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

# Upload measurement files

> Upload one or more measurement files for asynchronous processing. Supported formats: TDM (Tracking Data Message), SP3 (Standard Product 3), and OEM (Orbit Ephemeris Message). Each file is validated synchronously and then queued as a background job for full processing. The response includes per-file results with job IDs for tracking processing status.



## OpenAPI

````yaml https://api.valar.space/api-docs/mintlify post /operations/measurements
openapi: 3.0.1
info:
  contact:
    email: api@valar.space
    name: Valar Space
    url: https://valar.space
  description: >-
    <H4>Welcome to the documentation for the Valar Operations API, here are some
    quick tips if you just landed!</H4><ol><li> The top level elements are the
    <b>Resources</b> accessible via the API and the different queries used to
    interact with each resource via the appropriate HTTP method call.</li><li>
    You can expand each method to get further information on the expected input
    parameters and the different responses that can be received.</li><li>For
    both the input parameters and responses, an <b>Example</b> is present for
    clarification.</li><li>For further details, the example snipped can be
    switched to <b>Schema</b> view, where a detailed explanation of each element
    can be found.</li><li>The <b>Try it out</b> button can be used to call the
    API directly from the documentation page, which allows for some easy testing
    and also provides the equivalent 'curl' command line code for easy
    portability of the call execution.</li><li><b>Before starting</b>, select
    <b>Authorize</b> and enter your API key. The key is sent as a bearer token
    in the <code>Authorization</code> header.</li></ol>
  title: API Documentation
  version: 1.0.0
servers:
  - url: https://api.valar.space
    description: VALAR API Server
  - url: https://api.valar.space
    description: API Server
security:
  - apiKeyAuth: []
tags:
  - description: >-
      Operations for managing state vectors — listing, importing, exporting, and
      deleting spacecraft state data
    name: State Vectors
  - description: Register, list, read, update, and manage the lifecycle of your spacecraft.
    name: Spacecraft
  - description: Manage the thrusters mounted on a spacecraft.
    name: Thrusters
  - description: Manage the payloads (sensors) mounted on a spacecraft.
    name: Payloads
  - description: >-
      Maneuver API 3.0.0: import and export spacecraft maneuvers using CCSDS
      OCM, and delete stored maneuvers.
    name: Maneuvers
paths:
  /operations/measurements:
    post:
      tags:
        - Measurements
      summary: Upload measurement files
      description: >-
        Upload one or more measurement files for asynchronous processing.
        Supported formats: TDM (Tracking Data Message), SP3 (Standard Product
        3), and OEM (Orbit Ephemeris Message). Each file is validated
        synchronously and then queued as a background job for full processing.
        The response includes per-file results with job IDs for tracking
        processing status.
      operationId: uploadMeasurementFiles
      parameters:
        - description: >-
            SHA-256 content hash from a prior /imports/inspect call. When
            present and exactly one file is uploaded, the server re-verifies
            this hash against the uploaded content and returns 409
            IMPORT_STALE_PREVIEW on mismatch. Ignored (with a DEBUG log) for
            multi-file batch uploads, since the header cannot unambiguously bind
            to one of several files.
          in: header
          name: X-Content-Hash
          required: false
          schema:
            type: string
      requestBody:
        content:
          multipart/form-data:
            schema:
              type: object
              properties:
                files:
                  type: array
                  description: Measurement files to upload (TDM, SP3, OEM formats)
                  items:
                    type: string
                    format: binary
              required:
                - files
      responses:
        '202':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchUploadResponse'
          description: Files accepted for processing
        '207':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BatchUploadResponse'
          description: >-
            Partial failure: at least one file failed; see results[] for
            per-file outcomes
        '400':
          content:
            application/json:
              example:
                timestamp: '2025-01-15T10:30:00.000Z'
                status: 400
                error: Bad Request
                message: No files provided
                path: /operations/measurements
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: No files provided or invalid request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BearerTokenErrorResponse'
          description: Not authenticated — missing or invalid bearer token
        '403':
          content:
            application/json:
              example:
                timestamp: '2025-01-15T10:30:00.000Z'
                status: 403
                error: ACCESS_ERROR
                message: Access denied
                path: /operations/measurements
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Insufficient permissions
        '409':
          content:
            application/json:
              example:
                timestamp: '2025-01-15T10:30:00.000Z'
                status: 409
                error: IMPORT_STALE_PREVIEW
                code: import.commit.preview.stale
                message: 'Content hash mismatch: the preview you inspected is stale'
                path: /operations/measurements
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: >-
            Stale preview: the X-Content-Hash header does not match the uploaded
            content
        '413':
          content:
            application/json:
              example:
                timestamp: '2025-01-15T10:30:00.000Z'
                status: 413
                error: Payload Too Large
                message: File size exceeds the maximum allowed limit
                path: /operations/measurements
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: File size exceeds the maximum allowed limit
        '500':
          content:
            application/json:
              example:
                timestamp: '2025-01-15T10:30:00.000Z'
                status: 500
                error: Internal Server Error
                message: An unexpected error occurred
                path: /operations/measurements
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal server error
      security:
        - apiKeyAuth: []
components:
  schemas:
    BatchUploadResponse:
      type: object
      properties:
        failureCount:
          type: integer
          description: The number of files that failed to process
          format: int32
          example: 2
        results:
          type: array
          description: Individual results for each file in the batch
          items:
            $ref: '#/components/schemas/FileUploadResult'
        successCount:
          type: integer
          description: The number of successfully processed files
          format: int32
          example: 5
        totalCount:
          type: integer
          description: The total number of files processed
          format: int32
          example: 7
      description: Response from a batch file upload operation
    ErrorResponse:
      type: object
      properties:
        code:
          type: string
          description: Stable frontend-dictionary error code
          nullable: true
          example: import.tracking.tdm.parse_failed
        correlationId:
          type: string
          description: Server-generated opaque identifier for support correlation
          nullable: true
          example: a1b2c3d4-e5f6-7890-abcd-ef1234567890
        details:
          type: object
          additionalProperties:
            type: object
            description: Structured error details with scenario-specific context fields
            nullable: true
          description: Structured error details with scenario-specific context fields
          nullable: true
        error:
          type: string
          description: The HTTP status reason phrase or exception-handler code
          example: Bad Request
        fieldErrors:
          type: object
          additionalProperties:
            type: string
            description: Field-level validation errors (field name to error message)
          description: Field-level validation errors (field name to error message)
        message:
          type: string
          description: Detailed error message
          example: Invalid spacecraft ID format
        params:
          type: object
          additionalProperties:
            type: string
            description: Per-key allowlisted structured params for frontend rendering
            nullable: true
          description: Per-key allowlisted structured params for frontend rendering
          nullable: true
        path:
          type: string
          description: The request path where the error occurred
          example: /api/v1/stm/credentials
        status:
          type: integer
          description: The HTTP status code
          format: int32
          example: 400
        timestamp:
          type: string
          description: The timestamp when the error occurred
          format: date-time
          example: '2025-11-14T10:15:30.123Z'
      description: Standard API error response
    BearerTokenErrorResponse:
      type: object
      properties:
        error:
          type: string
          description: OAuth 2.0 error code
          example: invalid_token
        error_description:
          type: string
          description: Human-readable error description
          example: An error occurred while attempting to decode the Jwt
      description: OAuth 2.0 Bearer Token error response (RFC 6750)
    FileUploadResult:
      type: object
      properties:
        code:
          type: string
          description: Stable frontend-dictionary code for programmatic handling
          nullable: true
          example: import.tracking.tdm.parse_failed
        correlationId:
          type: string
          description: Reference for support and process diagnostics, when available
        duplicateCount:
          type: integer
          description: >-
            Measurements already present and skipped by this file attempt; null
            when unavailable
          format: int32
        errorCode:
          type: string
          description: Deprecated legacy error code. Use 'code' instead.
          nullable: true
          example: TRK-4001
          deprecated: true
        errors:
          type: array
          description: >-
            List of per-block rejection details when status='error' came from a
            partial ingest (DEV-3104). Null otherwise.
          nullable: true
          items:
            $ref: '#/components/schemas/BlockRejectionDetail'
        filename:
          type: string
          description: The name of the uploaded file
          example: tracking_data_001.tdm
        insertedCount:
          type: integer
          description: >-
            Measurements newly stored by this file attempt; null when
            unavailable
          format: int32
        jobId:
          type: string
          description: The job ID for tracking async processing status
          nullable: true
          example: 550e8400-e29b-41d4-a716-446655440000
        measurementContext:
          $ref: '#/components/schemas/MeasurementImportContext'
        message:
          type: string
          description: A message describing the result
          example: Successfully processed 150 measurements
        params:
          type: object
          additionalProperties:
            type: string
            description: Per-key allowlisted structured params for frontend rendering
            nullable: true
          description: Per-key allowlisted structured params for frontend rendering
          nullable: true
        status:
          type: string
          description: The status of the upload
          example: success
          enum:
            - success
            - error
            - warning
        uncertaintySummary:
          type: string
          description: >-
            Effective OEM assumed uncertainty and source, when the feature is
            enabled
          nullable: true
      description: Result of a single file upload in a batch operation
    BlockRejectionDetail:
      type: object
      properties:
        blockId:
          type: string
          description: Provider-supplied block identifier
          nullable: true
          example: block-1
        code:
          type: string
          description: Reject code for the block
          example: TRK-4006
        firstEpoch:
          type: string
          description: >-
            ISO-8601 UTC timestamp of the first rejected observation in the
            block
          nullable: true
          example: '2026-04-27T01:14:29.9Z'
        message:
          type: string
          description: Localized rejection message
          example: 'Ambiguous Doppler correction state: YES'
      description: Per-block rejection detail for a partial file upload result
      nullable: true
    MeasurementImportContext:
      type: object
      properties:
        endDate:
          type: string
          format: date-time
        measurementTypes:
          type: array
          items:
            type: string
        spacecraftIds:
          type: array
          items:
            type: string
        startDate:
          type: string
          format: date-time
      description: >-
        Spacecraft, types and UTC time span of stored measurements from the
        uploaded source file
      nullable: true
  securitySchemes:
    apiKeyAuth:
      description: 'API Key (format: vsp_sk_...)'
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.