Skip to main content
Version: 1.3.0

Create a new API key for an organization

POST 

/v1/organizations/:orgId/api-keys

Generates a new API key with the specified scope and environment. The full API key is only returned once at creation - store it securely.

Request

Path Parameters

    orgId stringrequired

    Organization ID

    Example: 507f1f77bcf86cd799439011

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 determines the permissions of the API key (admin, manager, or generator)

    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

    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...