Skip to content

Route and organise tickets

When your own system knows who should handle a ticket, for example from the customer’s account manager in your CRM or from the product the ticket is about, it can route the ticket in Replyco. You look up your agents and assign tickets to one of them, label tickets with folders, and snooze tickets that cannot be answered before a certain date.

Requirement Where to get it
An access token Sign in as a Replyco user of your company; see Authentication.
The ids of the tickets to route From the ticket list; see Answer tickets from your own system.
The base URL https://open-api.replyco.com
  1. Look up your agents.
  2. Assign tickets to an agent.
  3. Look up your folders (optional).
  4. Put tickets in folders (optional).
  5. Snooze a ticket (optional).
sequenceDiagram
  participant app as Your app
  participant api as Replyco API
  app->>api: GET /openapi/user/id_name
  api-->>app: Look up your agents
  app->>api: POST /openapi/thread/assignuser
  api-->>app: Assign tickets to an agent
  opt Look up your folders
    app->>api: GET /openapi/folder
    api-->>app: Look up your folders
  end
  opt Put tickets in folders
    app->>api: POST /openapi/folderthreads/assignfolderstothreads
    api-->>app: Put tickets in folders
  end
  opt Snooze a ticket
    app->>api: POST /openapi/thread/snoozethread
    api-->>app: Snooze a ticket
  end

Call GET /openapi/user/id_name.

Terminal window
curl https://open-api.replyco.com/openapi/user/id_name -H "Authorization: Bearer $ACCESS_TOKEN"

The response is a JSON object with one entry per user of your company: the key is the user’s id and the value their full name, for example {"9b3e5f17-2c8d-4a6e-b1f9-7e4d2c6a8b53": "Priya Patel"}. Match the names to the people in your system once and keep the ids.

Call POST /openapi/thread/assignuser with the agent’s id in userId and the tickets in threadsIds.

Terminal window
curl -X POST https://open-api.replyco.com/openapi/thread/assignuser \
-H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" \
-d '{"userId": "9b3e5f17-2c8d-4a6e-b1f9-7e4d2c6a8b53", "threadsIds": ["7d2e9b14-5c3a-4f61-9a8e-2b6c0d4e1f37", "b2f8d4a1-6e3c-4b9f-8d7a-5a1c3e9f2b64"]}'
{
"userId": "9b3e5f17-2c8d-4a6e-b1f9-7e4d2c6a8b53",
"threadsIds": ["7d2e9b14-5c3a-4f61-9a8e-2b6c0d4e1f37", "b2f8d4a1-6e3c-4b9f-8d7a-5a1c3e9f2b64"]
}

The agent replaces whoever had the tickets before, and is notified unless they are the user you sign in as. To unassign tickets, send 00000000-0000-0000-0000-000000000000 as userId. Each change is recorded in the ticket’s history.

Skip this step and step 4 when you do not label tickets. Otherwise call GET /openapi/folder: it lists the folders of the user you sign in as, each with its id and name.

Terminal window
curl https://open-api.replyco.com/openapi/folder -H "Authorization: Bearer $ACCESS_TOKEN"
[
{ "id": "8a4c2e6f-1b9d-4e7a-b3c5-6f2d8a1e9c47", "name": "Returns" },
{ "id": "d5b9e3a7-2c6f-4d1b-8e4a-7f3c1b9d6e52", "name": "VIP customers" }
]

Call POST /openapi/folderthreads/assignfolderstothreads with one entry per folder and ticket.

Terminal window
curl -X POST https://open-api.replyco.com/openapi/folderthreads/assignfolderstothreads \
-H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" \
-d '[{"folderId": "8a4c2e6f-1b9d-4e7a-b3c5-6f2d8a1e9c47", "threadId": "7d2e9b14-5c3a-4f61-9a8e-2b6c0d4e1f37"}]'
[
{ "folderId": "8a4c2e6f-1b9d-4e7a-b3c5-6f2d8a1e9c47", "threadId": "7d2e9b14-5c3a-4f61-9a8e-2b6c0d4e1f37" },
{ "folderId": "d5b9e3a7-2c6f-4d1b-8e4a-7f3c1b9d6e52", "threadId": "7d2e9b14-5c3a-4f61-9a8e-2b6c0d4e1f37" }
]

The folders are added to the ticket’s folders; the folders it already had stay. A ticket that is already in a folder is left as it is, so you can send the same call again safely.

Call POST /openapi/thread/snoozethread with the ticket and the time it should come back, in UTC.

Terminal window
curl -X POST https://open-api.replyco.com/openapi/thread/snoozethread \
-H "Authorization: Bearer $ACCESS_TOKEN" -H "Content-Type: application/json" \
-d '{"threadId": "b2f8d4a1-6e3c-4b9f-8d7a-5a1c3e9f2b64", "snoozeUntil": "2026-10-28T09:00:00Z"}'
{ "threadId": "b2f8d4a1-6e3c-4b9f-8d7a-5a1c3e9f2b64", "snoozeUntil": "2026-10-28T09:00:00Z" }

The ticket leaves the active lists until that time, then comes back by itself. A reply sent on the ticket also ends the snooze. Send snoozeUntil: null to bring the ticket back now.

Step Status Meaning What to do
any 401 The access token is missing or has expired. Refresh the token; see Authentication.
any 429 Too many calls to this operation. Slow down; see Rate limits.
2 404 No user or no ticket with one of the ids. Use an id from step 1 and ticket ids from the ticket list.
4 404 No folder or no ticket with one of the ids. Use folder ids from step 3. Entries before the failing one are already applied; send the corrected call again.