# One registry credential

> GET /v1/registry-credentials/{credential_id}. .

Source: https://legion.ambient.xyz/docs/api/images/get-registry-credential

`GET https://api.legion.ambient.xyz/v1/registry-credentials/{credential_id}`

Authenticate with an API key: `Authorization: Bearer $LEGION_API_KEY`.

. A credential of the organization, without its secret. Any member may read it. 404
`not_found` for an id that is not the organization's.

## Path parameters

- `credential_id`, string (uuid), required: The registry credential.

## Responses

### 200

The credential.

- `id`, string (uuid), required
- `name`, string: A name the organization gave it; absent when none.
- `host`, string, required: The registry host, as image references name it: `docker.io` for Docker Hub, `ghcr.io`, `nvcr.io`, `registry.gitlab.com`, `europe-docker.pkg.dev`, `acme.azurecr.io`.
- `path_prefix`, string, required: The repositories it is chosen for automatically: `""` for every image on the host, else whole path segments (`acme`, `group/sub/project`). Of several credentials for one image, the longest prefix wins.
- `username`, string, required: The username the secret goes with (`$oauthtoken` on `nvcr.io`).
- `token_realm`, string, required: The registry's token service, discovered when the secret was saved and pinned: the only address the secret is ever sent to.
- `created_by`, string (uuid): The person who saved it; absent when it was saved with an API key of no person.
- `created_at`, string (date-time), required
- `updated_at`, string (date-time), required: When it was last changed (renamed or its secret replaced).
- `last_used_at`, string (date-time): When a host last got a pull token made from it; absent until then.
- `last_checked_at`, string (date-time), required: When the registry last answered a token exchange with it.
- `last_check_result`, RegistrySignInCheckResult, required: How the sign-in's last check went: `ok`, or `rejected` when the registry refused it (when it was saved, when an image was inspected or a rental created with it, or when a host pulled with it).

Example:

```json
{
  "id": "0192f1a2-7c3d-7e4f-8a9b-0c1d2e3f4a5b",
  "name": "string",
  "host": "ghcr.io",
  "path_prefix": "acme",
  "username": "string",
  "token_realm": "https://ghcr.io/token",
  "created_by": "0192f1a2-7c3d-7e4f-8a9b-0c1d2e3f4a5b",
  "created_at": "2026-10-15T12:00:00Z",
  "updated_at": "2026-10-15T12:00:00Z",
  "last_used_at": "2026-10-15T12:00:00Z",
  "last_checked_at": "2026-10-15T12:00:00Z",
  "last_check_result": "ok"
}
```

### 401

Missing, unknown, expired or revoked credentials.

### 403

The caller lacks the permission this operation requires (`forbidden`),
or signed in without having joined an organization yet
(`no_organization`; `getOnboarding` and the invitation and
organization operations under it work), or could not sign in
(`email_unverified`, `account_conflict`, and `domain_not_allowed`). `not_invited` is no longer returned to
session tokens.

`access_not_approved`: a signed-in person who is not approved
for the beta yet. Every operation that takes a credential answers it to
them, except `getMe` and `joinMyWaitlist`; the problem carries
`access` (`waitlisted` or `not_requested`, and the email). Approved
means a member of an organization, holding a pending invitation, or Legion; an API key always belongs to a member.

`oauth_token_mcp_only`: the caller sent an OAuth access token (`lgo_`), which is accepted
only by `mcpMessage` and the tool calls it dispatches. Every other operation answers it, whatever
the token's scope. Use an API key or the Legion web app.

`org_suspended`: the caller's organization is suspended. Every operation that takes a
credential answers it, by session or API key, except `getMe` (which shows `org.suspended_at` and
`org.suspension_reason`) and the support operations under `/v1/support/`.

`terms_not_accepted`: an approved caller who has not accepted
the current version of the Terms of Use and the Acceptable Use Policy. Every operation that takes a credential answers it, except `getMe`,
`acceptLegalDocuments`, `joinMyWaitlist` and the wind-down operations
(`listRentals`, `stopRental`, `deleteRental`, `listHosts`,
`updateListing` with `listed` false, `removeHost`); the problem
carries `legal`. An API key acts for the person who created it, so it
is refused until that person accepts. Terminal
operations also return
`session_required` (called with an API key) and `step_up_required`
(neither a sign-in nor a step-up challenge within the step-up window).

### 404

The resource does not exist or belongs to another organization.

### 500

An unexpected server error. Safe to retry.

## Errors

- 403 [`no_organization`](https://legion.ambient.xyz/docs/errors#no_organization)

## Example request

```sh
curl -s "https://api.legion.ambient.xyz/v1/registry-credentials/$CREDENTIAL_ID" \
  -H "Authorization: Bearer $LEGION_API_KEY"
```
