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 back to SiteCall; it stays reclaimable for graceDays (at most 15), then ages out and joins SiteCall's pool. SiteCall never releases it to the carrier.
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_default_numbernumberThe workspace's default number. SiteCall keeps one on its own: the first number in service, then the oldest one when the default leaves.
set_caller_namenumberThe caller name (CNAM) recipients see, up to 15 characters.
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", … } }

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.

Imported numbers

import_number records a number exactly as the carrier has it. acquire_number for a number the workspace already holds points it at SiteCall: its calls on SiteCall's voice engine, where routing plans decide who rings, and its texts on the workspace's own messaging profile (SiteCall receives them as message.* events; you send through /v1/messages). Opt-outs move with it. Re-applying it changes nothing.

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