---
title: "Refine an existing X (Twitter) post"
method: POST
path: "/x/refine"
tags: ["X"]
---

# Refine an existing X (Twitter) post

`POST /x/refine`

Refines an existing tweet based on user instructions while maintaining context. Costs 1 credit. Can update the tweet text and any associated data tables or charts.

## Request body

- object
  - `tweetId` string, required — The unique ID of the tweet to refine
  - `prompt` string — Instructions for how to refine the tweet
  - `promptAudioUrl` string — URL to an audio file to transcribe and use as refinement instructions. Required if prompt is not provided.

## Response `200`

Tweet refined successfully

- object
  - `success` boolean
  - `post` object
    - `id` string — The unique ID of the refined tweet
    - `requestId` string — The original request ID
    - `result` string — The refined tweet text
    - `type` string — The post type
    - `order` integer — Order in thread (0 for single tweets)
    - `createdOn` string, date-time — Original creation date
    - `tweetImageUrl` string, nullable — Main image for the tweet if present
    - `dataTableImageUrl` string, nullable — URL to updated data table image if present
    - `barChartImageUrl` string, nullable — URL to updated bar chart image if present

## Other responses

- `400` — Bad request - validation error or insufficient credits
- `401` — Unauthorized - invalid or missing token
- `404` — Tweet not found or unauthorized
- `500` — Internal server error

---

[API](https://skmtc.net/autocontentapi/apis/content-api.md) · [All operations](https://skmtc.net/autocontentapi/apis/content-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/autocontentapi/content-api/revisions/355890b6b4cc/schema)
