Media Upload
Upload files to the Amili system. This endpoint is used to attach files to various resources, such as original invoices to cases.
Media Upload endpoints
POST /media--upload/{reference_id}- Upload a file
See Case Registration for creating cases.
Example Request
Below is an example of uploading an original invoice to an existing case.
URL: POST /media--upload/6867da7788b9226bb78d716c
Headers:
x-api-key: {your_access_token}
Content-Type: multipart/form-dataForm Data:
file: [binary file data]
domain: "cases"
dotted_path: "original_invoice"Response Code: 201 Created
Response Body:
json
{
"_status": "OK",
"url": "https://storage.googleapis.com/stage-ada-vcom-api-files/stage/cases/6867da7788b9226bb78d716c-3109930dcb954308b2e028392a6f3c62?Expires=1751640521&GoogleAccessId=stage-ada-vcom-pod-svc%40stage-ada-vcom.iam.gserviceaccount.com&Signature=RI%2FVtRaYgkNpFnzQYRihVz90PrvHjtUuKRXB13AIt0%2FXkoBqJ6ekhenljhf%2BQaCK2hn09IkCxxN%2Bd9nVuV1PwlbjcA8DBkzNlqS2tmk%2FrYif%2BAbOZG9rgYAyBpnD6tXs0i11F832E7R3MsprOMyPFvs8BMvev9iaM7qzLZqNw%2FEAvt076ImTVECp6wyoc%2Fsw8ilpCAvqCGTJcIY%2FqoHLHpI3iU7dED5eSTShXGv05OmcEHM98IdVfmOBoKYWkPg9TewkX9Gse0DG2PXFa%2F9RWFHt1tMiNZYix1dcX9wHwFWvBVuGDp1ZBBULSldSD749vLUjTlPhhtsERsVxVHwfQg%3D%3D"
}Parameters
Path Parameters
| Name | Type | Required | Description |
|---|---|---|---|
reference_id | string | Yes | The ID of the resource to attach the file to |
Form Data Parameters
| Property | Type | Required | Description |
|---|---|---|---|
file | binary | Yes | File to upload. Default allowed types: PDF, JPEG, PNG, GIF, BMP. Specific fields may have different restrictions. |
domain | string | No | Resource type (e.g. "cases", "invoices"). Defaults to "media--files" if not provided.* |
dotted_path | string | Yes** | Path to the field where the file should be stored (e.g. "original_invoice" for cases). Required when domain is not "media--files".* |
Response Properties
| Property | Type | Required | Description |
|---|---|---|---|
_status | string | Yes | Request status. "OK" on success, "ERR" on error. |
url | string | Yes | Temporary signed URL (valid for 1 hour) to access the uploaded file |
Error Responses
| Status Code | Error Message | Description |
|---|---|---|
| 400 | "Domain '{domain}' is not valid." | The specified domain is not registered in the system |
| 400 | "Dotted Path Not Found in request form" | The dotted_path parameter is required when domain is not "media--files" |
| 400 | "Dotted Path is not valid" | The specified dotted_path does not exist in the domain's schema or is not a media file field |
| 400 | "File is a required attribute." | No file was provided in the request |
| 400 | "The provided file's content type is not allowed." | The file type is not allowed for this field. Error message includes expected and actual content types |
| 404 | "Resource Document Not Found" | The resource with the specified reference_id does not exist |
*) For complete list of valid domains and dotted paths, please see Media Upload **) Required when domain is not "media--files"
