---
title: "Create a namespace"
method: POST
path: "/v1/namespaces"
tags: ["Namespaces"]
---

# Create a namespace

`POST /v1/namespaces`

## Request

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

Creates a namespace with status 201. Names are unique within the organization; a duplicate conflicts.

## Request body

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

## Response `201`

Success

- 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
- `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)
