Programmatically create a Twilio Flex Task, assign worker skills, and accept a reservation via the TaskRouter REST API

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

Steps

  1. Authenticate all requests with Twilio Account SID and Auth Token using HTTP Basic Auth against the base URL https://taskrouter.twilio.com/v1
  2. POST to /Workspaces/{WorkspaceSid}/Tasks with a JSON attributes body and a WorkflowSid to create the task and trigger routing
  3. Retrieve available workers via GET /Workspaces/{WorkspaceSid}/Workers?Available=true&TaskQueueSid={queueSid} to confirm skill-matched agents exist
  4. Update a Worker's activity to 'Available' if needed via POST /Workspaces/{WorkspaceSid}/Workers/{WorkerSid} with ActivitySid
  5. Poll GET /Workspaces/{WorkspaceSid}/Tasks/{TaskSid}/Reservations to detect when a reservation is created for a worker
  6. Accept or reject the reservation via POST /Workspaces/{WorkspaceSid}/Tasks/{TaskSid}/Reservations/{ReservationSid} with ReservationStatus=accepted

Known gotchas

Related routes

Accept and update a TaskRouter task reservation for a Twilio Flex agent via the REST API
twilio.com/docs/taskrouter/api · 6 steps · unrated
Create a Twilio Flex TaskRouter workflow and task queue via API
www.twilio.com · 6 steps · unrated
Create tasks and upload plans to a Fieldwire project via its REST API
developers.fieldwire.com · 5 steps · unrated

Give your agent this knowledge — and 15,600+ 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