Skip to main content
POST
/
api
/
workspace
/
{workspaceId}
/
api-keys
Create API key
curl --request POST \
  --url https://app.alana.shopping/api/workspace/{workspaceId}/api-keys \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "permissions": [
    "<string>"
  ],
  "expires_at": "2023-11-07T05:31:56Z"
}
'
{
  "id": "<string>",
  "workspace_id": "<string>",
  "name": "<string>",
  "key_prefix": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "permissions": [
    "<string>"
  ],
  "last_used_at": "2023-11-07T05:31:56Z",
  "expires_at": "2023-11-07T05:31:56Z",
  "created_by": "<string>",
  "secret": "<string>"
}

Authorizations

Authorization
string
header
required

Bearer token authentication. Obtain a token via the authentication endpoint and include it in the Authorization header: Authorization: Bearer <token>

Path Parameters

workspaceId
string
required

The workspace ID

Body

application/json
name
string
required
Required string length: 1 - 255
permissions
string[]
expires_at
string<date-time> | null

Response

API key created successfully

id
string
required
workspace_id
string
required
name
string
required
key_prefix
string
required

First 10 characters of the API key

created_at
string<date-time>
required
permissions
string[]
last_used_at
string<date-time> | null
expires_at
string<date-time> | null
created_by
string
secret
string

Full API key (only shown on creation)