Skip to content

File uploads

Documents such as ID cards, signatures and CAC certificates are uploaded first, on their own. Each upload returns a file reference, which you then send in the order field that needs the document.

Upload a file

Send the file as the multipart form field file. Don't set Content-Type: application/json for this call; your HTTP client sets the multipart header itself.

POSThttps://partners.diylaw.ng/api/options/v1/FileUpload
multipart/form-data with one field:
file = the document (PDF, PNG or JPEG, up to 5 MB)
curl -X POST "https://partners.diylaw.ng/api/options/v1/FileUpload" \
  -H "Authorization: Bearer $DIYLAW_API_KEY" \
  -F "[email protected]"
{
  "file": "api_uploads/1/Xb7Qm2Kp9Lr4Tz8Vn1Wc1.pdf"
}

Then use the reference in an order step:

{
  "director_identity": "api_uploads/1/Xb7Qm2Kp9Lr4Tz8Vn1Wc1.pdf"
}

Rules

Rule Detail
File types PDF, PNG or JPEG (.pdf, .png, .jpg, .jpeg).
Size Up to 5 MB per file.
Content check The file's content must match its extension. A renamed file, e.g. an HTML page called id.pdf, is rejected.
Ownership A reference only works with the API key's own account.
One document per upload Upload each person's documents separately. You can reuse a reference if the same document genuinely applies twice.

Errors

All return 400 with a message under file:

Message Fix
No file was submitted. Send it as multipart form field "file". Use multipart/form-data with a field named file.
Only PDF, PNG and JPEG files are accepted. Convert the document.
File is larger than 5 MB. Compress or rescan at a lower resolution.
File content does not match the .pdf extension. The file is damaged or not really that type.

If an order step returns Unknown file reference. Upload the file with FileUpload first and send the "file" value it returns., the reference was mistyped, belongs to another account, or wasn't returned by FileUpload.