Skip to main content
Documentation

Comms

comms.get_phone_number

Get one of the shop's numbers: status, role and message sending
Read-onlyRead budget

REST

Shipping
POST /api/v1/comms/get_phone_number

MCP tool

Live
comms.get_phone_number

Exposed on: REST API · Shop MCP server · Claude connector · Dash (in-app copilot) · Zapier. Part of the Comms domain.

Operating contract

One line, looked up by the number itself in any format — +1 (403) 555-0134 and 4035550134 both find the row stored as +14035550134. There is no separate id to fetch first, because the thing a caller has in hand is a phone number.

USE IT TO ANSWER 'CAN WE TEXT FROM THIS'. is_sending is the honest answer and it is not the same as the line existing: a shop can hold a number that is suspended for billing, or a reservation that never completed, and both are real rows that cannot send. status says which case it is.

is_primary marks the number the shop sends from by default — the one on its cards and the one a customer sees on an unmatched inbound.

A number this shop does not hold is refused as not found, INCLUDING one held by another shop. That is deliberate: this must never be a way to ask whether a competitor is on the platform.

Who may call it

Permission
inbox.accessThe caller must hold Inbox at the ACT level. A read-only dashboard grant on the same section is refused.
Plan
Every planNo plan gate. Available on every Service VIN plan.
Retries
naturalNaturally idempotent — running it twice leaves the same world as running it once. A retrying integration needs no key.
Rate class
readCounted against the read budget — the widest of the four.

Input

FieldTypeDescription
numberrequiredstringmax 40 chars, min 4 chars

The phone number, in any format, as returned by comms.list_phone_numbers.

Output

FieldTypeDescription
idstring

numberstring

namestring | null

providerstring

statusstring

countrystring | null

is_primaryboolean

is_sendingboolean

purchased_atstring | null

Examples

Built from this capability's own schema — required fields and the ones carrying a default, and nothing invented. Paste one and it validates.

curl
export SERVICEVIN_API_KEY=svk_live_…

curl -X POST https://www.servicevin.com/api/v1/comms/get_phone_number \
  -H "Authorization: Bearer $SERVICEVIN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"number":"…"}'

TypeScript (fetch)
const res = await fetch("https://www.servicevin.com/api/v1/comms/get_phone_number", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.SERVICEVIN_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "number": "…"
  }),
});

// Success and failure are both envelopes. Switch on error.code, never
// on error.message — the codes are stable, the messages are for people.
const payload = await res.json();
if (!res.ok) throw new Error(payload.error.code);
const data = payload.data;

Python (requests)
import os, requests

res = requests.post(
    "https://www.servicevin.com/api/v1/comms/get_phone_number",
    headers={"Authorization": f"Bearer {os.environ['SERVICEVIN_API_KEY']}"},
    json={
    "number": "…"
},
    timeout=30,
)
payload = res.json()
if not res.ok:
    raise RuntimeError(payload["error"]["code"])
data = payload["data"]

MCP tools/call — https://www.servicevin.com/api/mcp
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "tools/call",
  "params": {
    "name": "comms.get_phone_number",
    "arguments": {
      "number": "…"
    }
  }
}

Refusals

The four gates run in this order on every surface, and the order is not arbitrary — see Authentication.

StatusCodeWhen
404not_foundThe id is unknown, or the feature is not enabled for this account. Deliberately the same answer for both.
403forbiddenThis login does not hold inbox.access.
422validation_errorAn argument was wrong. The message names the field.
429rate_limitedToo many read calls. Back off and retry.
500internal_errorSomething failed on our side. Nothing was changed.