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-TypeThe MIME type stored for the attachment (e.g. image/png).
Content-Dispositionattachment; filename="…" — causes browsers and HTTP clients to save the response as a file using the attachment's original filename.
Content-LengthFile size in bytes (present when the OS can determine the file size).
Content-Transfer-Encoding: binarySignals that the content is binary data.
Accept-Ranges: bytesIndicates 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:
File streamed successfully. The response body contains the raw file bytes.
The API user does not have visibility permission for this attachment, or the attachment record does not exist in the database.
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.