---
title: "EventWolf API: Topics"
description: "Create or update a topic, list topics, get a topic, or delete a topic, with the EventWolf API."
url: "https://agentpost.tools/docs/eventwolf/reference/topics"
kind: reference
---

# Topics

What notifications are about, such as `assignments`: each topic’s name, whether it reaches each channel by default, and whether it is required.

[Notifications](/docs/eventwolf/concepts/notifications.md) explains topics, recipients, preferences, and the inbox.

Paths are relative to `https://api.agentpost.tools/v1/events`, and every request follows the [API basics](/docs/platform/api-basics.md). [Who may call](/docs/eventwolf/reference.md#who-may-call) explains each kind of caller.

## Create or update a topic

`PUT /topics/:key`

Creates a topic, or replaces what it says.

-   **Who may call:** Your server, with your project’s secret key.
-   **Credential:** the examples send your project’s `dev` secret key, `sk_test_…`, as `Authorization: Bearer <token>`.
-   **Idempotency-Key:** optional. [Retrying a write](/docs/platform/api-basics.md#retrying-a-write) has the rule.

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `key` | `string` | Yes | A topic key, such as `assignments`. The `key` of a [`TopicRecord`](/docs/eventwolf/reference/topics.md#the-topicrecord-object). |

### Body

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | `string` | No | 1–200 characters. |
| `description` | `string` | No | Up to 2000 characters. |
| `defaults` | `object` | Yes |  |
| `defaults.inbox` | `boolean` | Yes |  |
| `defaults.push` | `boolean` | Yes |  |
| `required` | `boolean` | Yes |  |

### Response

`200 OK`, with:

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `topic` | [`TopicRecord`](/docs/eventwolf/reference/topics.md#the-topicrecord-object) | Always |  |

### Errors

-   [`invalid_request`](/docs/eventwolf/errors.md#invalid_request) (400)
-   [`payload_too_large`](/docs/eventwolf/errors.md#payload_too_large) (413)

Any operation can also answer with the codes [Conventions](/docs/eventwolf/reference.md#conventions) lists.

```bash tab="curl"
curl -X PUT https://api.agentpost.tools/v1/events/topics/assignments \
  -H "Authorization: Bearer sk_test_…" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Assignments",
    "description": "When a request is assigned to you",
    "defaults": {
      "inbox": true,
      "push": false
    },
    "required": false
  }'
```

```json title="Response"
{
  "topic": {
    "key": "assignments",
    "name": "Assignments",
    "description": "When a request is assigned to you",
    "defaults": {
      "inbox": true,
      "push": false
    },
    "required": false,
    "createdAt": "2026-11-02T14:05:00.000Z",
    "updatedAt": "2026-11-02T14:05:00.000Z"
  }
}
```

## List topics

`GET /topics`

Topics, by key.

-   **Who may call:** Your server, with your project’s secret key.
-   **Credential:** the examples send your project’s `dev` secret key, `sk_test_…`, as `Authorization: Bearer <token>`.
-   **Pages:** `limit`, 1 to 200, default 50, with `next` and `after`. [Lists](/docs/platform/api-basics.md#lists) has the rule.

### Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `after` | `string` | No |  |
| `limit` | `integer` | No | 1–200; default `50`. |

### Response

`200 OK`, with:

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `topics` | [`TopicRecord`](/docs/eventwolf/reference/topics.md#the-topicrecord-object) array | Always |  |
| `next` | `string` | When set |  |

### Errors

-   [`invalid_request`](/docs/eventwolf/errors.md#invalid_request) (400)

Any operation can also answer with the codes [Conventions](/docs/eventwolf/reference.md#conventions) lists.

```bash tab="curl"
curl https://api.agentpost.tools/v1/events/topics \
  -H "Authorization: Bearer sk_test_…"
```

```json title="Response"
{
  "topics": [
    {
      "key": "assignments",
      "name": "Assignments",
      "description": "When a request is assigned to you",
      "defaults": {
        "inbox": true,
        "push": false
      },
      "required": false,
      "createdAt": "2026-11-02T14:05:00.000Z",
      "updatedAt": "2026-11-02T14:05:00.000Z"
    }
  ]
}
```

## Get a topic

`GET /topics/:key`

One topic.

-   **Who may call:** Your server, with your project’s secret key.
-   **Credential:** the examples send your project’s `dev` secret key, `sk_test_…`, as `Authorization: Bearer <token>`.

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `key` | `string` | Yes | A topic key, such as `assignments`. The `key` of a [`TopicRecord`](/docs/eventwolf/reference/topics.md#the-topicrecord-object). |

### Response

`200 OK`, with:

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `topic` | [`TopicRecord`](/docs/eventwolf/reference/topics.md#the-topicrecord-object) | Always |  |

### Errors

-   [`not_found`](/docs/eventwolf/errors.md#not_found) (404)

Any operation can also answer with the codes [Conventions](/docs/eventwolf/reference.md#conventions) lists.

```bash tab="curl"
curl https://api.agentpost.tools/v1/events/topics/assignments \
  -H "Authorization: Bearer sk_test_…"
```

```json title="Response"
{
  "topic": {
    "key": "assignments",
    "name": "Assignments",
    "description": "When a request is assigned to you",
    "defaults": {
      "inbox": true,
      "push": false
    },
    "required": false,
    "createdAt": "2026-11-02T14:05:00.000Z",
    "updatedAt": "2026-11-02T14:05:00.000Z"
  }
}
```

## Delete a topic

`DELETE /topics/:key`

Deletes a topic. A subscription that still notifies on it answers `conflict`: change it first.

-   **Who may call:** Your server, with your project’s secret key.
-   **Credential:** the examples send your project’s `dev` secret key, `sk_test_…`, as `Authorization: Bearer <token>`.
-   **Idempotency-Key:** optional. [Retrying a write](/docs/platform/api-basics.md#retrying-a-write) has the rule.

### Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `key` | `string` | Yes | A topic key, such as `assignments`. The `key` of a [`TopicRecord`](/docs/eventwolf/reference/topics.md#the-topicrecord-object). |

### Response

`204 No Content`, with no body.

### Errors

-   [`not_found`](/docs/eventwolf/errors.md#not_found) (404)
-   [`conflict`](/docs/eventwolf/errors.md#conflict) (409)

Any operation can also answer with the codes [Conventions](/docs/eventwolf/reference.md#conventions) lists.

```bash tab="curl"
curl -X DELETE https://api.agentpost.tools/v1/events/topics/assignments \
  -H "Authorization: Bearer sk_test_…"
```

```text title="Response"
204 No Content
```

## The TopicRecord object

| Name | Type | Present | Description |
| --- | --- | --- | --- |
| `key` | `string` | Always |  |
| `name` | `string` | Always |  |
| `description` | `string` | When set |  |
| `defaults` | `object` | Always | Each value is a `boolean`. |
| `required` | `boolean` | Always |  |
| `createdAt` | `string` | Always |  |
| `updatedAt` | `string` | Always |  |

```json title="The TopicRecord object"
{
  "key": "assignments",
  "name": "Assignments",
  "description": "When a request is assigned to you",
  "defaults": {
    "inbox": true,
    "push": false
  },
  "required": false,
  "createdAt": "2026-11-02T14:05:00.000Z",
  "updatedAt": "2026-11-02T14:05:00.000Z"
}
```
