---
title: "Create Namespace"
method: POST
path: "/api/v1.msgs.namespace.create"
tags: ["Msgs"]
---

# Create Namespace

`POST /api/v1.msgs.namespace.create`

Creates or updates a msgs namespace with the given name.

## Request body

- MsgNamespaceCreateIn
  - `name` string, required
  - `retention` Retention
    - `period_ms` integer, nullable

## Response `200`

- MsgNamespaceCreateOut
  - `name` string, required
  - `retention` Retention, required
    - `period_ms` integer, nullable
  - `created` integer, required
  - `updated` integer, required

## Other responses

- `400`
- `401`
- `403`
- `422`

## Changes

- **2026-04-13** `e6c44b12ecfb` — 2 breaking
  - the `created` response's property type changed from `string` to `integer`, and format from `date-time` to `uint64` for status `200`
  - the `updated` response's property type changed from `string` to `integer`, and format from `date-time` to `uint64` for status `200`
- **2026-04-03** `8128e16dd64a` — 2 warning
  - removed the request property `retention/size_bytes`
  - removed the optional property `retention/size_bytes` from the response with the `200` status
- **2026-03-31** `cb1523fc3cdd` — 1 warning
  - the `retention/period_ms` request property's min was set to `0.00`
- **2026-03-31** `f62be26d2a53` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/svix/apis/diom-api/changes/api/v1.msgs.namespace.create/post.md)

---

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