Access Tokens
List Service Principal Tokens
/api/orgs/{orgName}/service-principals/{userLogin}/tokensLists the access tokens of a user-defined service principal, named by its login or ID. Token values are never returned after creation.
By default only active tokens are listed; set filter to expired or all to include others, and search to match a token’s name or description, or a prefix of its ID. Without maxResults or continuationToken, all matching tokens are returned in one response. To page through them, pass maxResults, then pass the continuationToken of each response to fetch the next page. Tokens are listed newest first by creation time unless sortBy and sortDirection say otherwise. Requires the org_token:read permission.
Returns 409 when service principals are not enabled for the organization.
Request Parameters
orgNamestring path requiredThe organization nameuserLoginstring path requiredThe service principal’s login (service-principal:<ID>), or its IDcontinuationTokenstring query optionalOpaque token for fetching the next page of results.filterstring query optionalFilter tokens by status (active, expired, or all). Defaults to active.maxResultsinteger query optionalMaximum number of tokens per page, from 1 to 1000. Without it, all matching tokens are returned in one response, or 100 per page when a continuationToken is passed.searchstring query optionalCase-insensitive substring match on token name or description, or a prefix of the token IDsortBystring query optionalField to sort the results by. Defaults to created.sortDirectionstring query optionalDirection to sort the results in. Defaults to desc.
Responses
- The list of access tokens
- ↳
idstring requiredUnique identifier for this access token. - ↳
namestring requiredHuman-readable name assigned to this access token. - ↳
descriptionstring requiredUser-provided description of the token’s purpose. - ↳
createdstring requiredTimestamp when the token was created, in ISO 8601 format. - ↳
lastUsedinteger requiredUnix epoch timestamp (seconds) when the token was last used. Zero if never used. - ↳
expiresinteger requiredUnix epoch timestamp (seconds) when the token expires. Zero if it never expires. - ↳
adminboolean requiredWhether this token has Pulumi Cloud admin privileges. - ↳
createdBystring requiredUser.GitHubLogin of the user that created the access token - Role associated with the token, if applicable
- ↳
typeenum optionalThe token’s kind.Values:personal— Personal- A personal access token created by a user.
refresh— Refresh- A refresh token, exchanged for short-lived OBO access tokens at /api/oauth/token. Not authorized for any other endpoint.
organization— Organization- A machine token bound to an organization’s robot user.
team— Team- A machine token bound to a team’s robot user within an organization.
service-principal— ServicePrincipal- A machine token that authenticates as a user-defined service principal of an organization.
continuationTokenstring optionalContinuationToken can be used to fetch the next page of results. If null, there are no more results available.
Create Service Principal Token
/api/orgs/{orgName}/service-principals/{userLogin}/tokensCreates an access token that authenticates as a user-defined service principal, named by its login or ID. Requests made with the token act as the service principal, with exactly its organization-wide roles and entity access, and audit logs attribute them to it.
Service principal tokens require a plan with teams and machine tokens. The request returns 402 on a plan without teams. It returns 403 when the organization has no subscription, its subscription is canceled or its trial has expired, its plan has no machine tokens, or service principal tokens are not enabled for it. It returns 409 when service principals are not enabled for the organization.
The name field must be unique among the service principal’s tokens (including deleted tokens) and cannot exceed 40 characters; the description may be empty and cannot exceed 255 characters. The optional expires field is a time in the future, at most two years from now. Without it the token does not expire, unless the organization sets a maximum token lifetime: then expires is required and must fall within that limit.
Requires the org_token:create permission. Delegated credentials, such as Neo agent tokens and tokens obtained through OIDC token exchange, cannot create tokens, so that a token cannot be used to mint further long-lived tokens.
Important: The token value in the response is only returned once at creation time and cannot be retrieved later.
Request Parameters
orgNamestring path requiredThe organization nameuserLoginstring path requiredThe service principal’s login (service-principal:<ID>), or its ID
Request Body
namestring requiredThe name of the token, unique among the service principal’s tokens, including deleted ones. At most 40 characters.descriptionstring requiredWhat the token is for. May be empty; at most 255 characters.expiresstring optionalWhen the token expires: a time in the future, at most two years from now. Without it, the token does not expire, unless the organization sets a maximum token lifetime: then it is required and must fall within that limit.
Responses
idstring requiredThe unique identifiertokenValuestring requiredThe token value
Delete Service Principal Token
/api/orgs/{orgName}/service-principals/{userLogin}/tokens/{tokenId}Permanently revokes and deletes an access token of a user-defined service principal, named by its login or ID. Automation using the token loses access immediately. Deleting the service principal itself, with DeleteOrganizationMember, deletes all its tokens.
Requires the org_token:delete permission. Delegated credentials, such as Neo agent tokens and tokens obtained through OIDC token exchange, cannot delete tokens.
Returns 409 when service principals are not enabled for the organization.
Request Parameters
orgNamestring path requiredThe organization nameuserLoginstring path requiredThe service principal’s login (service-principal:<ID>), or its IDtokenIdstring path requiredThe ID of the token to delete
Responses
List Org Tokens
/api/orgs/{orgName}/tokensRetrieves the access tokens created for an organization. Organization tokens provide CI/CD automation access scoped to the organization rather than tied to individual user accounts. The response includes token metadata such as name, description, creation date, last used date, and expiration status. The actual token values are never returned after initial creation. Use the filter query parameter to narrow by status (active, expired, all). Use the search query parameter to match token name, description, ID, or creator login. Results are paginated; use continuationToken (returned in the response) and maxResults to page. Use the sortBy and sortDirection query parameters to order results; the default is newest-first by creation time.
Request Parameters
orgNamestring path requiredThe organization namecontinuationTokenstring query optionalOpaque token for fetching the next page of results.filterstring query optionalFilter tokens by status (active, expired, or all). Defaults to active.maxResultsinteger query optionalMaximum number of tokens per page. Defaults to 100, maximum 1000.searchstring query optionalCase-insensitive substring match on token name, description, ID, or creator loginsortBystring query optionalField to sort the results by. Defaults to created.sortDirectionstring query optionalDirection to sort the results in. Defaults to desc.
Responses
- The list of access tokens
- ↳
idstring requiredUnique identifier for this access token. - ↳
namestring requiredHuman-readable name assigned to this access token. - ↳
descriptionstring requiredUser-provided description of the token’s purpose. - ↳
createdstring requiredTimestamp when the token was created, in ISO 8601 format. - ↳
lastUsedinteger requiredUnix epoch timestamp (seconds) when the token was last used. Zero if never used. - ↳
expiresinteger requiredUnix epoch timestamp (seconds) when the token expires. Zero if it never expires. - ↳
adminboolean requiredWhether this token has Pulumi Cloud admin privileges. - ↳
createdBystring requiredUser.GitHubLogin of the user that created the access token - Role associated with the token, if applicable
- ↳
typeenum optionalThe token’s kind.Values:personal— Personal- A personal access token created by a user.
refresh— Refresh- A refresh token, exchanged for short-lived OBO access tokens at /api/oauth/token. Not authorized for any other endpoint.
organization— Organization- A machine token bound to an organization’s robot user.
team— Team- A machine token bound to a team’s robot user within an organization.
service-principal— ServicePrincipal- A machine token that authenticates as a user-defined service principal of an organization.
continuationTokenstring optionalContinuationToken can be used to fetch the next page of results. If null, there are no more results available.
Create Org Token
/api/orgs/{orgName}/tokensGenerates a new access token scoped to the organization for use in CI/CD pipelines and automated workflows. Organization tokens belong to the organization rather than individual users, ensuring that access is not disrupted when team members leave.
The name field must be unique across the organization (including deleted tokens) and cannot exceed 40 characters. The expires field accepts a unix epoch timestamp up to two years from the present, or 0 for no expiry (default).
Important: The token value in the response is only returned once at creation time and cannot be retrieved later. Audit logs for actions performed with organization tokens are attributed to the organization rather than an individual user.
This request must be authenticated as a user, for example with a personal access token. Organization and team access tokens cannot create organization tokens, even when they have the Admin role, so that a token cannot be used to mint further organization tokens. Such requests return a 403 error.
Request Parameters
orgNamestring path requiredThe organization namereasonstring query optionalAudit log reason for creating this token
Request Body
descriptionstring requiredThe descriptionnamestring requiredThe display name of the token. Must be between 1 and 40 characters.adminboolean requiredWhether the entity has admin privilegesexpiresinteger requiredThe expiration timeroleIDstring optionalThe role identifier
Responses
idstring requiredThe unique identifiertokenValuestring requiredThe token value
Delete Org Token
/api/orgs/{orgName}/tokens/{tokenId}Permanently revokes and deletes an organization access token. Any CI/CD pipelines or automation using this token will immediately lose access to the organization’s resources. This action cannot be undone.
This request must be authenticated as a user, for example with a personal access token. Organization and team access tokens cannot delete organization tokens and receive a 403 error.
Request Parameters
orgNamestring path requiredThe organization nametokenIdstring path requiredThe access token identifier
Responses
List Personal Tokens
/api/user/tokensReturns the access tokens currently bound to the authenticated user: personal access tokens (Bearer-usable) and refresh tokens issued during agent signup (exchange-only at POST /api/oauth/token; 401 if presented as Bearer). Web-session tokens are excluded. Use the filter query parameter to narrow by status (active, expired, all). Use the search query parameter to match token name or description, or to prefix-match token ID. Results are paginated; use continuationToken (returned in the response) and maxResults to page. Revoke any entry via DELETE /api/user/tokens/{tokenId}, which is type-agnostic. Use the sortBy and sortDirection query parameters to order results; the default is newest-first by creation time.
Request Parameters
continuationTokenstring query optionalOpaque token for fetching the next page of results.filterstring query optionalFilter tokens by status (active, expired, or all). Defaults to active.maxResultsinteger query optionalMaximum number of tokens per page. Defaults to 100, maximum 1000.searchstring query optionalCase-insensitive substring match on token name or description, or prefix match on token IDsortBystring query optionalField to sort the results by. Defaults to created.sortDirectionstring query optionalDirection to sort the results in. Defaults to desc.
Responses
- The list of access tokens
- ↳
idstring requiredUnique identifier for this access token. - ↳
namestring requiredHuman-readable name assigned to this access token. - ↳
descriptionstring requiredUser-provided description of the token’s purpose. - ↳
createdstring requiredTimestamp when the token was created, in ISO 8601 format. - ↳
lastUsedinteger requiredUnix epoch timestamp (seconds) when the token was last used. Zero if never used. - ↳
expiresinteger requiredUnix epoch timestamp (seconds) when the token expires. Zero if it never expires. - ↳
adminboolean requiredWhether this token has Pulumi Cloud admin privileges. - ↳
createdBystring requiredUser.GitHubLogin of the user that created the access token - Role associated with the token, if applicable
- ↳
typeenum optionalThe token’s kind.Values:personal— Personal- A personal access token created by a user.
refresh— Refresh- A refresh token, exchanged for short-lived OBO access tokens at /api/oauth/token. Not authorized for any other endpoint.
organization— Organization- A machine token bound to an organization’s robot user.
team— Team- A machine token bound to a team’s robot user within an organization.
service-principal— ServicePrincipal- A machine token that authenticates as a user-defined service principal of an organization.
continuationTokenstring optionalContinuationToken can be used to fetch the next page of results. If null, there are no more results available.
Create Personal Token
/api/user/tokensCreates a new personal access token for the authenticated user. The request body includes a description for the token and an optional expiration time. The response includes the token ID and the tokenValue (prefixed with ‘pul-’). The token value is only returned once at creation time and cannot be retrieved later.
Request Parameters
reasonstring query optionalTracks the context that triggered token creation (e.g., redirect URL or referral source)
Request Body
descriptionstring requiredThe descriptionexpiresinteger requiredThe expiration time
Responses
idstring requiredThe unique identifiertokenValuestring requiredThe token value
Delete Personal Token
/api/user/tokens/{tokenId}Permanently deletes a personal access token by its identifier. The token is immediately invalidated and can no longer be used for authentication. Returns 204 on success or 404 if the token does not exist.
Request Parameters
tokenIdstring path requiredThe access token identifier