Skip to main content
POST
/
v1
/
registry
/
credentials
Create registry credential
curl --request POST \
  --url https://api.cnap.tech/v1/registry/credentials \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "GitHub Container Registry",
  "registry_url": "ghcr.io",
  "type": "basic",
  "credentials": {
    "username": "<string>",
    "password": "<string>",
    "token": "<string>",
    "client_id": "<string>",
    "client_secret": "<string>",
    "token_url": "<string>"
  }
}
'
{
  "error": {
    "code": "not_found",
    "message": "Resource not found",
    "param": "name",
    "suggestion": "Run `cnap clusters list` to see available clusters",
    "details": "<unknown>"
  }
}

Authorizations

Authorization
string
header
required

Personal Access Token (cnap_pat_...) or OAuth2 JWT. Create tokens at https://dash.cnap.tech/account/tokens

Body

application/json
name
string
required
Required string length: 1 - 100
Example:

"GitHub Container Registry"

registry_url
string
required
Required string length: 1 - 2048
Example:

"ghcr.io"

type
enum<string>
required

Auth type

Available options:
basic,
token,
oauth
credentials
object
required

Auth credentials (type-dependent)

Response

Credential created