Attachment API
The Attachment API manages file attachments in Deepser. You can upload, download, retrieve metadata, and delete attachments associated with any supported entity. This section covers each operation and its endpoint.
Administrators, Operators, and Key Users can access this API. End Users cannot access attachments via API. Access permissions also depend on the main model (model_alias) to which the attachment belongs.
Endpoints
| Operation | Method | URL |
|---|---|---|
| Upload | POST | https://deepserhost/api/rest/attachment/attachments?model_alias=[model_alias]&id=[model_id] |
| Get (single) | GET | https://deepserhost/api/rest/attachment/attachment/[id]?model_alias=[model_alias]&id=[model_id] |
| Get (multiple) | GET | https://deepserhost/api/rest/attachment/attachments?model_alias=[model_alias]&id=[model_id] |
| Download (single) | GET | https://deepserhost/api/rest/attachment/attachment/download/[id]?model_alias=[model_alias]&id=[model_id] |
| Download (multiple) | GET | https://deepserhost/api/rest/attachment/attachments/download?model_alias=[model_alias]&id=[model_id] |
| Delete | DELETE | https://deepserhost/api/rest/attachment/attachment/[id]?model_alias=[model_alias]&id=[model_id] |
Roles
| Administrator | Operator | Key User | User | |
|---|---|---|---|---|
| Actions Allowed | CREATE RETRIEVE DOWNLOAD DELETE | CREATE RETRIEVE DOWNLOAD DELETE | CREATE RETRIEVE DOWNLOAD DELETE | -- |
Fields
The following table lists all fields of the Attachment entity:
| Field | Description |
|---|---|
| entity_id | The unique ID of the attachment record. |
| name | Display name of the attachment in Deepser. |
| file_name | File name including extension. |
| file_type | MIME type of the file. |
| file_path | Full storage path of the file in the system. |
| thumbnail_path | Path to the file thumbnail. |
| model_alias | The model the attachment belongs to. |
| model_id | The ID of the parent model record. |
| type_id | Type of attachment. |
| portal_visibility | Whether the attachment is visible on the User Portal. |
| frontend_visibility | User Portal visibility setting. |
| group_visibility | Groups authorized to view the attachment. |
| updated_by | Last user who modified the attachment. |
| created_by | User who uploaded the attachment. |
| status | Whether the attachment is enabled. |
| formtemplate_id | The form template ID of the record. |
| updated_at | Date of the last update. |
| created_at | Creation date of the record. |
Upload an Attachment
HTTP Method: POST
Endpoint:
https://deepserhost/api/rest/attachment/attachments?model_alias=[model_alias]&id=[model_id]
Required query parameters:
model_alias-- the model the attachment belongs to (e.g.,deep_service/operation).id-- the ID of the parent model record (e.g.,1868).
Request body (multipart/form-data):
| Key | Type | Description |
|---|---|---|
| attachment | File | The file to upload. |
Example response:
{
"type_id": 1,
"name": "request.svg",
"file_name": "request.svg",
"file_type": "image/svg+xml",
"model_alias": "deep_service/operation",
"model_id": 1868,
"frontend_visibility": 1,
"portal_visibility": 1,
"status": 1,
"file_path": "/0/0/0032ccd4ee1d90045deb2f18b8ccd5c8",
"created_at": "2025-08-07 08:40:54",
"created_by": "api_test",
"updated_by": "api_test",
"updated_at": "2025-08-07 08:40:54",
"entity_id": 410
}
You cannot overwrite an existing attachment. To replace a file, delete the existing attachment first, then upload the new one.
Get Attachment Info
HTTP Method: GET
Single attachment:
https://deepserhost/api/rest/attachment/attachment/[id]?model_alias=[model_alias]&id=[model_id]
Multiple attachments:
https://deepserhost/api/rest/attachment/attachments?model_alias=[model_alias]&id=[model_id]
Required parameters:
id(path) -- the attachment ID (single endpoint only).model_alias-- the model the attachment belongs to (e.g.,deep_service/operation).id(query) -- the ID of the parent model record (e.g.,1868).
Use these endpoints to retrieve the metadata of a specific attachment or all attachments associated with a given entity.
Download an Attachment
HTTP Method: GET
Single attachment:
http://deepserhost/api/rest/attachment/attachment/download/[id]?model_alias=[model_alias]&id=[model_id]
Multiple attachments:
http://deepserhost/api/rest/attachment/attachments/download?model_alias=[model_alias]&id=[model_id]
Required parameters:
id(path) -- the attachment ID (single endpoint only).model_alias-- the model the attachment belongs to.id(query) -- the ID of the parent model record.
Binary files (e.g., .zip, .docx) return raw binary content. When downloading multiple attachments, the response is a .zip archive containing all files.
Delete an Attachment
HTTP Method: DELETE
Endpoint:
https://deepserhost/api/rest/attachment/attachment/[id]?model_alias=[model_alias]&id=[model_id]
Required parameters:
id(path) -- the attachment ID.model_alias-- the model the attachment belongs to (e.g.,deep_service/operation).id(query) -- the ID of the parent model record (e.g.,1868).
On success, the server returns an HTTP 200 OK response with an empty body.