Skip to main content
Version: V2

Create API key

POST 

/v2/organizations/:orgId/api-keys

Create a new API key for an organization. Pick a scope (manager or generatoradmin keys are provisioned manually, not via this endpoint) and the domains it can hit (artworks-internal, style-dna, textcraft). The requested domains must be a subset of the calling admin key's own domains. The full key is returned once in the response, so store it somewhere safe before closing the connection.

Request

Path Parameters

    orgId stringrequired

    Organization ID

Body

required

    label stringrequired

    Possible values: non-empty and <= 100 characters

    Human-readable label for the API key

    scope stringrequired

    Possible values: [admin, manager, generator]

    Scope of the API key. admin is not creatable via this endpoint (admins are bootstrapped manually). Pick manager or generator.

    domains string[]required

    Possible values: [artworks-internal, style-dna, textcraft], >= 1

    Feature domains the key may access. Must be a subset of the calling admin key's own domains.

    credits integer

    Default value: 0

    Initial credits allocated to the API key

Responses

API key created successfully. The apiKey field contains the full key and will only be shown once.

Schema

    keyId stringrequired

    Unique identifier for the API key

    apiKey string

    The full API key - ONLY shown once at creation. Store this securely.

    keyPrefix stringrequired

    First 10 characters of the API key for identification

    label stringrequired

    Human-readable label for the API key

    scope stringrequired

    Possible values: [admin, manager, generator]

    Permission scope of the API key

    domains string[]required

    Possible values: [artworks-internal, style-dna, textcraft]

    Feature domains the key may access

    environment stringrequired

    Possible values: [live, test]

    Environment the key is valid for

    credits numberrequired

    Available credits for this API key

    status stringrequired

    Possible values: [active, revoked, expired]

    Current status of the API key

    usageCount numberrequired

    Number of times the key has been used

    lastUsedAt date-timenullablerequired

    Last time the key was used (ISO 8601 format)

    expiresAt date-timenullablerequired

    Expiration date of the key (ISO 8601 format)

    createdAt date-timerequired

    Creation date of the key (ISO 8601 format)

Loading...