6.5.Download an attachment — GET /v1/ats/attachments/:id/download

6.5.Download an attachment — GET /v1/ats/attachments/:id/download

Streams the file content as a binary response. This endpoint bypasses the JSON:API pipeline entirely: the response body is the raw file bytes, not a JSON document.

The response includes the following headers:

Content-Type

The MIME type stored for the attachment (e.g. image/png).

Content-Disposition

attachment; filename="…" — causes browsers and HTTP clients to save the response as a file using the attachment's original filename.

Content-Length

File size in bytes (present when the OS can determine the file size).

Content-Transfer-Encoding: binary

Signals that the content is binary data.

Accept-Ranges: bytes

Indicates that byte-range requests are structurally supported. Note that partial-content (HTTP 206) responses are not implemented; the entire file is always returned.

Example request:

GET /api/index.php/v1/ats/attachments/7/downloadAuthorization: Bearer <token>

HTTP codes:

200 OK

File streamed successfully. The response body contains the raw file bytes.

403 Forbidden

The API user does not have visibility permission for this attachment, or the attachment record does not exist in the database.

404 Not Found

The attachment record exists in the database but the physical file is missing from the server's file system (e.g. it was deleted manually). The response body is empty.