Preview a message
Previews a send without sending it. Use it to surface field-level errors and capability rewrites in a composer before anything reaches the customer.
Behavior
- Runs the identical accept pipeline as the send: the same validation,
chat gates,
degradedecision, and consent policy, but records nothing: no message id is minted, no idempotency claim is made, and noIdempotency-Keyis required. - A body this endpoint refuses, the send refuses with the same
codeandparam, except that asource_urlattachment is not fetched during preview. Its reachability, MIME, byte size and storage readiness are therefore send-time facts, and the preview returns the unresolved source form rather than anatt_id. Otherwise a body preview accepts is accepted by send, chat state permitting, since a preview cannot freeze the chat between the two calls.
Limits
- The per-message
wirefield is representative, never exact;wire_fidelitystates this in the response. Values resolved only at delivery are substituted or omitted: payment sessions and app identities appear as placeholders, image bytes are omitted, and a plain attachment message has nowireat all. Do not present it as the exact payload Apple will receive.
Query Parameters
Body ParametersJSON
How long the typing indicator runs before this message, in MILLISECONDS.
THE INDICATOR IS YOURS TO ASK FOR. We show one for exactly as long as you
request and never on our own, so this field is the whole control: absent
or 0 shows no indicator at all, and a positive value shows one for
precisely that long before the message reaches the customer.
OPTIONAL by contract, and absent means the same as 0: no indicator.
We recommend asking for about 1000 ms before each message you send, and
longer when the customer is about to wait on a lookup or a handoff, so
the pause reads as thinking rather than as a stall.
Bounded at 15000 (422 code 1096, which is also what a negative
value gets). The cap is derived from the budget one send attempt gets: a
longer indicator eats the time the message send itself needs, so the send
would be cut short and retried and the customer would watch a long
indicator followed by a late message or none.
Preview a message
curl https://messages.api.linqapp.com/v1/chats/$CHAT/messages/preview \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $LINQ_AMB_API_KEY" \
-d '{
"parts": [
{
"items": [
{
"id": "curb",
"label": "Curbside"
},
{
"id": "garage",
"label": "Garage level 2"
}
],
"summary_text": "Pickup options",
"type": "choices"
}
]
}'{
"chat_id": "chat_4f81b2",
"wire_fidelity": "representative",
"messages": [
{
"type": "choices",
"parts": [
{
"type": "choices",
"summary_text": "Pickup options",
"items": [
{
"id": "curb",
"label": "Curbside"
},
{
"id": "garage",
"label": "Garage level 2"
}
]
}
]
}
]
}Returns Examples
{
"chat_id": "chat_4f81b2",
"wire_fidelity": "representative",
"messages": [
{
"type": "choices",
"parts": [
{
"type": "choices",
"summary_text": "Pickup options",
"items": [
{
"id": "curb",
"label": "Curbside"
},
{
"id": "garage",
"label": "Garage level 2"
}
]
}
]
}
]
}