Look up a caller's priority
https://app.wiseparts.ai/api/v1/voice/priorityGiven a phone number, returns the priority of the segment the matching customer belongs to. Use it in your phone system's routing plan to put known customers in the right queue before the call is even offered.
Numbers that match no customer return the priority of the account's default segment, and so does a customer with no segment of its own — an unrecognised number is never an error here.
POST is accepted with from in the body, for systems that prefer it.
Neither verb creates a call or stores anything about the lookup, but the
request itself is recorded in the request history like every other Voice
API call, so expect it to appear in GET /voice.
One asymmetry to know about: this lookup assumes no country, whereas call ingestion falls back to the account's own country when a number is ambiguous. A number in national format can therefore resolve to a different customer here than on the call that follows. Send numbers in full international format and the two stay in step.
Query parameters
fromstringRequiredThe caller's number, ideally in full international format. Short numbers are not ruled out: a number saved as a contact on a customer or branch is matched at any length, and it is only the fallback that scans the customer and branch phone and mobile fields which skips anything shorter than eight digits. So a four-digit number resolves if somebody recorded it as a contact, and not otherwise.
curl --request GET \
--url 'https://app.wiseparts.ai/api/v1/voice/priority?from=%2B351210000000' \
--header 'Authorization: Bearer REPLACE_BEARER_TOKEN'
Responses
The caller's segment priority.
The token is missing, wrong, or belongs to an integration that is not active. Requests that fail here leave no entry in the request history, because the account could not be identified. POST /voice/call and /voice/priority always answer with this JSON body. GET /voice only does so when the request asks for JSON — send Accept: application/json or you will get a 302 redirect to a browser page instead of a 401, which is a confusing thing to debug from a script.
from was missing or was not a string. It is the only field this endpoint validates, so it is the only key errors can ever carry here — a number that matches nothing is a 200, not a 422.
Response fields
priorityinteger or nullThe matching segment's priority, or the default segment's when nothing matched. null in the one case where there is nothing to fall back to either: an account with no default segment configured.
{
"priority": 3
}