API Tokens
API tokens authorize programmatic access to Glean's REST APIs:
- Indexing API: For pushing content into Glean
- Client API: For search, chat, agents, and other user-facing functionality
Admins create and manage these tokens in the Admin console under Platform → API tokens. This page covers managing tokens in the Admin console. For how to authenticate and call the APIs, see the Glean developer documentation.
Add an API token
To get started with a token, click Add token in the top right corner of the page. Name the token, specify whether it has global permissions or scoped permissions to specific apps, and set an expiration date. Tokens can be revoked from the dashboard as well.
Indexing API tokens require an expiration date.
For the full token creation reference — including IP restrictions, token rotation, and the roles required to create each token type — see Indexing API authentication and Client API authentication in the developer documentation.
Client API tokens for specific agents
When you create a Client API token, you can restrict its access to one or more specific agents instead of granting access to all agents available to your account.
Creation methods
You can generate scoped tokens from two locations in the platform:
- Admin console: Go to the API tokens page to scope a token to one or more selected agents.
- Agent share panel: Open a specific agent, click Share → API, and generate a token dedicated exclusively to that agent.
Eligibility for agent-specific tokens
An agent Owner or Editor can create and delete their own token from Share → API when they also have the Agent Creator role.
If an identity provider group gives you Editor access to an agent, Glean counts that as Editor access. Admins, Agent Moderators, and users with the API Token Creator role retain their existing token-management access.
By default, the deployment setting client_api.auth.allowAgentEditorTokens enables token management for eligible Owners and Editors. When an admin disables this setting, it blocks the Owner and Editor path. Admins, Agent Moderators, and users with the API Token Creator role retain their existing access. The setting applies at the deployment level; it is not a toggle in the Admin console. Contact your Glean account team to request a change to this setting.
For agent sharing and role details, see Sharing and permissions.
If a user loses agent access
Removing Owner or Editor access does not revoke or delete a token that the user already created. The token remains valid until someone deletes it or it expires. API requests still use the current permissions of the user who created the token, so the token cannot preserve access that the user no longer has.
To revoke a token before it expires, delete it from Share → API or the Admin console Platform → API tokens page. An Admin or Agent Moderator can revoke it if the creator no longer has access to the agent.
Key considerations and limitations
- Security requirement: The token secret is displayed only once during creation. Copy and store it securely in a password manager or vault before closing the window; it cannot be recovered.
- Scope restriction: A scoped token only authorizes requests for its explicitly assigned agents.
- Expiration: Scoped agent tokens automatically expire one year after their creation date.
- Uniqueness constraint: Only one token can exist per user and agent combination.
- Token rotation: The system does not support automated rotation or multiple concurrent tokens for the same agent. To rotate a token, you must delete the existing token and create a new one.
See also
Authentication overview
Server URLs, OAuth, and Glean-issued tokens for the Client and Indexing APIs.
Developer guides
Step-by-step guides for building agents and tools, and for the search, chat, and MCP APIs.
Web SDK
Embed Glean search, chat, and recommendations directly into your web applications.
All developer docs
Browse the full developer documentation, including the complete API reference and changelog.