The attachments namespace provides API methods for getting, adding or deleting attachments from test cases. The following endpoints allow single and bulk operations
DELETE
cases/{case_id}/attachments
GET /cases/{case_id}/attachments
Returns attachment details for a test case, including the path for download.
This method uses pagination so you might need to request additional pages to retrieve all attachment details.
case_id id required
ID of the case.
Request
page integer
Number of page to return (default: first page)
per_page integer
Maximum number of attachments to return (supported: 15, 25, 50, 100; default: 100)
order string
Sort order ascending or descending by attachment ID (supported: asc, desc; default: desc)
created_by string
Comma-separated list of user IDs to filter by.
expands string
Comma-separated list of expands to return.
"created_by": {
"type": "string",
"description": "Comma-separated list of users to filter by."
},
"expands": {
"type": "string",
"description": "Comma-separated list of expands to return."
},
"order": {
"type": "string",
"enum": [
"asc",
"desc"
],
"description": "Sort order (ascending or descending)."
},
"page": {
"type": "integer",
"format": "int64",
"description": "Number of page to return."
},
"per_page": {
"type": "integer",
"format": "int64",
"enum": [
15,
25,
50,
100
],
"description": "Maximum number of items to return per page."
}This method supports the following expands so you can automatically include additional information for referenced objects:
users
Response
GET /api/v1/cases/1/attachments200 OK
{
"page": 1,
"prev_page": null,
"next_page": null,
"last_page": 1,
"per_page": 100,
"total": 9,
"result": [
{
"id": 8,
"name": "images-12.jpeg",
"note": null,
"mime_type": "image/jpeg",
"size": 10284,
"created_at": "2025-09-26T15:05:45.003Z",
"created_by": 1,
"path": "http://hostname/attachments/view/8"
},
{
"id": 7,
"name": "images-13.jpeg",
"note": null,
"mime_type": "image/jpeg",
"size": 11049,
"created_at": "2025-09-26T15:05:44.994Z",
"created_by": 1,
"path": "http://hostname/attachments/view/7"
},
...
]
}
// Paginate through results (page 1, 20 per page)
GET /cases/1/attachments?limit=20&offset=0
// Limit results to 5 attachments
GET /cases/1/attachments?limit=5
// Filter by user who created the attachments
GET /cases/1/attachments?created_by=1
// Combine pagination + filter
GET /cases/1001/attachments?limit=10&offset=10&created_by=1Status codes
200 401 403 404 429 (details)
POST /cases/{case_id}/attachments/single
Uploads a single attachment to a test case.
Request
Response
Returns the ID and details of the successfully uploaded attachment.
POST /api/v1/cases/1/attachments/single201 Created
{
"result": [
{
"id": 6,
"name": "YOUR_ATTACHMENT.png",
"note": null,
"mime_type": "image/png",
"size": 10183,
"created_at": "2025-09-17T12:33:14.108Z",
"created_by": 1,
"path": "http://TESTMO_URL/attachments/view/6"
}
]
}
Status codes
201 403 404 413 422 429 (details)
POST /cases/{case_id}/attachments
Uploads up to 20 attachments to a test case.
case_id id required
ID of the target case.
Request
files[] Multipart/form-data required
curl --location 'http://localhost/api/v1/cases/1/attachments' \
--header 'Authorization: Bearer YOUR_API_TOKEN' \
--form 'file=@"/PATH_TO_YOUR FILE"'
--form 'file=@"/PATH_TO_YOUR FILE"'
--form ...
"files[]": {
"type": "array",
"description": "Files to upload.",
"items": {
"type": "string",
"format": "binary"
}
}
Response
Returns an array containing the IDs and details of the successfully uploaded attachments.
201 Created
{
"result": [
{
"id": 15,
"name": "images-11.jpeg",
"note": null,
"mime_type": "image/jpeg",
"size": 11471,
"created_at": "2025-09-17T12:56:19.276Z",
"created_by": 1,
"path": "http://localhost/attachments/view/15"
},
{
"id": 16,
...
},
...
]
}Status codes
201 401 403 404 422 429 (details)
DELETE /cases/{case_id}/attachment
Deletes up to 100 attachments from a case.
case_id id required
ID of the target case.
Request
ids array required
An array of the attachment IDs to be deleted.
ids": {
"type": "array",
"description": "List of attachment IDs to delete (maximum of 100).",
"items": {
"type": "integer",
"format": "int64"
}
}Response
Returns a 204 no content response.
Example
DELETE /api/v1/cases/1/attachments
{
"ids": [27, 31]
}
204 No Content
Status codes
204 404 422 429 (details)