---
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}`

## Request

- Base URL: `https://engine.prod.bria-api.com/v1`
- URL: `https://engine.prod.bria-api.com/v1/tailored-gen/datasets/{dataset_id}/images/{image_id}`
- Auth: none declared. Required headers: `api_token`

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

## Changes

- **2026-07-13** `2768230345a5`: 1 info
  - endpoint added
- **2021-07-29** `817f5bbbd013`: 1 breaking
  - api path removed without deprecation

[Operation history](https://skmtc.dev/bria-ai/apis/the-bria-api/changes/tailored-gen/datasets/:dataset_id/images/:image_id/put.md)

---

[API](https://skmtc.dev/bria-ai/apis/the-bria-api.md) · [All operations](https://skmtc.dev/bria-ai/apis/the-bria-api/llms.txt) · [OpenAPI document](https://skmtc.dev/bria-ai/apis/the-bria-api/revisions/2768230345a5?raw)
