Skip to main content
POST
/
v1
/
keys
Create an API key
curl --request POST \
  --url https://ai.liara.ir/v1/keys \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "workspaces": [
    "<string>"
  ]
}
'
{
  "name": "<string>",
  "enabled": true,
  "workspaces": [
    {
      "_id": "<string>",
      "name": "<string>"
    }
  ],
  "key": "<string>",
  "createdBy": {
    "fullname": "<string>"
  },
  "_id": "<string>"
}

Authorizations

Authorization
string
header
required

Enter the token with the Bearer: prefix, e.g. "Bearer abcde12345"

Body

application/json
name
string
required

Unique name for the API key

Required string length: 3 - 15
Pattern: ^[A-Za-z0-9._~| -]+$
workspaces
string[]
required

Array of workspace names to associate with this key

Minimum array length: 1

Response

API key created

name
string
enabled
boolean
workspaces
object[]
key
string

The JWT token for this API key (only shown once)

createdBy
object
_id
string