Skip to main content

Attach organizations to a group by slug

POST 

/groups/:group_id/organizations/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.

Slugs are resolved first. When some slugs match no organization, rejections lists only those, and the sponsored-group rules are not checked yet: fix the batch and send it again, which may report further refusals.

The owners of each organization newly attached receive an email saying they were granted access in the owner organization, every time the organization is attached, a re-attach after a detach included. An organization already attached is skipped and gets no email.

Requires grant:write and at least the org-admin role.

Request​

Responses​

The outcome, in data.status