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

# Generate a fitted TLE

> Returns an own-computed TLE at the explicit requested epoch. Uses the latest eligible stored state by epoch: manual/imported states or accepted converged orbit solutions. Propagates with the existing accurate force model and applicable maneuvers, then fits a single-state TLE. This does not retrieve provider TLEs, select a historical state, persist a resource, or start a background job. Required spacecraft force-model configuration must be present. Assigned numeric catalogue IDs through 339999 can be serialized (Alpha-5 above 99999); larger IDs are rejected, never truncated. A missing NORAD ID retains the generator's 99999 placeholder. Requires a valid API key with read:ephemeris permission and access to the spacecraft. Success is text/plain only; an unsupported or malformed Accept header returns 406. Request and generation failures use JSON error envelopes even when Accept is text/plain. Missing credentials or malformed bearer tokens may instead receive an empty 401 with WWW-Authenticate: Bearer. No receiver compatibility or orbit accuracy guarantee is implied.



## OpenAPI

````yaml https://api.valar.space/api-docs/mintlify get /operations/spacecraft/{spacecraftId}/tle
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
paths:
  /operations/spacecraft/{spacecraftId}/tle:
    get:
      tags:
        - State Vectors
      summary: Generate a fitted TLE
      description: >-
        Returns an own-computed TLE at the explicit requested epoch. Uses the
        latest eligible stored state by epoch: manual/imported states or
        accepted converged orbit solutions. Propagates with the existing
        accurate force model and applicable maneuvers, then fits a single-state
        TLE. This does not retrieve provider TLEs, select a historical state,
        persist a resource, or start a background job. Required spacecraft
        force-model configuration must be present. Assigned numeric catalogue
        IDs through 339999 can be serialized (Alpha-5 above 99999); larger IDs
        are rejected, never truncated. A missing NORAD ID retains the
        generator's 99999 placeholder. Requires a valid API key with
        read:ephemeris permission and access to the spacecraft. Success is
        text/plain only; an unsupported or malformed Accept header returns 406.
        Request and generation failures use JSON error envelopes even when
        Accept is text/plain. Missing credentials or malformed bearer tokens may
        instead receive an empty 401 with WWW-Authenticate: Bearer. No receiver
        compatibility or orbit accuracy guarantee is implied.
      operationId: generateOperationsTle
      parameters:
        - description: >-
            Canonical spacecraft ID from the spacecraft API; names, NORAD and
            COSPAR identifiers are not accepted
          example: 550e8400-e29b-41d4-a716-446655440000
          in: path
          name: spacecraftId
          required: true
          schema:
            type: string
        - description: >-
            Required target epoch as an ISO-8601 instant with timezone; no
            implicit default
          example: '2026-09-22T12:00:00Z'
          in: query
          name: epoch
          required: true
          schema:
            type: string
            format: date-time
      responses:
        '200':
          content:
            text/plain:
              schema:
                type: string
          description: Two TLE lines separated by a newline, without a name line
        '400':
          content:
            application/json:
              examples:
                missingEpoch:
                  description: missingEpoch
                  value:
                    timestamp: '2026-09-22T12:00:00Z'
                    status: 400
                    error: VALIDATION_ERROR
                    message: Required parameter 'epoch' of type 'Instant' is missing
                    path: >-
                      /operations/spacecraft/550e8400-e29b-41d4-a716-446655440000/tle
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: >-
            Missing or invalid epoch, invalid source state, missing force-model
            configuration, unsupported catalogue ID, or propagation failure
        '401':
          content:
            application/json:
              examples:
                invalidApiKey:
                  description: invalidApiKey
                  summary: >-
                    Rejected API-key credentials; security entry-point 401
                    responses can have no body
                  value:
                    timestamp: '2026-09-22T12:00:00Z'
                    status: 401
                    error: Unauthorized
                    message: Invalid API key
                    path: >-
                      /operations/spacecraft/550e8400-e29b-41d4-a716-446655440000/tle
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: >-
            Missing, invalid, expired or disabled credentials. API-key
            rejections return JSON; missing credentials or malformed bearer
            tokens may return an empty body with WWW-Authenticate: Bearer
        '403':
          content:
            application/json:
              examples:
                missingPermission:
                  description: missingPermission
                  value:
                    timestamp: '2026-09-22T12:00:00Z'
                    status: 403
                    error: ACCESS_ERROR
                    message: Access denied
                    path: >-
                      /operations/spacecraft/550e8400-e29b-41d4-a716-446655440000/tle
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Key grant, IP allowlist or read:ephemeris permission is insufficient
        '404':
          content:
            application/json:
              examples:
                spacecraftNotFound:
                  description: spacecraftNotFound
                  value:
                    timestamp: '2026-09-22T12:00:00Z'
                    status: 404
                    error: SC-4040
                    message: >-
                      Spacecraft with identifier
                      '550e8400-e29b-41d4-a716-446655440000' not found
                    path: >-
                      /operations/spacecraft/550e8400-e29b-41d4-a716-446655440000/tle
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: >-
            Spacecraft is unknown or inaccessible, or has no eligible stored
            orbital state
        '406':
          content:
            application/json:
              examples:
                unsupportedAccept:
                  description: unsupportedAccept
                  value:
                    timestamp: '2026-09-22T12:00:00Z'
                    status: 406
                    error: Not Acceptable
                    message: >-
                      Accept header is malformed or does not allow a supported
                      response media type
                    path: >-
                      /operations/spacecraft/550e8400-e29b-41d4-a716-446655440000/tle
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: >-
            Accept header is malformed or does not allow text/plain; errors are
            returned as JSON
        '422':
          content:
            application/json:
              examples:
                degenerateState:
                  description: degenerateState
                  value:
                    timestamp: '2026-09-22T12:00:00Z'
                    status: 422
                    error: COMPUTE_STATE_INSIDE_ELLIPSOID
                    message: >-
                      The requested computation resolved a state vector inside
                      the Earth ellipsoid (sub-surface). Verify the spacecraft's
                      state vector, or shorten the propagation window.
                    path: >-
                      /operations/spacecraft/550e8400-e29b-41d4-a716-446655440000/tle
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Physically degenerate or numerically unrepresentable orbital input
        '500':
          content:
            application/json:
              examples:
                unexpectedFailure:
                  description: unexpectedFailure
                  value:
                    timestamp: '2026-09-22T12:00:00Z'
                    status: 500
                    error: Internal Server Error
                    message: An unexpected error occurred
                    path: >-
                      /operations/spacecraft/550e8400-e29b-41d4-a716-446655440000/tle
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Unexpected generation failure
      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
  securitySchemes:
    apiKeyAuth:
      description: 'API Key (format: vsp_sk_...)'
      scheme: bearer
      type: http

````