Add a topic
You can create topics with the REST API in a similar manner to the topic creation methods in Diffusion client SDKs.
Endpoint |
|
Content-type |
|
Method |
|
Required scope(s) |
|
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" }
}'
| Parameter | Whether Optional | Description |
|---|---|---|
|
No |
The path at which the topic must be added |
|
Yes |
The type of topic. The default value is |
|
Yes |
A map of topic properties. The default value is |
200 |
The topic was added successfully (or already exists) |
|---|---|
|
There was a problem adding the topic due to the parameters supplied. See |
|
There was an unexpected problem adding the topic. See |
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.