# Refresh image in project

`POST /v1/projects/{project}/images/{image}/refresh`, operation `environments.RefreshImageInProject`

Resolves an image's source again, and prepares what it names now, if that is new.

kosem does this itself every hour for an image that follows its tag. Environments keep the version they run until they're reset.

## Parameters

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

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