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

# Set the metadata of a transaction by its ID

`POST /{ledger}/transactions/{txid}/metadata`

## Path parameters

- `ledger` string, required
- `txid` integer, required

## Request body

- Metadata, nullable — Arbitrary key/value pairs attached to the resource

## Response `204`

No Content

## Other responses

- `default` — Error

## Changes

- **2025-03-13** `a13b37bacc1f` — 1 breaking
  - request body became required

[Change history](https://skmtc.dev/formancehq/apis/ledger-api/changes/:ledger/transactions/:txid/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-service-production.skmtc.workers.dev/v1/apis/formancehq/ledger-api/revisions/a0dfa3b73bf8/schema)
