***

title: RestClient
slug: /reference/typescript/rest/client
description: HTTP client for the SignalWire REST API.
max-toc-depth: 3
---------------------

For a complete index of all SignalWire documentation pages, fetch https://signalwire.com/docs/llms.txt

[fabric]: /docs/server-sdks/reference/typescript/rest/fabric

[calling]: /docs/server-sdks/reference/typescript/rest/calling

[phone-numbers]: /docs/server-sdks/reference/typescript/rest/phone-numbers

[addresses]: /docs/server-sdks/reference/typescript/rest/addresses

[queues]: /docs/server-sdks/reference/typescript/rest/queues

[recordings]: /docs/server-sdks/reference/typescript/rest/recordings

[number-groups]: /docs/server-sdks/reference/typescript/rest/number-groups

[verified-callers]: /docs/server-sdks/reference/typescript/rest/verified-callers

[sip-profile]: /docs/server-sdks/reference/typescript/rest/sip-profile

[lookup]: /docs/server-sdks/reference/typescript/rest/lookup

[short-codes]: /docs/server-sdks/reference/typescript/rest/short-codes

[imported-numbers]: /docs/server-sdks/reference/typescript/rest/imported-numbers

[mfa]: /docs/server-sdks/reference/typescript/rest/mfa

[registry]: /docs/server-sdks/reference/typescript/rest/registry

[datasphere]: /docs/server-sdks/reference/typescript/rest/datasphere

[video]: /docs/server-sdks/reference/typescript/rest/video

[logs]: /docs/server-sdks/reference/typescript/rest/logs

[project]: /docs/server-sdks/reference/typescript/rest/project

[pubsub]: /docs/server-sdks/reference/typescript/rest/pubsub

[chat]: /docs/server-sdks/reference/typescript/rest/chat

[compatibility]: /docs/server-sdks/reference/typescript/rest/compat

The `RestClient` is the entry point for all SignalWire REST API operations.
It authenticates with your project credentials and exposes every API namespace
as a property, giving you typed access to phone numbers, fabric resources,
call control, video rooms, datasphere documents, logs, and more.

## **Constructor Parameters**

<ParamField path="project" type="string" toc={true}>
  SignalWire project ID. Falls back to the `SIGNALWIRE_PROJECT_ID` environment variable
  when not provided.
</ParamField>

<ParamField path="token" type="string" toc={true}>
  API token for authentication. Falls back to the `SIGNALWIRE_API_TOKEN` environment
  variable when not provided.
</ParamField>

<ParamField path="host" type="string" toc={true}>
  SignalWire space hostname (e.g., `your-space.signalwire.com`). Falls back to the
  `SIGNALWIRE_SPACE` environment variable when not provided.
</ParamField>

<Note>
  All three parameters are required. If any is missing from both the constructor
  arguments and environment variables, an `Error` is thrown.
</Note>

## **Namespace Properties**

<ParamField path="fabric" type="FabricNamespace" toc={true}>
  AI agents, SWML scripts, [subscribers](/docs/platform/subscribers), call flows, SIP gateways, and tokens.
  See [`Fabric`][fabric].
</ParamField>

<ParamField path="calling" type="CallingNamespace" toc={true}>
  REST-based call control with 37+ commands dispatched via POST.
  See [`Calling`][calling].
</ParamField>

<ParamField path="phoneNumbers" type="PhoneNumbersResource" toc={true}>
  Search, purchase, and manage phone numbers.
  See [`Phone Numbers`][phone-numbers].
</ParamField>

<ParamField path="addresses" type="AddressesResource" toc={true}>
  Manage regulatory addresses.
  See [`Addresses`][addresses].
</ParamField>

<ParamField path="queues" type="QueuesResource" toc={true}>
  Manage call queues and queue members.
  See [`Queues`][queues].
</ParamField>

<ParamField path="recordings" type="RecordingsResource" toc={true}>
  List, retrieve, and delete call recordings.
  See [`Recordings`][recordings].
</ParamField>

<ParamField path="numberGroups" type="NumberGroupsResource" toc={true}>
  Manage number groups and their memberships.
  See [`Number Groups`][number-groups].
</ParamField>

<ParamField path="verifiedCallers" type="VerifiedCallersResource" toc={true}>
  Manage and verify caller IDs.
  See [`Verified Callers`][verified-callers].
</ParamField>

<ParamField path="sipProfile" type="SipProfileResource" toc={true}>
  Get and update the project SIP profile.
  See [`SIP Profile`][sip-profile].
</ParamField>

<ParamField path="lookup" type="LookupResource" toc={true}>
  Phone number carrier and CNAM lookup.
  See [`Lookup`][lookup].
</ParamField>

<ParamField path="shortCodes" type="ShortCodesResource" toc={true}>
  Manage short codes.
  See [`Short Codes`][short-codes].
</ParamField>

<ParamField path="importedNumbers" type="ImportedNumbersResource" toc={true}>
  Import externally-hosted phone numbers.
  See [`Imported Numbers`][imported-numbers].
</ParamField>

<ParamField path="mfa" type="MfaResource" toc={true}>
  Multi-factor authentication via SMS and voice.
  See [`MFA`][mfa].
</ParamField>

<ParamField path="registry" type="RegistryNamespace" toc={true}>
  10DLC brand and campaign registration.
  See [`Registry`][registry].
</ParamField>

<ParamField path="datasphere" type="DatasphereNamespace" toc={true}>
  Document management and semantic search.
  See [`Datasphere`][datasphere].
</ParamField>

<ParamField path="video" type="VideoNamespace" toc={true}>
  Video rooms, conferences, sessions, recordings, and streams.
  See [`Video`][video].
</ParamField>

<ParamField path="logs" type="LogsNamespace" toc={true}>
  Message, voice, fax, and conference log queries.
  See [`Logs`][logs].
</ParamField>

<ParamField path="project" type="ProjectNamespace" toc={true}>
  Project-level API token management.
  See [`Project`][project].
</ParamField>

<ParamField path="pubsub" type="PubSubResource" toc={true}>
  PubSub token generation.
  See [`PubSub`][pubsub].
</ParamField>

<ParamField path="chat" type="ChatResource" toc={true}>
  Chat token generation.
  See [`Chat`][chat].
</ParamField>

<ParamField path="compat" type="CompatNamespace" toc={true}>
  Twilio-compatible LAML API for migration.
  See [`Compatibility`][compatibility].
</ParamField>

## **Examples**

### Explicit credentials

```typescript {3}
import { RestClient } from "@signalwire/sdk";

const client = new RestClient({
  project: "your-project-id",
  token: "your-api-token",
  host: "your-space.signalwire.com"
});

const numbers = await client.phoneNumbers.list();
```

### Environment variables

```typescript {6}
import { RestClient } from "@signalwire/sdk";

// With SIGNALWIRE_PROJECT_ID, SIGNALWIRE_API_TOKEN, and SIGNALWIRE_SPACE set
const client = new RestClient();

const available = await client.phoneNumbers.search({ areaCode: "512" });
```