Update access token Run in API Explorer
Update a specific access token for an organization.
PATCH
/v2/orgs/{org_name}/access-tokens/{access_token_id}
curl \
--request PATCH 'https://hub.docker.com/v2/orgs/myorganization/access-tokens/a7a5ef25-8889-43a0-8cc7-f2a94268e861' \
--header "Authorization: Bearer $ACCESS_TOKEN" \
--header "Content-Type: application/json" \
--data '{"label":"My organization token","description":"Token for CI/CD pipeline","resources":[{"type":"TYPE_REPO","path":"myorg/myrepo","scopes":["repo-pull"]}],"is_active":true}'
Request examples
{
"label": "My organization token",
"description": "Token for CI/CD pipeline",
"resources": [
{
"type": "TYPE_REPO",
"path": "myorg/myrepo",
"scopes": [
"repo-pull"
]
}
],
"is_active": true
}
Response examples (200)
{
"id": "a7a5ef25-8889-43a0-8cc7-f2a94268e861",
"label": "My organization token",
"created_by": "johndoe",
"is_active": true,
"created_at": "2022-05-20T00:54:18Z",
"expires_at": "2023-05-20T00:54:18Z",
"last_used_at": "2022-06-15T12:30:45Z",
"resources": [
{
"type": "TYPE_REPO",
"path": "myorg/myrepo",
"scopes": [
"repo-pull"
]
}
]
}
Response examples (401)
{
"detail": "string",
"message": "string"
}
Response examples (403)
{
"detail": "string",
"message": "string"
}
Response examples (404)
{
"detail": "string",
"message": "string"
}