Create an Org Auth Token
Create an org auth token for an organization, for tools such as CI pipelines.
The response includes the full token in token. This is the only time the token is
returned: store it securely, because it can't be retrieved again.
Org auth tokens aren't tied to a member and keep working after the member who
created them leaves the organization, so they can only be granted org:ci. Every new
token is recorded in the organization's audit log, and every organization owner is
emailed about it. Sending the same request again creates another token.
Org auth tokens can be managed from a signed-in session, or with an OAuth application
token that has the org:tokens scope in addition to one of the scopes listed here.
An OAuth application token can only create a token with scopes that it holds itself;
otherwise the request gets a 403. Personal auth tokens, org auth tokens and
integration tokens can't call this endpoint and get a 403.
Path Parameters
organization_id_or_slug(string)REQUIREDThe ID or slug of the organization the resource belongs to.
Body Parameters
name(string)Required. A name for the token, up to 255 characters, to tell it apart from the organization's other tokens.
scopes(array(string))Scopes to grant the token. Org auth tokens can only be granted
org:ci, which is also the default:["org:ci"].
Scopes
<auth_token> requires one of the following scopes:org:adminorg:readorg:write
curl https://sentry.io/api/0/organizations/{organization_id_or_slug}/org-auth-tokens/ \ -H 'Authorization: Bearer <auth_token>' \ -H 'Content-Type: application/json' \ -d '{}'
Copied{ "id": "4", "name": "CI release uploads", "scopes": [ "org:ci" ], "tokenLastCharacters": "Jk4Q", "dateCreated": "2024-07-16T15:36:46.048343Z", "dateLastUsed": null, "projectLastUsedId": null, "token": "sntrys_<base64-payload>_<secret>" }