# listDealActivity

One deal's activity feed, most-recent-first: the audit trail behind "who changed the price on this deal, and when did it get reassigned?". Each event carries eventType, createdAt, actor (the person, null for system/automation), and a SuperJSON `payload` whose `json` object holds the per-eventType detail. Pass `eventTypes` to narrow to the types you care about: a narrowed read pages at the DATABASE, so a sparse type's full history stays reachable however busy the rest of the feed is; omit it for the mixed feed, which caps at the 200 most recent events. Page with `offset`. THE FULL eventType VOCABULARY, with the payload keys under `payload.json` for each (there is no schema expansion for a SuperJSON scalar, so this text is the only description of the shape). The title and names are not in the payload: read the contract for them). Those nineteen are the whole vocabulary: an eventType outside this list does not exist. What the feed does NOT record is edits to a deal's title, description or custom-field values: no event type covers them, so their history is not reconstructable here.

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "listDealActivity", "variables": {...} }`
- Scope: `READ`
- Type: query
- Idempotency: a read; rejects `Idempotency-Key`
- Rate-limited: no
- Result cap: `limit` is clamped to 50, without an error

## Variables

- `dealId`: `ID!` (required)
- `limit`: `Int` (default `50`)
- `offset`: `Int`
- `eventTypes`: `[PipelineItemActivityEventType!]` (one of `STAGE_CHANGED`, `VALUE_CHANGED`, `COMMISSION_CHANGED`, `TEAM_SPLIT_CHANGED`, `CLOSE_DATE_CHANGED`, `ASSIGNED`, `UNASSIGNED`, `CONTACT_LINKED`, `CONTACT_UNLINKED`, `TASK_ADDED`, `TASK_COMPLETED`, `FILE_ADDED`, `FILE_REMOVED`, `PIPELINE_ITEM_CREATED`, `DEAL_CREATED`, `PIPELINE_ITEM_ARCHIVED`, `DEAL_ARCHIVED`, `PIPELINE_ITEM_RESTORED`, `DEAL_RESTORED`, `COMMENT`, `SCRAPER_HEALTH_MOVED`, `CONTRACT_EVENT`)

## Response (data, an example)

```json
{
  "dealQuery": {
    "getDeal": {
      "id": "<ID>",
      "events": [
        {
          "id": "<ID>",
          "eventType": "STAGE_CHANGED",
          "createdAt": "2026-01-01T00:00:00.000Z",
          "actor": {
            "userId": "<ID>",
            "name": "…"
          },
          "payload": "…",
          "taskNow": "…"
        }
      ]
    }
  }
}
```

## Example

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