Skip to content
Start here

Generate a JWT to interact with the specified image registry.

POST/accounts/{account_id}/containers/registries/{domain}/credentials

Generates credentials for accessing a configured container image registry.

Security
API Token

The preferred authorization scheme for interacting with the Cloudflare API. Create a token.

Example:Authorization: Bearer Sn3lZJTBX6kkg7OdcBUAxOO963GEIyGQqnFTOFYY
API Email + API Key

The previous authorization scheme for interacting with the Cloudflare API, used in conjunction with a Global API key.

Example:X-Auth-Email: user@example.com

The previous authorization scheme for interacting with the Cloudflare API. When possible, use API tokens instead of Global API keys.

Example:X-Auth-Key: 144c9defac04969c7bfad8efaa8ea194
Path ParametersExpand Collapse
account_id: string
domain: string

The domain to get credentials for.

Body ParametersJSONExpand Collapse
expiration_minutes: optional number

The number of minutes Cloudflare managed registry credentials stay valid. Required for managed registries and must remain positive. Cloudflare ignores this value for external registries.

minimum1
permissions: optional array of "pull" or "push" or "list"

The permissions for Cloudflare managed registry credentials. Required for managed registries. Cloudflare ignores this value for external registries.

One of the following:
"pull"
"push"
"list"
ReturnsExpand Collapse
errors: array of object { code, message, documentation_url, source }
code: number
minimum1000
message: string
documentation_url: optional string
source: optional object { pointer }
pointer: optional string
messages: array of object { code, message, documentation_url, source }
code: number
minimum1000
message: string
documentation_url: optional string
source: optional object { pointer }
pointer: optional string
result: object { account_id, password, registry_host, username }

Credentials returned for an authenticated registry configured on a Containers account.

account_id: string

A unique identifier for the user’s account.

password: string

The password to use when authenticating to the image registry.

registry_host: string

The domain of the image registry these credentials target.

username: string

The username to use when authenticating to the image registry.

success: boolean

Whether the API call was successful.

Generate a JWT to interact with the specified image registry.

curl https://api.cloudflare.com/client/v4/accounts/$ACCOUNT_ID/containers/registries/$DOMAIN/credentials \
    -H 'Content-Type: application/json' \
    -H "Authorization: Bearer $CLOUDFLARE_API_TOKEN" \
    -d '{}'
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": {
    "account_id": "account_id",
    "password": "password",
    "registry_host": "registry_host",
    "username": "username"
  },
  "success": true
}
Returns Examples
{
  "errors": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "messages": [
    {
      "code": 1000,
      "message": "message",
      "documentation_url": "documentation_url",
      "source": {
        "pointer": "pointer"
      }
    }
  ],
  "result": {
    "account_id": "account_id",
    "password": "password",
    "registry_host": "registry_host",
    "username": "username"
  },
  "success": true
}