POST
Re-test a stored credential against its registry

Authorizations

Authorization
string
header
required

Authorization: Bearer twk_<prefix>_<secret>.

The prefix is public and safe to log: it is what identifies which credential leaked. The secret is never logged, never returned after creation, and stored only as a SHA-256 hash.

Response

The credential, with its refreshed status.

A stored registry credential, without its secret. There is no read path for the plaintext at any permission, so no response anywhere carries one. A customer who has lost their token rotates it.

id
string<uuid>
required
name
string
required

What a human calls it, such as "ACME production Harbor".

kind
enum<string>
required

registry for a credential served by /registry-credentials, git for one served by /git-credentials. The listings return only their own kind, but the routes that take an {id} reach any credential the organization holds, so rotating the credential behind a cloud account or a cluster answers with cloud or kubernetes. The two surfaces share this schema and are separate stores: github.com serves both a registry and a repository host, the tokens differ, and they are rotated on different schedules.

Available options:
registry,
git,
cloud,
kubernetes
registry
string
required

The canonicalised host this credential authenticates to, such as ghcr.io or registry.example.com:5000, or github.com or bitbucket.example.com:8443 for a git credential. Also the matching key: a credential is selected for a scan by the host of the image or repository being scanned, never named by the caller.

Example:

"ghcr.io"

scheme
enum<string>
required

How this credential authenticates. See CreateRegistryCredential for which schemes each surface accepts and what each requires.

Available options:
basic,
token,
bearer,
assume_role,
aws_access_key,
azure_service_principal,
gcp_service_account
status
enum<string>
required

unverified has never authenticated, active last did so successfully, invalid was rejected by the registry, disabled was switched off by an administrator. A timeout or an unreachable host leaves the status untouched rather than marking it invalid.

Available options:
unverified,
active,
invalid,
disabled
created_at
string<date-time>
required
updated_at
string<date-time>
required
username
string

Stored in plaintext deliberately: it is not a secret, and it is what makes "which account is this" answerable. What it holds depends on the scheme: a username for basic, the role ARN for assume_role, the access key id for aws_access_key, <tenant-id>/<client-id> for azure_service_principal. Absent for token, bearer and gcp_service_account.

external_id
string

The sts:ExternalId this credential's role trust policy must require. Derived rather than stored, and present only for an Amazon ECR assume_role credential.

status_reason
string

Why the credential is in its current status, classified. Never the registry's raw error, which can echo the request.

last_verified_at
string<date-time>
last_used_at
string<date-time>

When a scan last resolved it. Separate from last_verified_at: verification answers "does this work", use answers "is this still needed".

rotated_at
string<date-time>
created_by
string<uuid>