SapaganDocs sapagan.com

API reference

Consent

Consent topics of the workspace and each person's choices.

Consent topics of the workspace and each person's choices.

POST /v1/consent-topics#

Create a consent topic (workspace keys only)

marketing and seller_marketing are reserved (400 topic_key_reserved): the engine creates them.

Accepted keys Server key

Request body

FieldTypeNotes
scopeIdstring (uuid) or null
key requiredstring
name requiredstringmin 1, max 200
channel"push" | "email" | "inbox" | "webhook" | "whatsapp" or null
mode required"opt_in" | "opt_out"
curl -X POST "$SAPAGAN_URL/v1/consent-topics" \
  -H "Authorization: Bearer $SAPAGAN_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "key": "<key>",
    "name": "order_placed",
    "mode": "opt_in"
  }'

Responses

201 Created, 400 Invalid request, 403 Forbidden, 409 Conflict. Errors use the error body.

Example response 201

{
  "id": "user-42",
  "scopeId": "<scopeId>",
  "key": "<key>",
  "name": "order_placed",
  "channel": "push",
  "mode": "opt_in",
  "createdAt": "<createdAt>"
}