{"openapi":"3.1.0","info":{"title":"Reggiee API","version":"1.0.0","description":"The Reggiee REST API lets you manage contacts, lists, segments, campaigns, templates, flows, event pages, registrations, suppressions and webhooks for a single brand. Authenticate with a per-brand API key as a Bearer token. All responses are JSON with a `data` envelope; lists include a `meta` pagination object.","contact":{"name":"Reggiee Support","url":"https://reggi.ee"}},"servers":[{"url":"https://reggi.ee/api/v1","description":"Production"}],"security":[{"bearerAuth":[]}],"tags":[{"name":"Account","description":"Key + brand info"},{"name":"Contacts","description":"People in your CRM"},{"name":"Lists","description":"Static lists & membership"},{"name":"Segments","description":"Dynamic, rule-based audiences"},{"name":"Campaigns","description":"Email / SMS / WhatsApp broadcasts"},{"name":"Templates","description":"Email & WhatsApp templates"},{"name":"Flows","description":"Automation flows"},{"name":"Pages","description":"Event pages"},{"name":"Registrations","description":"Event sign-ups"},{"name":"Suppressions","description":"Do-not-contact list"},{"name":"Messages","description":"Per-recipient delivery status"},{"name":"Events","description":"Custom contact events"},{"name":"Analytics","description":"Aggregate metrics"},{"name":"Credits","description":"Credit balance & ledger"},{"name":"Webhooks","description":"Outbound event delivery"}],"paths":{"/me":{"get":{"tags":["Account"],"summary":"Current key, brand & account","security":[{"bearerAuth":[]}],"responses":{"200":{"description":"OK"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/contacts":{"get":{"tags":["Contacts"],"summary":"List contacts","security":[{"bearerAuth":["contacts:read"]}],"parameters":[{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1},"description":"Page number"},{"name":"per_page","in":"query","schema":{"type":"integer","default":25,"maximum":100},"description":"Items per page (max 100)"},{"name":"q","in":"query","schema":{"type":"string"},"description":"Filter by email (substring)"},{"name":"tag","in":"query","schema":{"type":"string"},"description":"Filter by tag"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Contact"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"tags":["Contacts"],"summary":"Create or upsert a contact","description":"Deduped by email then phone within the brand. Supports the `Idempotency-Key` header.","security":[{"bearerAuth":["contacts:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactInput"}}}},"responses":{"201":{"description":"Created","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Contact"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"422":{"$ref":"#/components/responses/ValidationError"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/contacts/search":{"get":{"tags":["Contacts"],"summary":"Typeahead search","security":[{"bearerAuth":["contacts:read"]}],"parameters":[{"name":"q","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/contacts/batch":{"post":{"tags":["Contacts"],"summary":"Bulk upsert contacts (max 100)","security":[{"bearerAuth":["contacts:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contacts":{"type":"array","items":{"$ref":"#/components/schemas/ContactInput"}}}}}}},"responses":{"200":{"description":"OK"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/contacts/{id}":{"get":{"tags":["Contacts"],"summary":"Get a contact","security":[{"bearerAuth":["contacts:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Contact ID"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Contact"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"tags":["Contacts"],"summary":"Update a contact","security":[{"bearerAuth":["contacts:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Contact ID"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Contact"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"delete":{"tags":["Contacts"],"summary":"Delete a contact","security":[{"bearerAuth":["contacts:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Contact ID"}],"responses":{"204":{"description":"Deleted"},"404":{"$ref":"#/components/responses/NotFound"}}}},"/contacts/{id}/activity":{"get":{"tags":["Contacts"],"summary":"Activity timeline","security":[{"bearerAuth":["contacts:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Contact ID"}],"responses":{"200":{"description":"OK"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/contacts/{id}/optout":{"post":{"tags":["Contacts"],"summary":"Opt a contact out","security":[{"bearerAuth":["contacts:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Contact ID"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"channel":{"type":"string","enum":["email","sms","whatsapp","all"]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Contact"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/contacts/{id}/optin":{"post":{"tags":["Contacts"],"summary":"Opt a contact back in","security":[{"bearerAuth":["contacts:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Contact ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["channel"],"properties":{"channel":{"type":"string","enum":["email","sms","whatsapp"]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Contact"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/contacts/{id}/tags":{"post":{"tags":["Contacts"],"summary":"Add tags","security":[{"bearerAuth":["contacts:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Contact ID"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Contact"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"delete":{"tags":["Contacts"],"summary":"Remove tags","security":[{"bearerAuth":["contacts:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Contact ID"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"tags":{"type":"array","items":{"type":"string"}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Contact"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/contacts/{id}/links":{"post":{"tags":["Contacts"],"summary":"Generate unsubscribe/preference URLs","security":[{"bearerAuth":["contacts:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Contact ID"}],"responses":{"200":{"description":"OK"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/lists":{"get":{"tags":["Lists"],"summary":"List lists","security":[{"bearerAuth":["lists:read"]}],"parameters":[{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1},"description":"Page number"},{"name":"per_page","in":"query","schema":{"type":"integer","default":25,"maximum":100},"description":"Items per page (max 100)"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/List"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"tags":["Lists"],"summary":"Create a list","security":[{"bearerAuth":["lists:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/List"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/lists/{id}":{"get":{"tags":["Lists"],"summary":"Get a list","security":[{"bearerAuth":["lists:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"List ID"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/List"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"tags":["Lists"],"summary":"Update a list","security":[{"bearerAuth":["lists:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"List ID"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/List"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"delete":{"tags":["Lists"],"summary":"Delete a list","security":[{"bearerAuth":["lists:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"List ID"}],"responses":{"204":{"description":"Deleted"}}}},"/lists/{id}/members":{"get":{"tags":["Lists"],"summary":"List members","security":[{"bearerAuth":["lists:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"List ID"},{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1},"description":"Page number"},{"name":"per_page","in":"query","schema":{"type":"integer","default":25,"maximum":100},"description":"Items per page (max 100)"}],"responses":{"200":{"description":"OK"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"tags":["Lists"],"summary":"Add a member","security":[{"bearerAuth":["lists:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"List ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["contact_id"],"properties":{"contact_id":{"type":"string","format":"uuid"}}}}}},"responses":{"200":{"description":"OK"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"delete":{"tags":["Lists"],"summary":"Remove a member","security":[{"bearerAuth":["lists:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"List ID"},{"name":"contact_id","in":"query","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Removed"}}}},"/lists/{id}/members/batch":{"post":{"tags":["Lists"],"summary":"Add up to 1000 members","security":[{"bearerAuth":["lists:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"List ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"contact_ids":{"type":"array","items":{"type":"string","format":"uuid"}}}}}}},"responses":{"200":{"description":"OK"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/segments":{"get":{"tags":["Segments"],"summary":"List segments","security":[{"bearerAuth":["segments:read"]}],"parameters":[{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1},"description":"Page number"},{"name":"per_page","in":"query","schema":{"type":"integer","default":25,"maximum":100},"description":"Items per page (max 100)"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Segment"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"tags":["Segments"],"summary":"Create a segment","security":[{"bearerAuth":["segments:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Segment"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/segments/{id}":{"get":{"tags":["Segments"],"summary":"Get a segment","security":[{"bearerAuth":["segments:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Segment ID"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Segment"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"tags":["Segments"],"summary":"Update a segment","security":[{"bearerAuth":["segments:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Segment ID"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Segment"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"delete":{"tags":["Segments"],"summary":"Delete a segment","security":[{"bearerAuth":["segments:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Segment ID"}],"responses":{"204":{"description":"Deleted"}}}},"/segments/{id}/evaluate":{"post":{"tags":["Segments"],"summary":"Evaluate a segment","description":"Returns the live count. Pass `?include_members=true` to also return matching contact IDs.","security":[{"bearerAuth":["segments:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Segment ID"},{"name":"include_members","in":"query","schema":{"type":"boolean"}}],"responses":{"200":{"description":"OK"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/campaigns":{"get":{"tags":["Campaigns"],"summary":"List campaigns","security":[{"bearerAuth":["campaigns:read"]}],"parameters":[{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1},"description":"Page number"},{"name":"per_page","in":"query","schema":{"type":"integer","default":25,"maximum":100},"description":"Items per page (max 100)"},{"name":"status","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Campaign"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"tags":["Campaigns"],"summary":"Create a campaign","security":[{"bearerAuth":["campaigns:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CampaignInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Campaign"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/campaigns/{id}":{"get":{"tags":["Campaigns"],"summary":"Get a campaign","security":[{"bearerAuth":["campaigns:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Campaign ID"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Campaign"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"tags":["Campaigns"],"summary":"Update a draft campaign","security":[{"bearerAuth":["campaigns:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Campaign ID"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Campaign"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"delete":{"tags":["Campaigns"],"summary":"Delete a campaign","security":[{"bearerAuth":["campaigns:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Campaign ID"}],"responses":{"204":{"description":"Deleted"}}}},"/campaigns/{id}/send":{"post":{"tags":["Campaigns"],"summary":"Send a campaign","description":"Sends immediately and spends credits from the account pool.","security":[{"bearerAuth":["campaigns:send"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Campaign ID"}],"responses":{"200":{"description":"OK"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/campaigns/{id}/analytics":{"get":{"tags":["Campaigns"],"summary":"Campaign analytics","security":[{"bearerAuth":["campaigns:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Campaign ID"}],"responses":{"200":{"description":"OK"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/campaigns/{id}/recipients":{"get":{"tags":["Campaigns"],"summary":"Campaign recipients","security":[{"bearerAuth":["campaigns:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Campaign ID"},{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1},"description":"Page number"},{"name":"per_page","in":"query","schema":{"type":"integer","default":25,"maximum":100},"description":"Items per page (max 100)"},{"name":"status","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"OK"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/templates":{"get":{"tags":["Templates"],"summary":"List email templates","security":[{"bearerAuth":["templates:read"]}],"parameters":[{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1},"description":"Page number"},{"name":"per_page","in":"query","schema":{"type":"integer","default":25,"maximum":100},"description":"Items per page (max 100)"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Template"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"tags":["Templates"],"summary":"Create an email template","security":[{"bearerAuth":["templates:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"subject":{"type":"string"},"preview_text":{"type":"string"},"blocks":{"type":"array"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Template"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/templates/{id}":{"get":{"tags":["Templates"],"summary":"Get a template","security":[{"bearerAuth":["templates:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Template ID"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Template"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"tags":["Templates"],"summary":"Update a template","security":[{"bearerAuth":["templates:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Template ID"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Template"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"delete":{"tags":["Templates"],"summary":"Delete a template","security":[{"bearerAuth":["templates:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Template ID"}],"responses":{"204":{"description":"Deleted"}}}},"/whatsapp-templates":{"get":{"tags":["Templates"],"summary":"List WhatsApp templates","security":[{"bearerAuth":["templates:read"]}],"parameters":[{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1},"description":"Page number"},{"name":"per_page","in":"query","schema":{"type":"integer","default":25,"maximum":100},"description":"Items per page (max 100)"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Generic"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/flows":{"get":{"tags":["Flows"],"summary":"List flows","security":[{"bearerAuth":["flows:read"]}],"parameters":[{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1},"description":"Page number"},{"name":"per_page","in":"query","schema":{"type":"integer","default":25,"maximum":100},"description":"Items per page (max 100)"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Flow"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"tags":["Flows"],"summary":"Create a flow","security":[{"bearerAuth":["flows:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"trigger":{"type":"object"},"steps":{"type":"array","items":{"type":"object"}}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Flow"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/flows/{id}":{"get":{"tags":["Flows"],"summary":"Get a flow with steps","security":[{"bearerAuth":["flows:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Flow ID"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Flow"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"tags":["Flows"],"summary":"Update a flow (must be paused/draft)","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Flow ID"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Flow"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"delete":{"tags":["Flows"],"summary":"Delete a flow","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Flow ID"}],"responses":{"204":{"description":"Deleted"}}}},"/flows/{id}/status":{"patch":{"tags":["Flows"],"summary":"Set flow status (draft/active/paused/archived)","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Flow ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["status"],"properties":{"status":{"type":"string","enum":["draft","active","paused","archived"]}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Flow"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/flows/{id}/validate":{"post":{"tags":["Flows"],"summary":"Validate a flow before going live","security":[{"bearerAuth":["flows:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Flow ID"}],"responses":{"200":{"description":"OK"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/flows/{id}/test-step":{"post":{"tags":["Flows"],"summary":"Send a test email/SMS/WhatsApp for a flow step","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Flow ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["step_type","to"],"properties":{"step_type":{"type":"string","enum":["send_email","send_sms","send_whatsapp"]},"step_id":{"type":"string","format":"uuid"},"to":{"type":"string"},"config":{"type":"object"}}}}}},"responses":{"200":{"description":"OK"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/flows/{id}/analytics":{"get":{"tags":["Flows"],"summary":"Flow delivery analytics","security":[{"bearerAuth":["flows:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Flow ID"}],"responses":{"200":{"description":"OK"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/flows/{id}/runs":{"get":{"tags":["Flows"],"summary":"List flow enrollment runs","security":[{"bearerAuth":["flows:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Flow ID"},{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1},"description":"Page number"},{"name":"per_page","in":"query","schema":{"type":"integer","default":25,"maximum":100},"description":"Items per page (max 100)"}],"responses":{"200":{"description":"OK"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/flows/{id}/enroll":{"post":{"tags":["Flows"],"summary":"Enroll a contact","security":[{"bearerAuth":["flows:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Flow ID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["contact_id"],"properties":{"contact_id":{"type":"string","format":"uuid"}}}}}},"responses":{"200":{"description":"OK"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/flow-runs/{id}":{"get":{"tags":["Flows"],"summary":"Get a flow run with history","security":[{"bearerAuth":["flows:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Flow run ID"}],"responses":{"200":{"description":"OK"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pages":{"get":{"tags":["Pages"],"summary":"List event pages","security":[{"bearerAuth":["pages:read"]}],"parameters":[{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1},"description":"Page number"},{"name":"per_page","in":"query","schema":{"type":"integer","default":25,"maximum":100},"description":"Items per page (max 100)"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Page"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pages/{id}":{"get":{"tags":["Pages"],"summary":"Get a page","security":[{"bearerAuth":["pages:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Page ID"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Page"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/pages/{id}/registrations":{"get":{"tags":["Pages"],"summary":"Registrations for a page","security":[{"bearerAuth":["registrations:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Page ID"},{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1},"description":"Page number"},{"name":"per_page","in":"query","schema":{"type":"integer","default":25,"maximum":100},"description":"Items per page (max 100)"}],"responses":{"200":{"description":"OK"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/registrations":{"get":{"tags":["Registrations"],"summary":"List registrations","security":[{"bearerAuth":["registrations:read"]}],"parameters":[{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1},"description":"Page number"},{"name":"per_page","in":"query","schema":{"type":"integer","default":25,"maximum":100},"description":"Items per page (max 100)"},{"name":"page_id","in":"query","schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Registration"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"tags":["Registrations"],"summary":"Create a registration","security":[{"bearerAuth":["registrations:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RegistrationInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Registration"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/registrations/{id}":{"get":{"tags":["Registrations"],"summary":"Get a registration","security":[{"bearerAuth":["registrations:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Registration ID"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Registration"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"delete":{"tags":["Registrations"],"summary":"Delete a registration","security":[{"bearerAuth":["registrations:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Registration ID"}],"responses":{"204":{"description":"Deleted"}}}},"/suppressions":{"get":{"tags":["Suppressions"],"summary":"List suppressions","security":[{"bearerAuth":["suppressions:read"]}],"parameters":[{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1},"description":"Page number"},{"name":"per_page","in":"query","schema":{"type":"integer","default":25,"maximum":100},"description":"Items per page (max 100)"},{"name":"channel","in":"query","schema":{"type":"string","enum":["email","sms","whatsapp","all"]}}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Suppression"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"tags":["Suppressions"],"summary":"Add a suppression","security":[{"bearerAuth":["suppressions:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["value"],"properties":{"value":{"type":"string"},"channel":{"type":"string","enum":["email","sms","whatsapp","all"]},"reason":{"type":"string"}}}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/Suppression"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/suppressions/batch":{"post":{"tags":["Suppressions"],"summary":"Add many suppressions","security":[{"bearerAuth":["suppressions:write"]}],"responses":{"200":{"description":"OK"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/suppressions/{id}":{"delete":{"tags":["Suppressions"],"summary":"Remove a suppression","security":[{"bearerAuth":["suppressions:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Suppression ID"}],"responses":{"204":{"description":"Removed"}}}},"/messages/{id}":{"get":{"tags":["Messages"],"summary":"Message delivery status","security":[{"bearerAuth":["messages:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Message recipient ID"}],"responses":{"200":{"description":"OK"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/events":{"post":{"tags":["Events"],"summary":"Ingest a custom contact event","security":[{"bearerAuth":["events:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"contact_id":{"type":"string","format":"uuid"},"email":{"type":"string"},"phone":{"type":"string"},"properties":{"type":"object"}}}}}},"responses":{"200":{"description":"OK"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/analytics/contacts":{"get":{"tags":["Analytics"],"summary":"Contact growth","security":[{"bearerAuth":["analytics:read"]}],"parameters":[{"name":"days","in":"query","schema":{"type":"integer","default":30}}],"responses":{"200":{"description":"OK"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/analytics/campaigns":{"get":{"tags":["Analytics"],"summary":"Campaign aggregates","security":[{"bearerAuth":["analytics:read"]}],"responses":{"200":{"description":"OK"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/analytics/pages":{"get":{"tags":["Analytics"],"summary":"Registrations by page","security":[{"bearerAuth":["analytics:read"]}],"responses":{"200":{"description":"OK"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/credits/balance":{"get":{"tags":["Credits"],"summary":"Credit balance","security":[{"bearerAuth":["credits:read"]}],"responses":{"200":{"description":"OK"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/credits/ledger":{"get":{"tags":["Credits"],"summary":"Credit ledger","security":[{"bearerAuth":["credits:read"]}],"parameters":[{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1},"description":"Page number"},{"name":"per_page","in":"query","schema":{"type":"integer","default":25,"maximum":100},"description":"Items per page (max 100)"}],"responses":{"200":{"description":"OK"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/exports/contacts":{"get":{"tags":["Contacts"],"summary":"Cursor-paginated contact export","security":[{"bearerAuth":["contacts:read"]}],"parameters":[{"name":"cursor","in":"query","schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","default":500,"maximum":1000}}],"responses":{"200":{"description":"OK"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/webhooks":{"get":{"tags":["Webhooks"],"summary":"List webhook endpoints","security":[{"bearerAuth":["webhooks:read"]}],"parameters":[{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1},"description":"Page number"},{"name":"per_page","in":"query","schema":{"type":"integer","default":25,"maximum":100},"description":"Items per page (max 100)"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookEndpoint"}},"meta":{"$ref":"#/components/schemas/PaginationMeta"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/RateLimited"}}},"post":{"tags":["Webhooks"],"summary":"Create a webhook endpoint","description":"Returns the signing `secret` once on creation.","security":[{"bearerAuth":["webhooks:write"]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookInput"}}}},"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookEndpoint"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/webhooks/{id}":{"get":{"tags":["Webhooks"],"summary":"Get a webhook endpoint","security":[{"bearerAuth":["webhooks:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Endpoint ID"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookEndpoint"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"patch":{"tags":["Webhooks"],"summary":"Update a webhook endpoint","security":[{"bearerAuth":["webhooks:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Endpoint ID"}],"responses":{"200":{"description":"OK","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"$ref":"#/components/schemas/WebhookEndpoint"}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}},"delete":{"tags":["Webhooks"],"summary":"Delete a webhook endpoint","security":[{"bearerAuth":["webhooks:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Endpoint ID"}],"responses":{"204":{"description":"Deleted"}}}},"/webhooks/{id}/test":{"post":{"tags":["Webhooks"],"summary":"Send a test event","security":[{"bearerAuth":["webhooks:write"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Endpoint ID"}],"responses":{"200":{"description":"OK"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}},"/webhooks/{id}/deliveries":{"get":{"tags":["Webhooks"],"summary":"Delivery log","security":[{"bearerAuth":["webhooks:read"]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"},"description":"Endpoint ID"},{"name":"page","in":"query","schema":{"type":"integer","default":1,"minimum":1},"description":"Page number"},{"name":"per_page","in":"query","schema":{"type":"integer","default":25,"maximum":100},"description":"Items per page (max 100)"}],"responses":{"200":{"description":"OK"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"API key","description":"Per-brand API key. Send as `Authorization: Bearer rk_live_...`."}},"responses":{"Unauthorized":{"description":"Missing or invalid API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"Forbidden":{"description":"Key lacks the required scope or brand not on Pro","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"NotFound":{"description":"Resource not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"ValidationError":{"description":"Invalid request body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"RateLimited":{"description":"Too many requests","headers":{"Retry-After":{"schema":{"type":"integer"}},"X-RateLimit-Remaining":{"schema":{"type":"integer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"type":"object","properties":{"error":{"type":"boolean"},"status":{"type":"integer"},"code":{"type":"string"},"message":{"type":"string"},"errors":{"type":"object"}}},"PaginationMeta":{"type":"object","properties":{"total":{"type":"integer"},"page":{"type":"integer"},"per_page":{"type":"integer"},"total_pages":{"type":"integer"}}},"Generic":{"type":"object","additionalProperties":true},"Contact":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"first_name":{"type":["string","null"]},"last_name":{"type":["string","null"]},"country":{"type":["string","null"]},"city":{"type":["string","null"]},"tags":{"type":"array","items":{"type":"string"}},"custom_fields":{"type":"object"},"email_ok":{"type":"boolean"},"sms_ok":{"type":"boolean"},"whatsapp_ok":{"type":"boolean"},"lifetime_value":{"type":"number"},"created_at":{"type":"string","format":"date-time"}}},"ContactInput":{"type":"object","properties":{"email":{"type":"string"},"phone":{"type":"string"},"first_name":{"type":"string"},"last_name":{"type":"string"},"country":{"type":"string"},"city":{"type":"string"},"tags":{"type":"array","items":{"type":"string"}},"custom_fields":{"type":"object"},"dialing_code":{"type":"string"}}},"List":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":["string","null"]},"member_count":{"type":"integer"},"created_at":{"type":"string","format":"date-time"}}},"Segment":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"description":{"type":["string","null"]},"filter_logic":{"type":"object"},"last_calculated_count":{"type":["integer","null"]}}},"SegmentInput":{"type":"object","required":["name"],"properties":{"name":{"type":"string"},"description":{"type":"string"},"filter_logic":{"type":"object"}}},"Campaign":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"channel":{"type":"string","enum":["email","sms","whatsapp"]},"status":{"type":"string"},"subject":{"type":["string","null"]},"stats":{"type":"object"},"created_at":{"type":"string","format":"date-time"}}},"CampaignInput":{"type":"object","required":["name","channel"],"properties":{"name":{"type":"string"},"channel":{"type":"string","enum":["email","sms","whatsapp"]},"list_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"segment_ids":{"type":"array","items":{"type":"string","format":"uuid"}},"subject":{"type":"string"},"blocks":{"type":"array"},"from_name":{"type":"string"},"from_email":{"type":"string"},"sms_body":{"type":"string"},"sms_sender":{"type":"string"},"scheduled_at":{"type":"string","format":"date-time"}}},"Template":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"subject":{"type":["string","null"]},"blocks":{"type":"array"}}},"Flow":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"status":{"type":"string"},"trigger":{"type":"object"}}},"Page":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"type":{"type":"string"},"path":{"type":"string"},"title":{"type":"string"},"mode":{"type":"string"},"published":{"type":"boolean"},"start_date":{"type":["string","null"]}}},"Registration":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"page_id":{"type":"string","format":"uuid"},"first_name":{"type":["string","null"]},"last_name":{"type":["string","null"]},"email":{"type":["string","null"]},"phone":{"type":["string","null"]},"country":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"}}},"RegistrationInput":{"type":"object","required":["page_id"],"properties":{"page_id":{"type":"string","format":"uuid"},"first_name":{"type":"string"},"last_name":{"type":"string"},"email":{"type":"string"},"phone":{"type":"string"},"consent":{"type":"boolean"}}},"Suppression":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"channel":{"type":"string"},"value":{"type":"string"},"reason":{"type":"string"},"created_at":{"type":"string","format":"date-time"}}},"WebhookEndpoint":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string","enum":["contact.created","contact.updated","contact.deleted","contact.unsubscribed","campaign.sent","message.delivered","message.bounced","message.complained","message.opened","message.clicked","registration.created"]}},"active":{"type":"boolean"},"secret":{"type":"string","description":"Only returned on creation"},"created_at":{"type":"string","format":"date-time"}}},"WebhookInput":{"type":"object","required":["url"],"properties":{"url":{"type":"string","format":"uri"},"events":{"type":"array","items":{"type":"string","enum":["contact.created","contact.updated","contact.deleted","contact.unsubscribed","campaign.sent","message.delivered","message.bounced","message.complained","message.opened","message.clicked","registration.created"]}},"description":{"type":"string"},"active":{"type":"boolean"}}}}},"x-scopes":{"contacts:read":"Read contacts and their activity","contacts:write":"Create, update, delete contacts; manage tags & consent","lists:read":"Read lists and members","lists:write":"Create/update lists and manage membership","segments:read":"Read segments and evaluate them","segments:write":"Create/update/delete segments","campaigns:read":"Read campaigns and analytics","campaigns:write":"Create/update/delete campaigns","campaigns:send":"Send campaigns (spends credits)","templates:read":"Read email & WhatsApp templates","templates:write":"Create/update/delete templates","flows:read":"Read automation flows","flows:write":"Enroll contacts / manage flows","pages:read":"Read event pages","registrations:read":"Read registrations","registrations:write":"Create/delete registrations","suppressions:read":"Read the suppression list","suppressions:write":"Add/remove suppressions","messages:read":"Read message delivery status","analytics:read":"Read analytics","credits:read":"Read the credit balance & ledger","events:write":"Ingest custom contact events","webhooks:read":"Read webhook endpoints & delivery log","webhooks:write":"Manage webhook endpoints"},"x-webhook-events":["contact.created","contact.updated","contact.deleted","contact.unsubscribed","campaign.sent","message.delivered","message.bounced","message.complained","message.opened","message.clicked","registration.created"]}