Skip to main content

Groups

Groups bundle grants and attach them to organizations and users: one group is one client's subscription. A group can be sponsored: the data owner then pays the platform fee of its clients' reads, within an optional monthly quota (see the Groups and Grants guide). Every route acts on the caller's current organization (x-organization-id selects another one the caller belongs to). Reads need the grant:read token ability and at least the member role, writes need grant:write and at least the admin role.

📄️ Attach organizations to a group by ID

Attaches existing organizations, skipping those already attached. Every member of an attached organization, present and future, reaches the group's grants. On a sponsored group, a refusal answers `409` with its code in `error.name`: `SPONSORED_GROUP_ALREADY_EXISTS` for an organization that already holds a sponsored group of the same owner, `SPONSOR_CANNOT_BE_MEMBER` for the owner itself. `error.data.refusals` lists every refused organization as `{organizationId, message}`, and nothing is attached. Attaching by ID sends no email, unlike `POST /groups/{group_id}/organizations/by-slug`.

📄️ Attach organizations to a group by slug

Answers `200` with `status: attached` and the IDs newly attached, or `status: rejected-members` with one rejection per slug that matches no organization or, on a sponsored group, per organization the group refuses (it already holds a sponsored group of the same owner, or it is the owner itself), with the refusal's message. A refusal is a per-slug entry in a `200` answer, never an HTTP error: the owner's own slug answers `200` `rejected-members` with 'A sponsor cannot be a member of its own sponsored group.', where the same organization sent by ID to `POST /groups/{group_id}/organizations` answers `409` `SPONSOR_CANNOT_BE_MEMBER`. When rejected, nothing is attached.