Account

Create an API key

Creates a pga_… key for the active workspace and returns it, secret included. The secret stays readable through listApiKeys. Every field is optional: the default is a write key for all sites.

post/api/v1/account/keys

Request

  • Base URL: https://api.dotsy.ai
  • URL: https://api.dotsy.ai/api/v1/account/keys
  • Auth: HTTP bearer

Headers

X-Dotsy-Workspacestring

Org id or slug to act as for this request (session/MCP user actors only — ignored for pga_ keys). Validated against the caller's own memberships (id match first, then slug); 403 if not a member. Takes precedence over session.activeOrganizationId and the auto-provisioned home-workspace fallback.

Request body

labelstring

A name for the key, up to 100 characters.

scope'read' | 'write' | 'admin'

read, write (default) or admin. read can only GET; admin can also manage keys.

siteSlugsstring[]

Limit the key to these sites. Leave it out or send [] for all sites. Each slug must be a site in this workspace, or the request answers 400 site_not_found.

Example request

{
  "label": "CI deploys",
  "siteSlugs": [
    "acme-studio"
  ]
}

Response

The new key.

idstring required
labelstring nullable required
scope'read' | 'write' | 'admin' required
siteSlugsstring[] nullable required

The sites the key is limited to, or null for all sites.

createdAtnumber required

Creation time, Unix ms.

secretstring nullable required

The key itself (pga_…). Null for an old key whose secret was never stored.

Changes

No recorded changes to this operation across all 1 revision of this API.