Skip to navigation

Download Attachments

View as Markdown

Downloads a document a session delivered with its results — the bytes, exactly as the source issued them.

Where the id comes from

A document is reported inside the record it belongs to, never in a list of its own, and its id is the attachment_id for this call:

FlowWhere it sitsWhat it is
Spain Public Administrationdata.employment.labor_check.attachmentsthe official working-life report the labor check was read from
Financial Riderdata.direct_debits[].attachmentswhat the bank keeps for a direct debit, such as the receipt of its most recent charge

Abbreviated, from Spain Public Administration’s results — every value is the one the full example carries, with the rest of the document cut away:

{
"is_closed": true,
"retrieved_features": ["customer_information_read", "labor_check"],
"data": {
"employment": {
"labor_check": {
"product": "social_security",
"sub_family": "social_security:spain_labor_check",
"currently_active": true,
"social_security_days": 6171,
"attachments": [
{
"product": "attachment",
"sub_family": "attachment:es-tgss-life-report",
"id": "6aa74d55cacbac2754cb62e4",
"content_name": "work_life_report.pdf",
"content_type": "application/pdf",
"content_hash": "d3df1044751484e3296222487667f33050fda5e1e5d80e159773bbcd2a9540212d5f64afa48e9318b2b93dca1077ad06fd79dfb64c2e58e56c6975528c024a47",
"metadata": {
"document-type": "attachment:es-tgss-life-report",
"document-date": "2026-09-12",
"csv-code": "DEMO0-3E03C-AB917-846EF-19093-A5A2A"
}
}
]
}
}
}
}

The complete object, in its place in the results, is data.employment.labor_check.attachments — expand it in the response explorer beside Get Session Results and you are looking at the same document this endpoint downloads. In Financial Rider the same object sits under each direct debit, in its results.

content_hash is the SHA-512 of the bytes you receive, so you can verify the file you stored is the file we read, and metadata carries whatever the source publishes for checking it at origin — for the Social Security report, the CSV code the document itself prints. content_type says what the file is: a PDF for an official report, whatever the bank issued for a receipt.

When to call it

  • Once the session is closed. An open session answers 412; one whose last connection is still delivering answers 202 — call again shortly.
  • Rate limit (429). One download every 5 seconds per document.

Call it from your backend: it takes your application secret, which must never reach your customer’s browser.

Authentication

X-APP-SECRETstring
Application Secret

Path parameters

session_idstringRequiredformat: "object-id"
The unique identifier of the flow session where the attachment was retrieved.
attachment_idstringRequiredformat: "object-id"
The unique identifier of the attachment file to download.

Response

200 OK
The file, as the source issued it.

Errors

401
Unauthorized Error
403
Forbidden Error
404
Not Found Error
422
Unprocessable Entity Error
429
Too Many Requests Error