• EN
  • Authentication

    The public bot API is available under /api/v1/bots. Send your credential in the Authorization header over HTTPS.

    Authorization: Bearer <your-bot-token>

    The bot middleware also accepts the Bot authorization scheme. Use Bearer in new clients.

    Credential types

    CredentialIdentity and accessWhere to use it
    Bot token, xoxb-One bot account and workspace, with assigned scopesPublic bot message and channel endpoints
    App installation token, xoxa-An active installation and its bot accountSupported public bot endpoints and app capabilities
    Personal access token, pulse_pat_User identity with user:full on allowed routesAllowed user operations
    Workspace user sessionA signed-in user and that user's permissionsWorkspace integration management routes
    Incoming webhook URLA secret URL associated with an incoming webhookThe incoming webhook delivery endpoint

    A token prefix helps identify its type. Authentication also checks the stored credential, revocation, expiry, and installation state. Treat the full value as a secret and keep it in your server's secret store. Avoid including tokens in source control, browser bundles, logs, or URLs.

    An installation token's effective scopes are restricted by both the token and the installation's grants. The installation must be active and have a bot account. Bot and installation credentials are tied to their workspace.

    Scopes for public endpoints

    EndpointBot tokenInstallation token
    POST /bots/messageschat:write or, for replies only, chat:write:threadSame scope requirement
    PATCH /bots/messages/{id}chat:writechat:update
    DELETE /bots/messages/{id}chat:writechat:delete
    GET /bots/channelschannels:readchannels:read

    These paths are relative to /api/v1. Scopes authorize an operation. Workspace access, channel membership, ownership, encryption mode, and message age can still prevent it.

    Personal access tokens

    Personal access tokens have the user:full scope and act as their owner only on explicitly allowed routes and HTTP methods. These include profile operations, workspace and organization reads, channels, messages, threads, files, search, drafts, and canvas documents, subject to the user's normal permissions.

    Token creation depends on organization policy. A signed-in user manages personal tokens under /api/v1/me/personal-access-tokens. Organization settings and expiry policy can restrict creation and use.

    Bot credential, webhook, app installation, connector, security, and administration management routes require a user session. A personal token on a session-only route receives 403 with error_code set to personal_access_token_not_allowed. Public /bots routes accept bot or installation tokens.

    Management authentication

    Creating, rotating, and revoking bot tokens uses the workspace user API under /api/v1/workspaces/{workspace_id}/integrations/bots/tokens. These routes use the signed-in user's session and check integration management permission. Browser session requests are also subject to origin protection.

    Use the product's integration settings for the first credential. See bots for the management contract and apps for installation tokens.

    Authentication errors

    Missing, malformed, unknown, revoked, or expired credentials return 401. A valid credential missing an endpoint's required scope returns 403.

    {"error":"Missing bot token"}
    {"error":"Missing scope: channels:read"}

    Error messages are diagnostic text. Branch on HTTP status in your client. See requests and errors.