CorefinityCorefinityDocs
Open the Control PanelControl Panel
Registry secrets · 2 of 5

Create a registry secret

Saves the credential for one Composer registry. The registry is named by its host, with a port when it needs one; it must resolve to public addresses. An environment holds one credential for each registry. A saved credential is used by the environment's builds once registry credentials are switched on for it.

POST/api/corestack/environments/{environment}/deploy-secrets

Path parameters

environmentintegerRequired

The id of a CoreStack Enterprise environment. Not the same number as a site row id. At least 1.

Body

auth_typestringRequired

How the registry signs in.

http-basicbearergithub-oauthgitlab-token
labelstringRequired

A name for the credential, on one line. Spaces around it are removed, and it cannot be blank. Up to 255 characters.

registrystringRequired

The registry's host name, with a port if it needs one. No scheme, path or spaces. Up to 255 characters.

secretstringRequired

The token or password, kept exactly as sent. No line breaks or control characters. Up to 4,096 characters.

usernamestring

The username, with no line breaks or control characters. Required and not blank for http-basic, and not kept for any other sign-in type. Up to 255 characters.

Returns

201 The saved credential.

Fields of the 201 answer
dataobjectRequired

One saved registry credential. Never its token or its username.

Fields
auth_typestringRequired

How the registry signs in.

http-basicbearergithub-oauthgitlab-token
idintegerRequired

At least 1.

kindstringRequired

Always composer on these endpoints.

labelstringRequired

The name you gave the credential.

last4string or nullRequired

The last four characters of the token. Null for a token shorter than 12 characters.

last_used_atstring or nullRequired

When a build last received the credential, in UTC. Format: date-time.

registrystringRequired

The registry's host, in lower case, with its port when that is not 443.

scopestringRequired

Always an empty string for a Composer registry.

verified_atstring or nullRequired

When the registry last accepted the credential, in UTC. Null when it has not been checked since it last changed. Format: date-time.

If it is refused

StatusReasonWhat to do
401noneSend a valid token as Authorization: Bearer <token>.
403company_unavailableYour company is unavailable.
403forbiddenThe person is not allowed to do this.
403scope_requiredUse a token with the scope named in scope.
403two_factor_requiredTurn on two-factor on your account, then send again.
404noneCheck the id. You see only what your account can reach.
409existsIt already exists. Use the existing one.
422secret_invalidChoose how the registry signs in: http-basic, bearer, github-oauth or gitlab-token.
422invalidFix the field named in field; errors says why.
429rate_limitedWait for the seconds in Retry-After.

Reasons are listed by name in Errors and refusals.

The same task elsewhere

curl -X POST https://manage.corefinity.com/api/corestack/environments/1311/deploy-secrets \
  -H "Authorization: Bearer $COREFINITY_TOKEN" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{
    "auth_type": "http-basic",
    "label": "Private packages",
    "registry": "packages.example.com",
    "secret": "your-registry-token",
    "username": "northwind-digital"
  }'
{
  "data": {
    "auth_type": "http-basic",
    "id": 319,
    "kind": "composer",
    "label": "Private packages",
    "last4": "oken",
    "last_used_at": null,
    "registry": "packages.example.com",
    "scope": "",
    "verified_at": null
  }
}
Try it

Try it is off for this endpointIt has not been cleared for the console. Copy the request and run it yourself when you are sure.

Was this helpful?
Open in ClaudeOpen in ChatGPT