---
title: "Publish"
method: POST
path: "/api/v1.msgs.publish"
tags: ["Msgs"]
---

# Publish

`POST /api/v1.msgs.publish`

Publishes messages to a topic within a namespace.

## Request body

- MsgPublishIn
  - `namespace` string, nullable
  - `topic` string, required
  - `msgs` MsgIn[], required
    - `value` integer[], required
    - `headers` object
    - `key` string, nullable — Optional partition key. Messages with the same key are routed to the same partition.
    - `delay_ms` integer, nullable — Optional delay in milliseconds. The message will not be delivered to queue consumers until the delay has elapsed from the time of publish.
  - `idempotency_key` string, nullable

## Response `200`

- MsgPublishOut
  - `topics` MsgPublishOutTopic[], required
    - `topic` string, required
    - `start_offset` integer, required
    - `offset` integer, required

## Other responses

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

---

[API](https://skmtc.net/svix/apis/diom-api.md) · [All operations](https://skmtc.net/svix/apis/diom-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/svix/diom-api/versions/e98d7f3a3e10/schema)
