---
title: "Set the metadata of a transaction by its ID"
method: POST
path: "/v2/{ledger}/transactions/{id}/metadata"
tags: ["ledger.v2"]
---

# Set the metadata of a transaction by its ID

`POST /v2/{ledger}/transactions/{id}/metadata`

## Path parameters

- `ledger` string, required
- `id` integer, required

## Query parameters

- `dryRun` boolean

## Headers

- `Idempotency-Key` string

## Request body

- V2Metadata

## Response `204`

No Content

## Other responses

- `default` — Error

## Changes

- **2025-03-13** `a13b37bacc1f` — 1 breaking
  - request body became required
- **2024-12-09** `7ee573f0087f` — 1 warning, 1 info
  - added the new `OUTDATED_SCHEMA` enum value to the `errorCode` response property for the response status `default`
  - removed the `BUCKET_OUTDATED` enum value from the `errorCode` response property for the response status `default`
- **2024-12-05** `d93e4ae21e38` — 1 warning
  - added the new `BUCKET_OUTDATED` enum value to the `errorCode` response property for the response status `default`
- **2024-10-25** `dcde15f756b5` — 1 warning
  - added the new `LEDGER_ALREADY_EXISTS` enum value to the `errorCode` response property for the response status `default`

[Change history](https://skmtc.dev/formancehq/apis/ledger-api/changes/v2/:ledger/transactions/:id/metadata/post.md)

---

[API](https://skmtc.dev/formancehq/apis/ledger-api.md) · [All operations](https://skmtc.dev/formancehq/apis/ledger-api/llms.txt) · [OpenAPI document](https://skmtc.dev/formancehq/apis/ledger-api/revisions/8bb59440bb35?raw)
