Attachment Base URL: https://{tenant-domain}.agentcis.com/api/v2/attachments/{attachmentableType}/{attachmentableId} Parameters: - attachmentableType (path parameter): The type of entity (e.g. clien - attachmentableId (path parameter): The ID of the entity
|
API Endpoints
Endpoint:{{Attachment Base URL}}/
Method: GET
Description: Retrieves all documents for a specific entity type and ID
Query String Parameters:
per_page=10&page=1 |
{ "data": [ { "_links": { "preview": "https:\/\/demoagency.agentcisapp.com\/attachments\/3\/preview", "download": "https:\/\/demoagency.agentcisapp.com\/attachments\/3\/download" }, "id": 3, "original_name": "John.docx", "type": "docx", "namespace": "default", "file_size": { "formatted": "11.56 KB", "actual": 11839 }, "meta": null, "created_at": "05-02-2018", "updated_at": "01-31-2019", "uploaded_by": [] }, ], "links": { "first": "http:\/\/demoagency.agentcisapp.com\/api\/v2\/attachments\/client\/5?page=1", "last": "http:\/\/demoagency.agentcisapp.com\/api\/v2\/attachments\/client\/5?page=1", "prev": null, "next": null }, "meta": { "current_page": 1, "from": 1, "last_page": 1, "links": [ { "url": null, "label": "« Previous", "active": false }, { "url": "http:\/\/demoagency.agentcisapp.com\/api\/v2\/attachments\/client\/5?page=1", "label": "1", "active": true }, { "url": null, "label": "Next »", "active": false } ], "path": "http:\/\/demoagency.agentcisapp.com\/api\/v2\/attachments\/client\/5", "per_page": "10", "to": 2, "total": 2 } } |
HTTP Status Codes:
- 200 OK
: Success
- 401 Unauthorized
: Invalid or missing authentication
- 403 Forbidden
: Insufficient permissions
- 404 Not Found
: Entity not found
Endpoint: {{Attachment Base URL}}/
Method: POST
Description: Uploads documents for a specific entity type and ID
{ "documents": [] (binary) } Note: use body type as form-data and set key as file |
{ "uploadedFiles": [], "rejectedFiles": [ { "original_name": “", "path":””, "type": "pdf", "description": "", "file_size": , "namespace": "”, "givenName": "" } ] } |
- 200 OK
: Success
- 400 Bad Request
: Validation error
- 401 Unauthorized
: Invalid or missing authentication
- 403 Forbidden
: Insufficient permissions
- 404 Not Found
: Entity not found
- 413 Payload Too Large
: File size exceeds limit
Endpoint: {{Attachment Base URL}}/
Method: PUT
Description: Updates documents for a specific entity type and ID
{ original_name: “John”, } |
{ "data": { "id": 3, "original_name": "Johns.docx", "path": "uploads\/documents\/c099688968925528594d8e5a2d9f3aaf.docx", "type": "docx", "description": null, "uploader": null, "uploader_type": "user", "attachmentable_id": 5, "attachmentable_type": "client", "file_size": 11839, "created_at": "2018-05-02T01:29:07.000000Z", "updated_at": "2025-10-08T08:56:38.000000Z", "namespace": "default", "meta": null }, "message": "You\u2019ve successfully saved your attachment\u2019s information." } |
- 200 OK
: Success
- 400 Bad Request
: Validation error
- 401 Unauthorized
: Invalid or missing authentication
- 403 Forbidden
: Insufficient permissions
- 404 Not Found
: Entity not found
Endpoint:{{Base URL}}/attachments
Method: POST
Description: Deletes multiple documents.
{ ids: [100, 101], _method: "delete" } |
{ “deletedFile”:[], “rejectedFiles”:[] } |
- 200 OK
: Success
- 400 Bad Request
: Validation error
- 401 Unauthorized
: Invalid or missing authentication
- 403 Forbidden
: Insufficient permissions