Attach organizations to a group by ID
POST/groups/:group_id/organizations
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.
Requires grant:write and at least the org-admin role.
Request
Responses
- 200
- 400
- 401
- 404
- 409
- 422
The IDs newly attached
An ID in the path is not a valid integer
UNAUTHORIZED: the token lacks the grant:read / grant:write ability, or the caller lacks the required role in the organization
The group or an organization was not found
The change violates a sponsored-group rule. error.name is one of SPONSORED_GROUP_REQUIRES_ENTERPRISE (the owner is not enterprise), SPONSORED_GROUP_CLUSTER_ONLY (a grant is not rooted on a cluster), SPONSORED_GROUP_ALREADY_EXISTS (an organization already holds a sponsored group of this owner), SPONSOR_CANNOT_BE_MEMBER (the owner is attached to its own sponsored group) or GROUP_SUSPENSION_PERMANENT (sponsorship cannot be turned back on)
Validation failed