---
title: "publish"
method: POST
path: "/event/{topic}/publish"
tags: ["events"]
---

# publish

`POST /event/{topic}/publish`

### Publish an event to a topic

The event provided as the request body will be published on `topic`.
When the operation returns successfully, the event is guaranteed to
eventually be published to the targeted topic.

## Path parameters

- `topic` string, required

## Request body

- CloudeventWrapper
  - `data` object — The event payload
  - `datacontenttype` string — RFC-2046 encoding of data type
  - `dataschema` string, uri — URI identifying the schema that `data` adheres to
  - `id` string, required — An event identifier
  - `source` string, uri, required — A URI identifying the event source
  - `specversion` string, required — The version of the CloudEvent spec being used.
  - `subject` string — Describes the subject of the event in the context of the event producer
  - `time` string, date-time — Time when the event occurred
  - `type` string, required — The type of the event

## Response `200`

A success message.

## Other responses

- `500` — A message describing the error

## Changes

- **2020-05-01** `d9f9d9f05f2d` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/ibm/apis/kar/changes/event/:topic/publish/post.md)

---

[API](https://skmtc.dev/ibm/apis/kar.md) · [All operations](https://skmtc.dev/ibm/apis/kar/llms.txt) · [OpenAPI document](https://skmtc.dev/ibm/apis/kar/revisions/d601f556f5f6?raw)
