Accept and update a TaskRouter task reservation for a Twilio Flex agent via the REST API

domain: twilio.com/docs/taskrouter/api · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. When TaskRouter creates a reservation for a task-worker match, receive the assignment callback HTTP request at your server; it contains the WorkspaceSid, TaskSid, ReservationSid, and worker details.
  2. To programmatically accept the reservation, send a POST to /v1/Workspaces/{WorkspaceSid}/Tasks/{TaskSid}/Reservations/{ReservationSid} with the body parameter ReservationStatus=accepted.
  3. To update task attributes (e.g., add context such as CRM data before the agent sees the task), PATCH the Task resource at /v1/Workspaces/{WorkspaceSid}/Tasks/{TaskSid} with an Attributes JSON string.
  4. To reassign or redirect, set ReservationStatus=redirected (voice) or call=conference on the reservation with the appropriate target; for non-voice channels, update the assignment callback response with an appropriate instruction.
  5. Handle reservation timeouts by monitoring for the reservation.timeout event in your webhook; when triggered, decide whether to re-queue or escalate.
  6. After the interaction is complete, update the task to ReservationStatus=completed or wrapping so TaskRouter transitions it through the end-of-task lifecycle correctly.

Known gotchas

Related routes

Programmatically create a Twilio Flex Task, assign worker skills, and accept a reservation via the TaskRouter REST API
twilio.com/docs/flex/routing/api · 6 steps · unrated
Create a Twilio Flex TaskRouter workflow and task queue via API
www.twilio.com · 6 steps · unrated
Read and deploy Twilio Flex plugin versions and configurations via the Plugins API
twilio.com/docs/flex/developer/plugins/api · 6 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans