API docs
API reference

API keys

Give each app or connected system its own key, with only the scopes it needs, and revoke it when it's done.

The key object

Ochio keeps a hash of each key, never the key itself, and shows the key once, when it's created. All key endpoints need the admin scope. The scopes are listed under Authentication.

FieldHolds
idThe key's id, key_….
nameIts name. Requests made with it show as key:<name>.
prefixThe first characters of the key, to tell keys apart.
scopesWhat it may do.
created_at, last_used_atWhen it was made, and last used (to the minute).
The key object
{
  "id": "key_365d1809087d",
  "name": "partner",
  "prefix": "ochio_ex01",
  "scopes": [
    "read",
    "alerts:write",
    "missions:request",
    "webhooks:write"
  ],
  "created_at": "2026-10-19T21:30:10.072Z",
  "last_used_at": "2026-10-19T21:34:46.535Z"
}

List API keys

GET/v1/keys
AccessAPI key · admin

Every key, without the keys themselves.

Returns

{"data": [...]} with a key for each.

Request
curl "$OCHIO_URL/v1/keys" \
  -H "Authorization: Bearer $OCHIO_API_KEY"
Response
{
  "data": [
    {
      "id": "key_9e5cecad4d1f",
      "name": "operator",
      "prefix": "ochio_ex02",
      "scopes": [
        "read",
        "alerts:write",
        "sensors:write",
        "missions:request",
        "missions:launch",
        "missions:approve",
        "webhooks:write",
        "admin"
      ],
      "created_at": "2026-10-19T21:30:10.072Z",
      "last_used_at": "2026-10-19T21:34:02.364Z"
    },
    {
      "id": "key_365d1809087d",
      "name": "partner",
      "prefix": "ochio_ex01",
      "scopes": [
        "read",
        "alerts:write",
        "missions:request",
        "webhooks:write"
      ],
      "created_at": "2026-10-19T21:30:10.072Z",
      "last_used_at": "2026-10-19T21:34:46.535Z"
    }
  ]
}

Create an API key

POST/v1/keys
AccessAPI key · admin

Makes a key. The answer is the only time Ochio shows it.

Body
namestringrequired
A name, unique among keys: letters, digits, ., _ and -, up to 64 characters.
scopesarrayrequired
One or more of read, alerts:write, sensors:write, missions:request, missions:launch, missions:approve, webhooks:write, admin.
Returns

201 with the key and key, the key itself.

Errors
StatusCodeWhen
409key_existsA key with this name exists.
400invalid_requestAn unknown scope, or a name that isn't valid.
Request
curl -X POST "$OCHIO_URL/v1/keys" \
  -H "Authorization: Bearer $OCHIO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "vms-connector",
    "scopes": [
      "read",
      "alerts:write"
    ]
  }'
Response
{
  "id": "key_fbf104143394",
  "name": "vms-connector",
  "prefix": "ochio_ex03",
  "scopes": [
    "read",
    "alerts:write"
  ],
  "created_at": "2026-10-19T21:34:49.545Z",
  "last_used_at": null,
  "key": "ochio_ex03_example_key_not_real_000000"
}

Revoke an API key

DELETE/v1/keys/{key}
AccessAPI key · admin

Revokes a key at once. A key can't revoke itself; use another admin key.

Its webhook subscriptions stay, and keep receiving deliveries: delete them first if they should stop. Subscriptions belong to a key's name, so a new key with the same name takes them over.

Path
keystringrequired
The key's id or name.
Returns

{"id", "name", "deleted": true}.

Errors
StatusCodeWhen
409key_in_useThat's the key making the request.
404not_foundNo key with this id or name.
Request
curl -X DELETE "$OCHIO_URL/v1/keys/vms-connector" \
  -H "Authorization: Bearer $OCHIO_API_KEY"
Response
{
  "id": "key_fbf104143394",
  "name": "vms-connector",
  "deleted": true
}