> ## Documentation Index
> Fetch the complete documentation index at: https://docs.codaclean.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Download CODA files

> List new bank statement files, download them, and acknowledge each download.

CODA files are bank statements that Codaclean receives from the banks of your customers.

Files arrive in the morning: running this loop twice a day is enough.

<Steps>
  <Step title="List new files">
    Call [`POST /coda-files`](/api/endpoints/list-coda-files) with a JSON body, at least `{}`.

    By default, the response only contains files you have not acknowledged yet.

    Files are grouped by customer, then by IBAN, currency and statement year.

    Useful filters: `enterpriseNumber`, `iban`, `statementDate`, `processingDate`, `statementNumber`.

    Set `includePdf` to `true` to also get the PDF version of each statement.

    **Required scope:** `files:read`
  </Step>

  <Step title="Download each file">
    Each file has a `urls.coda` link (and `urls.pdf` when requested).

    These are pre-signed URLs: download them with a plain `GET`, without the API headers.

    <Warning>
      Download URLs expire **30 minutes** after the list call. If a URL has expired, list the files again to get a fresh one.
    </Warning>
  </Step>

  <Step title="Acknowledge each download">
    Once a file is stored on your side, call [`DELETE /coda-files/{fileId}`](/api/endpoints/acknowledge-coda-file) with the file's `id`.

    The file is **not** deleted. It is marked as downloaded for your API key and the current user, and no longer appears in the next list.

    Acknowledging the same file twice returns `409`.
  </Step>
</Steps>

## Download a file again

To list files that were already acknowledged, send `"redownload": true`.

Combine it with filters such as `statementDate` to retrieve a specific period.

## Good to know

* The list is not paginated. Acknowledge files as you go to keep responses small.
* Acknowledgements are per API key and per user. Another user of your software still sees the file as new.
* Only files fully processed by Codaclean are listed.
