Update group assignments for a specific workspace member.

Path Parameters

id
string
required
The unique identifier of the member

Request Body

groupIds
array
Array of group IDs to assign to the user

Response

Returns the updated member with the same structure as the GET /workspace/members/ endpoint.
member
object
Member details (same as GET /workspace/members/ response)

Example Request

curl -X PATCH 'https://api.caret.so/v1/workspace/members/01887270-45ab-7da0-c95d-9a9e9ebc5e89' \
  -H 'Authorization: Bearer {api_key}' \
  -H 'Content-Type: application/json' \
  -d '{
    "groupIds": [
      "01887270-56cd-7da0-c95d-9a9e9ebc6f90",
      "01887270-67ef-7da0-c95d-9a9e9ebc7g01",
      "01887270-78gh-7da0-c95d-9a9e9ebc8h12"
    ]
  }'

Example Response

{
  "member": {
    "id": "01887270-45ab-7da0-c95d-9a9e9ebc5e89",
    "userId": "01887270-45ab-7da0-c95d-9a9e9ebc5e89",
    "name": "John Doe",
    "email": "john@acme.com",
    "profileUrl": "https://example.com/profiles/john.jpg",
    "role": "admin",
    "createdAt": "2023-01-15T08:30:00Z",
    "groups": [
      {
        "id": "01887270-56cd-7da0-c95d-9a9e9ebc6f90",
        "name": "Engineering"
      },
      {
        "id": "01887270-67ef-7da0-c95d-9a9e9ebc7g01",
        "name": "Leadership"
      },
      {
        "id": "01887270-78gh-7da0-c95d-9a9e9ebc8h12",
        "name": "Product"
      }
    ]
  }
}