Multi-tenancy
Hypemarket is multi-tenant. Each brand is an Organization. Users join brands via memberships, which carry a role (member or admin).
URL shape
Section titled “URL shape”Most endpoints are scoped to an organization (brand) via the URL:
/organizations/:organization_id/...The token authenticates the user; the URL identifies the organization. The user must be a member of that organization or the request returns:
404 Not Found— the org doesn’t exist for you403 Forbidden— membership found but the action isn’t permitted by your role
User-scoped endpoints
Section titled “User-scoped endpoints”A separate /me/... namespace covers resources that belong to a user directly, not a brand:
Each membership has a role:
| Role | Can read | Can mutate brand resources |
|---|---|---|
member | ✓ | ✗ (read-only on most resources) |
admin | ✓ | ✓ |
The brand owner is an admin who additionally cannot be removed or demoted.
Picking the right organization
Section titled “Picking the right organization”Most agents should:
GET /organizations.jsonto list the brands the user belongs to- Let the user pick (or, for single-org users, auto-select)
- Cache the selected
organization_idfor the session - Prepend it to every brand-scoped URL
For the structure of an Organization object, see the Organizations reference.