Skip to main content

API Keys

The API Keys endpoints let you programmatically create, list, and revoke API keys for your Soku account. These endpoints are intended for building custom admin dashboards, automation tooling, or key rotation scripts.
The API key management endpoints use Firebase ID token authentication, not the soku-api-key header used by content endpoints. You must include a valid Firebase ID token in the Authorization header as a Bearer token.

Authentication for Key Management

Unlike the content endpoints (posts, media, templates, transcription) which use the soku-api-key header, the API key management endpoints authenticate using a Firebase ID token. This is because creating and revoking API keys is a privileged operation that requires proof of account ownership. Include the Firebase ID token in the Authorization header:
You can obtain a Firebase ID token by authenticating through the Firebase Authentication SDK in your application. See the Firebase documentation for details.
Firebase ID tokens expire after 1 hour. Refresh your token before making key management requests if needed.

Create an API Key

Create a new API key for your account.

Headers

Request Body

Response

Status: 201 Created
The apiKey field contains the full API key and is only returned at creation time. Store it securely immediately. If you lose the key, you must revoke it and create a new one.

Example


List API Keys

Retrieve all API keys associated with your account. For security, the full key value is not returned — only metadata including the key ID, name, creation date, and a masked preview of the key.

Headers

Response

Returns an object containing an array of API key metadata objects.

Example


Revoke an API Key

Permanently revoke an API key. Once revoked, any requests using this key will receive a 401 Unauthorized response. This action cannot be undone.

Headers

Path Parameters

Response

Status: 200 OK

Example


Key Rotation Workflow

To rotate an API key without downtime:
  1. Create a new API key using POST /v1/api-keys.
  2. Update your application or service to use the new key.
  3. Verify that requests are succeeding with the new key.
  4. Revoke the old key using DELETE /v1/api-keys/{id}.

Error Responses

Example error response:

Next Steps