For the complete documentation index, see llms.txt. This page is also available as Markdown.

API Keys

Generate and use API keys for programmatic access.

API keys provide machine-to-machine access to the Duku platform.

Each API key is one base64-encoded string. It contains the OAuth2 client ID and secret. Exchange the key for a short-lived Bearer token, then use the token against the GraphQL API.

Limits and scope

  • Each key is scoped to one organisation.

  • Each user can have up to 10 API keys.

  • Keys do not expire unless you set an expiry during creation.

  • Organisation admins can create, view, and revoke keys. Rotation is available via the API.

  • By default a key inherits the roles of the user who created it. Over the API, generateApiKey(input: { name, roles: ["org-member"], expiresInDays }) creates a key with fewer roles - you can only assign roles you hold.

  • Listing, creating, rotating and revoking keys are all organisation-admin operations - a member cannot see the key list.

Generate a key

  1. Open Settings → API Keys in Viewport

  2. Click + Generate key

  3. Enter a name like GitHub Actions or CI Pipeline

  4. Click Generate key

  5. Copy the API key.

Over the API, generateApiKey returns clientId and clientSecret as separate fields, plus the roles the key carries. The single base64 string shown in the dashboard is clientId:clientSecret base64-encoded for convenience - combine them yourself if you need that form. The secret is returned once and cannot be retrieved again.

Exchange the key for an access token

Base64-decode the key, then split its value on the first colon.

Example response:

Access tokens are short-lived, typically about five minutes. Fetch a fresh token rather than caching one for a long-running job.

Use the access token

Rotate a key

Rotation is available via the API only - there is no Rotate button in Viewport yet. Call the rotateApiKey mutation to issue a new secret for an existing key, then store the new value (it is shown once). To retire a key from the dashboard, use Revoke and generate a replacement.

Confirm how long the previous secret keeps working after rotation before you rely on a specific grace window.

Revoke a key

  1. Open Settings → API Keys

  2. Click Revoke

  3. The key is deleted permanently

Auditing keys

The apiKeys query returns each key's name, clientId, createdAt, expiresAt and lastUsedAt, so you can find keys that have stopped being used before revoking them.

Best practices

  • Use one key per integration

  • Rotate keys regularly

  • Never commit secrets

See also

Use Triggering explorations from any CI for a complete Platform API walkthrough.

Last updated