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.
📄️ List the organization's groups
Every group owned by the current organization, by name, with its grants and, for sponsored groups, the quota, the suspension and `currentMonth`. It does not list the groups' members: read the organizations of a group with `GET /groups/{group_id}/organizations` and its direct users with `GET /groups/{group_id}/users`.
📄️ Create a group
Creates a group, optionally attaching one grant and an initial batch of members (organizations by slug, or users by email) in one transaction. The answer is `200` and `data.status` says what happened: `created`, `name-taken` (nothing created), or `rejected-members` (nothing created, `data.rejections` lists each refused identifier).
📄️ Get a group
Returns the group, with `currentMonth` when it is sponsored.
📄️ Update a group, including its sponsorship and quota
Updates the name and description, and the sponsorship of the group.
📄️ Delete a group
Deletes the group. The access it gave, and any sponsorship, ends at once for its members.
📄️ Suspend a sponsored group's sponsored access
Stops the owner paying for the group's clients' reads, without touching the clients' other use of the platform. Sponsored reads are refused until the suspension is lifted, with `402` for a single read, or an entry in `errors` for a read across datasets. A refusal is free: nobody is charged.
📄️ Lift a temporary suspension
Restores a temporary suspension. Lifting a group that is not suspended is a no-op and answers `200`. A permanent suspension cannot be lifted (`409`).
📄️ Get a sponsored group's monthly statement
The statement of one sponsored group for one Europe/Paris calendar month: totals (requests, amount charged to the sponsor, share of the quota), one row per client organization, and inside each organization one row per **pseudonymized** user. Built from the same ledger entries as the sponsor's invoice.
📄️ List a group's grants
Requires `grant:read` and at least the `org-member` role.
📄️ Attach grants to a group
Attaches a batch of the organization's grants, skipping those already attached. Every grant must belong to the organization (`404` otherwise). A sponsored group only accepts grants whose abilities are all rooted on a cluster (`409` otherwise). Changes access at once for every member of the group.
📄️ Detach a grant from a group
Requires `grant:write` and at least the `org-admin` role.
📄️ List a group's direct users
Only users attached directly, not the members of attached organizations. Requires `grant:read` and at least the `org-member` role.
📄️ Attach users to a group by ID
Attaches existing platform users directly, skipping those already attached. A user attached directly is never sponsored: their own organization pays for their reads.
📄️ Attach users to a group by email
Answers `200` with `status: attached`, or `status: rejected-members` and one rejection per email that matches no user (nothing attached). Newly attached users receive an email.
📄️ Detach a user from a group
Requires `grant:write` and at least the `org-admin` role.
📄️ List a group's organizations
Requires `grant:read` and at least the `org-member` 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.
📄️ Detach an organization from a group
The organization's users lose the group's access at once. On a sponsored group this ends the sponsorship of that client.