Add a topic

You can create topics with the REST API in a similar manner to the topic creation methods in Diffusion client SDKs.

Add Topic API

Endpoint

https://api.diffusion.cloud/topics/add

Content-type

application/json

Method

POST

Required scope(s)

rest-api/add

curl --include                                          \
     --request POST                                     \
     --url https://api.diffusion.cloud/topics/add       \
     --header 'authorization: Apikey <TOKEN>'           \
     --header 'content-type: application/json'          \
     -d '{"path":"my-first-topic", "type":"json",
          "properties":{ "VALIDATE_VALUES":"true" }
         }'
Add Topic parameters
Parameter Whether Optional Description

path

No

The path at which the topic must be added

type

Yes

The type of topic. The default value is json

properties

Yes

A map of topic properties. The default value is {}

Add Topic response status
200 The topic was added successfully (or already exists)

400

There was a problem adding the topic due to the parameters supplied. See message for more details

500

There was an unexpected problem adding the topic. See message for more details

Further reading

This endpoint is a thin wrapper around the JavaScript client SDK’s own topic creation method - see TopicControl.add in the JavaScript SDK reference for more detail on topic specifications, idempotency, and the underlying client-side behaviour.