Unsubscribe from a topic

POST {{baseUrl}}/subscriptions/:topic/unsubscribe

Unusbscribe a user from a particular topic (and optional categories).

Request Body

{"subscription"=>{"categories"=>[{"slug"=>"<string>", "reason"=>"<string>"}, {"slug"=>"<string>", "reason"=>"<string>"}]}}

HEADERS

KeyDatatypeRequiredDescription
X-MAGICBELL-API-KEYstring(Required) The (public) API key of your MagicBell project.
X-MAGICBELL-USER-EXTERNAL-IDstringID of the user. Provide the X-MAGICBELL-USER-EMAIL header instead if you identify users by email.
X-MAGICBELL-USER-EMAILstringEmail address of the user. Provide the X-MAGICBELL-USER-EXTERNAL-ID header instead if you identify users by ID.
X-MAGICBELL-USER-HMACstringHMAC calculated with the API secret and ID, or email, of the user. Required if the project has HMAC enabled.
Content-Typestring
Acceptstring

RESPONSES

status: OK

{&quot;subscription&quot;:{&quot;categories&quot;:[{&quot;slug&quot;:&quot;\u003cstring\u003e&quot;,&quot;reason&quot;:&quot;\u003cstring\u003e&quot;,&quot;status&quot;:&quot;unsubscribed&quot;},{&quot;slug&quot;:&quot;\u003cstring\u003e&quot;,&quot;reason&quot;:&quot;\u003cstring\u003e&quot;,&quot;status&quot;:&quot;subscribed&quot;}],&quot;topic&quot;:&quot;\u003cstring\u003e&quot;}}