Create API key
POST/v2/organizations/:orgId/api-keys
Create a new API key for an organization. Pick a scope (manager or generator — admin 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
Organization ID
- application/json
Body
required
Possible values: non-empty and <= 100 characters
Human-readable label for the API key
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.
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.
Default value: 0
Initial credits allocated to the API key
Responses
- 201
- 400
- 401
- 403
- 404
- 429
- 500
API key created successfully. The apiKey field contains the full key and will only be shown once.
- application/json
- Schema
- Example (from schema)
Schema
Unique identifier for the API key
The full API key - ONLY shown once at creation. Store this securely.
First 10 characters of the API key for identification
Human-readable label for the API key
Possible values: [admin, manager, generator]
Permission scope of the API key
Possible values: [artworks-internal, style-dna, textcraft]
Feature domains the key may access
Possible values: [live, test]
Environment the key is valid for
Available credits for this API key
Possible values: [active, revoked, expired]
Current status of the API key
Number of times the key has been used
Last time the key was used (ISO 8601 format)
Expiration date of the key (ISO 8601 format)
Creation date of the key (ISO 8601 format)
{
"keyId": "string",
"apiKey": "string",
"keyPrefix": "string",
"label": "string",
"scope": "admin",
"domains": [
"artworks-internal"
],
"environment": "live",
"credits": 0,
"status": "active",
"usageCount": 0,
"lastUsedAt": "2024-07-29T15:51:28.071Z",
"expiresAt": "2024-07-29T15:51:28.071Z",
"createdAt": "2024-07-29T15:51:28.071Z"
}
Invalid request data
- application/json
- Schema
- Example (from schema)
Schema
Available only when the message includes additional error details.
{
"message": "string",
"statusCode": 0,
"error": "string"
}
Unauthorized
- application/json
- Schema
- Example (from schema)
Schema
Available only when the message includes additional error details.
{
"message": "string",
"statusCode": 0,
"error": "string"
}
Forbidden
- application/json
- Schema
- Example (from schema)
Schema
Available only when the message includes additional error details.
{
"message": "string",
"statusCode": 0,
"error": "string"
}
Organization not found
- application/json
- Schema
- Example (from schema)
Schema
Available only when the message includes additional error details.
{
"message": "string",
"statusCode": 0,
"error": "string"
}
Too Many Requests
- application/json
- Schema
- Example (from schema)
Schema
Available only when the message includes additional error details.
{
"message": "string",
"statusCode": 0,
"error": "string"
}
Internal Server Error
- application/json
- Schema
- Example (from schema)
Schema
Available only when the message includes additional error details.
{
"message": "string",
"statusCode": 0,
"error": "string"
}