# Search Countdowns

Searches countdowns by name, newest first, with settings and app links.

## Input schema:

```json
{
  "type": "object",
  "properties": {
    "query": {
      "type": [
        "null",
        "string"
      ],
      "default": null
    },
    "limit": {
      "type": "integer",
      "default": 50,
      "minimum": 1,
      "maximum": 200
    },
    "offset": {
      "type": "integer",
      "default": 0,
      "minimum": 0
    },
    "accountId": {
      "type": [
        "null",
        "integer"
      ],
      "default": null,
      "minimum": 1
    }
  },
  "additionalProperties": false
}
```

## Output schema:

```json
{
  "type": "object",
  "required": [
    "accountId",
    "items",
    "total"
  ],
  "properties": {
    "accountId": {
      "type": "integer"
    },
    "items": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "accountId",
          "id",
          "settings",
          "editUrl",
          "placeholder"
        ],
        "properties": {
          "accountId": {
            "type": "integer"
          },
          "id": {
            "type": "integer"
          },
          "settings": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 250
              },
              "notes": {
                "type": "string",
                "maxLength": 1000
              },
              "metaLabels": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "template": {
                "type": "string",
                "enum": [
                  "round_orange",
                  "round_purple",
                  "round_blue",
                  "round_green",
                  "round_lightgreen",
                  "round_turquoise",
                  "round_grey"
                ]
              },
              "terminationType": {
                "type": "integer",
                "enum": [
                  1,
                  2,
                  3
                ]
              },
              "terminationDateTime": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Y-m-d H:i:s in the server timezone; required for terminationType 1; must be in the future and at most 30 days ahead, checked on create and update. Kept to the minute: seconds are read back as 00."
              },
              "terminationCustomFieldID": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Contact field of type date and time; required for terminationType 2; date-only fields are refused."
              },
              "terminationTagIDs": {
                "type": [
                  "object",
                  "null"
                ],
                "additionalProperties": false,
                "required": [
                  "ids"
                ],
                "properties": {
                  "ids": {
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "minimum": 1
                    }
                  },
                  "new": {
                    "type": "array",
                    "maxItems": 0,
                    "items": {
                      "type": "string"
                    }
                  }
                }
              },
              "terminationTagDurationDays": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "maximum": 999,
                "description": "For terminationType 3; days and hours together must be at least 1 hour and at most 30 days."
              },
              "terminationTagDurationHours": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "maximum": 999
              },
              "customExpiredImage": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 2000
              },
              "targetURL": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 2000
              },
              "targetURLExpired": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 2000
              },
              "subscriberParameterName": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 250
              },
              "emailParameterName": {
                "type": [
                  "string",
                  "null"
                ],
                "maxLength": 250
              }
            }
          },
          "editUrl": {
            "type": "string"
          },
          "placeholder": {
            "type": "string"
          }
        }
      }
    },
    "total": {
      "type": "integer"
    }
  }
}
```

