# Search Automations

Finds automations by name and optional status within the selected account. Results use stable ID ordering and bounded offset pagination. Set includeStats to add the four contact counts the overview screen shows -- active, started, finished and ended on open -- which cost four queries per automation in the result page, so leave it off unless the counts are the question. Use get-automation for the graph and current revision, get-automation-statistics for one automation including goal conversions.

## Input schema:

```json
{
  "type": "object",
  "properties": {
    "query": {
      "type": "string",
      "default": "",
      "maxLength": 250
    },
    "status": {
      "type": [
        "string",
        "null"
      ],
      "default": null,
      "enum": [
        "draft",
        "paused",
        "scheduled",
        "active",
        null
      ]
    },
    "offset": {
      "type": "integer",
      "default": 0,
      "minimum": 0
    },
    "limit": {
      "type": "integer",
      "default": 25,
      "minimum": 1,
      "maximum": 100
    },
    "includeStats": {
      "type": "boolean",
      "default": false
    },
    "accountId": {
      "type": [
        "null",
        "integer"
      ],
      "default": null,
      "minimum": 1
    }
  },
  "additionalProperties": false
}
```

## Output schema:

```json
{
  "type": "object",
  "required": [
    "items",
    "nextOffset"
  ],
  "properties": {
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "name",
          "status"
        ],
        "properties": {
          "id": {
            "type": "integer"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "contactsActive": {
            "type": "integer"
          },
          "contactsStarted": {
            "type": "integer"
          },
          "contactsFinished": {
            "type": "integer"
          },
          "contactsEndedOnOpen": {
            "type": "integer"
          }
        }
      }
    },
    "nextOffset": {
      "type": [
        "integer",
        "null"
      ]
    }
  }
}
```

