# getContactEmployees

The AI employees on one contact, as the contact page's card shows them. `aiEmployees[].id` is the attachment id setEmployeeSchedule and clearEmployeeSchedule take (`agentId` is the employee); `status` PAUSED means it stopped working this contact (REMOVED, with `includeRemoved`, means it was taken off); `isWorkingNow` means it is mid-conversation. `upcomingAgentRuns` is what they will do next, soonest first, AT MOST 25 with no total (when 25 come back more may be booked, so after acting on these read again before saying none are left): a CRON row is a schedule's next run, a FOLLOW_UP row a follow-up the employee booked itself, whose `id` cancelEmployeeFollowUp takes.

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "getContactEmployees", "variables": {...} }`
- Scope: `READ`
- Type: query
- Idempotency: a read; rejects `Idempotency-Key`
- Rate-limited: no

## Variables

- `contactId`: `ID!` (required)
- `includeRemoved`: `Boolean` (default `false`)

## Response (data, an example)

```json
{
  "contactQuery": {
    "contact": {
      "id": "<ID>",
      "aiEmployees": [
        {
          "id": "<ID>",
          "agentId": "<ID>",
          "name": "…",
          "status": "ACTIVE",
          "isWorkingNow": true,
          "schedule": {
            "cronExpression": "…",
            "timezone": "…",
            "status": "ACTIVE",
            "nextFireAt": "2026-01-01T00:00:00.000Z",
            "lastFiredAt": "2026-01-01T00:00:00.000Z",
            "maxRuns": 0,
            "runCount": 0
          }
        }
      ],
      "upcomingAgentRuns": [
        {
          "id": "<ID>",
          "agentId": "<ID>",
          "agentName": "…",
          "kind": "CRON",
          "fireAt": "2026-01-01T00:00:00.000Z",
          "cronExpression": "…",
          "timezone": "…",
          "runsRemaining": 0
        }
      ]
    }
  }
}
```

## Example

```bash
curl https://server.goliathdata.com/api/v1/call \
  -H "Authorization: Bearer $GOLIATH_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "operationId": "getContactEmployees",
    "variables": {
      "contactId": "<contactId>"
    }
  }'
```
