The model and the why
Instead of tying each user to each group individually (which doesn’t scale), Cativa uses an indirection layer: the badge. The user receives a badge, and the badge unlocks everything attached to it. Changing access for a thousand people becomes one badge operation, not a thousand group operations. Think of a badge as an access card. The “Premium” card opens certain doors in the building. You don’t configure door by door for each employee: hand out the right card and the right doors open on their own.Badge lifecycle
1
Create the badge (admin)
A badge is created once, via
POST /admin/membership/badges or in the dashboard. It has a name, an image, and a relevance.2
Configure access (dashboard)
The admin marks, on each group/course access screen, which badges unlock entry. This binding lives in the dashboard, not in the partner API.
3
Assign to the user (API)
You assign the badge to the user (by
userId or by email). Access is unlocked at that moment.4
Remove when needed (API)
Removing the badge revokes access immediately. Ideal for subscription cancellation.
Real-world use cases
External purchase grants access
User buys on Hotmart: the webhook hits your API, you assign the
Premium badge, and they enter the VIP group right away.Cancelled subscription revokes access
Cancellation on Stripe: the webhook arrives, you remove the
Premium badge, and course access is gone instantly.Cohort with an expiry
Student in the 2026 cohort: assign the badge with an
expirationDate and access expires on its own at the end.Mentor role
Promoted someone to mentor: the
Mentor badge opens the mentors’ group without touching each group by hand.The user’s badges
To list the authenticated user’s badges, useGET /membership/badges/my:
id is the user/badge link (the assignment); badgeId is the badge itself. To revoke, use the badgeId. The JSON here is illustrative: the field-by-field schema lives in the API Reference tab (Badge tag).Admin badge API
Under the/admin/membership/badges prefix:
Create a badge
201 Created):
Assign a badge
Assign by email when you only have the CRM email and don’t want to resolve theuserId first. If you already have the userId, use the direct route.
expirationDate (ISO 8601). Without it, access does not expire.
Remove a badge
Adjust the expiration
Extend or shorten access without re-assigning:Idempotency
Assigning the same badge twice is idempotent: the final state is the same, with no error and no duplicate. Removing a badge the user no longer has is idempotent too. This simplifies retries in jobs and webhook handlers: you can reprocess an event without fear of side effects.End-to-end: external purchase grants access
1
Receive the purchase webhook
Your API receives the purchase event from the external provider (Hotmart, Stripe, etc.) with the buyer’s email.
2
Ensure the user in Cativa
Look up by email (
GET /admin/users/email/{email}); if missing, create (POST /admin/users). See Identity and Users.3
Assign the badge
POST /admin/membership/badges/{badgeId}/users/by-email with the email. Group/course access opens immediately.4
On cancellation, remove the badge
When the cancellation webhook arrives,
DELETE the assignment. Access is revoked.Difference from Roles
Badge asks “can you enter here?”. Role asks “can you edit what’s here?”.
Common errors
404 Not Found on assign
404 Not Found on assign
The
badgeId does not exist in the tenant, or the email/userId matches no user. Confirm the badge (GET /admin/membership/badges) and the user before assigning.403 Forbidden
403 Forbidden
The key lacks admin scope.
/admin/membership/badges routes require an admin API Key.Assigned the badge but access didn't open
Assigned the badge but access didn't open
The badge exists and was assigned, but no group/course is configured to accept it. That binding is done in the dashboard. Confirm with the tenant admin that the badge is an access requirement on some resource.
Anti-pattern: don’t use badges as tags
Next steps
Communities and Spaces
How groups and courses consume badges to gate entry.
Webhooks
Receive
user_received_badge and other membership events.