# Update registry

`PATCH /v1/organizations/{organization}/registries/{registry}`, operation `environments.UpdateRegistry`

Changes a registry's description, how kosem signs in, or the projects an organization's is shared with.

## Parameters

| Name | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `organization` | path | Yes | `string` | The organization's ID. |
| `registry` | path | Yes | `string` | The registry's ID. |

## Request body

Content-Type: `application/json` (required)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `availability` | `Availability` | No | The projects whose environments pull with it. Changing it also takes environments.registries.setAvailability, and takes effect for the next pulls. A project's own registry takes none. |
| `availability.allProjects` | `boolean` | Yes | Every project, including those created later. |
| `availability.projects` | `string[]` | Yes | Projects, projects/{project_id}, when not all of them; at most 500. Past that, make the resource available to every project. |
| `aws` | `RegistryAWS` | No | The role kosem signs in as from now on, without a key. |
| `aws.role` | `string` | Yes | The role kosem assumes, which pulls from the registry, such as arn:aws:iam::123456789012:role/kosem-pull. Its trust policy takes kosem's issuer, as an IAM OpenID Connect provider whose client ID is sts.amazonaws.com. |
| `description` | `string` | No | What the registry is for. |
| `google` | `RegistryGoogle` | No | The service account kosem signs in as from now on, without a key. |
| `google.provider` | `string` | Yes | The workload identity pool's provider that takes kosem's identity tokens, projects/{number}/locations/global/workloadIdentityPools/{pool}/providers/{provider}; kosem's tokens name it as their audience. |
| `google.serviceAccount` | `string` | Yes | The service account kosem acts as, which reads the repositories, such as kosem-pull@acme.iam.gserviceaccount.com. The provider's principals need Workload Identity User on it. |
| `token` | `RegistryToken` | No | The username and the secret that kosem signs in with from now on, whole, in place of how it signed in. A registry that needs attention is active again. At most one of token, google and aws. |
| `token.secret` | `string` | Yes | The secret, of the registry's own organization or project, whose latest enabled version kosem signs in with. Not a dynamic secret. Choosing one takes what using it takes: secrets.versions.access on it. |
| `token.username` | `string` | Yes | The username kosem signs in as, such as a bot account's. |

## Responses

### 200

OK

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `availability` | `Availability` | Yes | For an organization's registry: the projects whose environments pull with it, without adopting it. A project's own applies to it alone, and is shared with none. |
| `availability.allProjects` | `boolean` | Yes | Every project, including those created later. |
| `availability.projects` | `string[]` | Yes | Projects, projects/{project_id}, when not all of them; at most 500. Past that, make the resource available to every project. |
| `aws` | `RegistryAWS` | No | For a registry of Amazon ECR: the role kosem signs in as, without a key. |
| `aws.role` | `string` | Yes | The role kosem assumes, which pulls from the registry, such as arn:aws:iam::123456789012:role/kosem-pull. Its trust policy takes kosem's issuer, as an IAM OpenID Connect provider whose client ID is sts.amazonaws.com. |
| `createTime` | `string (date-time)` | Yes | When the registry was created. |
| `description` | `string` | Yes | What the registry is for. |
| `google` | `RegistryGoogle` | No | For a registry of Artifact Registry: the service account kosem signs in as, without a key. |
| `google.provider` | `string` | Yes | The workload identity pool's provider that takes kosem's identity tokens, projects/{number}/locations/global/workloadIdentityPools/{pool}/providers/{provider}; kosem's tokens name it as their audience. |
| `google.serviceAccount` | `string` | Yes | The service account kosem acts as, which reads the repositories, such as kosem-pull@acme.iam.gserviceaccount.com. The provider's principals need Workload Identity User on it. |
| `lastPullTime` | `string (date-time)` | No | When an environment last pulled an image with the registry; unset until one has. |
| `name` | `string` | Yes | Resource name, organizations/{organization_id}/registries/{registry_id}, or projects/{project_id}/registries/{registry_id} for a project's own. |
| `prefix` | `string` | Yes | The images the registry covers: a host, and a path in it when it covers only part of it, such as ghcr.io/acme. kosem signs in with the registry of the longest prefix that covers an image's repository, among a project's own and those its organization shares with it, and of two of the same prefix, the project's own. Set when the registry is created, and never changed. |
| `state` | `string` | Yes | NOT_CONNECTED for a registry that has yet to sign in: one without a key until a check or a pull signs in with it, and one with a token that a check found refused before anything pulled with it. NEEDS_ATTENTION once the registry refused kosem's sign-in, until how it signs in changes or a check takes it. Values: `ACTIVE`, `NEEDS_ATTENTION`, `NOT_CONNECTED`. |
| `stateReason` | `string` | Yes | Why the registry needs attention, when it does. |
| `token` | `RegistryToken` | No | The username and the secret that kosem signs in with, unless it signs in without a key. |
| `token.secret` | `string` | Yes | The secret, of the registry's own organization or project, whose latest enabled version kosem signs in with. Not a dynamic secret. Choosing one takes what using it takes: secrets.versions.access on it. |
| `token.username` | `string` | Yes | The username kosem signs in as, such as a bot account's. |
| `trust` | `RegistryTrust` | No | For a registry that signs in without a key: what its cloud trusts, kosem's identity tokens for it. |
| `trust.attributeCondition` | `string` | No | For Google Cloud: the attribute condition a workload identity provider can take, which takes the identity tokens of this organization's registries, and of its projects' own, and no environment's. kosem's issuer is every customer's, so a provider without a condition trusts them all; each service account then lets one registry's subject act as it. |
| `trust.audience` | `string` | Yes | The audience of kosem's identity tokens for the registry. |
| `trust.issuer` | `string` | Yes | kosem's issuer of identity tokens, whose keys it publishes at /.well-known/jwks.json. |
| `trust.subject` | `string` | Yes | The subject of kosem's identity tokens for the registry: registry:{name}. Environments' own tokens have other subjects, so trusting it trusts no environment. |
| `updateTime` | `string (date-time)` | Yes | When the registry last changed. |
| `verification` | `RegistryVerification` | No | What VerifyRegistry last found, until how the registry signs in changes. |
| `verification.steps` | `RegistryVerifyStep[]` | Yes | The steps, in the order they run. |
| `verification.verifyTime` | `string (date-time)` | Yes | When it was checked. |

### default

Error

Base URL: `https://api.kosem.ai`. See [API conventions](https://docs.kosem.ai/reference/api-conventions.md) for authentication, pagination and errors, and [https://docs.kosem.ai/openapi.yaml](https://docs.kosem.ai/openapi.yaml) for the full OpenAPI document.