# Update image in organization

`PATCH /v1/organizations/{organization}/images/{image}`, operation `environments.UpdateImageInOrganization`

Changes an image's display name, the projects an organization's image is shared with, whether it follows its tag, or how many versions it keeps.

## Parameters

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

## Request body

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

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `availability` | `Availability` | No | For an organization's image: the projects whose environments use it. Changing it also takes environments.images.setAvailability, and applies from their next starts. |
| `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. |
| `displayName` | `string` | No | What people call the image. |
| `followTag` | `boolean` | No | Whether kosem resolves its tag again every hour. |
| `keepVersions` | `integer (int32)` | No | How many of its newest versions it keeps, from 1 to 10. Lowering it deletes the older ones that no environment runs. |

## Responses

### 200

OK

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `availability` | `Availability` | Yes | For an organization's image: the projects whose environments use it. A project's image is available to 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. |
| `checkTime` | `string (date-time)` | No | When kosem last resolved its source; unset until it has. |
| `createTime` | `string (date-time)` | Yes | When the image was created. |
| `displayName` | `string` | Yes | What people call the image. |
| `followTag` | `boolean` | Yes | Whether kosem resolves its tag again every hour, as RefreshImage does, so that it prepares each new version. A source named by a digest never moves. |
| `keepVersions` | `integer (int32)` | Yes | How many of its newest versions it keeps. An older one is deleted once no environment runs it. |
| `name` | `string` | Yes | Resource name, organizations/{organization_id}/images/{image_id} or projects/{project_id}/images/{image_id}. |
| `refreshReason` | `string` | Yes | Why kosem's last check of its tag couldn't refresh it, which leaves it as it was; empty once a check can. |
| `registry` | `string` | No | The registry that kosem signs in with to pull it, when it's private. |
| `source` | `string` | Yes | The image's reference, with a tag or a digest, in its shortest spelling, such as node:24 for docker.io/library/node:24. Set when the image is created, and never changed. |
| `state` | `string` | Yes | PREPARING until its latest version is ready to run, READY once it is, and FAILED if kosem can't prepare it. Values: `PREPARING`, `READY`, `FAILED`. |
| `stateReason` | `string` | Yes | Why kosem can't prepare it, when it can't. |
| `updateTime` | `string (date-time)` | Yes | When the image last changed. |
| `versions` | `ImageVersion[]` | Yes | What its source named each time it was resolved, newest first. |

### 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.