API reference
Numbers
Phone numbers and playbook assignments
| Method | Path | Summary |
|---|---|---|
GET | /v1/account/direct-lines | Reps' direct lines: numbers that ring one rep first, then the agent |
GET | /v1/account/numbers | The account's phone numbers with their group and what they run |
GET | /v1/account/numbers/available | Local numbers you can buy, by area code (owner of a self-serve account with a card) |
POST | /v1/account/numbers/buy | Buy a number and place it in a community (owner of a self-serve account with a card, within the plan’s limit) |
GET | /v1/account/numbers/self-serve | Whether the owner can buy a number now, and how many the plan allows |
PATCH | /v1/account/numbers/{numberId} | Rename a number (the label your team sees next to it), or say whether the test number rings your team on test calls |
PUT | /v1/account/numbers/{numberId}/assignment | Point a number at a playbook: pinned to a version or following the latest publish. Its schedule, if it has one, is kept |
GET | /v1/account/numbers/{numberId}/assignments | What this number ran and when, newest first |
PUT | /v1/account/numbers/{numberId}/direct-line | Make a number a rep's direct line: every part of its schedule rings them first, then its playbook |
DELETE | /v1/account/numbers/{numberId}/direct-line | Stop a number being a rep’s direct line: the agent answers it straight away again |
PUT | /v1/account/numbers/{numberId}/group | Place a number in one of your groups, move it to another, or leave it unplaced |
PUT | /v1/account/numbers/{numberId}/routing | Save a number's whole schedule: what it runs at all other times, and each holiday, closure or weekly window that runs another playbook |
GET | /v1/account/numbers/{numberId}/routing/preview | What a call to this number would do at a moment: which part of the schedule answers, who would ring and when, and who would be skipped and why |
Reps' direct lines: numbers that ring one rep first, then the agent#
GET /v1/account/direct-lines
Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token). Bearer token: Authorization: Bearer <token> (An API token (ans_pat_ or ans_svc_). Only routes that list a scope here accept one, and only with that scope.).
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
canRing | boolean | Yes | — |
directLines | array<DirectLine> | Yes | — |
directLines[].e164 | string | Yes | — |
directLines[].groupId | string (grp_… ID) | Yes | ID (grp_…) |
directLines[].label | string | null | Yes | — |
directLines[].phoneNumberId | string (pn_… ID) | Yes | ID (pn_…) |
directLines[].ringGroupId | string (rgp_… ID) | Yes | ID (rgp_…) |
directLines[].ringSeconds | integer | Yes | — |
directLines[].userId | string (usr_… ID) | Yes | ID (usr_…) |
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
curl -X GET "$ANSWERSTACK_API_URL/v1/account/direct-lines" \
-H "Authorization: Bearer $ACCESS_TOKEN"The account's phone numbers with their group and what they run#
GET /v1/account/numbers
Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
numbers | array<PhoneNumber> | Yes | — |
numbers[].assignment | any | null | Yes | — |
numbers[].closures | array<object> | Yes | — |
numbers[].closures[].from | string (date) | Yes | — |
numbers[].closures[].hours | object | null | Yes | — |
numbers[].closures[].hours.end | string | constant | Yes | — |
numbers[].closures[].hours.start | string | Yes | Pattern: ^([01]\d|2[0-3]):[0-5]\d$. |
numbers[].closures[].id | string | Yes | 1–64 characters. Pattern: ^[a-z0-9][a-z0-9_-]*$. |
numbers[].closures[].name | string | Yes | 1–60 characters. |
numbers[].closures[].to | string (date) | Yes | — |
numbers[].e164 | string | Yes | — |
numbers[].groupId | string (grp_… ID) | null | Yes | — |
numbers[].groupName | string | null | Yes | — |
numbers[].id | string (pn_… ID) | Yes | ID (pn_…) |
numbers[].isTest | boolean | Yes | — |
numbers[].label | string | null | Yes | — |
numbers[].status | enum | Yes | One of: "active", "released". |
numbers[].testRingsTeam | boolean | Yes | — |
numbers[].timeZone | string | null | Yes | — |
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
curl -X GET "$ANSWERSTACK_API_URL/v1/account/numbers" \
-H "Authorization: Bearer $ACCESS_TOKEN"Local numbers you can buy, by area code (owner of a self-serve account with a card)#
GET /v1/account/numbers/available
Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
areaCode | string | Yes | Pattern: ^\d\{3\}$. |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
numbers | array<AvailableNumber> | Yes | — |
numbers[].e164 | string | Yes | — |
numbers[].locality | string | No | — |
numbers[].region | string | No | — |
numbers[].type | enum | Yes | One of: "local", "toll_free". |
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
curl -X GET "$ANSWERSTACK_API_URL/v1/account/numbers/available?areaCode=string" \
-H "Authorization: Bearer $ACCESS_TOKEN"Buy a number and place it in a community (owner of a self-serve account with a card, within the plan’s limit)#
POST /v1/account/numbers/buy
Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).
Request body
application/json, required.
| Field | Type | Required | Description |
|---|---|---|---|
e164 | string | Yes | Pattern: ^\+1[2-9][0-9]\{9\}$. |
groupId | string (grp_… ID) | Yes | ID (grp_…) |
Response 201
| Field | Type | Required | Description |
|---|---|---|---|
number | PhoneNumber | Yes | — |
number.assignment | any | null | Yes | — |
number.closures | array<object> | Yes | — |
number.closures[].from | string (date) | Yes | — |
number.closures[].hours | object | null | Yes | — |
number.closures[].hours.end | string | constant | Yes | — |
number.closures[].hours.start | string | Yes | Pattern: ^([01]\d|2[0-3]):[0-5]\d$. |
number.closures[].id | string | Yes | 1–64 characters. Pattern: ^[a-z0-9][a-z0-9_-]*$. |
number.closures[].name | string | Yes | 1–60 characters. |
number.closures[].to | string (date) | Yes | — |
number.e164 | string | Yes | — |
number.groupId | string (grp_… ID) | null | Yes | — |
number.groupName | string | null | Yes | — |
number.id | string (pn_… ID) | Yes | ID (pn_…) |
number.isTest | boolean | Yes | — |
number.label | string | null | Yes | — |
number.status | enum | Yes | One of: "active", "released". |
number.testRingsTeam | boolean | Yes | — |
number.timeZone | string | null | Yes | — |
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
curl -X POST "$ANSWERSTACK_API_URL/v1/account/numbers/buy" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"e164": "string",
"groupId": "grp_2ZPh7XbT0v9Ao4iJ3qK1mN8sRgE"
}'Whether the owner can buy a number now, and how many the plan allows#
GET /v1/account/numbers/self-serve
Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
allowed | boolean | Yes | — |
held | integer | null | Yes | — |
limit | integer | null | Yes | — |
needsCard | boolean | Yes | — |
reason | string | null | Yes | — |
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
curl -X GET "$ANSWERSTACK_API_URL/v1/account/numbers/self-serve" \
-H "Authorization: Bearer $ACCESS_TOKEN"Rename a number (the label your team sees next to it), or say whether the test number rings your team on test calls#
PATCH /v1/account/numbers/{numberId}
Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
numberId | string (pn_… ID) | Yes | ID (pn_…) |
Request body
application/json, required.
| Field | Type | Required | Description |
|---|---|---|---|
label | string | null | No | Up to 120 characters. |
testRingsTeam | boolean | No | — |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
number | PhoneNumber | Yes | — |
number.assignment | any | null | Yes | — |
number.closures | array<object> | Yes | — |
number.closures[].from | string (date) | Yes | — |
number.closures[].hours | object | null | Yes | — |
number.closures[].hours.end | string | constant | Yes | — |
number.closures[].hours.start | string | Yes | Pattern: ^([01]\d|2[0-3]):[0-5]\d$. |
number.closures[].id | string | Yes | 1–64 characters. Pattern: ^[a-z0-9][a-z0-9_-]*$. |
number.closures[].name | string | Yes | 1–60 characters. |
number.closures[].to | string (date) | Yes | — |
number.e164 | string | Yes | — |
number.groupId | string (grp_… ID) | null | Yes | — |
number.groupName | string | null | Yes | — |
number.id | string (pn_… ID) | Yes | ID (pn_…) |
number.isTest | boolean | Yes | — |
number.label | string | null | Yes | — |
number.status | enum | Yes | One of: "active", "released". |
number.testRingsTeam | boolean | Yes | — |
number.timeZone | string | null | Yes | — |
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
curl -X PATCH "$ANSWERSTACK_API_URL/v1/account/numbers/{numberId}" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"label": "string",
"testRingsTeam": true
}'Point a number at a playbook: pinned to a version or following the latest publish. Its schedule, if it has one, is kept#
PUT /v1/account/numbers/{numberId}/assignment
Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
numberId | string (pn_… ID) | Yes | ID (pn_…) |
Request body
application/json, required.
| Field | Type | Required | Description |
|---|---|---|---|
mode | enum | Yes | One of: "pinned", "follow_latest". |
playbookId | string (pb_… ID) | Yes | ID (pb_…) |
version | integer | enum | No | — |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
droppedRoutes | array<string> | Yes | — |
effective | object | null | Yes | — |
effective.issues | array<string> | Yes | — |
effective.outcome | string | Yes | — |
number | PhoneNumber | Yes | — |
number.assignment | any | null | Yes | — |
number.closures | array<object> | Yes | — |
number.closures[].from | string (date) | Yes | — |
number.closures[].hours | object | null | Yes | — |
number.closures[].hours.end | string | constant | Yes | — |
number.closures[].hours.start | string | Yes | Pattern: ^([01]\d|2[0-3]):[0-5]\d$. |
number.closures[].id | string | Yes | 1–64 characters. Pattern: ^[a-z0-9][a-z0-9_-]*$. |
number.closures[].name | string | Yes | 1–60 characters. |
number.closures[].to | string (date) | Yes | — |
number.e164 | string | Yes | — |
number.groupId | string (grp_… ID) | null | Yes | — |
number.groupName | string | null | Yes | — |
number.id | string (pn_… ID) | Yes | ID (pn_…) |
number.isTest | boolean | Yes | — |
number.label | string | null | Yes | — |
number.status | enum | Yes | One of: "active", "released". |
number.testRingsTeam | boolean | Yes | — |
number.timeZone | string | null | Yes | — |
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
curl -X PUT "$ANSWERSTACK_API_URL/v1/account/numbers/{numberId}/assignment" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"playbookId": "pb_2ZPh7XbT0v9Ao4iJ3qK1mN8sRgE",
"mode": "pinned"
}'What this number ran and when, newest first#
GET /v1/account/numbers/{numberId}/assignments
Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
numberId | string (pn_… ID) | Yes | ID (pn_…) |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
assignments | array<NumberAssignment> | Yes | — |
assignments[].assignedBy | string (usr_… ID) | string (svc_… ID) | null | Yes | — |
assignments[].effectiveFrom | string (date-time) | Yes | — |
assignments[].effectiveTo | string (date-time) | null | Yes | — |
assignments[].experiment | object | null | Yes | — |
assignments[].experiment.id | string (exp_… ID) | Yes | ID (exp_…) |
assignments[].experiment.name | string | Yes | — |
assignments[].experiment.versions | array<integer> | Yes | — |
assignments[].id | string (nas_… ID) | Yes | ID (nas_…) |
assignments[].mode | enum | Yes | One of: "pinned", "follow_latest". |
assignments[].playbookId | string (pb_… ID) | Yes | ID (pb_…) |
assignments[].playbookName | string | Yes | — |
assignments[].playbookVersionId | string (pbv_… ID) | null | Yes | — |
assignments[].ringFirst | any | null | Yes | — |
assignments[].routes | array<NumberRoute> | Yes | — |
assignments[].routes[].id | string (nrt_… ID) | Yes | ID (nrt_…) |
assignments[].routes[].mode | enum | Yes | One of: "pinned", "follow_latest". |
assignments[].routes[].name | string | Yes | — |
assignments[].routes[].playbookId | string (pb_… ID) | Yes | ID (pb_…) |
assignments[].routes[].playbookName | string | Yes | — |
assignments[].routes[].playbookVersionId | string (pbv_… ID) | null | Yes | — |
assignments[].routes[].ringFirst | any | null | Yes | — |
assignments[].routes[].runningVersion | integer | null | Yes | — |
assignments[].routes[].when | object | object | object | Yes | — |
assignments[].routes[].when.kind | constant | Yes | (variant 1) Always "weekly". |
assignments[].routes[].when.windows | array<object> | Yes | (variant 1) Up to 14 items. |
assignments[].routes[].when.everyYear | boolean | Yes | (variant 2) Default: false. |
assignments[].routes[].when.hours | object | null | Yes | (variant 2) |
assignments[].routes[].when.kind | constant | Yes | (variant 2) Always "dates". |
assignments[].routes[].when.ranges | array<object> | Yes | (variant 2) Up to 30 items. |
assignments[].routes[].when.kind | constant | Yes | (variant 3) Always "closed". |
assignments[].routes[].whenInWords | string | Yes | — |
assignments[].runningDraft | boolean | Yes | — |
assignments[].runningVersion | integer | null | Yes | — |
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
curl -X GET "$ANSWERSTACK_API_URL/v1/account/numbers/{numberId}/assignments" \
-H "Authorization: Bearer $ACCESS_TOKEN"Make a number a rep's direct line: every part of its schedule rings them first, then its playbook#
PUT /v1/account/numbers/{numberId}/direct-line
Makes (or reuses) a ring group of that one rep in the number's location and saves the number's plan again with the ring step on every part. The playbooks and the schedule stay as they were; any experiment on the number stops.
Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
numberId | string (pn_… ID) | Yes | ID (pn_…) |
Request body
application/json, required.
| Field | Type | Required | Description |
|---|---|---|---|
ringSeconds | integer | No | Between 10 and 60. Default: 25. |
userId | string (usr_… ID) | Yes | ID (usr_…) |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
directLine | DirectLine | Yes | — |
directLine.e164 | string | Yes | — |
directLine.groupId | string (grp_… ID) | Yes | ID (grp_…) |
directLine.label | string | null | Yes | — |
directLine.phoneNumberId | string (pn_… ID) | Yes | ID (pn_…) |
directLine.ringGroupId | string (rgp_… ID) | Yes | ID (rgp_…) |
directLine.ringSeconds | integer | Yes | — |
directLine.userId | string (usr_… ID) | Yes | ID (usr_…) |
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
curl -X PUT "$ANSWERSTACK_API_URL/v1/account/numbers/{numberId}/direct-line" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"userId": "usr_2ZPh7XbT0v9Ao4iJ3qK1mN8sRgE"
}'Stop a number being a rep’s direct line: the agent answers it straight away again#
DELETE /v1/account/numbers/{numberId}/direct-line
Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
numberId | string (pn_… ID) | Yes | ID (pn_…) |
Response 204
No content.
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
curl -X DELETE "$ANSWERSTACK_API_URL/v1/account/numbers/{numberId}/direct-line" \
-H "Authorization: Bearer $ACCESS_TOKEN"Place a number in one of your groups, move it to another, or leave it unplaced#
PUT /v1/account/numbers/{numberId}/group
Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
numberId | string (pn_… ID) | Yes | ID (pn_…) |
Request body
application/json, required.
| Field | Type | Required | Description |
|---|---|---|---|
groupId | string (grp_… ID) | null | Yes | — |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
droppedRoutes | array<string> | Yes | — |
effective | object | null | Yes | — |
effective.issues | array<string> | Yes | — |
effective.outcome | string | Yes | — |
number | PhoneNumber | Yes | — |
number.assignment | any | null | Yes | — |
number.closures | array<object> | Yes | — |
number.closures[].from | string (date) | Yes | — |
number.closures[].hours | object | null | Yes | — |
number.closures[].hours.end | string | constant | Yes | — |
number.closures[].hours.start | string | Yes | Pattern: ^([01]\d|2[0-3]):[0-5]\d$. |
number.closures[].id | string | Yes | 1–64 characters. Pattern: ^[a-z0-9][a-z0-9_-]*$. |
number.closures[].name | string | Yes | 1–60 characters. |
number.closures[].to | string (date) | Yes | — |
number.e164 | string | Yes | — |
number.groupId | string (grp_… ID) | null | Yes | — |
number.groupName | string | null | Yes | — |
number.id | string (pn_… ID) | Yes | ID (pn_…) |
number.isTest | boolean | Yes | — |
number.label | string | null | Yes | — |
number.status | enum | Yes | One of: "active", "released". |
number.testRingsTeam | boolean | Yes | — |
number.timeZone | string | null | Yes | — |
outcomes | array<NumberRoutingOutcome> | Yes | — |
outcomes[].issues | array<string> | Yes | — |
outcomes[].outcome | string | Yes | — |
outcomes[].playbookId | string (pb_… ID) | Yes | ID (pb_…) |
outcomes[].routes | array<string | null> | Yes | — |
outcomes[].version | integer | Yes | — |
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
curl -X PUT "$ANSWERSTACK_API_URL/v1/account/numbers/{numberId}/group" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"groupId": "grp_2ZPh7XbT0v9Ao4iJ3qK1mN8sRgE"
}'Save a number's whole schedule: what it runs at all other times, and each holiday, closure or weekly window that runs another playbook#
PUT /v1/account/numbers/{numberId}/routing
Holidays and closures are checked first, then the weekly schedule, each in the order given; the first that matches answers, in the group's time zone. Saving closes the number's assignment and opens a new one, so any experiment running on the number stops.
Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token).
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
numberId | string (pn_… ID) | Yes | ID (pn_…) |
Request body
application/json, required.
| Field | Type | Required | Description |
|---|---|---|---|
default | object | Yes | — |
default.mode | enum | Yes | One of: "pinned", "follow_latest". |
default.playbookId | string (pb_… ID) | Yes | ID (pb_…) |
default.ringFirst | object | No | — |
default.ringFirst.ringGroupId | string (rgp_… ID) | Yes | ID (rgp_…) |
default.ringFirst.ringSeconds | integer | No | Between 10 and 60. Default: 25. |
default.version | integer | enum | No | — |
routes | array<object> | Yes | Up to 20 items. |
routes[].mode | enum | Yes | One of: "pinned", "follow_latest". |
routes[].name | string | Yes | 1–60 characters. |
routes[].playbookId | string (pb_… ID) | Yes | ID (pb_…) |
routes[].ringFirst | object | No | — |
routes[].ringFirst.ringGroupId | string (rgp_… ID) | Yes | ID (rgp_…) |
routes[].ringFirst.ringSeconds | integer | No | Between 10 and 60. Default: 25. |
routes[].version | integer | No | Minimum 1. |
routes[].when | object | object | object | Yes | — |
routes[].when.kind | enum | Yes | (variant 1) One of: "weekly". |
routes[].when.windows | array<object> | Yes | (variant 1) Up to 14 items. |
routes[].when.windows[].days | array<enum> | Yes | (variant 1) Items: "mon", "tue", "wed", "thu", "fri", "sat", "sun". Up to 7 items. |
routes[].when.windows[].end | string | enum | Yes | (variant 1) |
routes[].when.windows[].start | string | Yes | (variant 1) Pattern: ^([01]\d|2[0-3]):[0-5]\d$. |
routes[].when.everyYear | boolean | No | (variant 2) Default: false. |
routes[].when.hours | object | null | No | (variant 2) |
routes[].when.hours.end | string | enum | Yes | (variant 2) |
routes[].when.hours.start | string | Yes | (variant 2) Pattern: ^([01]\d|2[0-3]):[0-5]\d$. |
routes[].when.kind | enum | Yes | (variant 2) One of: "dates". |
routes[].when.ranges | array<object> | Yes | (variant 2) Up to 30 items. |
routes[].when.ranges[].from | string (date) | Yes | (variant 2) |
routes[].when.ranges[].to | string (date) | Yes | (variant 2) |
routes[].when.kind | enum | Yes | (variant 3) One of: "closed". |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
number | PhoneNumber | Yes | — |
number.assignment | any | null | Yes | — |
number.closures | array<object> | Yes | — |
number.closures[].from | string (date) | Yes | — |
number.closures[].hours | object | null | Yes | — |
number.closures[].hours.end | string | constant | Yes | — |
number.closures[].hours.start | string | Yes | Pattern: ^([01]\d|2[0-3]):[0-5]\d$. |
number.closures[].id | string | Yes | 1–64 characters. Pattern: ^[a-z0-9][a-z0-9_-]*$. |
number.closures[].name | string | Yes | 1–60 characters. |
number.closures[].to | string (date) | Yes | — |
number.e164 | string | Yes | — |
number.groupId | string (grp_… ID) | null | Yes | — |
number.groupName | string | null | Yes | — |
number.id | string (pn_… ID) | Yes | ID (pn_…) |
number.isTest | boolean | Yes | — |
number.label | string | null | Yes | — |
number.status | enum | Yes | One of: "active", "released". |
number.testRingsTeam | boolean | Yes | — |
number.timeZone | string | null | Yes | — |
outcomes | array<NumberRoutingOutcome> | Yes | — |
outcomes[].issues | array<string> | Yes | — |
outcomes[].outcome | string | Yes | — |
outcomes[].playbookId | string (pb_… ID) | Yes | ID (pb_…) |
outcomes[].routes | array<string | null> | Yes | — |
outcomes[].version | integer | Yes | — |
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
curl -X PUT "$ANSWERSTACK_API_URL/v1/account/numbers/{numberId}/routing" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"default": {
"playbookId": "pb_2ZPh7XbT0v9Ao4iJ3qK1mN8sRgE",
"mode": "pinned"
},
"routes": [
{
"name": "string",
"when": {
"kind": "weekly",
"windows": [
{}
]
},
"playbookId": "pb_2ZPh7XbT0v9Ao4iJ3qK1mN8sRgE",
"mode": "pinned"
}
]
}'What a call to this number would do at a moment: which part of the schedule answers, who would ring and when, and who would be skipped and why#
GET /v1/account/numbers/{numberId}/routing/preview
Authentication: Bearer token: Authorization: Bearer <token> (Supabase access token). Bearer token: Authorization: Bearer <token> (An API token (ans_pat_ or ans_svc_). Only routes that list a scope here accept one, and only with that scope.).
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
numberId | string (pn_… ID) | Yes | ID (pn_…) |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
at | string (date-time) | No | — |
assumeAvailable | enum | No | One of: "true", "false". |
Response 200
| Field | Type | Required | Description |
|---|---|---|---|
at | string (date-time) | Yes | — |
canRing | boolean | Yes | — |
playbookId | string (pb_… ID) | Yes | ID (pb_…) |
playbookName | string | Yes | — |
ringFirst | object | null | Yes | — |
ringFirst.canRing | boolean | Yes | — |
ringFirst.members | array<object> | Yes | — |
ringFirst.members[].endSecond | integer | null | Yes | — |
ringFirst.members[].memberId | string (rgm_… ID) | Yes | ID (rgm_…) |
ringFirst.members[].name | string | Yes | — |
ringFirst.members[].reason | string | null | Yes | — |
ringFirst.members[].reasonInWords | string | null | Yes | — |
ringFirst.members[].ring | boolean | Yes | — |
ringFirst.members[].startSecond | integer | null | Yes | — |
ringFirst.requireKeyPress | boolean | Yes | — |
ringFirst.ringGroupId | string (rgp_… ID) | Yes | ID (rgp_…) |
ringFirst.ringGroupName | string | Yes | — |
ringFirst.ringSeconds | integer | Yes | — |
ringFirst.strategy | enum | Yes | One of: "all", "in_order", "rotate". |
routeId | string (nrt_… ID) | null | Yes | — |
routeName | string | Yes | — |
runningVersion | integer | null | Yes | — |
sentence | string | Yes | — |
timeZone | string | Yes | — |
Errors: 400, 401, 403, 404, 409, 429, 500, with an ErrorBody body.
Example
curl -X GET "$ANSWERSTACK_API_URL/v1/account/numbers/{numberId}/routing/preview" \
-H "Authorization: Bearer $ACCESS_TOKEN"