Skip to content
ndStill is in development. These docs describe the v2 API as designed; the SDKs and the hosted MCP server are previews and not generally available.
Docs

API keys API

Org and agent-scoped keys with scopes, expiry, rotation and revocation.

6 endpointsGenerated from the typed registry

Base URL https://api.ndstill.com/v2. Send Authorization: Bearer with a key, Ndstill-Version: 2026-11-01, and an Idempotency-Key on every POST. Conventions, scopes and errors are in the API overview and Errors and decline reasons. Examples come from the mock backend; the shapes are the TypeScript types in packages/api.

Create an API key#

POST/v2/api-keys
Request body ApiKeyCreate
  • namestringrequired
  • scopesstring[]required
  • agent_idId | null
  • expires_atTimestamp | null
  • modestring enum
    "live""test"
Response ApiKeyCreated
  • idId
  • object"api_key"
  • org_idId
  • created_atTimestamp
  • updated_atTimestampoptional
  • test_modebooleanoptional

    True for test-mode objects (simulations, sandbox).

  • namestring
  • prefixstring

    Shown in lists: "nds_live_7Hq2…". The secret is returned once, on create.

  • scopesstring[]
  • agentRef | null

    Small reference used for denormalized names in lists (no N+1 lookups in tables).

    Ref: 2 fields
    • idId
    • namestring
  • created_byRef

    Small reference used for denormalized names in lists (no N+1 lookups in tables).

    Ref: 2 fields
    • idId
    • namestring
  • expires_atTimestamp | null
  • revoked_atTimestamp | null

    Set when revoked. A future time means the key still works until then (rotation overlap).

  • last_used_atTimestamp | null
  • modestring enum
    "live""test"
  • last_used_ipstring | nulloptional

    Where the last request came from.

  • requests_24hnumberoptional

    Requests in the last 24 hours.

  • rotated_fromId | nulloptional

    Rotation chain: the key this one replaced, and the key that replaced it.

  • rotated_toId | nulloptional
  • secretstring
Errors
  • 400invalid_request

    A field is missing or invalid; fields names each one.

  • 401authentication

    The key or token is missing, expired or revoked.

  • 403permission

    The key's scopes or the person's role don't allow this.

  • 409conflict

    The object changed or already exists, or the Idempotency-Key was reused with a different body.

  • 429rate_limited

    Slow down; retry after the Retry-After header.

Example from the mock backend
Request
curl -X POST "https://api.ndstill.com/v2/api-keys" \
  -H "Authorization: Bearer $NDSTILL_API_KEY" \
  -H "Ndstill-Version: 2026-11-01" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Docs example key",
    "scopes": [
      "payments:read"
    ],
    "mode": "test"
  }'
Response 200
{
  "id": "key_01M82XPRPPT7Q17T3RRQTKKYAK",
  "object": "api_key",
  "org_id": "org_A99F918124609C9DAAACB209D8",
  "created_at": "2026-11-23T00:43:13.494Z",
  "name": "Docs example key",
  "prefix": "nds_test_89c9",
  "scopes": [
    "payments:read"
  ],
  "agent": null,
  "created_by": {
    "id": "usr_01K7WYQ6MEYNYVHTQCVYZCTCDX",
    "name": "Dana Whitfield"
  },
  "expires_at": null,
  "revoked_at": null,
  "last_used_at": null,
  "mode": "test",
  "last_used_ip": null,
  "requests_24h": 0,
  "rotated_from": null,
  "rotated_to": null,
  "secret": "nds_test_89c91af989036e955217d869909f93c5ed38cc39"
}
Try it

Runs against the in-browser mock with a test key. Nothing leaves your browser.

List API keys#

GET/v2/api-keys
Query parameters all optional
  • agent_idId
  • modestring enum
    "live""test"
  • cursorstring
  • limitnumber

    1–200, default 50.

  • qstring

    Free-text search over names, ids and descriptors.

  • sortstring

    Sort field, prefix "-" for descending ("-created_at" is the default).

  • created_gteTimestamp

    created_at >= (ISO).

  • created_lteTimestamp

    created_at <= (ISO).

Response list of ApiKey

Returns a list envelope: object "list", data[], has_more, next_cursor (pass it back as cursor) and total when cheap to count. Items:

  • idId
  • object"api_key"
  • org_idId
  • created_atTimestamp
  • updated_atTimestampoptional
  • test_modebooleanoptional

    True for test-mode objects (simulations, sandbox).

  • namestring
  • prefixstring

    Shown in lists: "nds_live_7Hq2…". The secret is returned once, on create.

  • scopesstring[]
  • agentRef | null

    Small reference used for denormalized names in lists (no N+1 lookups in tables).

    Ref: 2 fields
    • idId
    • namestring
  • created_byRef

    Small reference used for denormalized names in lists (no N+1 lookups in tables).

    Ref: 2 fields
    • idId
    • namestring
  • expires_atTimestamp | null
  • revoked_atTimestamp | null

    Set when revoked. A future time means the key still works until then (rotation overlap).

  • last_used_atTimestamp | null
  • modestring enum
    "live""test"
  • last_used_ipstring | nulloptional

    Where the last request came from.

  • requests_24hnumberoptional

    Requests in the last 24 hours.

  • rotated_fromId | nulloptional

    Rotation chain: the key this one replaced, and the key that replaced it.

  • rotated_toId | nulloptional
Errors
  • 400invalid_request

    A query parameter is invalid.

  • 401authentication

    The key or token is missing, expired or revoked.

  • 403permission

    The key's scopes or the person's role don't allow this.

  • 429rate_limited

    Slow down; retry after the Retry-After header.

Example from the mock backend
Request
curl -X GET "https://api.ndstill.com/v2/api-keys?limit=2" \
  -H "Authorization: Bearer $NDSTILL_API_KEY" \
  -H "Ndstill-Version: 2026-11-01"
Response 200
{
  "object": "list",
  "data": [
    {
      "id": "key_01M6CVBKMENJA5BND123KN6BTK",
      "object": "api_key",
      "org_id": "org_A99F918124609C9DAAACB209D8",
      "created_at": "2026-11-02T00:43:11.374Z",
      "name": "Production backend",
      "prefix": "nds_live_935b",
      "scopes": [
        "payments:write",
        "payments:read",
        "budgets:read"
      ],
      "agent": null,
      "created_by": {
        "id": "usr_01KD1R56ME94CCHFNYQB1CC01H",
        "name": "Aisha Bello"
      },
      "expires_at": null,
      "revoked_at": null,
      "last_used_at": "2026-11-22T18:21:11.374Z",
      "mode": "live",
      "last_used_ip": "203.0.113.18",
      "requests_24h": 949,
      "rotated_from": null,
      "rotated_to": null
    },
    {
      "id": "key_01M3JQEEME8MPFVK0NAGMJ5013",
      "object": "api_key",
      "org_id": "org_A99F918124609C9DAAACB209D8",
      "created_at": "2026-09-28T00:43:11.374Z",
      "name": "Literature scout runtime",
      "prefix": "nds_live_e857",
      "scopes": [
        "payments:write",
        "budgets:read"
      ],
      "agent": {
        "id": "agt_01KQM4HZWEB7WBQNPK4NFJY5A0",
        "name": "Literature scout"
      },
      "created_by": {
        "id": "usr_01KD1R56ME94CCHFNYQB1CC01H",
        "name": "Aisha Bello"
      },
      "expires_at": null,
      "revoked_at": null,
      "last_used_at": "2026-11-22T22:11:11.374Z",
      "mode": "live",
      "last_used_ip": "203.0.113.132",
      "requests_24h": 2568,
      "rotated_from": null,
      "rotated_to": null
    }
  ],
  "has_more": true,
  "next_cursor": "Mg==",
  "total": 6
}
Try it

Runs against the in-browser mock with a test key. Nothing leaves your browser.

Retrieve an API key#

GET/v2/api-keys/{id}
Path parameters
  • idIdrequired

    A prefixed ID from this org.

Response ApiKey

The same ApiKey object as List API keys.

Errors
  • 401authentication

    The key or token is missing, expired or revoked.

  • 403permission

    The key's scopes or the person's role don't allow this.

  • 404not_found

    No object with that id in this org.

  • 429rate_limited

    Slow down; retry after the Retry-After header.

Example from the mock backend
Request
curl -X GET "https://api.ndstill.com/v2/api-keys/key_01M6CVBKMENJA5BND123KN6BTK" \
  -H "Authorization: Bearer $NDSTILL_API_KEY" \
  -H "Ndstill-Version: 2026-11-01"
Response 200
{
  "id": "key_01M6CVBKMENJA5BND123KN6BTK",
  "object": "api_key",
  "org_id": "org_A99F918124609C9DAAACB209D8",
  "created_at": "2026-11-02T00:43:11.374Z",
  "name": "Production backend",
  "prefix": "nds_live_935b",
  "scopes": [
    "payments:write",
    "payments:read",
    "budgets:read"
  ],
  "agent": null,
  "created_by": {
    "id": "usr_01KD1R56ME94CCHFNYQB1CC01H",
    "name": "Aisha Bello"
  },
  "expires_at": null,
  "revoked_at": null,
  "last_used_at": "2026-11-22T18:21:11.374Z",
  "mode": "live",
  "last_used_ip": "203.0.113.18",
  "requests_24h": 949,
  "rotated_from": null,
  "rotated_to": null
}
Try it

Runs against the in-browser mock with a test key. Nothing leaves your browser.

List API scopes#

GET/v2/api-keys/scopes

Every scope an API key or OAuth client can carry, with who it is for.

Query parameters all optional
  • audiencestring enum
    "api_key""oauth"
Response list of objects

Returns a list envelope: object "list", data[], has_more, next_cursor (pass it back as cursor) and total when cheap to count. Items:

  • object"api_scope"
  • scopestring
  • groupstring

    "Payments", "Agents", "Control", "Proof", "Developers", "Accept".

  • labelstring
  • descriptionstring
  • audiencestring enum

    "api_key" scopes go on keys; "oauth" scopes are what an MCP client or integration asks for.

    "api_key""oauth"
  • sensitiveboolean

    Writes, money movement or people-only powers: shown with a quiet warning.

  • people_onlybooleanoptional

    People-only scopes are never granted to agent-scoped tokens.

Errors
  • 400invalid_request

    A query parameter is invalid.

  • 401authentication

    The key or token is missing, expired or revoked.

  • 403permission

    The key's scopes or the person's role don't allow this.

  • 429rate_limited

    Slow down; retry after the Retry-After header.

Example from the mock backend
Request
curl -X GET "https://api.ndstill.com/v2/api-keys/scopes" \
  -H "Authorization: Bearer $NDSTILL_API_KEY" \
  -H "Ndstill-Version: 2026-11-01"
Response 200
{
  "object": "list",
  "data": [
    {
      "object": "api_scope",
      "scope": "payments:write",
      "group": "Payments",
      "label": "Make payments",
      "description": "Ask ndStill to pay (pay, x402 approvals). Every payment still runs the full decision pipeline.",
      "audience": "api_key",
      "sensitive": true
    },
    {
      "object": "api_scope",
      "scope": "payments:read",
      "group": "Payments",
      "label": "Read payments",
      "description": "Payments, decisions, traces and receipts.",
      "audience": "api_key",
      "sensitive": false
    },
    {
      "object": "api_scope",
      "scope": "decisions:simulate",
      "group": "Payments",
      "label": "Simulate payments",
      "description": "Dry-run the pipeline. No money moves and nothing is written to evidence.",
      "audience": "api_key",
      "sensitive": false
    }
  ],
  "has_more": false,
  "next_cursor": null,
  "total": 17
}
Try it

Runs against the in-browser mock with a test key. Nothing leaves your browser.

Revoke an API key#

POST/v2/api-keys/{id}/revoke
Path parameters
  • idIdrequired

    A prefixed ID from this org.

Response ApiKey

The same ApiKey object as List API keys.

Errors
  • 401authentication

    The key or token is missing, expired or revoked.

  • 403permission

    The key's scopes or the person's role don't allow this.

  • 404not_found

    No object with that id in this org.

  • 409conflict

    The object changed or already exists, or the Idempotency-Key was reused with a different body.

  • 429rate_limited

    Slow down; retry after the Retry-After header.

Example from the mock backend
Request
curl -X POST "https://api.ndstill.com/v2/api-keys/key_01M82XPRPPT7Q17T3RRQTKKYAK/revoke" \
  -H "Authorization: Bearer $NDSTILL_API_KEY" \
  -H "Ndstill-Version: 2026-11-01" \
  -H "Idempotency-Key: $(uuidgen)"
Response 200
{
  "id": "key_01M82XPRPPT7Q17T3RRQTKKYAK",
  "object": "api_key",
  "org_id": "org_A99F918124609C9DAAACB209D8",
  "created_at": "2026-11-23T00:43:13.494Z",
  "name": "Docs example key",
  "prefix": "nds_test_89c9",
  "scopes": [
    "payments:read"
  ],
  "agent": null,
  "created_by": {
    "id": "usr_01K7WYQ6MEYNYVHTQCVYZCTCDX",
    "name": "Dana Whitfield"
  },
  "expires_at": null,
  "revoked_at": "2026-11-23T00:43:13.665Z",
  "last_used_at": null,
  "mode": "test",
  "last_used_ip": null,
  "requests_24h": 0,
  "rotated_from": null,
  "rotated_to": null
}
Try it

Runs against the in-browser mock with a test key. Nothing leaves your browser.

Rotate an API key#

POST/v2/api-keys/{id}/rotate
Path parameters
  • idIdrequired

    A prefixed ID from this org.

Request body ApiKeyRotate
  • overlap_hoursnumber
Response ApiKeyCreated

The same ApiKeyCreated object as Create an API key.

Errors
  • 400invalid_request

    A field is missing or invalid; fields names each one.

  • 400step_up_required

    A person must confirm with a passkey first, when the org requires it.

  • 401authentication

    The key or token is missing, expired or revoked.

  • 403permission

    The key's scopes or the person's role don't allow this.

  • 404not_found

    No object with that id in this org.

  • 409conflict

    The object changed or already exists, or the Idempotency-Key was reused with a different body.

  • 429rate_limited

    Slow down; retry after the Retry-After header.

Example from the mock backend
Request
curl -X POST "https://api.ndstill.com/v2/api-keys/key_01M6CVBKMENJA5BND123KN6BTK/rotate" \
  -H "Authorization: Bearer $NDSTILL_API_KEY" \
  -H "Ndstill-Version: 2026-11-01" \
  -H "Idempotency-Key: $(uuidgen)" \
  -H "Content-Type: application/json" \
  -d '{}'
Response 200
{
  "id": "key_01M82XPRW2569JZ6VHJSY9CSG0",
  "object": "api_key",
  "org_id": "org_A99F918124609C9DAAACB209D8",
  "created_at": "2026-11-23T00:43:13.666Z",
  "name": "Production backend",
  "prefix": "nds_live_2915",
  "scopes": [
    "payments:write",
    "payments:read",
    "budgets:read"
  ],
  "agent": null,
  "created_by": {
    "id": "usr_01K7WYQ6MEYNYVHTQCVYZCTCDX",
    "name": "Dana Whitfield"
  },
  "expires_at": null,
  "revoked_at": null,
  "last_used_at": null,
  "mode": "live",
  "last_used_ip": null,
  "requests_24h": 0,
  "rotated_from": "key_01M6CVBKMENJA5BND123KN6BTK",
  "rotated_to": null,
  "secret": "nds_live_2915bb7afe908815bb5a782a6b3615854c64d4fa"
}
Try it

Runs against the in-browser mock with a test key. Nothing leaves your browser.