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

# Collect

> Accept one bounded batch of normalized browser performance measurements from an allowed project origin.



## OpenAPI

````yaml /openapi.json post /v1/speed-insights/collect/{projectRef}
openapi: 3.1.0
info:
  title: Korve API
  version: 0.1.0
  description: >-
    Typed control plane for deploying applications and explicitly provisioning
    their managed infrastructure.
servers:
  - url: https://api.korve.dev
security: []
paths:
  /v1/speed-insights/collect/{projectRef}:
    post:
      tags:
        - speedInsights
      summary: Collect
      description: >-
        Accept one bounded batch of normalized browser performance measurements
        from an allowed project origin.
      operationId: speedInsights.collect
      parameters:
        - name: projectRef
          in: path
          required: true
          schema:
            type: string
            pattern: ^[a-z][a-z0-9-]{1,61}$
          description: Globally unique public project slug.
      requestBody:
        required: true
        x-korve-max-bytes: 32768
        content:
          application/json:
            schema:
              type: object
              properties:
                schemaVersion:
                  type: integer
                  enum:
                    - 1
                batchId:
                  type: string
                  minLength: 1
                  maxLength: 64
                  pattern: ^[A-Za-z0-9_-]+$
                environment:
                  type: string
                  pattern: ^[a-z][a-z0-9-]{0,38}$
                  description: >-
                    Project environment. Defaults to production in the browser
                    SDK.
                sdkVersion:
                  type: string
                  minLength: 1
                  maxLength: 32
                events:
                  type: array
                  minItems: 1
                  maxItems: 20
                  items:
                    type: object
                    properties:
                      eventId:
                        type: string
                        minLength: 1
                        maxLength: 64
                        pattern: ^[A-Za-z0-9_-]+$
                      metric:
                        type: string
                        enum:
                          - CLS
                          - FCP
                          - INP
                          - LCP
                          - TTFB
                      value:
                        type: number
                        minimum: 0
                        maximum: 600000
                      timestamp:
                        type: string
                        format: date-time
                      route:
                        type: string
                        minLength: 1
                        maxLength: 256
                        pattern: ^/[^?#]*$
                        description: >-
                          A normalized route only. Browser SDKs remove query
                          strings, fragments, and common dynamic identifiers
                          before upload.
                      device:
                        type: string
                        enum:
                          - desktop
                          - mobile
                      navigationType:
                        type: string
                        enum:
                          - navigate
                          - reload
                          - back-forward
                          - prerender
                          - restore
                          - other
                    required:
                      - eventId
                      - metric
                      - value
                      - timestamp
                      - route
                      - device
                      - navigationType
                    additionalProperties: false
              required:
                - schemaVersion
                - batchId
                - environment
                - sdkVersion
                - events
              additionalProperties: false
      responses:
        '202':
          description: >-
            Measurement batch accepted, deduplicated, or sampled out before
            storage and billing.
          content:
            application/json:
              schema:
                type: object
                properties:
                  accepted:
                    type: integer
                    minimum: 0
                    maximum: 20
                  duplicate:
                    type: boolean
                  sampledOut:
                    type: boolean
                required:
                  - accepted
                  - duplicate
                additionalProperties: false
        '403':
          description: Speed Insights is disabled or the request origin is not allowed.
        '404':
          description: No such project.
        '413':
          description: Encoded request exceeds 32,768 bytes.
        '422':
          description: The measurement batch is invalid.
        '429':
          description: The browser intake limit was reached.
        '503':
          description: Speed Insights intake is temporarily unavailable.
      security: []

````