Skip to main content
POST
/
v1
/
api-tokens
Create API token
curl --request POST \
  --url http://co-mind-platform-host/v1/api-tokens \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "CI/CD Pipeline Token",
  "scopes": [
    "chat:write",
    "models:read",
    "knowledgebases:read"
  ],
  "expires_in_days": 90
}
'
{
  "token": "cmnd_abc123.sk_xxxxxxxxxxxxxxxxxxxx",
  "id": "abc123",
  "name": "CI/CD Pipeline Token",
  "scopes": [
    "chat:write",
    "models:read",
    "knowledgebases:read"
  ],
  "created_at": "2023-11-07T05:31:56Z",
  "expires_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

Bearer token authentication. Supports two token types:

  • JWT Access Token — obtained via POST /v1/auth/login
  • Personal Access Token (PAT) — created via POST /v1/api-tokens, format: cmnd_<tokenId>.<secret>

Body

application/json
name
string
required

Human-readable name for the token

Example:

"CI/CD Pipeline Token"

scopes
string[]
required

Permission scopes for the token

Example:
[
"chat:write",
"models:read",
"knowledgebases:read"
]
expires_in_days
integer
default:90

Token expiry in days (max 365)

Example:

90

Response

Token created successfully

token
string

The token secret (shown only once). Format: cmnd_.

Example:

"cmnd_abc123.sk_xxxxxxxxxxxxxxxxxxxx"

id
string
Example:

"abc123"

name
string
Example:

"CI/CD Pipeline Token"

scopes
string[]
Example:
[
"chat:write",
"models:read",
"knowledgebases:read"
]
created_at
string<date-time>
expires_at
string<date-time>