Skip to main content
POST
Send a message

Authorizations

Authorization
string
header
required

An API key (onx_sk_…) created in OnlyX under Settings → API & MCP, or an OAuth access token (onx_at_…) issued to a connected app. Send it as Authorization: Bearer <credential>. API keys may also be sent as X-API-Key: <key>.

Headers

Idempotency-Key
string
required

Required. A new unique value per new request (8 to 64 letters, digits, - or _; a UUID is ideal). If the request times out or fails with a 5xx, retry with the SAME key: you get the original response (with Idempotent-Replayed: true) and nothing is done twice. Keys are kept for 24 hours. Without it the answer is 400 IDEMPOTENCY_KEY_REQUIRED.

Required string length: 8 - 64
Pattern: ^[A-Za-z0-9_-]{8,64}$

Path Parameters

conversationId
string
required

The conversation id (cnv_…), from GET /v1/conversations.

Maximum string length: 40

Body

application/json
mediaIds
string[]

Up to 20 vault media ids locked behind priceCents. Requires a price of at least 300 cents.

Maximum array length: 20
Pattern: ^\d{1,25}$
previewMediaIds
string[]

Up to 20 vault media ids the fan receives free and unlocked. On a paid message these are the teaser.

Maximum array length: 20
Pattern: ^\d{1,25}$
priceCents
integer
default:0

The unlock price in cents: 0 (free) or 300 to 500000 ($3.00 to $5,000.00). A price requires mediaIds.

Required range: 0 <= x <= 500000
text
string
default:""

The message text, up to 4,000 characters. Optional when media is attached.

Maximum string length: 4000

Response

Accepted: the message, with its delivery status.

conversationId
string
required

The conversation it belongs to.

createdAt
string | null
required

When the message was sent (or, for a queued send, accepted).

delivery
Delivery · object | null
required

Delivery of an outgoing message. null for incoming messages.

direction
enum<string>
required

in from the fan, out to the fan.

Available options:
in,
out
id
string
required

The message id (msg_…).

media
MessageMedia · object[]
required

Media attached to the message.

paid
Paid · object | null
required

Set on a paid message, otherwise null.

sender
enum<string>
required

Who wrote it: the fan, the AI chatter, or your team (including anything sent through the API).

Available options:
fan,
ai,
team
text
string
required

The message text. May be empty when the message is media only.

tipCents
integer | null
required

A tip that came with this message, in cents, or null.