---
title: "Update a namespace"
method: PATCH
path: "/v1/namespaces/{id}"
tags: ["Namespaces"]
---

# Update a namespace

`PATCH /v1/namespaces/{id}`

## Request

- Base URL: `https://api.samva.dev`
- URL: `https://api.samva.dev/v1/namespaces/{id}`
- Auth: API key in header `x-api-key`

Updates the fields you name and keeps the rest. `metadata` merges into the stored metadata by key, and a `null` value deletes that key.

## Path parameters

- `id` string, required

## Request body

- UpdateNamespacePayload
  - `name` string, nullable
  - `metadata` object, nullable

## Response `200`

Namespace

- Namespace
  - `id` string, required
  - `name` string, required
  - `createdAt` string, required
  - `metadata` NamespaceMetadata, required: Your own labels for the namespace, such as the id of your customer it serves. Samva stores them and never reads them.
  - `updatedAt` string, required

## Other responses

- `401`: UnauthorizedError
- `403`: ForbiddenError
- `404`: ResourceNotFoundError
- `409`: ConflictError
- `422`: ValidationError
- `500`: InternalError
- `504`: GatewayTimeoutError

---

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