Skip to main content
POST
Mint a sandbox (test-mode) API key
Mint a key bound to this organization’s sandbox partition. The plaintext is returned exactly once and is unrecoverable afterwards: only its SHA-256 hash is stored. That is the same contract as POST /v1/keys, which this route reuses rather than reimplementing. Scopes are fixed at read and write and are not caller-selectable: a test key must never be able to mint keys, provision subjects or erase real data. The sandbox partition is provisioned on first mint, and the key is minted as exo_sandbox_... so it is recognisable on sight. Deliberately not replayable: a retried Idempotency-Key mints a fresh key instead of replaying the first response. Persisting a live credential in the replay store to save one key is the wrong trade.

Authorization

This route requires the admin scope. A missing or invalid credential returns 401 authentication_error. A valid credential without the scope returns 403 permission_denied, and the problem body names the exact scope required.

Headers

These are request conventions the contract does not declare as parameters, so they do not appear in the schema tables below.

Success responses

Errors

Every error is an RFC 9457 application/problem+json body carrying a stable code, a requestId, and a suggestedAction where Exo has one. See Errors.

Notes

  • Sandbox keys are minted exo_sandbox_... so they are recognisable on sight, and their scopes are fixed at read and write.
  • A sandbox key cannot select out of its partition. Sending X-Exo-Subject with one is 403 permission_denied.
  • This route does not replay. A retried Idempotency-Key mints a fresh key rather than persisting a live credential in the replay store.

Authorizations

X-Exo-API-Key
string
header
required

An Exo API key (exo_...) sent as the X-Exo-API-Key header.

Body

application/json

Body for POST /v1/sandbox/keys. Scopes are NOT caller-selectable.

label
string | null

Optional human label; defaults to 'Sandbox key'.

Maximum string length: 200

Response

Key minted; apiKey is shown once

A freshly minted sandbox key. apiKey is shown exactly once.

apiKey
string
required
id
string
required
scopes
string[]
required
subject
string
required
expiresAt
string<date-time> | null

When this test key stops authenticating. Mint another to continue.

label
string | null