Attachment APIs
This set of APIs manages the full lifecycle of a “File” resource. Each API plays a specific role, and together they provide a standard create–read–update pattern.
1. Upload File API
POST /api-public/1.0/save_file
This endpoint is uploads and attaches a file to a case in the system.
Operation:
- The authenticated client sends a binary file in the request body.
- Unlike all other create operations, this uses multipart/form-data instead of JSON.
- The server validates and uploads the new attachment.
- A unique attachment id is generated and returned in the response.
Form fields:
| caseId | UUID of the case to which to attach the file. | Required |
| file | The binary file. Must be the last field in the body. | Required |
| description | Text description for the attachment. | Optional |
| templateLocale | Locale, e.g. "en_US" (defaults to en_US). | Optional |
| bulkTags[] | Tag IDs. Repeat this field once per tag ID. The full tag field name is bulkTags[] (including the brackets). Do not send a JSON array. | Optional |
Typical Response (200 File uploaded and attachment created successfully):
{
"id": "uuid string",
"name": "string",
"nameWithoutExtension": "string",
"encoding": "string",
"mimeType": "string",
"objectId": "string",
"sizeBytes": integer
...
}Purpose:
- Upload a new file to a case.
- Retrieve the ID required for further operations (retrieval, updates).
2. List Attachments API
GET /api-public/1.0/attachments
This endpoint retrieves a list of files that the authenticated user is authorized to view.
Operation:
- The authenticated client sends a GET request with query parameters.
- The server returns an object containing records and count, where records contains the attachments in the current page and count indicates how many records were returned.
Use query parameters to:
- Limit the number of records to return with limit
- List records before or after the given field value together with sort
- Control sort direction with order
- Limit the returned fields with fields
- Filter results by supported (string based) file fields, such as kind, fileFormat, etc.
Typical Response (200 List attachments successfully):
{
"records": [
{
"id": "string",
"createdDate": "UTC time"
...
}
],
...
"count": integer
}Purpose:
- View existing attachment information, including file metadata (e.g. filename, size, MIME type, etc.).
- Find and query all files meeting certain criteria.
3. Download Attachment API
GET /api-public/1.0/attachment/:id/attachment
This endpoint streams binary file content of an attachment record. For legacy multi-file uploads, return only the first file.
Operation:
- Client sends a GET request with the attachment's unique id.
- The server returns the raw file, not JSON. The response will not list the attachment's metadata.
- To get the attachment's metadata without download the file, see Retrieve Attachment API.
Typical Response (200 File bytes streamed successfully):
@filename
Purpose:
- Download a file attached to a case.
4. Retrieve Attachment API
GET /api-public/1.0/attachment/{id}
This endpoint is used to fetch an existing attachment by its ID.
Operation:
- Client sends a GET request with the id returned from the upload step.
- The server validates the ID and returns the attachment details.
Typical Response (200 Attachment retrieved successfully):
{
"id": "uuid string",
"createdDate": "UTC time"
...
}Purpose:
- View existing attachment information, including file metadata (e.g. filename, size, MIME type, etc.).
- Confirm data that was created or previously updated.