---
title: "Update Image Caption"
method: PUT
path: "/tailored-gen/datasets/{dataset_id}/images/{image_id}"
tags: ["Dataset"]
---

# Update Image Caption

`PUT /tailored-gen/datasets/{dataset_id}/images/{image_id}`

Update the caption of a specific image. Two mutually exclusive options:

1. **Provide a new caption**: Use the `caption` parameter (sets `caption_source` to "manual"). The caption must be a string containing a **valid JSON structure**.
2. **Regenerate automatically**: Set `regenerate_caption` to true (sets `caption_source` to "automatic").

**Constraints:**
* Cannot update captions in a completed dataset
* Cannot provide both caption and regenerate_caption

## Path parameters

- `dataset_id` integer, required
- `image_id` integer, required

## Headers

- `api_token` string, required

## Request body

- object
  - `caption` string — New caption text as a string containing valid JSON structure.
  - `regenerate_caption` boolean — When true, generates new caption automatically.

## Response `200`

Caption successfully updated

- object
  - `id` integer
  - `dataset_id` integer
  - `caption` string
  - `caption_source` 'automatic' | 'manual'
  - `image_name` string
  - `image_url` string
  - `thumbnail_url` string
  - `created_at` string, date-time
  - `updated_at` string, date-time

## Other responses

- `400` — Bad request (both parameters provided, or invalid JSON)
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Image or dataset not found
- `409` — Cannot update caption in a completed dataset
- `429` — Request limit exceeded.
- `500` — Internal server error

---

[API](https://skmtc.net/bria-ai/apis/tailored-generation-api-reference.md) · [All operations](https://skmtc.net/bria-ai/apis/tailored-generation-api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/bria-ai/tailored-generation-api-reference/revisions/806c6d31631b/schema)
