Skip to main content
POST
/
api
/
v2
/
tokens
Create token
curl --request POST \
  --url https://sitegpt.ai/api/v2/tokens \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Knowledge updater",
  "scopes": [
    "account:read",
    "chatbots:read",
    "knowledge:read",
    "knowledge:write"
  ],
  "expiresInDays": 90
}
'
{
  "ok": true,
  "data": {
    "token": {
      "id": "token-id",
      "name": "Knowledge updater",
      "scopes": [
        "account:read",
        "chatbots:read",
        "knowledge:write"
      ]
    },
    "plaintextToken": "sgpt_..."
  },
  "meta": {
    "requestId": "request-id"
  }
}

Documentation Index

Fetch the complete documentation index at: https://sitegpt.ai/docs/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
name
string
required
Required string length: 1 - 120
scopes
enum<string>[]
required
Minimum array length: 1
Available options:
account:read,
account:write,
tokens:read,
tokens:write,
chatbots:read,
chatbots:write,
chatbots:delete,
knowledge:read,
knowledge:write,
knowledge:delete,
personas:read,
personas:write,
personas:delete,
instructions:read,
instructions:write,
instructions:delete,
settings:read,
settings:write,
starters:read,
starters:write,
starters:delete,
followups:read,
followups:write,
followups:delete,
conversations:read,
conversations:write,
conversations:delete,
leads:read,
leads:write,
leads:delete,
members:read,
members:write,
members:delete,
integrations:read,
integrations:write,
billing:read,
billing:write
chatbotIds
string[]

Optional chatbot IDs to restrict this token to. Omit for all accessible chatbots.

expiresInDays
integer
default:90
Required range: 1 <= x <= 365
expiresAt
string<date-time>

Absolute token expiration. Cannot be combined with expiresInDays.

Response

Successful SiteGPT API v2 response.

ok
boolean
required
data
object
required
meta
object
required