> ## Documentation Index
> Fetch the complete documentation index at: https://docs.surnex.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Run a Core Web Vitals check

> Create a pending check record and dispatch a Lighthouse audit. Poll the GET endpoint until status is completed.



## OpenAPI

````yaml https://api.surnex.io/openapi.json post /v1/projects/{project_id}/web-vitals/check
openapi: 3.1.0
info:
  title: Surnex API
  description: |-
    Surnex SEO Platform API — api.surnex.io

    Provides the complete backend for the Surnex SEO dashboard including:
    - Multi-tenant organization management
    - Project tracking (domains)
    - Keyword rank tracking (Phase 1+)
    - Backlink analysis (Phase 3+)
    - Site auditing (Phase 4+)
    - Stripe billing integration
    - MCP endpoint for AI agents at /mcp
  version: 0.1.0
servers: []
security: []
paths:
  /v1/projects/{project_id}/web-vitals/check:
    post:
      tags:
        - Core Web Vitals
      summary: Run a Core Web Vitals check
      description: >-
        Create a pending check record and dispatch a Lighthouse audit. Poll the
        GET endpoint until status is completed.
      operationId: check_web_vitals_v1_projects__project_id__web_vitals_check_post
      parameters:
        - name: project_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Project Id
        - name: X-API-Key
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: X-Api-Key
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckWebVitalsRequest'
      responses:
        '202':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/APIResponse_WebVitalsCheckResponse_'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    CheckWebVitalsRequest:
      properties:
        url:
          type: string
          title: Url
          description: URL to check.
        device:
          type: string
          title: Device
          description: '''mobile'' or ''desktop''.'
          default: mobile
        refresh_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Refresh Id
          description: >-
            If provided, resets the existing check instead of creating a new
            one.
      type: object
      required:
        - url
      title: CheckWebVitalsRequest
      description: Request body to trigger a Web Vitals check.
    APIResponse_WebVitalsCheckResponse_:
      properties:
        success:
          type: boolean
          title: Success
          default: true
        data:
          anyOf:
            - $ref: '#/components/schemas/WebVitalsCheckResponse'
            - type: 'null'
      type: object
      title: APIResponse[WebVitalsCheckResponse]
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    WebVitalsCheckResponse:
      properties:
        id:
          type: string
          title: Id
        project_id:
          type: string
          title: Project Id
        url:
          type: string
          title: Url
        status:
          type: string
          title: Status
          default: completed
        error_message:
          anyOf:
            - type: string
            - type: 'null'
          title: Error Message
        performance_score:
          anyOf:
            - type: number
            - type: 'null'
          title: Performance Score
        metrics:
          items:
            $ref: '#/components/schemas/WebVitalsMetric'
          type: array
          title: Metrics
        opportunities:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Opportunities
        diagnostics:
          items:
            additionalProperties: true
            type: object
          type: array
          title: Diagnostics
        device:
          type: string
          title: Device
          default: mobile
        checked_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Checked At
        si_ms:
          anyOf:
            - type: number
            - type: 'null'
          title: Si Ms
          description: Speed Index in ms.
        tbt_ms:
          anyOf:
            - type: number
            - type: 'null'
          title: Tbt Ms
          description: Total Blocking Time in ms.
        lcp_ms:
          anyOf:
            - type: number
            - type: 'null'
          title: Lcp Ms
          description: Largest Contentful Paint in ms.
        inp_ms:
          anyOf:
            - type: number
            - type: 'null'
          title: Inp Ms
          description: Interaction to Next Paint in ms.
        cls:
          anyOf:
            - type: number
            - type: 'null'
          title: Cls
          description: Cumulative Layout Shift.
        fcp_ms:
          anyOf:
            - type: number
            - type: 'null'
          title: Fcp Ms
          description: First Contentful Paint in ms.
        ttfb_ms:
          anyOf:
            - type: number
            - type: 'null'
          title: Ttfb Ms
          description: Time to First Byte in ms.
      type: object
      required:
        - id
        - project_id
        - url
      title: WebVitalsCheckResponse
      description: Full Web Vitals check result.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    WebVitalsMetric:
      properties:
        name:
          type: string
          title: Name
          description: Metric name (e.g., 'LCP', 'INP', 'CLS').
        value:
          anyOf:
            - type: number
            - type: 'null'
          title: Value
        unit:
          type: string
          title: Unit
          description: 'Unit: ''ms'' or ''score''.'
          default: ms
        rating:
          type: string
          title: Rating
          description: '''good'', ''needs-improvement'', or ''poor''.'
          default: unknown
      type: object
      required:
        - name
      title: WebVitalsMetric
      description: A single Core Web Vitals metric with classification.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````