# Preview an AI-composed message

### Preview an AI-composed message

`POST /api/v1/compose`

Operation ID: `composePreview`

identity accepts the same forms as leads: a LinkedIn public identifier, /in/ path, profile URL, or user id; or an Instagram username, @handle, or profile URL.

**Request body** (required)

- `channel` ("linkedin" | "instagram", required)
- `connectedAccountId` (string · uuid, required)
- `identity` (string, required): LinkedIn public identifier, /in/ path, profile URL, or user id (ACoAAA…); or Instagram username, @handle, or profile URL. Stored as the identifier.
- `prompt` (string, required)
- `context` ("profile" | "posts" | "conversation" | "lead_properties"[], optional)
- `maxChars` (integer, optional)
- `leadProperties` (object, optional)

**200**: Generated text and compose metadata.

- `text` (string, required)
- `meta` (object, required)
  - `contextUsed` (object[], required)
  - `generatedAt` (string · date-time, required)
- `channelCalls` (integer, required)
- `remainingBudget` (object, required)
- `requestId` (string · uuid, required): Id of this request, for support and troubleshooting

**Errors**

- `400`: Bad request
- `401`: Unauthorized: missing or invalid API key
- `403`: Forbidden
- `404`: Not found
- `422`: Invalid request payload
