---
title: "Create or update branch metadata"
method: POST
path: "/v2/storage/branch/{branchId}/metadata"
tags: ["Metadata"]
---

# Create or update branch metadata

`POST /v2/storage/branch/{branchId}/metadata`

## Request

- Base URL: `https://connection.keboola.com`
- URL: `https://connection.keboola.com/v2/storage/branch/{branchId}/metadata`
- Auth: one of:
  - API key in header `X-StorageApi-Token`
  - API key in header `X-KBC-ManageApiToken`
  - HTTP bearer
- TypeScript: <https://skmtc.dev/keboola/apis/keboola-storage-api/docs/v2/storage/branch/:branchId/metadata/post.ts> (a function with typed inputs; its response is checked against the schema)

Sets multiple metadata with one call. If the given key already exists
for the branch, the data will be updated with the new value and timestamp. All metadata associated
with the branch are returned.

All requests must include the branch (`/branch/{branchId}`) in the URL. This is also true for default (production) branch.
You can find out the id of your default branch by calling [List Branches](#tag/Development-Branches) and finding branch with attribute `isDefault` set to `true`.
Or you can use placeholder `default` to use with project's default branch.

## Path parameters

- `branchId` string, required

## Request body

- MetadataCreateRequest
  - `metadata` object[], required: List of metadata items to create or update
    - `key` string, required: Metadata key (`a-zA-Z0-9_.-`, max 255 chars)
    - `value` string, nullable, required: Metadata value

## Response `201`

All metadata associated with the branch.

- MetadataItemWithoutProviderResponse[]
  - `id` string, required: Metadata record identifier
  - `key` string, required: Metadata key
  - `value` string, nullable, required: Metadata value
  - `timestamp` string, required: When the metadata was created or last updated, ISO 8601 with a `+hhmm` offset

## Other responses

- `403`: Returned when the token cannot manipulate the branch or the metadata key is reserved for internal use (`storage.branches.metadata.reservedKey`).

---

[API](https://skmtc.dev/keboola/apis/keboola-storage-api.md) - [All operations](https://skmtc.dev/keboola/apis/keboola-storage-api/llms.txt) - [OpenAPI document](https://skmtc.dev/keboola/apis/keboola-storage-api/revisions/34b5ceac0317?raw)
