# setContactsTeams

Put contacts on teams (addTeamIds, from listTeams) and take them off (removeTeamIds); replaceExisting makes addTeamIds the exact set. addTeamIds is required: pass [] to only take them off. A bulk task (bulkTaskId, getBulkTask).

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "setContactsTeams", "variables": {...} }`
- Scope: `WRITE`
- Type: mutation
- Idempotency: honors `Idempotency-Key` (24 h)
- Rate-limited: no

## Variables

- `contactIds`: `[String!]!` (required)
- `addTeamIds`: `[ID!]!` (required)
- `removeTeamIds`: `[ID!]`
- `replaceExisting`: `Boolean`

## Response (data, an example)

```json
{
  "contactMutation": {
    "bulkAssignUserGroupsOnContacts": {
      "mode": "SYNC",
      "bulkTaskId": "…"
    }
  }
}
```

## Example

```bash
curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{
    "operationId": "setContactsTeams",
    "variables": {
      "contactIds": [
        "<String>"
      ],
      "addTeamIds": [
        "<addTeamIds>"
      ]
    }
  }'
```
