Skip to content

Webhook

All you need is a webhook: a URL that answers a POST. Paste it into the connect wizard and you're done. No secret to set up and no response format to learn: answer with plain text, or JSON, or nothing at all and reply later.

It works with n8n, Make, Zapier and Tasklet webhooks, a Supabase edge function, a Next.js route, a Cloudflare Worker, or a server on your laptop behind a tunnel.

Create a webhook line

In the wizard, paste the URL; we send it one test message and show what came back. With the API, a webhook_url and nothing else makes a webhook line:

curl -s -X POST "https://silverarrows.dev/v1/lines" \
  -H "Authorization: Bearer $SA_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name": "My Agent", "keyword": "MYHOOK", "webhook_url": "https://example.com/sms"}'

Then run the connection test (POST /v1/lines/:id/test). Nothing goes live until it passes.

What we send

One POST per text, JSON, with a 10 second timeout:

{
  "line_id": "line_8Hq2kVd0sPZx1mLw4TfR",
  "conversation_id": "conv_Q2m9VtX0aLr7Bc1nYp4e",
  "sender_id": "snd_3f9a1c0b7e2d4a6b8c1d2e3f",
  "message": { "id": "msg_a1", "body": "is this thing on", "media_urls": [], "received_at": "2026-10-05T18:02:10.000Z" },
  "history": [{ "direction": "in", "body": "hi", "at": "2026-10-05T18:01:00.000Z" }]
}

history is the conversation so far, oldest first, up to 20 messages ("in" is the texter, "out" is what we sent them). sender_id is a stable anonymous id for the texter; the phone number is only included (as phone) if you turn on "share phone number with my agent". If your users log in to your own app, phone login adds your account_id too. media_urls are photo links. It's the same payload as relay.

What you can answer

Your response What happens
200 with a plain-text body: Sure, we open at 9. We text it back.
JSON with a string in reply, text, message, output, response or answer (checked in that order): {"text": "Sure, we open at 9."} We text that string. [{"output": "…"}] (n8n's default) works too.
{"reply": "…", "request_schedule_consent": true} We text the reply, then the scheduled-texts opt-in prompt. See Async and scheduled.
An empty 200, {"reply": null}, or JSON without any of those keys ({"status": "ok"}) We send nothing now. Your agent can answer within 5 minutes with POST /v1/lines/:id/reply.
Anything not 2xx, an HTML page, or no answer within 10 seconds We text the line's fallback text ("Sorry, I'm having trouble right now…") and log the error.

We don't retry a webhook: automation platforms run a whole workflow per POST, and a retry could run it twice. (Relay lines get one retry, because relay endpoints dedupe on X-Arrow-Delivery.)

Replies are formatted like every other mode: markdown stripped, up to 320 characters per text (longer ones are cut or, if you raise the limit, split), plus "Reply STOP to opt out." on the first reply of the day and "Sent via Silver Arrows" on free lines.

Replying later

If your agent needs longer than 10 seconds, answer the POST straight away with nothing to say, then:

curl -s -X POST "https://silverarrows.dev/v1/lines/$LINE_ID/reply" \
  -H "Authorization: Bearer $SA_KEY" \
  -H "Content-Type: application/json" \
  -d '{"conversation_id": "conv_Q2m9VtX0aLr7Bc1nYp4e", "in_reply_to": "msg_a1", "body": "Sure, we open at 9."}'

in_reply_to is the message.id we sent you. The reply must arrive within 5 minutes of the text.

Checking the signature (optional)

Every POST carries X-Arrow-Signature: sha256=<hex HMAC-SHA256 of the raw body>, keyed with the line's webhook secret (shown once when you create the line; rotate it with {"rotate_webhook_secret": true}). In webhook mode, checking it is up to you. If your URL is public and its work costs money, check it: see Verify the signature for Node, Deno and Python.

Webhook or relay?

Webhook Relay
Setup Paste a URL Paste a URL, set the secret, verify every request
Response Plain text or almost any JSON {"reply": "…"} JSON, exactly
Signature check Optional Required (your endpoint must reject bad signatures)
Retry on timeout or 5xx No Once, with the same delivery id
Answer later Respond with nothing Respond {"reply": "__async__"}

The wizard picks relay for you when your endpoint already answers with {"reply": …}, and webhook otherwise. You can switch any time with PATCH /v1/lines/:id {"mode": "webhook"} or {"mode": "relay"}.

Texts that come from us

The opt-in confirmation, HELP reply and a few other texts come from Silver Arrows, not your webhook. You can make them yours, or have us fetch them from your webhook: see Customize what texters see.