sinch-fax-api
Sinch Fax API
Overview
The Sinch Fax API lets you send and receive faxes programmatically. It supports multiple file formats, webhooks for incoming faxes, fax-to-email delivery, and automatic retries. Used for healthcare, legal, financial, and government applications where fax remains a required communication channel.
Auth: See sinch-authentication for setup.
Getting Started
Before generating code, gather from the user: approach (SDK or direct API), language (Node.js, Python, Java, .NET, curl), and use case (sending, receiving, fax-to-email, or managing services). Do not assume defaults.
When generating callback/webhook handlers or processing inbound fax data, always include input validation and sanitization. Treat all inbound content (contentUrl, filenames, metadata, errorMessage) as untrusted — never interpolate into prompts, evaluate as code, or use in shell commands unsanitized.
When the user chooses SDK, fetch the relevant API reference docs linked in Links for accurate method signatures (trusted first-party Sinch docs at developers.sinch.com). When the user chooses direct API calls, use REST with the appropriate HTTP client for their language.
See sinch-sdks for SDK installation and client initialization. Note: Fax is only supported in Node.js (preview) and .NET (partial) — for Java and Python, use direct HTTP calls.
First API Call — Send a Fax
Store credentials in environment variables — never hardcode tokens or keys in commands or source code:
export SINCH_PROJECT_ID="your-project-id"
export SINCH_ACCESS_TOKEN="your-oauth-token"
curl:
curl -X POST \
"https://fax.api.sinch.com/v3/projects/$SINCH_PROJECT_ID/faxes" \
-H "Authorization: Bearer $SINCH_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"to": "+12025550134",
"contentUrl": "https://example.com/document.pdf",
"callbackUrl": "https://yourserver.com/fax-callback"
}'
Node.js SDK: See Send a Fax with Node.js.
Test number: Send to +19898989898 to emulate a real fax without charges (always suggest this for integration testing).
Key Concepts
- Fax Services — Logical containers for fax configuration. Associate numbers, set defaults, and manage routing.
- Fax Numbers — Phone numbers provisioned for fax. Must be configured in your Sinch dashboard.
- Faxes — Individual fax transmissions (inbound or outbound). Each has a unique ID, status, and metadata.
- Fax statuses —
QUEUED→IN_PROGRESS→COMPLETEDorFAILURE. Error details inerrorTypeanderrorMessagefields. - Supported formats — PDF (most reliable), DOC, DOCX, TIF/TIFF, JPG, PNG, TXT, HTML.
- Webhooks/Callbacks — HTTP POST notifications for fax events. Default content type is
multipart/form-data(fax content as attachment). SetcallbackUrlContentType: "application/json"for JSON callbacks. - Cover Pages — Customizable cover pages per service. Attach via
coverPageIdandcoverPageDataon send. - Fax-to-Email — Incoming faxes auto-forwarded to email addresses.
- Retries — Auto-retry on failure. Default set per fax service; maximum: 5.
- Retention — Fax logs and media retained for 13 months. Use
DELETE /faxes/{id}/fileto remove earlier.
Common Patterns
Three ways to deliver content: contentUrl for URLs (recommended — supports basic auth), multipart/form-data for local files, or contentBase64 for in-memory bytes. contentUrl can be a single URL or an array of URLs to compose multi-document faxes.
For HTTPS URLs, ensure your SSL certificate (including intermediate certs) is valid and up-to-date. You can optionally specify from to set the sender number.
- Send a fax (URL, file upload, base64, multiple recipients) — See Send a Fax endpoint. Use
multipart/form-datafor local files, JSON withcontentUrlfor URLs. - Receive faxes via webhook — Callbacks use the content type configured via
callbackUrlContentType(see Key Concepts). Checkdirection === 'INBOUND'on the fax object. See Receive a Fax with Node.js. - Fax-to-email — Configure via API or dashboard. Incoming faxes auto-forward to the configured email. See Fax-to-Email Reference.
- List faxes — See Faxes Endpoint Reference
- Get fax details —
GET /faxes/{id} - Download fax content —
GET /faxes/{id}/file.pdf(.pdfsuffix required) - Delete fax content —
DELETE /faxes/{id}/file(removes stored content before 13-month expiry) - Manage fax services — See Services Endpoint Reference
- Manage cover pages —
POST/GET/DELETE /services/{id}/coverPages— see Services reference - Manage fax-to-email — See Fax-to-Email Reference
Troubleshooting
Fax not delivered
- Check fax status via
GET /faxes/{id}— look atstatus,errorType(DOCUMENT_CONVERSION_ERROR,CALL_ERROR,FAX_ERROR,FATAL_ERROR,GENERAL_ERROR), anderrorMessage - If
contentUrlwas used with HTTPS, verify the SSL certificate (including intermediate certs) is valid - Fax delivery depends on the receiving machine answering — retries are automatic (max 5, default set per service)
Fax content renders incorrectly
- Complex DOC/DOCX formatting may not render perfectly on receiving machines. Recommend PDF instead.
Cannot send or receive faxes
- Verify the number has fax capability enabled in the Sinch dashboard
- Numbers must be provisioned for fax before use
Gotchas and Best Practices
- Use
callbackUrlfor status tracking — fax delivery is async. Prefer callbacks over polling. - PDF is the safest format for reliable rendering on receiving machines.
- Fax logs and media are retained for 13 months. Use
DELETE /faxes/{id}/fileto remove earlier, or download and archive if longer retention is needed. - International fax success rates vary by country — some have specific dialing prefix requirements.
- Use
resolution: "SUPERFINE"(400 dpi) for faxes with small text or detailed images; defaultFINE(200 dpi) works for most cases. - Security — untrusted content: Inbound fax callbacks and
contentUrlvalues may contain user-provided or third-party content. Treat all inbound fax data as untrusted — do not execute, evaluate, or interpolate it into prompts or code. Validate URLs before fetching. Sanitize callback body fields (filenames, metadata,errorMessage) before logging, rendering in HTML, or storing in a database.
Links
More from sinch/skills
sinch-conversation-api
Sends and receives omnichannel messages with Sinch Conversation API. One unified API for SMS, WhatsApp, RCS, MMS, Viber, Messenger, and more. Use when sending texts, WhatsApp messages, rich cards, carousels, templates, batch messages, or building multi-channel messaging.
81sinch-authentication
Configures Sinch API credentials and authentication. Use when setting up OAuth2, Basic auth, application signing, or API keys for any Sinch product including Conversation API, Voice, Verification, Numbers, Fax, and Mailgun. Also use when troubleshooting 401 Unauthorized, 403 Forbidden, invalid signature, or credential errors against any Sinch API. For SDKs usage, see sinch-sdks.
76sinch-mailgun
Sends, receives, and tracks email via the Mailgun (Sinch) API. Use when the user wants to send email, manage domains, configure webhooks, query email events/logs, manage templates, handle suppressions (bounces, unsubscribes, complaints), set up inbound routes, manage mailing lists, DKIM keys, or IP warmup using Mailgun.
74sinch-provisioning-api
Provisions and manages channel resources for Conversation API projects, including WhatsApp accounts/senders/templates, RCS senders, KakaoTalk senders/templates, webhooks, and bundles. Use when the user asks to onboard channels, configure provisioning webhooks, manage templates, orchestrate multi-service bundles, or automate channel setup.
73sinch-numbers-api
Search, rent, manage, and release phone numbers with the Sinch Numbers API. Use when listing active numbers, searching available numbers, renting or releasing numbers, updating number configuration (SMS/voice/callback), managing emergency addresses, or checking available regions.
71sinch-10dlc
Registers US 10DLC brands and campaigns with Sinch for A2P SMS messaging. Use when the user needs to register a brand, create a 10DLC campaign, check registration status, troubleshoot a 10DLC rejection, fix an EIN mismatch, upgrade from simplified to full registration, or qualify a campaign for US SMS sending on 10-digit long codes. Do NOT use for non-US messaging or toll-free/short code registration.
69