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

# Update Image Caption

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

Update the caption of a specific image. There are two mutually exclusive ways to update a caption:

1. Provide a new caption text:
   * Use the `caption` parameter
   * This will set `caption_source` to "manual"
   * Reflects a human-written caption

2. Request automatic caption regeneration:
   * Set `regenerate_caption` to true
   * This will set `caption_source` to "automatic"
   * A new caption will be generated automatically based on the image and caption_prefix
   * For the same caption_prefix, regenerate_caption will always return the same caption
   * Useful for resetting captions or regenerating them after changing the caption_prefix

Note: You cannot provide both parameters simultaneously as they represent different update approaches.

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

## Path parameters

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

## Headers

- `api_token` string, required

## Request body

- object
  - `caption` string — New caption text. When provided, sets caption_source to "manual"
  - `regenerate_caption` boolean — When true, generates new caption automatically and sets caption_source to "automatic"

## Response `200`

Caption successfully updated

- object
  - `id` integer — Unique identifier for the image
  - `dataset_id` integer — ID of the dataset this image belongs to
  - `caption` string — Updated caption for the image
  - `caption_source` 'automatic' | 'manual' — Source of the updated caption
  - `image_name` string — Name of the image
  - `image_url` string — URL of the original image file
  - `thumbnail_url` string — URL of the image thumbnail
  - `created_at` string, date-time — Timestamp when the image was created
  - `updated_at` string, date-time — Timestamp when the image was last updated

## Other responses

- `400` — Bad request - Both caption and regenerate_caption provided
- `401` — Unauthorized
- `404` — Image or dataset not found
- `409` — Cannot update caption in a completed dataset
- `410` — Dataset deleted
- `429` — Request limit exceeded. Your account has reached its maximum allowed requests. Please upgrade your plan or try again later.
- `500` — Internal server error

---

[API](https://skmtc.net/bria-ai/apis/the-bria-api.md) · [All operations](https://skmtc.net/bria-ai/apis/the-bria-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/bria-ai/the-bria-api/versions/2768230345a5/schema)
