Quickstart
Send your first WhatsApp message and observe its outcome.
Your Linq contact gives you an API key during onboarding.
export BASE_URL="https://whatsapp.messages.api.linqapp.com"export API_KEY="sk_live_…" # use the exact key issued to you1. Fetch the contract
Section titled “1. Fetch the contract”The OpenAPI document and individual message-part schemas are public:
curl -s "$BASE_URL/v1/openapi.yaml" -o openapi.yamlcurl -s "$BASE_URL/v1/parts/text" | jq .2. Start the event stream
Section titled “2. Start the event stream”Open the stream before sending so you see each transition:
curl -N \ -H "Authorization: Bearer $API_KEY" \ "$BASE_URL/v1/streams/events"Persist each SSE id as a resume cursor. The event envelope contains the chat
and the range that moved, not message content; read content from the chat
journal. Unknown event kinds must be ignored so additive events do not break
your consumer.
3. Send a message
Section titled “3. Send a message”POST /v1/messages lets Linq select the eligible line
and chat for a destination. Supply an idempotency key for every logical send.
curl -sS -X POST "$BASE_URL/v1/messages" \ -H "Authorization: Bearer $API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: first-message-001" \ -d '{ "to": "+15551234567", "parts": [{"type": "text", "body": "Hello from Linq"}] }' | jq .HTTP 202 means the send is durably accepted. It does not mean delivered.
Watch for message.delivered, message.read, or message.failed, then read the
addressed range from GET /v1/chats/{chat}/events.
4. Recover after a disconnect
Section titled “4. Recover after a disconnect”Resume SSE with Last-Event-ID, or page the same durable account sequence:
curl -sS \ -H "Authorization: Bearer $API_KEY" \ "$BASE_URL/v1/event_log?limit=100" | jq .Use the response’s opaque next_cursor on the next request. Keep account-event
cursors separate from per-chat sequence cursors.
Next, read Sending messages and Events and recovery.