Download OpenAPI specification:Download
The Fax API allows you to send and receive faxes. You can send faxes to a single recipient or to multiple recipients. You can also receive faxes and download them.
To send a TEST Outbound fax you can send a fax TO +19898989898. This will emulate all aspects of a real fax without charging your account.
Create and send a fax.
Fax content may be supplied via one or more files or URLs of supported filetypes.
This endpoint supports the following content types for the fax payload:
We will however always return a fax object in the response in application json. If you supply a callbackUrl the callback will be sent as multipart/form-data with the content of the fax as an attachment to the body, unless you specify callbackUrlContentType as application/json.
Files may be included in the POST request as multipart/form-data parts.
Any URL on the Internet (including ones with basic authentication), and we'll pull it down and make it a fax. This might be useful to you if you're using a web framework for templates and creating fax files.
Please note: If you are passing fax a secure URL (starting with https://
), make sure that your SSL certificate (including your intermediate cert, if you have one) is installed properly, valid, and up-to-date.
to required | string <phoneNumber> When you send a fax you can specify a single number or a list of numbers separated by ;. Please note that if you specify a list of numbers, the fax will be sent to all numbers and a Fax resource will be created for each number. When you receive a fax, this is the number where the fax is sent to. | ||||||
file | string <binary> The file(s) you want to send as a fax as body attachment. | ||||||
from | string <phoneNumber> For | ||||||
string or Array of strings <URL> Give us any URL on the Internet (including ones with basic authentication) At least one file or contentUrl parameter is required. Please note: If you are passing fax a secure URL (starting with https://), make sure that your SSL certificate (including your intermediate cert, if you have one) is installed properly, valid, and up-to-date. If the file parameter is specified as well, content from URLs will be rendered before content from files. You can add multiple URLs by adding them as an array them with a comma when posting as multipart/form-data For example: "https://developers.sinch.com/fax/fax.pdf, https://developers.sinch.com/" or if posting JSON | |||||||
headerText | string <= 50 Default: "" Text that will be displayed at the top of each page of the fax. 50 characters maximum. Default header text is "-". Note that the header is not applied until the fax is transmitted, so it will not appear on fax PDFs or thumbnails. | ||||||
headerPageNumbers | boolean Default: true If true, page numbers will be displayed in the header. Default is true. | ||||||
headerTimeZone | string <timezone> Default: "America/New_York" A TZ database name string specifying the timezone for the header timestamp. | ||||||
retryDelaySeconds | integer [ 30 .. 300 ] Default: 60 The number of seconds to wait between retries if the fax is not yet completed. | ||||||
object (label) You can use this to attach labels to your call that you can use in your BI solutions. | |||||||
callbackUrl | string <URL> The URL to which a callback will be sent when the fax is completed. The callback will be sent as a POST request with a JSON body. The callback will be sent to the URL specified in the | ||||||
callbackUrlContentType | string Default: "multipart/form-data" The content type of the callback.
| ||||||
imageConversionMethod | string Default: "HALFTONE" Determines how documents are converted to black and white on OUTBOUND faxes only. Image conversion is not done on INBOUND faxes. Defaults to value selected on Fax Service object. | ||||||
maxRetries | integer [ 0 .. 5 ] | The number of times the fax will be retired before cancel. Default value is set in your fax service. | The maximum number of retries is 5. | ||||||
resolution | string (Resolution) The resolution for the fax. If this is set at the service, this applies to all faxes sent using that service. If this is set on the fax, this will override the service setting.
| ||||||
coverPageId | string The cover page id you want to use for the fax | ||||||
object (CoverPageData) You can use this to specify custom data for your cover page that will be sent as part of the fax. It is a key value store. Read more about how to use this here. All keys used must be lower case. | |||||||
serviceId | string ID of the fax service used. |
The created fax
id | string The id of a fax | ||||||||||
direction | string The direction of the fax.
| ||||||||||
from | string <phoneNumber> For | ||||||||||
to | string <phoneNumber> For You can add multiple numbers by adding them as an array. For example: application/json
multipart/form
| ||||||||||
numberOfPages | integer The number of pages in the fax. | ||||||||||
status | string (FaxStatus) The status of the fax
| ||||||||||
object The total price for this fax. This field is populated after the final fax price is calculated. | |||||||||||
Array of objects (BarCode) The bar codes found in the fax. This field is populated when sinch detects bar codes on incoming faxes. | |||||||||||
createTime | string <date-time> A timestamp representing the time when the initial API call was made. | ||||||||||
completedTime | string <date-time> If the job is complete, this is a timestamp representing the time the job was completed. | ||||||||||
pagesSentSuccessfully | integer The number of pages successfully sent to the receiving side in the fax. | ||||||||||
headerText | string <= 50 Default: "" Text that will be displayed at the top of each page of the fax. 50 characters maximum. Default header text is "-". Note that the header is not applied until the fax is transmitted, so it will not appear on fax PDFs or thumbnails. | ||||||||||
headerPageNumbers | boolean Default: true If true, page numbers will be displayed in the header. Default is true. | ||||||||||
headerTimeZone | string <timezone> Default: "America/New_York" A TZ database name string specifying the timezone for the header timestamp. | ||||||||||
retryDelaySeconds | integer [ 30 .. 300 ] Default: 60 The number of seconds to wait between retries if the fax is not yet completed. | ||||||||||
object (label) You can use this to attach labels to your call that you can use in your BI solutions. | |||||||||||
callbackUrl | string <URL> The URL to which a callback will be sent when the fax is completed. The callback will be sent as a POST request with a JSON body. The callback will be sent to the URL specified in the | ||||||||||
callbackUrlContentType | string Default: "multipart/form-data" The content type of the callback.
| ||||||||||
imageConversionMethod | string Default: "HALFTONE" Determines how documents are converted to black and white on OUTBOUND faxes only. Image conversion is not done on INBOUND faxes. Defaults to value selected on Fax Service object. | ||||||||||
errorType | string Error type | ||||||||||
errorCode | integer One of the error numbers listed in the Fax Error Messages section. | ||||||||||
errorMessage | string One of the error codes listed in the Fax Error Messages section. | ||||||||||
maxRetries | integer [ 0 .. 5 ] | The number of times the fax will be retired before cancel. Default value is set in your fax service. | The maximum number of retries is 5. | ||||||||||
retryCount | integer The number of times the fax has been retried. | ||||||||||
hasFile | string Only shown on the fax result. This indicates if the content of the fax is stored with Sinch. (true or false) | ||||||||||
resolution | string (Resolution) The resolution for the fax. If this is set at the service, this applies to all faxes sent using that service. If this is set on the fax, this will override the service setting.
| ||||||||||
coverPageId | string The cover page id you want to use for the fax | ||||||||||
object (CoverPageData) You can use this to specify custom data for your cover page that will be sent as part of the fax. It is a key value store. Read more about how to use this here. All keys used must be lower case. | |||||||||||
projectId | string The | ||||||||||
serviceId | string ID of the fax service used. |
{ "to": "+14155552222", "contentUrl": "https://developers.sinch.com/fax/fax.pdf" }
{- "id": "01HDF5S9P29WC29J578J8EKC1C",
- "direction": "OUTBOUND",
- "to": "+1234567890",
- "status": "IN_PROGRESS",
- "headerTimeZone": "America/New_York",
- "retryDelaySeconds": 60,
- "projectId": "YOUR_PROJECT_ID",
- "serviceId": "YOUR_SERVICE_ID",
- "maxRetries": 3,
- "createTime": "2023-10-23T21:06:52.231Z",
- "headerPageNumbers": true,
- "contentUrl": [
- "www.google.com"
], - "imageConversionMethod": "HALFTONE"
}
List faxes sent (OUTBOUND) or received (INBOUND), set parameters to filter the list. Example: Return calls made between 1st of January 2021 and 10th of January 2021.
created>=2021-01-01&startTime<=2021-01-10
{- "faxes": [
- {
- "id": "01F3J0G1M4WQR6HGY6HCF6JA0K",
- "direction": "OUTBOUND",
- "from": "+15551235656",
- "to": "+15551235656",
- "numberOfPages": 0,
- "status": "QUEUED",
- "price": {
- "currencyCode": "USD",
- "amount": "0.0040"
}, - "barCodes": [
- {
- "type": "CODE_128",
- "page": 0,
- "value": "string"
}
], - "createTime": "2021-11-01T23:25:67Z",
- "completedTime": "2019-08-24T14:15:22Z",
- "pagesSentSuccessfully": 3,
- "headerText": "",
- "headerPageNumbers": true,
- "headerTimeZone": "America/New_York",
- "retryDelaySeconds": 60,
- "labels": {
- "customerId": "1234",
- "customerName": "John Doe"
}, - "callbackUrlContentType": "multipart/form-data",
- "imageConversionMethod": "HALFTONE",
- "errorType": "DOCUMENT_CONVERSION_ERROR",
- "errorCode": 0,
- "errorMessage": "string",
- "maxRetries": 5,
- "retryCount": 0,
- "hasFile": "string",
- "resolution": "FINE",
- "coverPageId": "string",
- "coverPageData": {
- "toName": "Wahlgreens"
}, - "projectId": "ae00f005-e392-44dc-b3f5-a657a2684dg3",
- "serviceId": "01GVRB50KEQFFE1SGMPFRNBG6J"
}
], - "page": 0,
- "totalPages": 0,
- "pageSize": 0,
- "totalItems": 0
}
Get fax information using the ID number of the fax.
The fax
id | string The id of a fax | ||||||||||
direction | string The direction of the fax.
| ||||||||||
from | string <phoneNumber> For | ||||||||||
to | string <phoneNumber> For You can add multiple numbers by adding them as an array. For example: application/json
multipart/form
| ||||||||||
numberOfPages | integer The number of pages in the fax. | ||||||||||
status | string (FaxStatus) The status of the fax
| ||||||||||
object The total price for this fax. This field is populated after the final fax price is calculated. | |||||||||||
Array of objects (BarCode) The bar codes found in the fax. This field is populated when sinch detects bar codes on incoming faxes. | |||||||||||
createTime | string <date-time> A timestamp representing the time when the initial API call was made. | ||||||||||
completedTime | string <date-time> If the job is complete, this is a timestamp representing the time the job was completed. | ||||||||||
pagesSentSuccessfully | integer The number of pages successfully sent to the receiving side in the fax. | ||||||||||
headerText | string <= 50 Default: "" Text that will be displayed at the top of each page of the fax. 50 characters maximum. Default header text is "-". Note that the header is not applied until the fax is transmitted, so it will not appear on fax PDFs or thumbnails. | ||||||||||
headerPageNumbers | boolean Default: true If true, page numbers will be displayed in the header. Default is true. | ||||||||||
headerTimeZone | string <timezone> Default: "America/New_York" A TZ database name string specifying the timezone for the header timestamp. | ||||||||||
retryDelaySeconds | integer [ 30 .. 300 ] Default: 60 The number of seconds to wait between retries if the fax is not yet completed. | ||||||||||
object (label) You can use this to attach labels to your call that you can use in your BI solutions. | |||||||||||
callbackUrl | string <URL> The URL to which a callback will be sent when the fax is completed. The callback will be sent as a POST request with a JSON body. The callback will be sent to the URL specified in the | ||||||||||
callbackUrlContentType | string Default: "multipart/form-data" The content type of the callback.
| ||||||||||
imageConversionMethod | string Default: "HALFTONE" Determines how documents are converted to black and white on OUTBOUND faxes only. Image conversion is not done on INBOUND faxes. Defaults to value selected on Fax Service object. | ||||||||||
errorType | string Error type | ||||||||||
errorCode | integer One of the error numbers listed in the Fax Error Messages section. | ||||||||||
errorMessage | string One of the error codes listed in the Fax Error Messages section. | ||||||||||
maxRetries | integer [ 0 .. 5 ] | The number of times the fax will be retired before cancel. Default value is set in your fax service. | The maximum number of retries is 5. | ||||||||||
retryCount | integer The number of times the fax has been retried. | ||||||||||
hasFile | string Only shown on the fax result. This indicates if the content of the fax is stored with Sinch. (true or false) | ||||||||||
resolution | string (Resolution) The resolution for the fax. If this is set at the service, this applies to all faxes sent using that service. If this is set on the fax, this will override the service setting.
| ||||||||||
coverPageId | string The cover page id you want to use for the fax | ||||||||||
object (CoverPageData) You can use this to specify custom data for your cover page that will be sent as part of the fax. It is a key value store. Read more about how to use this here. All keys used must be lower case. | |||||||||||
projectId | string The | ||||||||||
serviceId | string ID of the fax service used. |
{- "id": "01HDF5S9P29WC29J578J8EKC1C",
- "direction": "OUTBOUND",
- "to": "+1234567890",
- "status": "IN_PROGRESS",
- "headerTimeZone": "America/New_York",
- "retryDelaySeconds": 60,
- "projectId": "YOUR_PROJECT_ID",
- "serviceId": "YOUR_SERVICE_ID",
- "maxRetries": 3,
- "createTime": "2023-10-23T21:06:52.231Z",
- "headerPageNumbers": true,
- "contentUrl": [
- "www.google.com"
], - "imageConversionMethod": "HALFTONE",
- "hasFile": false
}
Delete the fax content for a fax using the ID number of the fax. Please note that this only deletes the content of the fax from storage.
The fax content was deleted.
Download the fax content.
A file for the fax you requested will be returned in the format you specified.
A PDF file named 'fax-1234.pdf' containing all files sent for fax #1234.
This webhook is triggered when a fax is received on a Sinch number associated with a service. The webhook will contain information about the fax, such as the sender, the recipient, and the content of the fax. You set the callback URL for incoming fax events on the service, either through the dashboard or using the service API.
Multipart/form-data request payloads are encoded as forms with a content type of JSON and the actual fax content as a 'file' application/pdf attachment.
Application/json request payloads are a JSON object with the file encoded as a base64 string as part of the JSON object.
event | string Default: "INCOMING_FAX" The value is always
| ||||||
file | string <binary> <binary> <application/pdf> The fax content as a PDF attachment to the body | ||||||
eventTime | string <date-time> Time of the event. | ||||||
object (Fax) |
Returns a 200 OK response if the webhook was received successfully.
{ "event": "INCOMING_FAX", "eventTime": "2021-11-01T23:25:67Z", "fax": { "id": "01HDFHACK1YN7CCDYRA6ZRMA8Z", "direction": "INBOUND", "from": "+14155552222", "to": "+14155553333", "numberOfPages": 1, "status": "COMPLETED", "price": { "amount": "0.00", "currencyCode": "USD" }, "createTime": "2021-11-01T23:25:67Z", "completedTime": "2021-11-01T23:25:67Z", "projectId": "YOUR_PROJECT_ID", "serviceId": "YOUR_SERVICE_ID" }, "file": "{application/pdf}" }
Triggered when the fax has been completed. The callback will contain information about the fax, such as the sender, the recipient, and the content of the fax. You must set the callback URL where you want the callback sent when you make a send fax request.
event | string Default: "FAX_COMPLETED" Always fax completed for this event.
| ||||||
file | string <binary> <binary> <application/pdf> The fax content as pdf attachment to the body | ||||||
eventTime | string <date-time> Time of the event. | ||||||
object (Fax) |
Returns a 200 OK response if the webhook was received successfully.
{ "event": "FAX_COMPLETED", "eventTime": "2021-11-01T23:25:67Z", "fax": { "id": "01HDFHACK1YN7CCDYRA6ZRMA8Z", "direction": "INBOUND", "from": "+14155552222", "to": "+14155553333", "numberOfPages": 1, "status": "COMPLETED", "price": { "amount": "0.07", "currencyCode": "USD" }, "createTime": "2021-11-01T23:25:67Z", "completedTime": "2021-11-01T23:25:67Z", "callbackUrl": "https://www.my-website.com/callback", "callbackUrlContentType": "multipart/form-data", "imageConversionMethod": "HALFTONE", "projectId": "YOUR_PROJECT_ID", "serviceId": "YOUR_SERVICE_ID" }, "file": "{application/pdf}" }