POST
/
sources
/
{source_id}
/
topics
curl --request POST \
  --url https://app.getcensus.com/api/v1/sources/{source_id}/topics \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "name": "NewAppUsers",
  "sample_message": {
    "name": "Jill",
    "id": "1",
    "email": "Jill@foo.com"
  },
  "description": "Users that have signed up for our product in the last week."
}'
{
  "status": "created",
  "data": {
    "id": 18,
    "name": "NewAppUsers",
    "description": "Users that have signed up for our product in the last week.",
    "created_at": "2021-10-20T02:43:07.120Z",
    "updated_at": "2021-10-20T02:50:35.477Z",
    "schema": {
      "name": "string",
      "id": "number",
      "email": "string"
    }
  }
}

Authorizations

Authorization
string
headerrequired

Bearer token for the current workspace. Can be retrieved from the Workspace's settings page.

Path Parameters

source_id
integer
required

ID of the source

Body

application/json
name
string
required

The name of this topic.

sample_message
object
required

An example of the structure of a message that would be pushed to this topic.

description
string

The description for this topic.

Response

201 - application/json
status
enum<string>

Outcome of the operation.

Available options:
created,
error
data
object