curl --request POST \
--url https://api.example.com/api/personal-access-tokens/{patId}/regenerate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expiry": "week"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"note": "<string>",
"permissions": [
"owner"
],
"allProjects": true,
"projects": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"organisationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"key": "<string>",
"protected": true
}
],
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "[email protected]",
"type": "<string>",
"status": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"isService": true
},
"createdAt": "<string>",
"updatedAt": "<string>",
"token": "<string>",
"expiresAt": "<string>"
}Note that any pipelines that depend on the token will stop functioning.
curl --request POST \
--url https://api.example.com/api/personal-access-tokens/{patId}/regenerate \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"expiry": "week"
}
'{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"note": "<string>",
"permissions": [
"owner"
],
"allProjects": true,
"projects": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"organisationId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"version": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"key": "<string>",
"protected": true
}
],
"user": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email": "[email protected]",
"type": "<string>",
"status": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"firstName": "<string>",
"lastName": "<string>",
"isService": true
},
"createdAt": "<string>",
"updatedAt": "<string>",
"token": "<string>",
"expiresAt": "<string>"
}Service user ID to regenerate token for (admin only)
Personal access token ID to regenerate
New token expiration period (week, month, three_months, year, or indefinite)
week, month, three_months, year, indefinite Regenerated personal access token with the new token value
Regenerated personal access token with the new token value
Unique identifier of the personal access token
Description or note for the token
List of permissions granted to this token
owner, documents, releases, releases:manage, releases:deploy, releases:delete, integrations:manage, documents:full, documents:view-content, documents:edit-content, documents:edit-view, branches, branches:create, branches:merge, branches:delete, project:manage, environments, environments:manage, environments:delete Whether the token has access to all projects
List of projects the token has access to
Show child attributes
User who owns the token
Show child attributes
Timestamp when the token was created
Timestamp when the token was last updated
The generated token value (only returned on create or regenerate)
Timestamp when the token expires, null if indefinite
Was this page helpful?