Access Tokens
List Org Tokens
/api/orgs/{orgName}/tokensRetrieves all 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. An optional filter parameter can include expired tokens in the results.
Request Parameters
orgNamestring path requiredThe organization namefilterstring query optionalFilter tokens by status (e.g., include expired tokens)
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
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.
Request Parameters
orgNamestring path requiredThe organization namereasonstring query optionalAudit log reason for creating this token
Request Body
descriptionstring requiredThe descriptionnamestring requiredThe nameadminboolean 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.
Request Parameters
orgNamestring path requiredThe organization nametokenIdstring path requiredThe access token identifier
Responses
List Personal Tokens
/api/user/tokensReturns all personal access tokens for the authenticated user. Web-session generated tokens (type ‘web’) are excluded from the results. Each token in the response includes its ID, description, and lastUsed timestamp. Use the filter query parameter to search tokens by name or description.
Request Parameters
filterstring query optionalFilter tokens by name or description
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
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
Responses
Thank you for your feedback!
If you have a question about how to use Pulumi, reach out in Community Slack.
Open an issue on GitHub to report a problem or suggest an improvement.