# filterDeals

Run a SAVED deal filter (`filterId` from listDealFilters or saveFilter type DEAL) over ONE pipeline (`pipelineId` from listPipelineNames) and page the matching deals with limit/offset: id, title, isArchived, stage and assignees, plus pagination.total (every match, not the page) and hasMore. Saved filters only: to try criteria first, save the filter, run it here, and fix it in place with updateFilter. A deal filter does not carry its pipeline, so the same filter can run over any pipeline you pass. Use getDeal for one deal in full.

- Call: `POST https://server.goliathdata.com/api/v1/call` with `{ "operationId": "filterDeals", "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

- `filterId`: `ID!` (required)
- `pipelineId`: `ID!` (required)
- `limit`: `Int` (default `25`)
- `offset`: `Int` (default `0`)

## Response (data, an example)

```json
{
  "filterQuery": {
    "applyDealFilter": {
      "items": [
        {
          "id": "<ID>",
          "title": "…",
          "isArchived": true,
          "stage": {
            "id": "<ID>",
            "name": "…"
          },
          "users": [
            {
              "id": "<ID>",
              "firstName": "…",
              "lastName": "…"
            }
          ]
        }
      ],
      "pagination": {
        "total": 0,
        "hasMore": true
      }
    }
  }
}
```

## Example

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