{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/gtm/main/json-schema/gtm-execution-response-schema.json",
  "title": "ExecutionResponse",
  "description": "Response containing a single run's status.",
  "x-generated": "2026-10-20",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/gtm-platform-api-v1-api-openapi.yml#/components/schemas/ExecutionResponse",
  "type": "object",
  "required": [
    "data"
  ],
  "properties": {
    "data": {
      "allOf": [
        {
          "$ref": "#/$defs/Execution"
        }
      ],
      "description": "The primary data of the document"
    }
  },
  "$defs": {
    "Execution": {
      "type": "object",
      "required": [
        "id",
        "type",
        "attributes"
      ],
      "properties": {
        "id": {
          "type": "string",
          "description": "The unique identifier for the resource"
        },
        "type": {
          "type": "string",
          "description": "The type of the resource",
          "default": "Execution",
          "pattern": "Execution"
        },
        "attributes": {
          "allOf": [
            {
              "$ref": "#/$defs/ExecutionAttributes"
            }
          ],
          "description": "The attributes defining the resource"
        }
      },
      "description": "An export run, as a single API resource."
    },
    "ExecutionAttributes": {
      "type": "object",
      "required": [
        "exportId",
        "status"
      ],
      "properties": {
        "exportId": {
          "type": "string",
          "description": "Which export this run used"
        },
        "status": {
          "allOf": [
            {
              "$ref": "#/$defs/ExecutionStatus"
            }
          ],
          "description": "Current status of this run"
        },
        "error": {
          "type": "string",
          "description": "What went wrong, if the run failed or was stopped"
        }
      },
      "description": "Status of an export run."
    },
    "ExecutionStatus": {
      "type": "string",
      "enum": [
        "PENDING",
        "IN_PROGRESS",
        "COMPLETED",
        "FAILED",
        "STOPPED"
      ],
      "description": "Where a run currently stands."
    }
  }
}