Skip to main content

iFax API Documentation

All calls to the iFax API should be made to https://api.ifaxapp.com/v1, which remains current with the latest minor updates.

Getting Your API Key

You can find your API key on the Settings page of your dashboard.
If you make an API call with a Live key, your balance will decrease if you perform operations that cost money (e.g., sending a fax).
All iFax API responses are formatted in JSON.

HTTP Methods

Since our API is RESTful, each API call requires a specific HTTP method to indicate the type of operation to be performed.

Standard HTTP Methods

curl -X POST https://api.ifaxapp.com/v1/customer/fax-send \
  -H 'accessToken:YOUR_API_KEY'

Method Simulation

Some HTTP clients don’t support all HTTP methods. Use the POST method with the _method parameter:
curl https://api.ifaxapp.com/v1/customer/fax-send \
  -F '_method=POST' \
  -H 'accessToken:YOUR_API_KEY'

Authentication

Most API calls require authentication via the accessToken header.

HTTP Authentication

curl 'https://api.ifaxapp.com/v1/customer/fax-send' \
  -H 'accessToken:YOUR_API_KEY' \
  -H 'Content-Type: application/json'

Data Formats

All API calls return JSON responses by default.

API Objects

Fax Object

The fax object represents a fax job in the iFax system.
FieldTypeDescription
jobIdintegerA unique ID generated for each fax sent through the API
fromNumberstringThe number (E.164 format) the fax was sent from
toNumberstringThe number (E.164 format) that received the fax
faxCallLengthintegerTotal time spent in seconds from API call to fax end
faxCallStartintegerUnix timestamp when the initial API call was made
faxCallEndintegerUnix timestamp when fax processing ended
faxTotalPagesintegerTotal number of pages in the fax
faxTransferredPagesintegerNumber of pages successfully sent and received
faxStatusstringStatus of fax: sending, delivered, canceled, failed
messagestringDetailed description of fax status or error
codeintegerNumeric code for fax status or error
directionstringDirection of fax: sent or received
Example Fax Object:
{
  "jobId": 12345,
  "fromNumber": "+441224515014",
  "toNumber": "+15065001844",
  "faxCallLength": 173,
  "faxCallStart": 1610966603,
  "faxCallEnd": 1610966723,
  "faxTotalPages": 20,
  "faxTransferredPages": 20,
  "faxStatus": "delivered",
  "message": "NORMAL_CLEARING",
  "code": 0,
  "direction": "sent"
}

Webhooks

Webhooks allow iFax to update you in real-time about the status of your faxes.

Specifying Webhook URLs

Provide a valid webhook URL on your webhook settings page, e.g., https://www.example.com/ifax_webhook.

Postflight Webhooks

Postflight webhooks are triggered when a fax completes, regardless of success.

Webhook Retries

If a webhook fails, it will automatically retry up to 5 times with exponential backoff:
Retry NumberBackoff Time
15 minutes
210 minutes
320 minutes
430 minutes
560 minutes

Fax Statuses

StatusDescription
sendingCurrently sending/communicating with the recipient machine
deliveredSuccessfully sent and received by recipient machine
canceledFax has been cancelled successfully
failedSystem failed to send fax; see error codes for more information

Error Codes & Messages

Error CodeMessage
0Success
-3001Invalid fax number
-3002Insufficient account balance
-3003Image does not exist
-3004TIFF file is empty
-3005File size exceeds maximum limit
-3006Invalid file format
-3007No permission for this action (user is not Primary)
-3008Recipient limit exceeded
-3009Invalid API key
-3010Rate limit exceeded

Send Fax

Endpoint: POST /customer/fax-send Base URL: https://api.ifaxapp.com/v1

Request Headers

HeaderValueDescription
Content-Typeapplication/jsonRequest format (required)
Acceptapplication/jsonResponse format (required)
accessTokenYour API KeyAuthentication (required)

Request Parameters

ParameterTypeRequiredDescription
faxNumberstringYesRecipient fax number (E.164 format: +1234567890)
callerIdstringNoCaller ID as From number
templateIdstringNoTemplate ID from Webapp
smartDocumentIdstringNoSmart document ID from Webapp
subjectstringNoSubject on cover page
from_namestringNoSender Name on cover page
to_namestringNoRecipient Name on cover page
messagestringNoComment on cover page
send_atstringNoUTC date/time to schedule delivery (ISO 8601 format)
faxQualitystringNoFax quality: Low, Standard (default), or HD
faxDataarrayYesArray of file attachments (at least one required)

Fax Data Array

Each item in faxData should include:
{
  "fileName": "string - File name",
  "fileUrl": "string - HTTP/HTTPS accessible URL (preferred)",
  "fileData": "string - Base64 encoded file data",
  "pages": ["array - Page selection e.g. 1-5, 2, 1-10"]
}

Sample Request

{
  "faxNumber": "+12345678901",
  "callerId": "+12345678901",
  "templateId": "0000",
  "smartDocumentId": "0000",
  "subject": "test subject",
  "from_name": "abc",
  "to_name": "xyz",
  "message": "sample fax",
  "send_at": "2019-11-14T00:55:31.820Z",
  "faxQuality": "Standard",
  "faxData": [
    {
      "fileName": "abc.pdf",
      "fileUrl": "https://example.com/document.pdf",
      "pages": ["1-5", "2", "1-10"]
    },
    {
      "fileName": "xyz.pdf",
      "fileData": "JVBERi0xLjQKJ...base64encodedcontent...",
      "pages": ["1", "2"]
    }
  ]
}

Sample Response

{
  "status": 1,
  "message": "Fax processed for sending",
  "data": {
    "jobId": 12345
  }
}

Request Restrictions

LimitValue
Max request size20MB
Max pages per fax200
Max files per fax20
Max recipients per fax15

Cancel Scheduled Fax

Endpoint: POST /customer/fax-cancel Cancel a fax that has been scheduled for future delivery.

Request Parameters

ParameterTypeRequiredDescription
jobIdintegerYesThe unique ID of the fax job to cancel

Sample Request

{
  "jobId": 12345
}

Sample Response

{
  "status": 1,
  "message": "Fax job 12345 has been cancelled",
  "data": {
    "jobId": 12345,
    "faxStatus": "canceled"
  }
}

Resend Fax

Endpoint: POST /customer/fax-resend Resend a previously sent fax.

Request Parameters

ParameterTypeRequiredDescription
jobIdintegerYesThe unique ID of the original fax job
faxNumberstringNoNew recipient number (if different)

Sample Request

{
  "jobId": 12345,
  "faxNumber": "+19876543210"
}

Sample Response

{
  "status": 1,
  "message": "Fax resent successfully",
  "data": {
    "jobId": 12346,
    "originalJobId": 12345
  }
}

Fax Webhook Events

Webhook URL: Configured in your dashboard settings

Webhook Payload

When a fax completes, iFax sends a POST request to your webhook URL with the following payload:
{
  "event": "fax.completed",
  "timestamp": 1610966723,
  "data": {
    "jobId": 12345,
    "fromNumber": "+441224515014",
    "toNumber": "+15065001844",
    "faxCallLength": 173,
    "faxCallStart": 1610966603,
    "faxCallEnd": 1610966723,
    "faxTotalPages": 20,
    "faxTransferredPages": 20,
    "faxStatus": "delivered",
    "message": "NORMAL_CLEARING",
    "code": 0
  }
}

Webhook Security

Always verify the webhook signature to ensure the request came from iFax. The signature is sent in the X-iFax-Signature header.
import hmac
import hashlib

def verify_webhook(body, signature, webhook_secret):
    expected_signature = hmac.new(
        webhook_secret.encode(),
        body.encode(),
        hashlib.sha256
    ).hexdigest()
    return hmac.compare_digest(signature, expected_signature)

Rate Limiting

iFax API implements rate limiting to ensure fair usage:
LimitValue
Requests per hour1000
Concurrent requests20
Burst capacity50
If you exceed rate limits, you’ll receive a 429 Too Many Requests response.

Response Codes

CodeMeaningHTTP Status
1Success200 OK
0Fax processing started200 OK
-1General error400 Bad Request
-2Invalid parameters400 Bad Request
-3Authentication failed401 Unauthorized
-4Insufficient balance402 Payment Required
-5Resource not found404 Not Found

Best Practices

Always use file URLs over base64 encoding for better performance and lower bandwidth usage.
  1. Error Handling - Implement proper error handling and retry logic
  2. Webhooks - Always verify webhook signatures before processing
  3. Rate Limiting - Implement backoff strategies when approaching rate limits
  4. Scheduling - Use send_at parameter to batch faxes during off-peak hours
  5. File URLs - Provide publicly accessible HTTP/HTTPS URLs instead of base64 data
  6. Monitoring - Log all API calls for debugging and auditing purposes

Support

For additional help, contact support at: