Skip to main content
RiskProfile Documents

Attach a document to an existing RiskProfile

Uploads one file to a RiskProfile in the authenticated user’s current team. Requires addDocuments permission. Default individual limit: 15 MiB (configurable). Combined document limit: 20 MiB (20,971,520 bytes). Both file extension and MIME type must be supported. No new RiskProfile is created. Send Accept: application/json for JSON errors.

POST
/api/risk-profiles/documents
Authorizationstringheaderrequired

Laravel Sanctum API token.

Idempotency-Keystringheaderrequired

Unique key per upload. Scoped to user, team and operation. Matching RiskProfile ID and SHA-256 file content replay the same document for up to one day, without adding another file. Different input with the same key returns 422. A removed cached document returns 410 and clears the cached reference.

Required string length: 1 - 255
Example: upload-123-001

Body

multipart/form-data
documentstringrequired

One PDF, JPEG/JPG, PNG, GIF, WebP, HEIC or HEIF file.

risk_profile_idintegerrequired

Existing RiskProfile ID in the current team.

Example: 123

Response

application/json

Document attached or matching upload replayed.

human_readable_sizestringrequired
Example: 100 KB
idintegerrequired
Example: 456
mime_typestringrequired
Example: application/pdf
namestringrequired
Example: declarations.pdf
sizeintegerrequired

File size in bytes.

Example: 102400
urlstringrequired

Authenticated API download URL.

Example: https://api.riskadvisor.insure/api/risk-profiles/123/documents/456/download