Skip to main content

Create a Platform API Token

API Tokens page with Platform tokens and Vecto knowledge-base tokens sections

API Tokens page with Platform tokens and Vecto knowledge-base tokens sections

API tokens let external applications authenticate with the XpressAI Platform API. Use tokens to send messages, manage tasks, and integrate with external systems.

Prerequisites

  • You are signed in to the XpressAI Platform.

Steps

Create platform token form with name and scope inputs

Create platform token form with name and scope inputs
  1. Navigate to the Tokens section from the sidebar.
  2. Click Create.
  3. Enter a name for the token (for example, "CI Pipeline" or "Monitoring Script").
  4. Select the scopes the token should have:
ScopeDescription
messaging:readRead messages and conversations.
messaging:writeSend messages to conversations.
task:readRead task status and results.
task:writeCreate and manage tasks.
  1. Click Create.
  2. Copy the token immediately. It is displayed only once and cannot be retrieved later.

Using the token

Include the token in the Authorization header of your API requests:

Authorization: Bearer <your-token>

For example, to send a message to a conversation using curl:

curl -X POST https://platform.xpress.ai/api/projects/{projectId}/conversations/{conversationId}/messages \
-H "Authorization: Bearer <your-token>" \
-H "Content-Type: application/json" \
-d '{"content": "Hello from the API"}'
warning

The token is shown only once at creation time. If you lose it, you must delete the token and create a new one.

tip

Give each token a descriptive name that identifies its purpose and the system using it. This makes it easier to audit and revoke tokens later.

Verify

  • The new token appears in the Tokens list with its name and scopes.
  • You can make an authenticated API request using the token and receive a successful response.