# Create Countdown

Creates a countdown: terminationType 1 is a fixed expiry and needs terminationDateTime, 2 a contact field of type date and time (date-only fields are refused), 3 tagging-based expiry. Defaults to the orange template and terminationType 1, so a call without terminationDateTime is refused. Expiry lies at most 30 days ahead; dates use server time and are kept to the minute, seconds are dropped.

## Input schema:

```json
{
  "type": "object",
  "properties": {
    "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
        }
      }
    },
    "accountId": {
      "type": [
        "null",
        "integer"
      ],
      "default": null,
      "minimum": 1
    }
  },
  "required": [
    "settings"
  ],
  "additionalProperties": false
}
```

## Output schema:

```json
{
  "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"
    }
  }
}
```

