Add a workspace to a group
post
/v1/workspace-groups/{workspace_group_id}/workspacesDual gate: actor must be owner/admin on the group AND have an active direct membership on the workspace being added.
Requires a bearer token: Authorization: Bearer <token>.
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
| workspace_group_id | string <uuid> | Yes | Group ID.e.g. 00000000-0000-4000-8000-000000000000 |
Request
cURL
curl -X POST https://api.wellapp.ai/v1/workspace-groups/{workspace_group_id}/workspaces \
-H "Authorization: Bearer $WELL_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"data": {
"type": "workspace-group-workspace",
"attributes": {
"workspace_id": "ws_42"
}
}
}'Request body
{
"data": {
"type": "workspace-group-workspace",
"attributes": {
"workspace_id": "ws_42"
}
}
}Responses
201 — Workspace added (join row).
{
"data": {
"type": "workspace-group-workspace",
"id": "ws_42",
"attributes": {
"workspace_id": "ws_42",
"workspace_group_id": "wg_1"
},
"relationships": {
"created_by": {
"data": {
"type": "ManyToOne",
"id": "00000000-0000-4000-8000-000000000001"
}
}
}
}
}400 — Validation error.
{
"code": "BAD_REQUEST",
"status": 400,
"title": "Bad Request",
"message": "See title.",
"meta": {
"trace_id": "a1b2c3",
"log_id": "a1b2c3"
}
}401 — Unauthorized.
{
"code": "UNAUTHORIZED",
"status": 401,
"title": "Unauthorized",
"message": "See title.",
"meta": {
"trace_id": "a1b2c3",
"log_id": "a1b2c3"
}
}403 — Lacks owner/admin or workspace membership.
{
"code": "FORBIDDEN",
"status": 403,
"title": "Forbidden",
"message": "See title.",
"meta": {
"trace_id": "a1b2c3",
"log_id": "a1b2c3"
}
}404 — Group or workspace not found.
{
"code": "NOT_FOUND",
"status": 404,
"title": "Not Found",
"message": "See title.",
"meta": {
"trace_id": "a1b2c3",
"log_id": "a1b2c3"
}
}