---
title: "Associate a label with a transaction"
method: POST
path: "/v1/transaction_label_associations"
tags: ["Transaction label"]
---

# Associate a label with a transaction

`POST /v1/transaction_label_associations`

Associates a label with a transaction. Provide `cardda_transaction_id` and either an existing
`transaction_label_id` or a `label` name (a label is created for the caller's company when
only `label` is given and none matches). The caller must own the transaction or have a role
over its owner within the same company.

## Headers

- `company-id` string, uuid, required

## Request body

- TransactionLabelAssociationCreate — Payload to associate a label with a transaction. Provide `cardda_transaction_id` (the transaction's `accounting_ledger_tx_id`) and either an existing `transaction_label_id` or a `label` name — when only `label` is given and no matching label exists, one is created for the caller's company.
  - `cardda_transaction_id` string, required — The transaction's `accounting_ledger_tx_id`.
  - `transaction_label_id` string, uuid — An existing label id to associate.
  - `label` string — Label name; used to find-or-create a label when `transaction_label_id` is absent.

## Response `201`

Association created

- TransactionLabelAssociation — The association linking a transaction label to a transaction (`cardda_transaction_id` is the transaction's `accounting_ledger_tx_id`).
  - `id` string, uuid, required
  - `transaction_label_id` string, uuid, required
  - `cardda_transaction_id` string, required — The transaction's `accounting_ledger_tx_id`.
  - `created_at` string, date-time
  - `updated_at` string, date-time

## Other responses

- `401` — Unauthorized (not authorized over the transaction, or company mismatch)

---

[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/versions/ff1aeb3fda8b/schema)
