Delete Topic

Delete a topic by ID.

Deletion is refused with 409 CONFLICT (name: validation_error) while a broadcast that has not finished sending uses this topic: a broadcast that is draft, scheduled or queued, or one that still has an email the delivery consumer has not finished with. The message names the broadcast IDs; wait for them to finish, delete them, or point them at another topic first.

DELETE/topics/{topic_id}

Requires an API key with the topics:write permission.

Path Parameters

topic_idstringrequired

The ID of the topic to delete.

Response Fields

objectstring

Always "topic".

idstring

The topic ID.

deletedboolean

Always true.

curl -X DELETE 'https://api.postflare.dev/topics/b2c3d4e5-f6a7-8901-bcde-f12345678901' \
  -H 'Authorization: Bearer sk_xxxxxxxxx'
const response = await fetch(
  'https://api.postflare.dev/topics/b2c3d4e5-f6a7-8901-bcde-f12345678901',
  {
    method: 'DELETE',
    headers: {
      'Authorization': 'Bearer sk_xxxxxxxxx',
    },
  }
);

const data = await response.json();

Response

Response
{
  "object": "topic",
  "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
  "deleted": true
}