Xentree Docs
My Xentree
My Xentree
  1. API Keys
  • Documentation
    • Introduction
    • Quickstart
    • Authentication
    • Conversations
    • Knowledge Base
    • Xentree Live
    • Organizations and Teams
    • Xentree English
    • Errors and Limits
  • API Reference
    • Authentication
      • Register a new user
      • Log in and get an access token
      • Refresh an access token
      • Log out the current user
      • Get the current authenticated user
      • Update the current authenticated user
    • Conversations
      • List available AI providers
      • Generate an AI response
      • List conversations for the current user
      • Create a conversation
      • Get messages for a conversation
      • Search indexed user content
    • Knowledge Base
      • Search the knowledge base
    • Xentree Live
      • Get remaining Xentree Live quota
      • Start a live session
      • Update an active live session heartbeat
      • End a live session
      • Update the user nickname used in Xentree Live
      • List live transcripts for the current user
      • Save live session transcripts
      • Get a single live transcript
    • Organizations
      • List organizations for the current user
      • Create an organization
      • Get organization details
      • Update organization details
      • Delete an organization
      • List organization members
      • Add a member to an organization
    • Integrations
      • List active integrations for the current user
      • Start the Google Calendar OAuth flow
    • Xentree English
      • List XEL modules with user progress
      • Get XEL module details
      • Submit a learning task response
      • Run AI evaluation for speaking or writing
      • Get the XEL dashboard overview
    • API Keys
      • List API keys
        GET
      • Create an API key
        POST
      • Delete an API key
        DELETE
  • Schemas
    • Error
    • TokenResponse
    • UserProfile
    • ChatRequest
    • ChatResponse
    • ConversationCreateRequest
    • ConversationResponse
    • KnowledgeSearchRequest
    • LiveStartSessionRequest
    • LiveSessionResponse
    • LiveQuotaResponse
    • TranscriptTurn
    • SaveLiveTranscriptsRequest
    • OrganizationCreateRequest
    • OrganizationResponse
    • MemberResponse
    • XELModuleSummary
    • XELTaskSubmissionRequest
    • APIKeyCreateRequest
    • APIKeyResponse
  1. API Keys

Create an API key

POST
/api/admin/api-keys
Creates a new scoped API key tied to one of the user's organizations.
The full key value (xntr-...) is returned only once in key_value
and is never stored in plaintext. Copy it immediately.
Key format: xntr- prefix followed by 86 URL-safe base64 characters
(91 characters total).
IP Whitelist: optionally restrict the key to specific IPs or CIDR
ranges. If allowed_ips is null or empty, the key is usable from any IP.

Request

Authorization
JWT Bearer
Add the parameter
Authorization
to Headers
Example:
Authorization: ********************
or
Body Params application/jsonRequired

Examples

Responses

🟢200
application/json
API key created. Copy key_value — it is shown only once.
Body

🟠400
🟠403
🟠404
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'https://my.xentree.com/api/admin/api-keys' \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data-raw '{
    "name": "Production LMS Integration",
    "organization_id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
    "permissions": [
        "conversations:read",
        "conversations:write"
    ],
    "rate_limit_per_minute": 60,
    "expires_at": null,
    "allowed_ips": [
        "203.0.113.42",
        "10.0.0.0/8"
    ]
}'
Response Response Example
{
    "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
    "name": "string",
    "prefix": "xntr-TM2s4obr3gg",
    "tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",
    "user_id": "a169451c-8525-4352-b8ca-070dd449a1a5",
    "organization_id": "7c60d51f-b44e-4682-87d6-449835ea4de6",
    "organization_name": "string",
    "permissions": [
        "string"
    ],
    "rate_limit_per_minute": 0,
    "expires_at": "2019-08-24T14:15:22.123Z",
    "is_active": true,
    "last_used_at": "2019-08-24T14:15:22.123Z",
    "created_at": "2019-08-24T14:15:22.123Z",
    "allowed_ips": [
        "string"
    ],
    "key_value": "xntr-TM2s4obr3ggt76DWVZoxSF48H6OMXnkI..."
}
Modified at 2026-04-22 17:34:10
Previous
List API keys
Next
Delete an API key
Built with