---
title: "Merge plan metadata"
method: PATCH
path: "/plans/{code}/metadata"
tags: ["plans"]
---

# Merge plan metadata

`PATCH /plans/{code}/metadata`

## Request

- Base URL: `https://api.getlago.com/api/v1`
- URL: `https://api.getlago.com/api/v1/plans/{code}/metadata`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/getlago/apis/lago-api-documentation/docs/plans/:code/metadata/patch.ts> (a function with typed inputs; its response is checked against the schema)

This endpoint merges the provided metadata with existing metadata on the plan.
Existing keys not in the request are preserved. New keys are added, existing keys are updated.

## Path parameters

- `code` string, required

## Request body

- PlanMetadataResponse
  - `metadata` MetadataObject, nullable, required: Custom metadata stored as key-value pairs. Keys are strings (max 100 characters), values can be strings (max 255 characters) or null.

## Response `200`

Plan metadata merged

- PlanMetadataResponse
  - `metadata` MetadataObject, nullable, required: Custom metadata stored as key-value pairs. Keys are strings (max 100 characters), values can be strings (max 255 characters) or null.

## Other responses

- `401`: Unauthorized error
- `404`: Not Found error
- `422`: Unprocessable entity error

## Changes

- **2026-11-03** `5d26657495a3`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/getlago/apis/lago-api-documentation/changes/plans/:code/metadata/patch.md)

---

[API](https://skmtc.dev/getlago/apis/lago-api-documentation.md) - [All operations](https://skmtc.dev/getlago/apis/lago-api-documentation/llms.txt) - [OpenAPI document](https://skmtc.dev/getlago/apis/lago-api-documentation/revisions/b216574b9612?raw)
