---
title: "Upload transaction files"
method: POST
path: "/v1/transactions/{transaction_id}/files"
tags: ["Transaction"]
---

# Upload transaction files

`POST /v1/transactions/{transaction_id}/files`

Attaches one or more files to a transaction's documentation, creating the documentation
record on first upload. Send the request as `multipart/form-data` with a `files` field
(single file or array). Returns the most recently attached file.

## Path parameters

- `transaction_id` string, uuid, required

## Headers

- `company-id` string, uuid, required

## Response `201`

File attached

- TransactionFile — An ActiveStorage attachment stored against a transaction's documentation, serialized together with its blob. Returned by the transaction file endpoints.
  - `id` string, uuid, required — The attachment id (used as `file_id` in the file endpoints).
  - `name` string — The attachment name (association name, always `files`).
  - `record_type` string — The record type the attachment belongs to.
  - `record_id` string, uuid — The id of the documentation record the attachment belongs to.
  - `blob_id` string, uuid — The id of the underlying blob.
  - `created_at` string, date-time
  - `blob` object — The underlying ActiveStorage blob metadata.
    - `id` string, uuid
    - `key` string — Storage key of the blob.
    - `filename` string
    - `content_type` string
    - `metadata` object
    - `byte_size` integer
    - `checksum` string
    - `created_at` string, date-time
    - `service_name` string

## Other responses

- `400` — Missing `files` parameter
- `401` — Unauthorized
- `404` — Transaction not found
- `500` — The file could not be attached

---

[API](https://skmtc.net/cardda/apis/banking-api.md) · [All operations](https://skmtc.net/cardda/apis/banking-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/cardda/banking-api/revisions/ff1aeb3fda8b/schema)
