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

# Maneuver API

> Exchange stored spacecraft maneuvers through CCSDS OCM, delete records, and import corrections.

> For the complete documentation index, see [llms.txt](https://docs.valar.space/llms.txt).

The Maneuver API exchanges stored spacecraft maneuver records through **CCSDS OCM** at
**`https://api.valar.space`**. Import OCM files, export selected records or time ranges, and
delete records when needed. Each record belongs to one spacecraft and contains burn segments.
Importing a record stores data in VALAR; it does not uplink a command to a spacecraft.

## API contract

Download the [standalone OpenAPI contract](https://docs.valar.space/api-reference/contracts/maneuvers-v1.openapi.json)
to generate a client or pin an integration. Its `info.version` identifies the contract version.
The complete live customer API is available at
[`/api-docs/mintlify`](https://api.valar.space/api-docs/mintlify), with the maneuver version in
`x-valar-maneuver-api-version` and each operation's version in `x-valar-contract-version`.

The four public operations are:

| Method | Path | Purpose |
| - | - | - |
| GET | `/operations/maneuvers/import-destinations` | Discover eligible import phases for a spacecraft |
| DELETE | `/operations/maneuvers/{maneuverId}` | Delete one record |
| POST | `/operations/maneuvers/import` | Add records from OCM files |
| GET | `/operations/maneuvers/export` | Export selected IDs or a spacecraft/time range |

The [maneuver planner](https://docs.valar.space/features/planner.md), approval, and orbit-raise workflows are available
in the application and are outside this published API.

## Authenticate a mission-control integration

Use an [API key](https://docs.valar.space/features/api-keys.md) issued for your organization with access to the intended
workspace. Send `Authorization: Bearer $VALAR_API_KEY` on every request. The key inherits its
owner's resource permissions, and requests are recorded in the API-key usage audit log.
Organization, route permissions and workspace access are checked on every request.
Without `X-Workspace-Id`, the permanent default workspace is targeted; browser
selection does not change that binding. See [workspace targeting](https://docs.valar.space/features/mission-workspaces.md#connect-integrations-to-a-workspace).

| Operation | Required permission |
| - | - |
| Export | `read:plannedmaneuvers` |
| Import and phase lookup | `write:plannedmaneuvers` and `read:maneuverplans` |
| Delete | `delete:plannedmaneuvers` |

Look up the **VALAR spacecraft ID** before making maneuver requests:

```bash theme={null}
curl --fail-with-body 'https://api.valar.space/operations/spacecraft' \
  --header "Authorization: Bearer $VALAR_API_KEY"
```

Use that returned ID as `SPACECRAFT_ID` below. Names, NORAD IDs, COSPAR IDs, and external keys
are lookup filters, not substitutes for the VALAR spacecraft ID in export or delete requests.

## Identify records through OCM

Use an OCM export to inspect stored burn definitions. Select known `MAN_ID` values or export
a spacecraft/time range using the [examples below](#import-and-export-ocm-files).
OCM `MAN_ID` is the stable maneuver identity within its spacecraft, with a maximum length of
63 characters. An editable display name is not a substitute for that identity.
Address a deletion by **`maneuverId` plus `spacecraftId`**; URL-encode path values when necessary.

## Resolve conflicts

Imports must not overlap another stored maneuver on the same spacecraft.
The check uses each record's enclosing start-to-end interval, including gaps between segments.
Adjoining intervals may touch: a record ending at 12:01 may be followed by one starting at 12:01.
Records on different spacecraft do not conflict with each other.

Duplicate identities return **409 `MANEUVER_DUPLICATE_IDENTITY`**; overlaps with stored
records return **409 `MANEUVER_CONFLICT`**. Mixed batches return HTTP 207 with these
codes in each rejected file's `errorCode`; successful files remain committed.
Use the reported identities to export and inspect conflicting records, then decide which records
to retain or explicitly delete. No record is automatically merged, shortened, replaced, or
deleted. A conflict may be outside your current export window. Records with existing overlaps
remain exportable and deletable. Computation results retain their captured maneuver data;
new computations use the current records.

## Delete a record

```bash theme={null}
curl --fail-with-body --request DELETE \
  "https://api.valar.space/operations/maneuvers/BURN-001?spacecraftId=$SPACECRAFT_ID" \
  --header "Authorization: Bearer $VALAR_API_KEY"
```

Success is **204** with no response body. Deletion removes the live record and cannot be undone.

## Choose an import phase

Before importing, discover destinations for the VALAR spacecraft ID in the same workspace:

```bash theme={null}
curl --fail-with-body \
  "https://api.valar.space/operations/maneuvers/import-destinations?spacecraftId=$SPACECRAFT_ID" \
  --header "Authorization: Bearer $VALAR_API_KEY" \
  --header "X-Workspace-Id: $WORKSPACE_ID"
```

The response's `items` contain `flightPlanId`, `phaseId`, `spacecraftId`, `spacecraftName`,
and `phaseName`. Choose the intended phase and use its `phaseId` as `PHASE_ID` below.
Send the same `X-Workspace-Id` on the subsequent import. An empty list means a Flight Plan
phase must first be configured in the application. This lookup is read-only; it grants no
phase authoring or approval capability.

Import and phase discovery share Flight Plan availability for the key owner. The destination
is checked again at commit. A missing required parameter or an invalid/deleted destination
returns 400; `MANEUVER_IMPORT_PHASE_REQUIRED` means select a current phase and retry.
A phase association does not add a burn-time containment rule. Legacy unassigned records
remain exportable and deletable. After deletion, a corrected import uses the newly selected
phase, even when it reuses the same `MAN_ID`.

## Correct a stored maneuver

1. Export and inspect the record, retaining the file if you need a copy.
2. [Choose an eligible phase](#choose-an-import-phase) and prepare corrected OCM that satisfies the [import requirements](https://docs.valar.space/file-formats/ocm.md#valar-import-requirements).
3. Explicitly [delete the stored record](#delete-a-record) and confirm that deletion succeeded.
4. Import the corrected file and check its result:

```bash theme={null}
curl --fail-with-body \
  "https://api.valar.space/operations/maneuvers/import?spacecraftId=$SPACECRAFT_ID&phaseId=$PHASE_ID" \
  --header "Authorization: Bearer $VALAR_API_KEY" \
  --header "X-Workspace-Id: $WORKSPACE_ID" \
  --form 'files=@corrected-burn.ocm'
```

Deletion and import are **two separate operations**, not an atomic replacement. If the import
fails, the deleted record stays deleted. Import never overwrites an existing record; duplicate,
overlap, spacecraft-resolution, and physical validation still apply. Review failed-file results
and correct the file before retrying.

## Import and export OCM files

Import adds records from CCSDS OCM files:

```bash theme={null}
curl --fail-with-body \
  "https://api.valar.space/operations/maneuvers/import?spacecraftId=$SPACECRAFT_ID&phaseId=$PHASE_ID" \
  --header "Authorization: Bearer $VALAR_API_KEY" \
  --header "X-Workspace-Id: $WORKSPACE_ID" \
  --form 'files=@burns.ocm'
```

Repeat the multipart **`files`** part for several files going to the same destination. Both
`spacecraftId` and `phaseId` are required, including when file metadata resolves the target
unambiguously. The phase must belong to that spacecraft in the authorized workspace. Files require thrust, ISP, and physical wet mass;
see [OCM import requirements](https://docs.valar.space/file-formats/ocm.md#valar-import-requirements). `MAN_BASIS` is optional
format metadata and has no effect on stored-record behavior. Exports omit it. OCM `MAN_ID`
remains the stable identity, even after the editable name changes.

Each file and all its phase associations commit atomically and independently. **200** means every file succeeded; **207**
contains per-file successes and failures, including ambiguous targets. Inspect `successCount`,
`failureCount`, and `results`. An all-ambiguous batch also returns 207. If every file fails
without ambiguity, the request returns an error, such as 400 for invalid input or 409 for a
stored-record conflict. A failed file adds none of its records; successful files remain saved.
Reimporting an existing `MAN_ID` fails. To submit a correction, follow
[Correct a stored maneuver](#correct-a-stored-maneuver).

Optional `X-Content-Hash` and `X-Resolution-Fingerprint` headers bind an import to a previously
inspected file. A stale preview returns **409 `IMPORT_STALE_PREVIEW`**. Direct callers may omit
these headers. Submit preview-bound files individually rather than binding a multi-file batch
to one preview.

All exports use `GET /operations/maneuvers/export`. Export one record by supplying one
`spacecraftIds` value and one `maneuverIds` value, for example
`/operations/maneuvers/export?spacecraftIds=SC-1&maneuverIds=BURN-001`.
For selected IDs, use the collection GET with exactly one `spacecraftIds` value and 1–100
unique `maneuverIds`. Repeat the `maneuverIds` parameter for each identity; commas inside a
value are literal name characters, not separators. One ID produces `text/plain` OCM;
multiple IDs produce `application/zip`. Send these selections as query parameters with no request body.

```bash theme={null}
curl --fail-with-body --get 'https://api.valar.space/operations/maneuvers/export' \
  --header "Authorization: Bearer $VALAR_API_KEY" \
  --data-urlencode "spacecraftIds=$SPACECRAFT_ID" \
  --data-urlencode 'maneuverIds=BURN-001' \
  --data-urlencode 'maneuverIds=BURN-002' \
  --output maneuvers.zip
```

Export by range using exact instants (no expansion to calendar-day boundaries):

```bash theme={null}
curl --fail-with-body --get 'https://api.valar.space/operations/maneuvers/export' \
  --header "Authorization: Bearer $VALAR_API_KEY" \
  --data-urlencode "spacecraftIds=$SPACECRAFT_ID" \
  --data-urlencode 'startDate=2026-10-01T00:00:00Z' \
  --data-urlencode 'endDate=2026-10-02T00:00:00Z' \
  --output maneuvers.ocm
```

Range export accepts 1–50 spacecraft IDs (repeated or comma-separated) and requires both time
bounds, with `endDate` after `startDate`. One spacecraft produces OCM text; multiple spacecraft
produce a ZIP of OCM files. ID and time-range selection are mutually exclusive: do not send
time bounds with `maneuverIds`. Missing, empty, or mixed selections return 400. URI size limits
still apply; divide a large selection into smaller GET requests if its encoded URL is too long.
Integration software owns downstream submission and uplink procedures.

## Handle errors and retries

Resource, validation, and permission errors use VALAR's shared error envelope, including
`timestamp`, `status`, `error`, `message`, and `path`, with structured details where available.
Use the machine-readable error token and HTTP status instead of parsing prose messages.

| Status | Integration response |
| - | - |
| 400 | Correct invalid input, file syntax, or physical values. |
| 401 | Check for a missing, invalid, expired, revoked key, or disabled owner. |
| 403 | Check owner permissions, environment grant, IP allowlist, and Flight Plan availability. |
| 404 | Check record IDs and their owning spacecraft/organization. |
| 409 | Resolve `MANEUVER_DUPLICATE_IDENTITY` or `MANEUVER_CONFLICT`, or inspect again for `IMPORT_STALE_PREVIEW`. |
| 413 | Reduce file or total multipart request size. |
| 422 | Correct the unmet precondition reported in the error details. |
| 5xx | Preserve request details and any correlation ID for diagnosis. |

GET exports can be retried with bounded backoff. Import has no idempotency-key contract: if a
connection drops after submission, export the affected identities or time range and inspect
the stored data before repeating the write. Do not retry successful files in a 207 batch.
After an uncertain DELETE result, verify the record's state through export before importing
a correction; distinguish a missing record from authentication, permission, or transport errors.


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