Upload a file
create_documentUse this to add a file the person gave you to a fax: a PDF, or a photo saved as JPG, PNG, WEBP or HEIC, up to 20 MB. Call it once per file, before create_fax, in the order the files should be faxed. It returns document_id, upload_url and upload_headers: PUT the file's exact bytes to upload_url with those headers within 5 minutes, then pass document_id to create_fax within an hour. Nothing is faxed or charged. If you can't read the file's bytes, don't use this: call create_fax without document_ids, and the person adds the file on the status page.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| checksum | Yes | The file's MD5 digest, base64-encoded, as printed by: openssl md5 -binary <file> | base64 | |
| filename | Yes | The file's name with its extension, like referral.pdf. | |
| byte_size | Yes | The file's exact size in bytes. | |
| fax_number | Yes | The fax number the file will be faxed to, in international format, like +14155552671. Numbers in the US and Canada only. Use the same number in create_fax. | |
| content_type | Yes | The file's media type. It must match the file's contents. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| upload_url | Yes | PUT the file's exact bytes here within 5 minutes. | |
| document_id | Yes | Pass this to create_fax in document_ids. | |
| upload_headers | Yes | Send these headers, unchanged, with the PUT. |