---
title: "Rewrite an existing caption"
method: POST
path: "/ai/captions/refine"
tags: ["AI"]
---

# Rewrite an existing caption

`POST /ai/captions/refine`

## Request

- Base URL: `https://post.adaptlypost.com/post/api/v1`
- URL: `https://post.adaptlypost.com/post/api/v1/ai/captions/refine`
- Auth: HTTP bearer

Rewrites `originalText` following the instruction in `prompt`. Send `partialText` to continue from a partly written caption. Costs the same as generating one.. Requires the `ai.generate` permission.

## Headers

- `X-Workspace-Id` string

## Request body

- RefineCaptionRequest
  - `prompt` string, required: How the caption should change
  - `platform` 'TWITTER' | 'BLUESKY' | 'MASTODON' | 'THREADS' | 'PINTEREST' | 'INSTAGRAM' | 'TIKTOK' | 'LINKEDIN' | 'YOUTUBE' | 'FACEBOOK' | 'GOOGLE_BUSINESS' | 'TUMBLR': Holds the caption to this platform's character limit
  - `originalText` string, required: The caption to rewrite
  - `partialText` string: A partly written caption to continue from

## Response `201`

Rewritten caption

- CaptionResponse
  - `caption` string

## Other responses

- `400`: Validation error
- `401`: Invalid or missing API key
- `402`: Insufficient credits
- `403`: The key's role does not hold `ai.generate`
- `429`: Rate limit exceeded

---

[API](https://skmtc.dev/adaptlypost/apis/adaptlypost-public-api.md) · [All operations](https://skmtc.dev/adaptlypost/apis/adaptlypost-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/adaptlypost/apis/adaptlypost-public-api/revisions/8390a5fa9a0d?raw)
