SiteCallDevelopers

Numbers

Numbers for every workspace you manage.

SiteCall is the system of record for phone numbers. Your application orders, moves and releases them for its workspaces with one command endpoint, POST /api/v1/applications/telephony, and hears about every change as number.updated.

Authentication

An application key with scope numbers:*. (Applications registered before keys existed may still send their bearer secret with an x-sitecall-application header.) Workspaces are named inside each command by your own id, so no workspace header is sent.

Commands

One JSON command per request, named by type. The answer is the result its type names.

CommandAnswersWhat it does
ensure_workspaceworkspaceCreate or find the workspace for your own id (externalWorkspaceId, name).
search_numberssearchAvailable numbers by areaCode (country default US, limit 1–50, default 10).
acquire_numbernumberOrder one exact number for a workspace. Carries its own idempotencyKey.
release_numbernumberRelease a number; it stays reclaimable for graceDays (0–90, default 30).
reclaim_numbernumberTake a released number back while its grace lasts.
transfer_numbernumberMove a number between two of your workspaces. Carries its own idempotencyKey.
list_numbersnumbersEvery number of a workspace.
get_numbernumberOne number by E.164.
set_caller_namenumberThe caller name (CNAM) recipients see, up to 15 characters.
set_emergency_addressnumberThe number's registered E911 address.
set_voice_lanenumberMove the number's calls to SiteCall's voice engine (sitecall) or back.
set_messaging_lanenumberMove the number's texting to SiteCall's messaging (sitecall) or back.
submit_business_identitybusiness_identityThe company facts texting registration needs.
get_business_registrationbusiness_registrationWhere texting registration stands.

POST /api/v1/applications/telephony

curl https://sitecall.ai/api/v1/applications/telephony \
  -H "authorization: Bearer $SITECALL_API_KEY" \
  -H "content-type: application/json" \
  -d '{ "type": "acquire_number",
        "externalWorkspaceId": "acme-42",
        "phoneNumber": "+15125550123",
        "idempotencyKey": "acme-42-line-1",
        "externalNumberId": "line-1" }'

{ "type": "number",
  "number": { "sitecallNumberId": "…", "phoneNumber": "+15125550123", "status": "active",
              "externalWorkspaceId": "acme-42", "voiceLane": "sitecall", … } }

with @sitecall/cli

const [first] = await sitecall.numbers.search({ externalWorkspaceId: "acme-42", areaCode: "512" });
const number = await sitecall.numbers.acquire({
  externalWorkspaceId: "acme-42",
  phoneNumber: first.phoneNumber,
  idempotencyKey: "acme-42-line-1",
});
await sitecall.numbers.setCallerName({
  externalWorkspaceId: "acme-42",
  phoneNumber: number.phoneNumber,
  displayName: "ACME ROOFING",
});

Retries and errors

Refusals on this endpoint are { "error": "<message>", "code": "<code>" }:

CodeMeaning
unauthorizedThe key or secret is not valid for this application.
invalid_commandThe command does not match its schema.
workspace_not_foundNo workspace of yours has that id; ensure it first.
number_unavailableThe carrier no longer offers it; pick another.
number_not_ownedThe number is not in that workspace.
carrier_failedThe carrier refused the change.
carrier_ambiguousAn earlier change's outcome is still being confirmed: retry the same command after a minute.
unavailableTry the same command again.

Voice lanes

set_voice_lane with sitecall puts a number's calls on SiteCall's voice engine, where routing plans decide who rings. Texting stays on the number's messaging lane. The command is journaled and replay-safe; rolling back is the same command with the previous lane.

set_messaging_lane with sitecall moves the number's texting onto its SiteCall workspace's own messaging profile: SiteCall receives its texts and sends them as message.* events, and you send through /v1/messages. Opt-outs move with it. Calls stay on the voice lane. Re-applying it changes nothing; rolling back is the same command with the previous lane.

SiteCall's own customers provision numbers themselves through provisioning, with their owner or admin login and an explicit quote they approve.