Skip to content

Tasklet

Give a Tasklet agent a phone number: we POST each text to the agent's webhook trigger, and the agent answers by calling our reply endpoint.

Set it up

Paste it into your Tasklet agent. Your agent builds and connects everything itself, and this box turns green when it's done.

Or: already running? Paste its URL

Doing it by hand

Tasklet lines use webhook mode: paste the trigger URL, nothing else to set up.

Tasklet agents run asynchronously, so they answer via POST /v1/lines/:id/reply, within 5 minutes of the text arriving.

Fastest: let the agent set itself up (1 step)

In the connect wizard, choose Let your agent set it up → Tasklet, copy the prompt and paste it into your Tasklet agent. That's it. The agent adds a webhook trigger, connects it, and gets a reply key for this line during setup (it saves it as ARROW_API_KEY). You never create or paste a key. The wizard turns green when the line is live; then text your keyword to the number to try it.

The key only works for this line's replies and scheduled sends. It shows up under Account → API keys, where you can revoke it. Details: Let your agent set it up.

By hand

1. Add a webhook trigger in Tasklet (2 minutes)

In your Tasklet agent, add a webhook trigger and copy its URL.

2. Paste the URL into Silver Arrows (2 minutes)

Paste it into the connect wizard. Tasklet acknowledges the trigger without a reply, which webhook mode reads as "the answer comes later". Or with the API:

curl -s -X POST "https://silverarrows.dev/v1/lines" \
  -H "Authorization: Bearer $SA_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "My Tasklet Agent",
    "keyword": "TASKY",
    "webhook_url": "https://<your tasklet webhook trigger URL>"
  }'

Note the line id (line_...) from the response.

3. Give the agent your API key (1 minute)

Create an API key at /account and add it to the agent as a secret or connection it can use for HTTP requests (call it ARROW_API_KEY).

4. Add these instructions to the agent (2 minutes)

Paste this into the agent's instructions. Replace <LINE_ID> with your line id.

You receive text messages from people through Silver Arrows. Each one arrives on your webhook trigger as JSON:
{"line_id", "conversation_id", "sender_id", "message": {"id", "body", "media_urls", "received_at"}, "history": [{"direction": "in" | "out", "body", "at"}]}
"message.body" is what they just texted. "history" is the conversation so far, oldest first ("in" is them, "out" is what was sent to them). "sender_id" is a stable anonymous id for this person. "media_urls" are photo links.

To answer, make one HTTP request within 5 minutes:
POST https://silverarrows.dev/v1/lines/<LINE_ID>/reply
Headers: Authorization: Bearer <ARROW_API_KEY>, Content-Type: application/json
Body: {"conversation_id": "<conversation_id from the webhook>", "body": "<your reply>", "in_reply_to": "<message.id from the webhook>"}

Reply rules: one reply per message, plain text, no markdown, under 300 characters. You are an AI; say so if asked. No marketing or promotions. If someone describes an emergency, tell them to call 911.

Recurring messages: only if the person asks for something recurring (for example "text me every morning"), after your reply, make this request once:
POST https://silverarrows.dev/v1/lines/<LINE_ID>/request_schedule_consent
Body: {"conversation_id": "<conversation_id>", "in_reply_to": "<message.id>"}
Silver Arrows then texts them a prompt to reply YES. Tell them to watch for it. Never call this unless they asked.

Sending the scheduled message: when your schedule runs, for each person you're sending to, POST https://silverarrows.dev/v1/lines/<LINE_ID>/send with {"conversation_id": "<their conversation_id>", "body": "<the message>"}. At most once per person per calendar day. If it returns 403, read error.code: "no_consent" means they never said YES, "daily_limit" means they already got one today, "paused" means they paused, "opted_out" means they texted STOP. In every case, don't retry; skip that person. To see who is opted in, GET https://silverarrows.dev/v1/lines/<LINE_ID>/schedule_consents and use the entries with status "active".

5. Test it (1 minute)

Text your keyword to the number, then send a question. You should see the Tasklet run start, and the reply land on your phone a few seconds later.

Daily messages with a Tasklet schedule

We never run a schedule for you. Add a scheduled trigger to the same agent (for example "every day at 8am") whose task is: list active consents, write each person's message, and call /send once for each. The instructions above already tell the agent how. Full rules: Async and scheduled.

Troubleshooting

  • 403 outside_reply_window: the agent took longer than 5 minutes, or didn't pass in_reply_to.
  • Nothing arrives and no Tasklet run started: check the webhook URL on the line's dashboard and re-run the connection test.
  • Signature: Tasklet triggers usually don't let you verify X-Arrow-Signature. Keep the webhook URL private; anyone with it could start a run, but they can't send texts without your API key.