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

# subscribe

`POST /event/{topic}/subscribe`

### Subscribe to a topic

Subscribe an application endpoint to be invoked when events are delivered to
the targeted `topic`.  The endpoint is described in the request body and
may be either a service endpoint or an actor method.

## Path parameters

- `topic` string, required
- `path` string, required

## Request body

- EventSubscribeRequestBody
  - `actorId` string — The subscribing actor instance id
  - `actorType` string — The subscribing actor type
  - `id` string — A optional unique id to use for this subscrition. If not id is provided, the `topic` will be used as the id.
  - `oldest` boolean — Should the subscription start with the oldest available event or only include events published after the subscription operation?
  - `path` string, required — The target endpoint to which events will be delivered
  - `service` string — The subscribing service name

## 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/subscribe/post.md)

---

[API](https://skmtc.dev/ibm/apis/kar.md) · [All operations](https://skmtc.dev/ibm/apis/kar/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/ibm/kar/revisions/d9f9d9f05f2d/schema)
