Skip to main content

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

OperationMethodURL
UploadPOSThttps://deepserhost/api/rest/attachment/attachments?model_alias=[model_alias]&id=[model_id]
Get (single)GEThttps://deepserhost/api/rest/attachment/attachment/[id]?model_alias=[model_alias]&id=[model_id]
Get (multiple)GEThttps://deepserhost/api/rest/attachment/attachments?model_alias=[model_alias]&id=[model_id]
Download (single)GEThttps://deepserhost/api/rest/attachment/attachment/download/[id]?model_alias=[model_alias]&id=[model_id]
Download (multiple)GEThttps://deepserhost/api/rest/attachment/attachments/download?model_alias=[model_alias]&id=[model_id]
DeleteDELETEhttps://deepserhost/api/rest/attachment/attachment/[id]?model_alias=[model_alias]&id=[model_id]

Roles

AdministratorOperatorKey UserUser
Actions AllowedCREATE RETRIEVE DOWNLOAD DELETECREATE RETRIEVE DOWNLOAD DELETECREATE RETRIEVE DOWNLOAD DELETE--

Fields

The following table lists all fields of the Attachment entity:

FieldDescription
entity_idThe unique ID of the attachment record.
nameDisplay name of the attachment in Deepser.
file_nameFile name including extension.
file_typeMIME type of the file.
file_pathFull storage path of the file in the system.
thumbnail_pathPath to the file thumbnail.
model_aliasThe model the attachment belongs to.
model_idThe ID of the parent model record.
type_idType of attachment.
portal_visibilityWhether the attachment is visible on the User Portal.
frontend_visibilityUser Portal visibility setting.
group_visibilityGroups authorized to view the attachment.
updated_byLast user who modified the attachment.
created_byUser who uploaded the attachment.
statusWhether the attachment is enabled.
formtemplate_idThe form template ID of the record.
updated_atDate of the last update.
created_atCreation 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):

KeyTypeDescription
attachmentFileThe 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
}


note

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.
note

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.