# setIntakeAssignment

Replace who gets the contacts an owner's inbound traffic creates: assigneeUserIds (in order; 2+ rotate), participants, teams, tags, AI employees attached (agentAssigneeIds) and workflows fired (workflowGroupIds). owner is { kind, id }: ORG (the org id, the default), LINE (a phone line), META_PAGE (a Page id) or WORKFLOW (an EVENT workflow group). Send the whole policy (read it first: getPhoneRouting, getLineIntakeAssignments, getMetaPageIntakeAssignments, getWorkflowIntakeAssignment). A WORKFLOW owner takes no AI employees or workflows: send both []. Admins only.

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

## Variables

- `owner`: `AssignmentPolicyOwnerInput!` (required)
  - `kind`: `AssignmentPolicyOwnerKind!` (required, one of `AGENT`, `LINE`, `ORG`, `META_PAGE`, `WORKFLOW`)
  - `id`: `ID!` (required)
- `assigneeUserIds`: `[ID!]!` (required)
- `participantUserIds`: `[ID!]!` (required)
- `teamIds`: `[ID!]!` (required)
- `tags`: `[String!]!` (required)
- `agentAssigneeIds`: `[ID!]!` (required)
- `workflowGroupIds`: `[ID!]!` (required)

## Response (data, an example)

```json
{
  "assignmentPolicyMutation": {
    "set": {
      "id": "<ID>",
      "assigneeUserIds": [
        "<ID>"
      ],
      "agentAssigneeIds": [
        "<ID>"
      ],
      "workflowGroupIds": [
        "<ID>"
      ]
    }
  }
}
```

## 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": "setIntakeAssignment",
    "variables": {
      "owner": {
        "kind": "AGENT",
        "id": "<id>"
      },
      "assigneeUserIds": [
        "<assigneeUserIds>"
      ],
      "participantUserIds": [
        "<participantUserIds>"
      ],
      "teamIds": [
        "<teamIds>"
      ],
      "tags": [
        "<String>"
      ],
      "agentAssigneeIds": [
        "<agentAssigneeIds>"
      ],
      "workflowGroupIds": [
        "<workflowGroupIds>"
      ]
    }
  }'
```
