Skip to content
NuxieNuxie
Esc
↑↓navigate↵open⌘Jpreview
Open Nuxie

Create a workspace API key

Create a secret key for your backend’s workspace operations.

POSThttps://api.nuxie.ai/v1/workspaces/{workspaceId}/api-keys

Create a secret sk_ key for server-side workspace requests, such as starting an Experience. You must be a workspace owner or admin with a verified email address.

Authentication

Authenticate with the user session bearer token returned by Create a user session. A workspace sk_ key cannot authenticate this operation.

Request

workspaceIdpathstringrequired

Workspace ID from List your workspaces.

namebodystringrequired

A name describing where you will use the key, from 1 to 100 characters.

expiresInDaysbodyinteger

Days until expiry: 1–365. Defaults to 90. Send null for no expiry.

Response

Save the key when it is created. Later key listings return metadata without the secret. Keep it on your server, separate from the publishable app keys used by the SDKs.

objectstringrequired

api_key.

idstringrequired

Key ID, used to revoke it later.

namestringrequired

Key name, or null.

prefixstringrequired

sk_ for workspace keys.

created_by_user_idstringrequired

Creating user ID, or null.

created_atstringrequired

ISO 8601 creation time.

expires_atstringrequired

ISO 8601 expiry time, or null for no expiry.

last_used_atstringrequired

ISO 8601 last-use time, or null.

enabledbooleanrequired

Whether the key is enabled.

keystringrequired

Complete secret key. Returned only when the key is created.

Use and manage the key

Send the returned key as Authorization: Bearer <key> on Workspace API requests. Set X-Nuxie-Env: test for test data or X-Nuxie-Env: live for live data; requests default to live if you omit the header. The key’s name or prefix does not select the environment.

To list keys, send GET /v1/workspaces/{workspaceId}/api-keys. To revoke a key, send DELETE /v1/workspaces/{workspaceId}/api-keys/{keyId}. Both management requests use your user session token.

Errors

A 403 can return workspace_access_denied when you are not a member, workspace_admin_required when you are not an owner or admin, or email_verification_required when your email is unverified. Invalid body fields return 400.

Workspace API requests also depend on your plan and billing status. See Workspace authentication.

curl https://api.nuxie.ai/v1/workspaces/workspace-id/api-keys \
  --header "Authorization: Bearer $NUXIE_USER_TOKEN" \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "Experience backend",
  "expiresInDays": 90
}'
{
  "object": "api_key",
  "id": "key-id",
  "name": "Experience backend",
  "prefix": "sk_",
  "created_by_user_id": "user-id",
  "created_at": "2026-08-21T12:00:00.000Z",
  "expires_at": "2026-11-19T12:00:00.000Z",
  "last_used_at": null,
  "enabled": true,
  "key": "sk_example"
}

Last updated on

Was this page helpful?