{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/reportingninja-com/json-schema/reportingninja-com-schedules-update-request-schema.json",
  "title": "SchedulesUpdateRequest",
  "description": "The schedule to change and the fields to change in it. The update is partial: a field the body does not carry keeps the value it already had. The result is then validated as a whole, exactly as a creation is. A schedule as /v1/schedules/list publishes it is a body this endpoint takes back as it is: the keys a write has no column for are accepted and ignored with a READ_ONLY_FIELD_IGNORED warning each, and the nulls of the read keep the value.",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/reportingninja-com-openapi.json#/components/schemas/SchedulesUpdateRequest",
  "type": "object",
  "required": [
    "schedule_key"
  ],
  "properties": {
    "schedule_key": {
      "type": "string",
      "description": "The schedule to change, from /v1/schedules/list."
    },
    "report_key": {
      "type": "string",
      "description": "The report of the schedule. Optional, and when sent it must be the one the schedule already delivers; it cannot be moved to another report and cannot be null."
    },
    "frequency": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "daily",
            "weekly",
            "monthly",
            "none"
          ]
        },
        {
          "type": "null"
        }
      ],
      "description": "How often to deliver it. An update cannot send a report once (`now` belongs to /v1/schedules/create). `none` keeps a stopped schedule stopped, which is the value /v1/schedules/list gives it; over a schedule that delivers it is refused with INVALID_VALUE: /v1/schedules/delete stops one. Null, which /v1/schedules/list answers where the schedule has no value, keeps the one the schedule has."
    },
    "frequency_details": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "REQUIRED with weekly and with monthly, rejected with any other frequency, except that a stopped schedule takes back the value it kept from before it was stopped. With weekly it is the weekday in upper case: MONDAY, TUESDAY, WEDNESDAY, THURSDAY, FRIDAY, SATURDAY or SUNDAY. With monthly it is the day of the month written as a string, from \"1\" to \"31\". Null, which /v1/schedules/list answers where the schedule has no value, keeps the one the schedule has."
    },
    "time": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Hour of the delivery in the time zone of the account, as HH:00. Null, which /v1/schedules/list answers where the schedule has no value, keeps the one the schedule has."
    },
    "recipients_to": {
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 255
      },
      "maxItems": 20,
      "description": "At least one address, at most 20, each at most 255 characters."
    },
    "recipients_cc": {
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 255
      },
      "maxItems": 20
    },
    "recipients_bcc": {
      "type": "array",
      "items": {
        "type": "string",
        "maxLength": 255
      },
      "maxItems": 20
    },
    "report_format": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "pdf",
            "xls",
            "link"
          ]
        },
        {
          "type": "null"
        }
      ],
      "description": "How the report travels. `link` puts a link in the body instead of an attachment and needs the report link token in it. Null, which /v1/schedules/list answers where the schedule has no value, keeps the one the schedule has."
    },
    "email_template_key": {
      "description": "An email template of the account, which then carries the whole message, or \"\" for the system template, sent in the language of the user the schedule is attributed to, which carries a generic placeholder subject and body and the platform's sender: for a delivery to a client, name a template of your own or write the email with the six email fields. Explicit null means no template. When a template is named, the six email fields below are rejected by name.",
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "format": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "html",
            "plain_text"
          ]
        },
        {
          "type": "null"
        }
      ],
      "description": "Body of the email. REQUIRED when no email_template_key is named. Null, which /v1/schedules/list answers where the schedule has no value, keeps the one the schedule has."
    },
    "sender": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "Display name of the sender. REQUIRED when no email_template_key is named. Null, which /v1/schedules/list answers where the schedule has no value, keeps the one the schedule has.",
      "minLength": 5,
      "maxLength": 70
    },
    "sender_email": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "REQUIRED when no email_template_key is named. It must be the address of a user of the account, or of a domain the account already sends from. Null, which /v1/schedules/list answers where the schedule has no value, keeps the one the schedule has.",
      "maxLength": 255
    },
    "reply_to_email": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "REQUIRED when no email_template_key is named, under the same restriction as sender_email. Null, which /v1/schedules/list answers where the schedule has no value, keeps the one the schedule has.",
      "maxLength": 255
    },
    "subject": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "REQUIRED when no email_template_key is named. Null, which /v1/schedules/list answers where the schedule has no value, keeps the one the schedule has.",
      "minLength": 5,
      "maxLength": 150
    },
    "body": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "description": "REQUIRED when no email_template_key is named. Null, which /v1/schedules/list answers for a schedule on a template, keeps the one the schedule has.",
      "minLength": 5,
      "maxLength": 75000
    },
    "uses_system_template": {
      "description": "Ignored on a write: part of what /v1/schedules/list publishes and not part of what a write stores. It is accepted so a listed schedule can be sent straight back, and it comes back as a READ_ONLY_FIELD_IGNORED warning.",
      "readOnly": true,
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ]
    },
    "origin": {
      "description": "Ignored on a write: part of what /v1/schedules/list publishes and not part of what a write stores. It is accepted so a listed schedule can be sent straight back, and it comes back as a READ_ONLY_FIELD_IGNORED warning.",
      "readOnly": true,
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "app",
            "portal",
            "api"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "user_key": {
      "description": "Ignored on a write: part of what /v1/schedules/list publishes and not part of what a write stores. It is accepted so a listed schedule can be sent straight back, and it comes back as a READ_ONLY_FIELD_IGNORED warning.",
      "readOnly": true,
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "conditional_execution_enabled": {
      "description": "Ignored on a write: part of what /v1/schedules/list publishes and not part of what a write stores. It is accepted so a listed schedule can be sent straight back, and it comes back as a READ_ONLY_FIELD_IGNORED warning. A value other than the one the schedule has is refused with INVALID_VALUE: the condition is set in the application.",
      "readOnly": true,
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ]
    },
    "last_execution_at": {
      "description": "Ignored on a write: part of what /v1/schedules/list publishes and not part of what a write stores. It is accepted so a listed schedule can be sent straight back, and it comes back as a READ_ONLY_FIELD_IGNORED warning.",
      "readOnly": true,
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "queued": {
      "description": "Ignored on a write: part of what /v1/schedules/list publishes and not part of what a write stores. It is accepted so a listed schedule can be sent straight back, and it comes back as a READ_ONLY_FIELD_IGNORED warning.",
      "readOnly": true,
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ]
    },
    "dry_run": {
      "type": "boolean",
      "description": "Validate and answer what WOULD happen, without writing anything. Default false."
    },
    "idempotency_key": {
      "type": "string",
      "description": "Makes a retry safe: the answer of the first call is replayed for 24 hours to any later call with the same key and the same body.",
      "pattern": "^[A-Za-z0-9_.-]{1,128}$",
      "maxLength": 128
    },
    "confirmation_token": {
      "type": "string",
      "description": "The token the previous call answered. Sending the same body with it performs the write."
    }
  },
  "additionalProperties": false
}