{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/elocuenti-com/json-schema/elocuenti-com-automation-run-body-schema.json",
  "title": "AutomationRunBody",
  "description": "Who to run the automation for, and the values it needs.",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/elocuenti-com-automations-api-openapi.yml#/components/schemas/AutomationRunBody",
  "type": "object",
  "properties": {
    "contact": {
      "$ref": "#/$defs/AutomationContactRef"
    },
    "variables": {
      "type": "object",
      "propertyNames": {
        "type": "string",
        "pattern": "^[a-z][a-z0-9_]{0,39}$"
      },
      "additionalProperties": {
        "anyOf": [
          {
            "type": "string",
            "maxLength": 1000
          },
          {
            "type": "number"
          },
          {
            "type": "boolean"
          }
        ]
      },
      "description": "Values for the variables the automation declares (see `variables` in `GET /api/v1/automations`), by name. The steps of the automation read them as `{{trigger.variables.<name>}}`. A text can have up to 1000 characters. A variable the automation does not declare is refused, and so is a missing one it marks as required.",
      "title": "Variables"
    }
  },
  "required": [
    "contact"
  ],
  "additionalProperties": false,
  "$defs": {
    "AutomationContactRef": {
      "type": "object",
      "properties": {
        "id": {
          "description": "The identifier of the contact, as returned by the contacts operations.",
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$",
          "title": "Id"
        },
        "phone": {
          "type": "string",
          "maxLength": 16,
          "pattern": "^\\+[1-9]\\d{6,14}$",
          "description": "The contact's phone number in international format (E.164): a plus sign, the country code and the number, with no spaces or dashes.",
          "title": "Phone"
        },
        "email": {
          "format": "email",
          "description": "The contact's email address. It works only when exactly one contact of your business has it: if several share it, the request is refused and you should use another way to name the contact.",
          "type": "string",
          "maxLength": 254,
          "title": "Email"
        },
        "external_id": {
          "description": "The identifier the contact has in your own system.",
          "type": "string",
          "minLength": 1,
          "maxLength": 255,
          "title": "External Id"
        }
      },
      "additionalProperties": false,
      "description": "The contact to run the automation for. Send exactly one of `id`, `phone`, `email` or `external_id`.",
      "title": "AutomationContactRef"
    }
  }
}