Skip to main content
The API Keys endpoints let you manage programmatic access tokens for the Shipfastai API. API keys can be used as an alternative to JWT Bearer tokens for authenticating requests to AI and RAG endpoints. All key management operations require JWT authentication — you cannot use an API key to manage other API keys.
API key management is available on Pro and Enterprise plans only. All endpoints are mounted under /api/api-keys/.

POST /api/api-keys

Create a new API key. The plaintext key is returned only once in the response. Store it securely — it cannot be retrieved again after creation. Headers:
string
required
Bearer <access_token> — JWT authentication only.
Request body:
string
required
A descriptive name for the API key (e.g., "Production server", "CI pipeline").
string
Optional ISO 8601 expiration timestamp. If omitted, the key does not expire.
Response (201 Created) — ApiKeyCreated:
string
required
UUID of the API key.
string
required
The name you assigned to the key.
string
required
The first 12 characters of the key, used for identification in listings.
string
required
The full plaintext API key. This is the only time the full key is returned. Store it securely.
boolean
required
Whether the key is active. true on creation.
string
required
ISO 8601 timestamp of when the key was created.
string
ISO 8601 timestamp of last usage. null for a newly created key.
string
ISO 8601 expiration timestamp, or null if the key does not expire.

GET /api/api-keys

List all API keys for the authenticated user, ordered by creation date (newest first). The full key value is never included — only the prefix is shown for identification. Headers:
string
required
Bearer <access_token> — JWT authentication only.
Response — array of ApiKeyResponse:
string
required
UUID of the API key.
string
required
The name assigned to the key.
string
required
The first 12 characters of the key.
boolean
required
Whether the key is active. Revoked keys have is_active: false.
string
required
ISO 8601 creation timestamp.
string
ISO 8601 timestamp of last usage, or null.
string
ISO 8601 expiration timestamp, or null.

DELETE /api/api-keys/

Revoke an API key. This is a soft delete — the key is marked as inactive and can no longer be used for authentication. The key record is retained for audit purposes. Path parameters:
string
required
The UUID of the API key to revoke.
Headers:
string
required
Bearer <access_token> — JWT authentication only.
Response:
Returns 404 if the key does not exist or does not belong to the authenticated user.

PATCH /api/api-keys/

Update an API key’s display name. Path parameters:
string
required
The UUID of the API key to update.
Headers:
string
required
Bearer <access_token> — JWT authentication only.
Query parameters:
string
required
The new name for the API key.
ResponseApiKeyResponse with updated fields:
Returns 404 if the key does not exist or does not belong to the authenticated user.

Using API keys for authentication

Once you have a key, pass it in the Authorization header as a Bearer token, the same way you pass a JWT:
API keys are accepted on AI and RAG endpoints alongside JWTs. The backend automatically detects whether the token is a JWT or an API key.