File Uploads
Attach files to records in three steps: request an upload link, upload your file, then include the returned token when updating the record. Upload links are temporary and work only for the record and attachment type you selected.
Upload and attach a file
- Call Create File Upload with the existing record ID, attachment purpose, original filename, file type (
contentType), and file size in bytes. - Send the raw file bytes to the returned
uploadUrlusingPUTand itsContent-Typeheader. Do not include your Requidex API key in this upload request. - Pass the returned
uploadTokento the record update endpoint within 15 minutes of requesting it.
{
"resource": "invoice",
"recordId": "<INVOICE_ID>",
"purpose": "payment",
"fileName": "remittance.pdf",
"contentType": "application/pdf",
"size": 12345
}
Upload your file to the returned uploadUrl. For example, to upload a PDF from your computer:
curl -X PUT '<UPLOAD_URL>' \
-H 'Content-Type: application/pdf' \
--data-binary '@document.pdf'
Replace <UPLOAD_URL> with the link from Create File Upload and document.pdf with your file path. Use the returned Content-Type header and upload exactly the number of bytes declared in your request. Send the file itself, without JSON or base64 encoding. This upload request does not need your Requidex API key.
After the upload succeeds, include the returned uploadToken in the record update. See the endpoint-specific fields below for where to put it.
Use the same API credentials for requesting the upload link and updating the record. The token can only be used for the selected record, agency where applicable, and attachment purpose. Pass the token in your update request; you do not need to choose a storage folder or provide a file URL.
The file is attached to the record only after the update succeeds. Requidex checks that the uploaded file matches the size and file type you declared before attaching it.
Endpoint-specific fields
| Endpoint | Attachment input | Rules |
|---|---|---|
| Update Worker | attachments[].files[] or rightToWork[].files[]: { "uploadToken": "<TOKEN>", "docType": "Front" } | Requires agency-scoped write:workers. Use the matching attachments or rightToWork purpose. docType is optional. Qualification, expiry, document ownership, and verification rules still apply. Supplying files replaces the complete file set |
| Update Invoice Status | file: { "uploadToken": "<TOKEN>" } | Requires write:invoices and the payment purpose. Only for marking paid. Payment reference and date are required; comments and the attachment are optional |
| Create Worker | Inline base64 files | Upload tokens require an existing record; see Create Worker for its file content format |
Omit the invoice file field when no payment attachment is needed. Repeating an invoice's current paid status leaves its payment details and attachment unchanged. If an update fails after processing the file, request a new upload link and upload the file again before retrying.
File types and limits
| Format | MIME type |
|---|---|
application/pdf | |
| JPEG | image/jpeg |
| PNG | image/png |
Files must be non-empty and no larger than 20 MB (20,971,520 bytes). The actual size and MIME type must match the upload request, and the file signature must match its MIME type. Invalid content, missing uploads, expired tokens, and mismatched caller or record tokens return 400 BAD_REQUEST from the update endpoint.
The complete Requidex JSON request has a 50 MB limit. Files sent through an upload link do not count towards this JSON request limit. A JSON request exceeding the limit returns 413 PAYLOAD_TOO_LARGE.
Download URLs
The Open API returns temporary download links for supported Requidex-hosted attachments and documents. These links expire five minutes after the response is generated. Fetch the record again when you need a fresh link. If your integration needs to access the file later, save the record ID so you can request it again. Links to externally hosted files remain unchanged.
Keep upload links, upload tokens, and download links private: anyone with a valid link may be able to use it until it expires.