API reference · Registry credentials
Add registry credentials
/v1/registry-credentials- TypeScript
client.registryCredentials.create()- Python
client.registry_credentials.create()- CLI
hayonix registry-credentials create
Stores sign-in details for one private container registry, with a name unique in the project; the password is encrypted and never returned. Pods and private templates use them through registry_credential_id to pull private images.
Project API key (Authorization: Bearer sk_…), or a console session. Requires the registry_credential:create permission (a key's scope, or a role that includes it).
Examples
The samples read API_KEY and API_BASE_URL from the environment (see Setup). Values are examples.
curl -sS "$API_BASE_URL/registry-credentials" \
-H "Authorization: Bearer $API_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"name": "ghcr",
"registry": "ghcr.io",
"username": "deploy-bot",
"password": "ghp_example"
}'Request
| Header | Required | Description |
|---|---|---|
Authorization | yes | Bearer and your API key. The key implies its project. |
X-Project-Id | session only | The project to act in, for console sessions. Requests with an API key leave it out. |
Idempotency-Key | no | Makes a retry safe: the same key and request within 24 hours return the original response (see Idempotency). The SDKs send one for you. |
Body
JSON (application/json): CreateRegistryCredentialRequest.
namestringrequiredIts name
1–100 characters
registrystringrequiredRegistry host and optional port, no scheme
1–260 characters
usernamestringrequiredUser name to sign in to the registry with
1–256 characters
passwordstringrequiredPassword or access token. Write-only.
1–65536 characters
Response
201 RegistryCredential — The new credentials (without the password)
objectstringrequiredAlways `registry_credential`: the type of this object
One of
registry_credentialidstringrequiredUnique ID (`rcr_…`)
ID with prefix rcr_
project_idstringrequiredProject it belongs to
ID with prefix prj_
namestringrequiredIts name
registrystringrequiredRegistry host and optional port these credentials are for
usernamestringrequiredUser name to sign in to the registry with
created_by_user_idstring | nullrequiredID of the user who created it
created_byobject | nullrequiredWho created it (null: created by the platform)
ShowHide 3 fields of
created_byobjectstringrequiredAlways `person`
One of
personidstringrequiredThe person’s user ID (`usr_…`)
namestring | nullrequiredTheir name as they set it; null when they are no longer a member of the organization
created_atstring (date-time)requiredWhen it was created (ISO 8601, UTC)
updated_atstring (date-time)requiredWhen it last changed (ISO 8601, UTC)
Example response
{
"object": "registry_credential",
"id": "rcr_01jc5zq4m8k3v6x9t2w7r0b1e4",
"project_id": "prj_01jc5zq4m8k3v6x9t2w7r0b1e4",
"name": "string",
"registry": "string",
"username": "string",
"created_by_user_id": "string",
"created_by": {
"object": "person",
"id": "string",
"name": "string"
},
"created_at": "2026-01-01T00:00:00.000Z",
"updated_at": "2026-01-01T00:00:00.000Z"
}Errors
Errors use the standard envelope. What this operation can answer:
| Status | Type | When |
|---|---|---|
400 | invalid_request_error | A parameter or body field is missing or not allowed; param names it. |
401 | authentication_error | The key or session is missing, revoked or expired. |
403 | permission_error | The credential lacks the permission this needs, or the organization is suspended. |
409 | conflict_error idempotency_in_progress | A request with the same Idempotency-Key is still running. |
422 | idempotency_error idempotency_key_reused | The Idempotency-Key was used with a different request. |
429 | rate_limit_error rate_limited | Too many requests; retry after retry-after seconds. |