Skip to content
Linq Copy agent prompt
Getting Started

Quickstart

Send your first WhatsApp message and observe its outcome.

Your Linq contact gives you an API key during onboarding.

Terminal window
export BASE_URL="https://whatsapp.messages.api.linqapp.com"
export API_KEY="sk_live_…" # use the exact key issued to you

The OpenAPI document and individual message-part schemas are public:

Terminal window
curl -s "$BASE_URL/v1/openapi.yaml" -o openapi.yaml
curl -s "$BASE_URL/v1/parts/text" | jq .

Open the stream before sending so you see each transition:

Terminal window
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.

POST /v1/messages lets Linq select the eligible line and chat for a destination. Supply an idempotency key for every logical send.

Terminal window
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.

Resume SSE with Last-Event-ID, or page the same durable account sequence:

Terminal window
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.