Skip to main content
POST
Generate or improve reply

Authorizations

X-API-Key
string
header
required

API Key for authentication

Path Parameters

connectionId
string
required

Body

application/json
connectionId
string<uuid>
required

Conversation (connection) ID the action addresses.

mode
enum<string>
required

Generate writes a fresh reply; Improve rewrites the current reply text and requires instructions.

Available options:
Generate,
Improve
instructions
string

Plain-text direction: optional for Generate, required for Improve.

Required string length: 1 - 1250
campaignId
string<uuid>

One-call Voice source: an updatable campaign in this workspace belonging to the conversation owner. Does not reassign the prospect. Omit for implicit selection, which may differ from the recommendation.

Response

status
string
required

Response status

Allowed value: "success"
data
object
required

Generated reply on success. Generate without instructions may decline with needs_human: final_message, open_promise, call_outcome, missing_info, inappropriate_context or other. No new draft text is saved. The tool error (or batch item.error.message, with no item) says Reply not generated and includes the reason and model explanation. Show these to the user; generate with instructions reflecting the user's direction only if the user asks to write anyway. Do not retry uninstructed generation to bypass the refusal.

message
string
required

Success message

Example:

"Operation completed successfully"