> ## 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.

# Upload files

> Get temporary credentials and upload CODA or CODB files to Codaclean.

You can send CODA or CODB files to Codaclean by uploading them to a dedicated storage location.

<Note>
  Uploading must be enabled for the accounting firm by Codaclean, and your API key needs the `files:write` scope. Otherwise, the call returns `403`.

  [Contact Codaclean](https://codaclean.be/fr-be/contact) to enable it.
</Note>

<Steps>
  <Step title="Get upload credentials">
    Call [`POST /coda-files/upload`](/api/endpoints/coda-upload-credentials) for CODA files, or [`POST /codb-files/upload`](/api/endpoints/codb-upload-credentials) for CODB files.

    The response contains temporary AWS credentials (`accessKeyId`, `secretAccessKey`, `sessionToken`), a `bucketName`, a `prefix` and an `expirationUtc` date.
  </Step>

  <Step title="Upload the files">
    With an AWS S3 client configured with these credentials, upload each file to `bucketName`, with a key that starts with `prefix/`.

    The credentials only allow uploading (`PutObject`) under that prefix.
  </Step>

  <Step title="Renew the credentials">
    The credentials stop working at `expirationUtc`. Call the endpoint again to get new ones.
  </Step>
</Steps>
