***

title: receiveFax
slug: /reference/typescript/relay/call/receive-fax
description: Receive a fax on a call.
max-toc-depth: 3
---------------------

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

[faxaction]: /docs/server-sdks/reference/typescript/relay/actions

[calling-call-fax]: /docs/server-sdks/reference/typescript/relay/call#events

[call-events]: /docs/server-sdks/reference/typescript/relay/call#events

Start receiving a fax on the call. Returns a
[`FaxAction`][faxaction] that resolves when the
fax is fully received or an error occurs.

<Info>
  This method emits [`calling.call.fax`][calling-call-fax] events. See [Call Events][call-events] for payload details.
</Info>

## **Parameters**

<ParamField path="controlId" type="string | undefined" toc={true}>
  Custom control ID. Auto-generated if not provided.
</ParamField>

<ParamField path="onCompleted" type="(event: RelayEvent) => void | Promise<void>" toc={true}>
  Callback invoked when the fax reception completes. The event contains
  the received document URL and page count.
</ParamField>

## **Returns**

`Promise<`[`FaxAction`][faxaction]`>` -- An action handle with
`stop()` and `wait()` methods.

## **Example**

```typescript {12}
import { RelayClient } from '@signalwire/sdk';

const client = new RelayClient({
  project: process.env.SIGNALWIRE_PROJECT_ID!,
  token: process.env.SIGNALWIRE_TOKEN!,
  contexts: ['default']
});

client.onCall(async (call) => {
  await call.answer();

  const action = await call.receiveFax();
  const event = await action.wait();

  const faxResult = event.params.fax as Record<string, unknown> ?? {};
  const documentUrl = (faxResult.document ?? '') as string;
  const pages = faxResult.pages ?? 0;
  console.log(`Received fax: ${pages} pages, document: ${documentUrl}`);
  await call.hangup();
});

await client.run();
```