curl --request POST \
--url https://go.aiinsurance.io/api/v1/companies/{companyId}/files \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"entityType": "company",
"fileName": "master-agreement.pdf",
"contentType": "application/pdf",
"byteSize": 482133
}
'{
"fileId": "550e8400-e29b-41d4-a716-446655440020",
"versionId": "550e8400-e29b-41d4-a716-446655440021",
"uploadUrl": "https://storage.googleapis.com/bucket/companies/.../files/...?X-Goog-Expires=900&X-Goog-Signature=..."
}Create Upload Intent
Start uploading a document (a PDF, spreadsheet, image, or any other
attachment) to a claim or incident (event), an exposure (the insured), a
submission, quote, policy, person, organization, or the company’s own
files. This is step 1 of 3. Next, PUT the bytes to the returned
uploadUrl, then call Finalize Upload (finalizeCompanyFileUpload) with
the returned versionId. To replace the content of a file that already
exists, use Create Re-upload Intent
(createCompanyFileVersionUploadIntent) instead.
Declare the file (owner, name, MIME
type, exact byte size) and receive a short-lived signed uploadUrl
pinned to the declared content type and byte size.
To complete the upload:
PUTthe raw bytes touploadUrlwith TWO headers, both signed into the URL (the storage host rejects the request without them):Content-Type: <the contentType you declared>andx-goog-content-length-range: <byteSize>,<byteSize>. Bytes go straight to cloud storage — never through this API.POST /files/{fileId}/finalizewith the returnedversionIdto make the file visible.
Until finalize the file’s status is pending and it appears in no
listing. The signed URL expires after 15 minutes; abandoned pending
uploads are reclaimed automatically.
Files belong to an owner: a configured entity (entityType +
entityId) or the whole company (entityType: "company", no
entityId). Optionally place the file inside one of the owner’s folders
with folderId.
Required permission: file.upload
curl --request POST \
--url https://go.aiinsurance.io/api/v1/companies/{companyId}/files \
--header 'Authorization: <api-key>' \
--header 'Content-Type: application/json' \
--data '
{
"entityType": "company",
"fileName": "master-agreement.pdf",
"contentType": "application/pdf",
"byteSize": 482133
}
'{
"fileId": "550e8400-e29b-41d4-a716-446655440020",
"versionId": "550e8400-e29b-41d4-a716-446655440021",
"uploadUrl": "https://storage.googleapis.com/bucket/companies/.../files/...?X-Goog-Expires=900&X-Goog-Signature=..."
}Authorizations
Body
Optional user-visible uploader label (trimmed; must be non-empty). When set, the file is presented as uploaded by this label instead of the uploader's name — intended for historical imports carrying the source system's author (or a marker like "Data Import"). Uploader attribution stays server-set.
255