Returns the current API, session or workload token’s identity, permissions and expiry. Workload tokens also report their effective project restrictions. No additional permissions are required.
Response body
- {object}Response object.
data
{object} requiredResult data.tokenKind
string requiredThe type of authentication material used for the request.one ofapi, session, workloadid
string requiredThe API token ID (slug), session UUID or workload credential UUID.name
stringThe API token name, session label or workload identity name, if set.description
stringThe description of the API token, if API token authentication was used.entityId
string requiredThe ID (slug) of the entity this authentication material is scoped to.entityUid
string requiredThe object ID of the entity this authentication material is scoped to.entityType
string requiredThe type of entity this authentication material is scoped to.one ofteam, orgorgId
stringThe ID (slug) of the organisation, if the entity is an org-owned team.orgUid
stringThe object ID of the organisation, if the entity is an org-owned team.role
{object}The current role assigned to the API or workload token.name
stringThe display name of the role.roleId
stringThe ID (slug) of the role.roleType
stringThe type of the role.one ofteam, orgentityType
string requiredThe entity type of the role.one ofteam, orgpermissions
{object}The effective permission actions, subject to project restrictions and resource-level checks.orgScope
[array]Organisation-level permission strings.- string
teamScope
[array]Team-level permission strings.- string
projectScope
[array]Project-level permission strings.- string
workload
{object}The caller, when authenticated with a workload token.id
string requiredThe calling workload ID (slug).name
string requiredThe calling workload name.type
string requiredThe calling workload type.one ofharness, service, jobprojectId
string requiredThe calling workload’s project ID (slug).workloadIdentity
{object}The identity providing the workload credential.id
string requiredThe workload identity ID (slug).name
string requiredThe workload identity name.scope
stringWhether workload access is capped to its own project or uses the role’s full scope.one ofown-project, roleprojectRestrictions
{object}The effective project restriction for a workload token.enabled
boolean requiredWhether project access is restricted.restrictionMode
string requiredWhether the listed project UIDs are included or excluded when enabled.one ofin, notInprojects
[array] requiredImmutable project UIDs used by the effective restriction, not project slugs.- string
creatorEmail
stringThe email of the user who created the API token.createdAt
string requiredThe creation time, or the verified issue time for a workload credential.expiresAt
string | nullThe time the authentication material expires, or null if it has no expiry.
GET /v1/auth
Example response
200 OK
Details about the current authentication.
JSON
{
"data": {
"tokenKind": "api",
"id": "my-api-token",
"name": "My API Token",
"description": "CI/CD pipeline token",
"entityId": "my-team",
"entityUid": "507f1f77bcf86cd799439011",
"entityType": "team",
"orgId": "my-org",
"orgUid": "507f191e810c19729de860ea",
"role": {
"name": "Developer",
"roleId": "developer",
"roleType": "team",
"entityType": "team"
},
"creatorEmail": "user@example.com",
"createdAt": "2024-01-15T10:30:00.000Z",
"expiresAt": "2024-07-15T10:30:00.000Z"
}
}