API Attachment
The Attachment entity is used to manage all attachments in Deepser.
Attachments can be uploaded/downloaded by users with the following roles: Administrator, Agent, and KeyUser.
End Users, on the other hand, cannot access this resource via API.
Access to the attachment API changes depending on the main model (model_alias) to which the attachment refers.
Endpoint references:
https://deepserhost/api/rest/attachment/attachment/[id]?model_alias=[model_alias]&id=[model_id]https://deepserhost/api/rest/attachment/attachments?model_alias=[model_alias]&id=[model_id]https://deepserhost/api/rest/attachment/attachment/download/[id]?model_alias=[model_alias]&id=[model_id]https://deepserhost/api/rest/attachment/attachments/download?model_alias=[model_alias]&id=[model_id
Roles:
Administrator | Agent | KeyUser | User | |
Actions Allowed | CREATE | CREATE | CREATE | – |
Fields:
Here we list all the fields of the entity to describe their meainings in Deepser:
Field | Description |
entity_id | The unique ID to identify the record. |
name | Name of attachment in Deepser |
file_name | File name, including extension |
file_type | The MIME type of the file |
file_path | The complete path where the file is stored in the system |
thumbnail_path | The path of the thumbnail of the file |
model_alias | The model that relates to that specific attachment |
model_id | Contains the id of the model that this attachment relates to |
type_id | Type of attachment |
portal_visibility | Visibility to user portal |
frontend_visibility | Frontend visibility |
group_visibility | Groups authorized to view the attachment |
updated_by | Last user who updated the attachment. |
created_by | User who uploaded the attachment |
status | Indicates if the attachment is enabled or not |
formtemplate_id | The formtemplate id of the record. |
updated_at | Date of the last update on the system. |
created_at | Creation date of the record |
Upload Attachment
HTTP Method: POST
Endpoint:
https://deepserhost/api/rest/attachment/attachments?model_alias=[model_alias]&id=[model_id]Required parameters:
- model_alias: that contains the model that relates to the attachment I want to create (e.g. deep_service/operation)
- model_id: that contains the id of the model that this attachment will relate to (e.g. 1868).
Body (multipart/form-data):
Key | Type | Description |
attachment | File | The file to be uploaded must be included in the body of the request. |
Once the file has been uploaded to Deepser, the system will return a JSON response containing all the references to the created Deepser attachment. Below is an example:
Response (JSON):
{
"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
}
NOTE: Once the file has been uploaded to Deepser, it will no longer be possible to overwrite the previously uploaded file. However, it can be deleted and a new attachment can be uploaded.
Get Attachment Info
HTTP Method: GET
Single attachment endpoint:
https://deepserhost/api/rest/attachment/attachment/[id]?model_alias=[model_alias]&id=[model_id]Multiple attachment endpoint:
https://deepserhost/api/rest/attachment/attachments?model_alias=[model_alias]&id=[model_id]Path Parameter:
- id: Attachment ID.
Required Query Parameters:
- model_alias: that contains the model that relates to the attachment I want to create (e.g. deep_service/operation)
- model_id: that contains the id of the model that this attachment will relate to (e.g. 1868).
Through the previously mentioned requests, it is possible to retrieve the details of a specific attachment or the list of all attachments associated with a specific entity.
Download Attachment
HTTP Method: GET
Single attachment download endpoint:
http://deepserhost/api/rest/attachment/attachment/download/[id]?model_alias=[model_alias]&id=[model_id]Multiple attachment download endpoint:
http://deepserhost/api/rest/attachment/attachments/download?model_alias=[model_alias]&id=[model_id]Path Parameter:
- id: Attachment ID.
Required parameters:
- model_alias: that contains the model that relates to the attachment I want to create
- model_id: that contains the id of the model that this attachment will relate to.
NOTE 1: Downloading files such as .zip or .docx returns binary content that cannot be read in plain text.
NOTE 2: Multiple downloads return a .zip archive containing all requested files
Delete Attachment
HTTP Method: DELETE
Endpoint:
https://deepserhost/api/rest/attachment/attachment/[id]?model_alias=[model_alias]&id=[model_id]Path Parameter:
- id: Attachment ID.
Required Query Parameters:
- model_alias: that contains the model that relates to the attachment I want to create (e.g. deep_service/operation)
- model_id: that contains the id of the model that this attachment will relate to (e.g. 1868).
If the request is successfully executed, the server will return an HTTP 200 OK response, indicating that the operation was completed successfully.