> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.taigabilling.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.taigabilling.com/_mcp/server.

# Pre Encounter Images V 1 Update

PUT https://api.taigabilling.com/images/v1/{id}/{version}
Content-Type: application/json

Updates an Image. The path must contain the version being written, which is the object's current version plus 1 (a create returns version 0, so the first update uses 1). Sending the current version returns 409 Version conflict. Use this to set status to UPLOADED once the file has been PUT to the signed_url from the create.

Reference: https://docs.taigabilling.com/api-reference/pre-encounter-images-v-1/pre-encounter-images-v-1-update

## Authentication

- `Authorization` header (bearer token, required) — Send your Taiga API key as a Bearer token. Create and manage keys in the Taiga developer portal.

## Servers

- `https://api.taigabilling.com` (Production, default)
- `https://api-staging.taigabilling.com` (Staging)

## Request

### Path parameters

- `id` (string, required) — The unique identifier for an Image
- `version` (string, required)

### Body (application/json)

This endpoint expects a pre-encounterimagesv1MutableImage.

- `file_name` (string, required)
- `display_name` (string, required)
- `file_type` (string, required)
- `status` (enum, required)
  - Allowed values: `PENDING`, `UPLOADED`, `FAILED`
- `coverage` (pre-encounterimagesv1CoverageAssociation, optional, nullable) — An association to a Coverage.
- `patient` (pre-encounterimagesv1PatientAssociation, optional, nullable) — An association to a Patient.

## Response

### 200

- `deactivated` (boolean, required) — True if the object is deactivated. Deactivated objects are not returned in search results but are returned in all other endpoints including scan.
- `display_name` (string, required)
- `file_name` (string, required)
- `file_type` (string, required)
- `id` (string, required) — The unique identifier for an Image
- `organization_id` (string, required) — The organization that owns this object.
- `signed_url` (string, required) — A signed URL to the image. This url can be used to upload an image to GCP storage or to read the image contents.
- `status` (enum, required)
  - Allowed values: `PENDING`, `UPLOADED`, `FAILED`
- `updated_at` (datetime, required)
- `updating_user_id` (string, required) — The user ID of the user who last updated the object.
- `version` (integer, required) — The version of the object. Any update to any property of an object object will create a new version.
- `coverage` (pre-encounterimagesv1CoverageAssociation, optional, nullable) — An association to a Coverage.
- `patient` (pre-encounterimagesv1PatientAssociation, optional, nullable) — An association to a Patient.

## Errors

### 404 Not Found Error

- `PreEncounter_images_v1_updateRequestNotFoundError`
  - PreEncounterImagesV1UpdateRequestNotFoundError0

### 409 Conflict Error

- `PreEncounter_images_v1_updateRequestConflictError`
  - PreEncounterImagesV1UpdateRequestConflictError0

## Types

### pre-encounterimagesv1CoverageAssociation

An association to a Coverage.

- `id` (string, required) — The unique identifier for a Coverage in the database
- `side` (enum, required)
  - Allowed values: `FRONT`, `BACK`

### pre-encounterimagesv1PatientAssociation

An association to a Patient.

- `id` (string, required) — The unique identifier for a Patient
- `notes` (string, optional, nullable)

### PreEncounterImagesV1UpdateRequestNotFoundError0

- `errorName` (enum, optional)
  - Allowed values: `VersionConflictError`
- `content` (pre-encounterErrorBase4xx, optional)

### PreEncounterImagesV1UpdateRequestConflictError0

- `errorName` (enum, optional)
  - Allowed values: `VersionConflictError`
- `content` (pre-encounterVersionConflictErrorBody, optional)

### pre-encounterErrorBase4xx

- `message` (string, required)
- `data` (any, optional, nullable)

### pre-encounterVersionConflictErrorBody

- `message` (string, required)
- `data` (any, optional, nullable)
- `latest_version` (integer, optional, nullable)

## Examples

**Request**

```json
{
  "file_name": "string",
  "display_name": "string",
  "file_type": "string",
  "status": "PENDING"
}
```

**Response**

```json
{
  "deactivated": true,
  "display_name": "string",
  "file_name": "string",
  "file_type": "string",
  "id": "string",
  "organization_id": "string",
  "signed_url": "string",
  "status": "PENDING",
  "updated_at": "2024-01-15T09:30:00Z",
  "updating_user_id": "string",
  "version": 1,
  "coverage": {
    "id": "string",
    "side": "FRONT"
  },
  "patient": {
    "id": "string",
    "notes": "string"
  }
}
```

**SDK Code**

```python
import requests

url = "https://api.taigabilling.com/images/v1/id/version"

payload = {
    "file_name": "string",
    "display_name": "string",
    "file_type": "string",
    "status": "PENDING"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```