Create access token
POST
/v2/orgs/{name}/access-tokens Create an access token for an organization.
Connection and access
API connection and authentication guidance
https://hub.docker.com
—
Docker HUB API
Use one of these alternatives. Requirements within an alternative apply together.
bearerAuth
Parameters
No parameters are declared.
Request and responses
Request
application/json
Schema:
createOrgAccessTokenRequest
Schema example
{
"description": "Token for CI/CD pipeline",
"label": "My organization token",
"resources": [
{
"path": "myorg/myrepo",
"scopes": [
"scope-image-pull"
],
"type": "TYPE_REPO"
}
]
}Response
201
Created
application/json
Schema:
createOrgAccessTokenResponse
Schema example
{
"created_at": "2022-05-20T00:54:18Z",
"expires_at": "2023-05-20T00:54:18Z",
"id": "a7a5ef25-8889-43a0-8cc7-f2a94268e861",
"is_active": true,
"label": "My organization token",
"last_used_at": "2022-06-15T12:30:45Z",
"resources": [
{
"path": "myorg/myrepo",
"scopes": [
"scope-image-pull"
],
"type": "TYPE_REPO"
}
],
"token": "dckr_oat_7awgM4jG5SQvxcvmNzhKj8PQjxo"
}Response
400
Bad Request
application/json
Schema:
error
error
{
"errinfo": null,
"message": "bad request"
}Response
401
Unauthorized
application/json
Schema:
error
error
{
"errinfo": null,
"message": "unauthorized"
}Response
403
Forbidden
application/json
Schema:
error
error
{
"errinfo": null,
"message": "permission denied"
}Response
404
Not Found
application/json
Schema:
error
error
{
"errinfo": null,
"message": "not found"
}Referenced schemas
#/components/schemas/createOrgAccessTokenRequest
#/components/schemas/createOrgAccessTokenResponse
Complete operation contract
{
"description": "Create an access token for an organization.\n",
"operationId": "postV2OrgsByNameAccessTokens",
"requestBody": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/createOrgAccessTokenRequest"
}
}
},
"required": true
},
"responses": {
"201": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/createOrgAccessTokenResponse"
}
}
},
"description": "Created"
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"403": {
"$ref": "#/components/responses/Forbidden"
},
"404": {
"$ref": "#/components/responses/NotFound"
}
},
"security": [
{
"bearerAuth": []
}
],
"summary": "Create access token",
"tags": [
"org-access-tokens"
]
}