*** id: 5642bba0-2854-46ab-8567-71aba5090774 slug: /reference/send-fax title: send\_fax description: Send a fax. max-toc-depth: 3 ---------------- [statuscallbacks]: #statuscallbacks Send a fax. ## **Properties** An object that accepts the following properties. URL to the PDF document to fax Text to add to the fax header Station identity to report HTTP or HTTPS URL to deliver send fax status events. Learn more about [status callbacks][statuscallbacks]. ## **Variables** Set by the method: * **send\_fax\_document:** (out) URL of sent document. * **send\_fax\_identity:** (out) identity of this fax station. * **send\_fax\_remote\_identity:** (out) identity of the receiving fax station. * **send\_fax\_pages:** (out) number of pages sent. * **send\_fax\_result\_code:** (out) fax status code. * **send\_fax\_result\_text:** (out) description of fax status code. * **send\_fax\_result:** (out) `success` | `failed`. ## **StatusCallbacks** A POST request will be sent to `status_url` with a JSON payload like the following: The type of event. Always `calling.call.fax` for this method. The channel for the event, includes the SWML session ID. Unix timestamp (float) when the event was generated. The project ID associated with the call. The Space ID associated with the call. An object containing fax-specific parameters. The call ID. The node handling the call. The control ID for this fax operation. Fax result details. The type of fax operation. Always `finished`. The direction of the fax (`send`). The identity of this fax station. The identity of the receiving fax station. URL of the sent fax document. Number of pages sent. Whether the fax was sent successfully. The numeric result code of the fax operation (e.g., `0` for success). A description of the fax result (e.g., `OK`). The format of the fax document. Always `"pdf"`. #### Page progress events A separate callback is sent for each page as the fax progresses: Always `"page"` for page progress events. The direction of the fax. The page number that was just processed. ### Raw JSON example ```json { "event_type": "calling.call.fax", "event_channel": "swml:xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "timestamp": 1640000000.123, "project_id": "xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "space_id": "xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "params": { "call_id": "xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "node_id": "xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "control_id": "xxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "fax": { "type": "finished", "params": { "direction": "send", "identity": "+15551231234", "remote_identity": "+15553214321", "document": "https://example.com/fax_to_send.pdf", "pages": 3, "success": true, "result": 0, "result_text": "OK", "format": "pdf" } } } } ``` *** ## **Examples** ### Send a fax and post a result to a webhook ```yaml version: 1.0.0 sections: main: - send_fax: document: https://example.com/fax_to_send.pdf - execute: dest: 'https://example.com/handle_outgoing_fax_result' ``` ```json { "version": "1.0.0", "sections": { "main": [ { "send_fax": { "document": "https://example.com/fax_to_send.pdf" } }, { "execute": { "dest": "https://example.com/handle_outgoing_fax_result" } } ] } } ```