> ## 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.

# Export a state vector as OPM

> Export a state vector in CCSDS OPM v2.0 format. Optionally includes covariance data if available.



## OpenAPI

````yaml https://api.valar.space/api-docs/mintlify get /operations/state-vectors/{id}/export-opm
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 4.0.0: import and export spacecraft maneuvers using CCSDS
      OCM, and delete stored maneuvers.
    name: Maneuvers
paths:
  /operations/state-vectors/{id}/export-opm:
    get:
      tags:
        - State Vectors
      summary: Export a state vector as OPM
      description: >-
        Export a state vector in CCSDS OPM v2.0 format. Optionally includes
        covariance data if available.
      operationId: exportOpm
      parameters:
        - description: State vector display ID
          example: SV-123
          in: path
          name: id
          required: true
          schema:
            type: string
        - description: 'Include covariance data in OPM output (default: false)'
          example: false
          in: query
          name: includeCovariance
          required: false
          schema:
            type: boolean
            default: false
      responses:
        '200':
          content:
            text/plain:
              example: |-
                CCSDS_OPM_VERS = 2.0
                CREATION_DATE = 2024-06-15T12:30:00
                ORIGINATOR = VALAR
                ...
              schema:
                type: string
          description: OPM file generated successfully
        '400':
          content:
            application/json:
              example:
                timestamp: '2025-01-15T10:30:00.000Z'
                status: 400
                error: VALIDATION_ERROR
                message: Covariance data is not available for this state vector
                path: /operations/state-vectors/{id}/export-opm
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Covariance requested but not available for this state vector
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BearerTokenErrorResponse'
          description: Not authenticated — missing or invalid bearer token
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Insufficient permissions
        '404':
          content:
            application/json:
              example:
                timestamp: '2025-01-15T10:30:00.000Z'
                status: 404
                error: Not Found
                message: 'StateVector not found with id: SV-999'
                path: /operations/state-vectors/SV-999/export-opm
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: State vector not found
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Internal error during OPM generation
      security:
        - apiKeyAuth: []
components:
  schemas:
    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)
  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.