Send documents by API
Post a file to a flow and fetch the result, or have it sent to you by webhook.
Create a key
Open Settings, and under Workspace open For developers. Select Create key. Give the key a name, such as "Invoice system", and select Create key again.
Copy the flow's API address
Open the flow, go to the Arrives step and open For developers. Select Copy beside the address.
Send a file
Post the file as a part named file, with your key in the X-ProcuLink-Key header. Add an Idempotency-Key so a retry never makes a second document.
curl -X POST "https://api.example.com/api/v1/flows/FLOW_ID/documents" \
-H "X-ProcuLink-Key: YOUR_KEY" \
-H "Idempotency-Key: march-invoice-0001" \
-F "file=@invoice.pdf"
Fetch the result
Reading takes a short while. Ask for the document by its id.
curl "https://api.example.com/api/v1/documents/DOCUMENT_ID" \
-H "X-ProcuLink-Key: YOUR_KEY"
Optional: get told by webhook
Instead of asking again and again, let us call you. Under For developers, enter it in Web address to call when a document is read or sent. Enter a signing secret if you want to check that calls come from us. Select Save and send a test.
Good to know
A file you send by API counts as a document, the same as an upload. A call we refuse does not create a document.