Add a workspace to a group

post/v1/workspace-groups/{workspace_group_id}/workspaces

Dual 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

NameTypeRequiredDescription
workspace_group_idstring <uuid>YesGroup 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

201Workspace 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"
        }
      }
    }
  }
}

400Validation error.

{
  "code": "BAD_REQUEST",
  "status": 400,
  "title": "Bad Request",
  "message": "See title.",
  "meta": {
    "trace_id": "a1b2c3",
    "log_id": "a1b2c3"
  }
}

401Unauthorized.

{
  "code": "UNAUTHORIZED",
  "status": 401,
  "title": "Unauthorized",
  "message": "See title.",
  "meta": {
    "trace_id": "a1b2c3",
    "log_id": "a1b2c3"
  }
}

403Lacks owner/admin or workspace membership.

{
  "code": "FORBIDDEN",
  "status": 403,
  "title": "Forbidden",
  "message": "See title.",
  "meta": {
    "trace_id": "a1b2c3",
    "log_id": "a1b2c3"
  }
}

404Group or workspace not found.

{
  "code": "NOT_FOUND",
  "status": 404,
  "title": "Not Found",
  "message": "See title.",
  "meta": {
    "trace_id": "a1b2c3",
    "log_id": "a1b2c3"
  }
}