Skip to main content
The examples below use a configured client from the Quickstart. Replace resource IDs with IDs from your workspace.

Resource shortcuts

The following groups offer concise methods. Use client.api for operations not listed here. Campaign-specific leads are available through client.api.listLeads with the campaign ID in path.id, or famulor list-leads <campaign-id> in the CLI. client.contacts manages the shared workspace audience.

Read responses

Resource methods keep the API response envelope: your result is in data, and list responses can include meta.pagination.
Use optional chaining for metadata and nullable response fields. Some results, such as a call summary or recording, become available only after processing finishes. Omitting an optional request field and sending null are different actions; send null only where the API reference allows it.

Fetch pages as you need them

Use the async iterator for supported paginated resources:
limit is the page size, not a limit on the total items yielded. The iterator preserves your filters and advances the offset until it reaches the end. Breaking out of the loop stops fetching new pages. Offset pagination is not a snapshot: concurrent inserts or updates can change page contents. To set a safety bound, pass a second argument such as { maxPages: 100 }. Reaching the bound before the list ends throws an error; it does not silently return a partial result. For manual page control, call client.calls.list() with limit and offset, then inspect meta.pagination. Typical list endpoints default to 50 items and allow up to 200; follow each endpoint’s limits. The equivalent CLI request is famulor list-calls --status completed --limit 50; add --all to fetch all pages.

Use any public API operation

client.api exposes the operation IDs from the API reference as typed methods. Inputs are grouped into path, query, body and headers instead of combining unrelated parameters.
For an outbound call, the complete API method is:
The resource shorthand is client.calls.create(body). Both methods call the same API and retain the same response envelope and permissions. Use your editor’s autocomplete for all operation methods. See MCP tools and scopes for using the corresponding capabilities inside an AI assistant.

Download binary responses

Audio endpoints return an ArrayBuffer, without a JSON data wrapper. For example, download an existing Full Duplex voice preview as WAV audio:
Choose an opaque Full Duplex voice ID from the voice catalog. Your workspace needs access to the corresponding voice mode. A missing preview returns an API error; this request does not create a new sample.

Upload files

Pass a FormData body to operations that accept multipart uploads. The SDK sets the multipart content type and boundary:
Avatar uploads accept PNG, JPEG or WebP, with a maximum incoming file size of 1 MB. Follow each operation’s file requirements. The CLI equivalents for both examples are:

Override one request

Request options are the last argument, after the method’s input parameters. Generated client.api methods take grouped input first and request options second. Resource shortcuts have different argument counts. For example, a list takes its query first, then options:
Place options after the ID and body when updating an assistant, after the ID and query when downloading audio, and as the only argument for account.me(). Pass an empty query to keep its defaults. Replace the resource IDs below before running these examples; updating an assistant changes its configuration.
See Configuration and errors for cancellation, error classes and retry behavior.