{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/stripe/main/json-schema/stripe-scheduled-query-run-schema.json",
  "title": "ScheduledQueryRun",
  "description": "If you have [scheduled a Sigma query](https://stripe.com/docs/sigma/scheduled-queries), you'll\nreceive a `sigma.scheduled_query_run.created` webhook each time the query\nruns. The webhook contains a `ScheduledQueryRun` object, which you can use to\nretrieve the query results.",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/stripe-sigma-api-openapi.yml#/components/schemas/scheduled_query_run",
  "properties": {
    "created": {
      "description": "Time at which the object was created. Measured in seconds since the Unix epoch.",
      "format": "unix-time",
      "type": "integer"
    },
    "data_load_time": {
      "description": "When the query was run, Sigma contained a snapshot of your Stripe data at this time.",
      "format": "unix-time",
      "type": "integer"
    },
    "error": {
      "$ref": "#/$defs/sigma_scheduled_query_run_error"
    },
    "file": {
      "anyOf": [
        {
          "$ref": "#/$defs/file"
        }
      ],
      "description": "The file object representing the results of the query."
    },
    "id": {
      "description": "Unique identifier for the object.",
      "maxLength": 5000,
      "type": "string"
    },
    "livemode": {
      "description": "Has the value `true` if the object exists in live mode or the value `false` if the object exists in test mode.",
      "type": "boolean"
    },
    "object": {
      "description": "String representing the object's type. Objects of the same type share the same value.",
      "enum": [
        "scheduled_query_run"
      ],
      "type": "string"
    },
    "result_available_until": {
      "description": "Time at which the result expires and is no longer available for download.",
      "format": "unix-time",
      "type": "integer"
    },
    "sql": {
      "description": "SQL for the query.",
      "maxLength": 100000,
      "type": "string"
    },
    "status": {
      "description": "The query's execution status, which will be `completed` for successful runs, and `canceled`, `failed`, or `timed_out` otherwise.",
      "maxLength": 5000,
      "type": "string"
    },
    "title": {
      "description": "Title of the query.",
      "maxLength": 5000,
      "type": "string"
    }
  },
  "required": [
    "created",
    "data_load_time",
    "id",
    "livemode",
    "object",
    "result_available_until",
    "sql",
    "status",
    "title"
  ],
  "type": "object",
  "x-expandableFields": [
    "error",
    "file"
  ],
  "x-resourceId": "scheduled_query_run",
  "$defs": {
    "file": {
      "type": "object",
      "description": "Referenced by this document but never defined in it. API Evangelist added this empty placeholder so the document resolves; the shape is unknown and is NOT a claim about the API.",
      "x-ae-placeholder": true
    },
    "sigma_scheduled_query_run_error": {
      "type": "object",
      "description": "Referenced by this document but never defined in it. API Evangelist added this empty placeholder so the document resolves; the shape is unknown and is NOT a claim about the API.",
      "x-ae-placeholder": true
    }
  }
}