{
  "openapi": "3.1.0",
  "info": {
    "title": "Outlit API",
    "summary": "Public Outlit Platform and Ingest APIs.",
    "description": "Canonical OpenAPI specification for the public Outlit API surfaces documented at docs.outlit.ai.",
    "version": "1.0.0"
  },
  "servers": [
    {
      "url": "https://app.outlit.ai"
    }
  ],
  "tags": [
    {
      "name": "Platform API",
      "description": "Authenticated API key routes for customer intelligence tools and integration management."
    },
    {
      "name": "Ingest API",
      "description": "Public-key event ingestion routes used by Outlit SDKs."
    }
  ],
  "security": [
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/api/validate-api-key": {
      "post": {
        "tags": ["Platform API"],
        "summary": "Validate API key",
        "description": "Verify that the API key in the Authorization header can authenticate Platform API requests.",
        "operationId": "validateApiKey",
        "responses": {
          "200": {
            "description": "The API key is valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ValidateApiKeySuccess"
                },
                "example": {
                  "valid": true,
                  "organizationId": "org_123",
                  "createdById": "user_123"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/api/tools/call": {
      "post": {
        "tags": ["Platform API"],
        "summary": "Call customer intelligence tool",
        "description": "Call a public customer intelligence tool through the shared Outlit tool gateway.",
        "operationId": "callTool",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ToolCallRequest"
              },
              "example": {
                "tool": "outlit_search_customer_context",
                "input": {
                  "customer": "acme.com",
                  "query": "What renewal concerns came up recently?",
                  "topK": 5
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Tool-specific JSON result.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON, unknown tool name, or invalid tool input.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                },
                "example": {
                  "error": "Invalid tool input",
                  "details": [
                    {
                      "path": ["limit"],
                      "message": "Too big: expected number to be <=1000"
                    }
                  ]
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "402": {
            "$ref": "#/components/responses/PlanLimit"
          },
          "429": {
            "$ref": "#/components/responses/PlanLimit"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/api/agent-templates": {
      "get": {
        "tags": ["Platform API"],
        "summary": "List agent templates",
        "description": "List Outlit agent templates that can be created by API, CLI, or MCP clients. This route is read-only.",
        "operationId": "listAgentTemplates",
        "responses": {
          "200": {
            "description": "Available agent templates.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListAgentTemplatesCommandSuccess"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent read scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/api/agent-actions": {
      "get": {
        "tags": ["Platform API"],
        "summary": "List agent actions",
        "description": "List action capabilities that an Outlit agent may reference. This route is read-only and does not grant actions to any agent.",
        "operationId": "listAgentActions",
        "responses": {
          "200": {
            "description": "Available agent action capabilities.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListAgentActionsCommandSuccess"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent read scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/api/agents": {
      "get": {
        "tags": ["Platform API"],
        "summary": "List agents",
        "description": "List configured Outlit agents for the authenticated organization. Read-only.",
        "operationId": "listAgents",
        "responses": {
          "200": {
            "description": "Configured agents were returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListAgentsCommandSuccess"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent read scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not list agents.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": ["Platform API"],
        "summary": "Create agent",
        "description": "Create an Outlit agent. Use type=template for supported templates or type=custom for a custom hosted agent.",
        "operationId": "createAgent",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAgentRequest"
              },
              "examples": {
                "template": {
                  "summary": "Create from template",
                  "value": {
                    "type": "template",
                    "templateKey": "churn",
                    "mode": "draft"
                  }
                },
                "custom": {
                  "summary": "Create custom agent",
                  "value": {
                    "type": "custom",
                    "displayName": "Renewal risk",
                    "instructions": "Find risky customers and skip already resolved issues.",
                    "actionKeys": ["send_slack_notification"]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Agent was created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateAgentCommandSuccess"
                }
              }
            }
          },
          "400": {
            "description": "Invalid JSON or unsupported agent create request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent write scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The requested template or agent conflicts with the current platform state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not complete the command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/agents/{id}": {
      "get": {
        "tags": ["Platform API"],
        "summary": "Get agent",
        "description": "Get one configured Outlit agent by id. Read-only.",
        "operationId": "getAgent",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Agent ID to fetch.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The configured agent was returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetAgentCommandSuccess"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent read scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No agent was found for the authenticated organization and requested id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not get the agent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": ["Platform API"],
        "summary": "Update agent",
        "description": "Patch one configured Outlit agent. Only provided fields are changed.",
        "operationId": "updateAgent",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Agent ID.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAgentRequest"
              },
              "example": {
                "displayName": "Renewal risk",
                "instructions": "Prioritize recent support escalations.",
                "actionKeys": ["send_slack_notification"]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Agent was updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateAgentCommandSuccess"
                }
              }
            }
          },
          "400": {
            "description": "The request body failed command validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent write scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No resource was found for the authenticated organization and requested id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The requested change conflicts with the current platform state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not complete the command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/integrations": {
      "get": {
        "tags": ["Platform API"],
        "summary": "List integrations",
        "description": "List available integrations and current connection status for the authenticated organization.",
        "operationId": "listIntegrations",
        "parameters": [
          {
            "name": "connectedOnly",
            "in": "query",
            "description": "When true, only returns currently connected integrations.",
            "schema": {
              "type": "boolean",
              "default": false
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Integration list.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": ["items"],
                  "properties": {
                    "items": {
                      "type": "array",
                      "maxItems": 12,
                      "items": {
                        "$ref": "#/components/schemas/Integration"
                      }
                    }
                  },
                  "additionalProperties": false
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/api/integrations/capabilities": {
      "get": {
        "tags": ["Platform API"],
        "summary": "Get integration setup capabilities",
        "description": "Inspect setup mode, required credential fields, and follow-up steps for one provider or all providers.",
        "operationId": "getIntegrationCapabilities",
        "parameters": [
          {
            "name": "provider",
            "in": "query",
            "description": "Optional public provider ID or CLI alias. When omitted, returns all provider capabilities.",
            "schema": {
              "$ref": "#/components/schemas/ProviderId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Provider capability metadata.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationCapabilitiesResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/api/integrations/setup-step": {
      "post": {
        "tags": ["Platform API"],
        "summary": "Run provider setup step",
        "description": "Run a supported follow-up setup step for a connected provider, such as CRM mappings or webhook setup.",
        "operationId": "runIntegrationSetupStep",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationSetupStepRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Step-specific setup response.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/api/integrations/connect": {
      "post": {
        "tags": ["Platform API"],
        "summary": "Connect integration",
        "description": "Connect a provider with direct credentials or create a browser-auth connection session.",
        "operationId": "connectIntegration",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationConnectRequest"
              },
              "example": {
                "provider": "posthog",
                "config": {
                  "apiKey": "phx_...",
                  "region": "us",
                  "projectId": "12345"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Direct credential connection or browser session response.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/IntegrationDirectConnectionResponse"
                    },
                    {
                      "$ref": "#/components/schemas/IntegrationBrowserSessionResponse"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/PlanConnectionLimit"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/api/integrations/connect/status": {
      "get": {
        "tags": ["Platform API"],
        "summary": "Poll connection status",
        "description": "Poll the state of a browser-auth integration connection session.",
        "operationId": "getIntegrationConnectionStatus",
        "parameters": [
          {
            "name": "sessionId",
            "in": "query",
            "required": true,
            "description": "Session ID returned by POST /api/integrations/connect.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Current connection session status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationConnectionStatusResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/api/integrations/disconnect": {
      "post": {
        "tags": ["Platform API"],
        "summary": "Disconnect integration",
        "description": "Disconnect a currently connected provider for the authenticated organization.",
        "operationId": "disconnectIntegration",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IntegrationDisconnectRequest"
              },
              "example": {
                "provider": "stripe"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Integration disconnected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationDisconnectResponse"
                },
                "example": {
                  "success": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "404": {
            "description": "The provider is valid but no active connection exists.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationDisconnectNotConnectedResponse"
                },
                "example": {
                  "success": false,
                  "message": "Integration is not connected"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/api/integrations/sync-status": {
      "get": {
        "tags": ["Platform API"],
        "summary": "Get integration sync status",
        "description": "Inspect the connection and model sync status for one public provider.",
        "operationId": "getIntegrationSyncStatus",
        "parameters": [
          {
            "name": "provider",
            "in": "query",
            "required": true,
            "description": "Public provider ID from the provider table.",
            "schema": {
              "$ref": "#/components/schemas/ProviderId"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Provider sync status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationSyncStatusResponse"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          }
        }
      }
    },
    "/api/i/v1/{publicKey}/events": {
      "post": {
        "tags": ["Ingest API"],
        "summary": "Ingest events",
        "description": "Send tracking events to Outlit. The public key in the URL path identifies the workspace; no secret bearer token is required for this endpoint.",
        "operationId": "ingestEvents",
        "security": [],
        "parameters": [
          {
            "name": "publicKey",
            "in": "path",
            "required": true,
            "description": "Your organization's public key. Starts with pk_.",
            "schema": {
              "type": "string",
              "pattern": "^pk_"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IngestEventsRequest"
              },
              "example": {
                "visitorId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
                "source": "client",
                "events": [
                  {
                    "type": "pageview",
                    "url": "https://example.com/pricing",
                    "path": "/pricing",
                    "title": "Pricing - Example",
                    "timestamp": 1699999999999
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Events accepted.",
            "headers": {
              "X-RateLimit-Limit": {
                "$ref": "#/components/headers/RateLimitLimit"
              },
              "X-RateLimit-Remaining": {
                "$ref": "#/components/headers/RateLimitRemaining"
              },
              "X-RateLimit-Reset": {
                "$ref": "#/components/headers/RateLimitReset"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IngestEventsSuccess"
                },
                "example": {
                  "success": true
                }
              }
            }
          },
          "400": {
            "description": "Invalid request body or event payload.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IngestEventsError"
                }
              }
            }
          },
          "403": {
            "description": "Invalid public key or unauthorized domain.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IngestEventsError"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IngestEventsError"
                }
              }
            }
          },
          "500": {
            "description": "Internal server error.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IngestEventsError"
                }
              }
            }
          }
        }
      }
    },
    "/api/automations/options": {
      "get": {
        "tags": ["Platform API"],
        "summary": "Get automation options",
        "description": "Show automation schemas, constants, and constraints for configuring agent automations. Read-only.",
        "operationId": "getAutomationOptions",
        "responses": {
          "200": {
            "description": "Automation options were returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AutomationOptionsCommandSuccess"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent read scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not get automation options.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/automations": {
      "get": {
        "tags": ["Platform API"],
        "summary": "List automations",
        "description": "List configured Outlit automations for the authenticated organization. Read-only.",
        "operationId": "listAutomations",
        "responses": {
          "200": {
            "description": "Configured automations were returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListAutomationsCommandSuccess"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent read scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not list automations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": ["Platform API"],
        "summary": "Create automation",
        "description": "Create an agent automation. Provide agentId; Outlit maps it to the hosted-agent processor internally.",
        "operationId": "createAutomation",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAutomationRequest"
              },
              "example": {
                "agentId": "10000000-0000-4000-8000-000000000004",
                "name": "Churn response",
                "description": null,
                "enabled": false,
                "triggerType": "SIGNAL_OCCURRENCE",
                "signalIds": ["10000000-0000-4000-8000-000000000002"],
                "destinationIds": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Automation was created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateAutomationCommandSuccess"
                }
              }
            }
          },
          "400": {
            "description": "The request body failed command validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent write scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No resource was found for the authenticated organization and requested id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The requested change conflicts with the current platform state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not complete the command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/automations/{id}": {
      "get": {
        "tags": ["Platform API"],
        "summary": "Get automation",
        "description": "Get one configured Outlit automation by id. Read-only and does not include run history.",
        "operationId": "getAutomation",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Automation ID to fetch.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The configured automation was returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetAutomationCommandSuccess"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent read scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No automation was found for the authenticated organization and requested id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not get the automation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": ["Platform API"],
        "summary": "Update automation",
        "description": "Update an agent automation with a full configuration body. Provide agentId, name, enabled, and triggerType; Outlit maps agentId to the hosted-agent processor internally.",
        "operationId": "updateAutomation",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Automation ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAutomationRequest"
              },
              "example": {
                "agentId": "10000000-0000-4000-8000-000000000004",
                "name": "Churn response",
                "description": null,
                "enabled": false,
                "triggerType": "SIGNAL_OCCURRENCE",
                "signalIds": ["10000000-0000-4000-8000-000000000002"],
                "destinationIds": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Automation was updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateAutomationCommandSuccess"
                }
              }
            }
          },
          "400": {
            "description": "The request body failed command validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent write scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No resource was found for the authenticated organization and requested id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The requested change conflicts with the current platform state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not complete the command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/automations/{automationId}/runs": {
      "get": {
        "tags": ["Platform API"],
        "summary": "List automation runs",
        "description": "List safe run summaries for one configured Outlit automation. Read-only.",
        "operationId": "listAutomationRuns",
        "parameters": [
          {
            "name": "automationId",
            "in": "path",
            "required": true,
            "description": "Automation ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum runs to return.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Pagination cursor from the previous response.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Automation run summaries were returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListAutomationRunsCommandSuccess"
                }
              }
            }
          },
          "400": {
            "description": "The query parameters failed command validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent read scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No automation was found for the authenticated organization and requested automation ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not list automation runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/automations/{automationId}/runs/{runId}": {
      "get": {
        "tags": ["Platform API"],
        "summary": "Get automation run",
        "description": "Get safe run details for one configured Outlit automation run. Read-only.",
        "operationId": "getAutomationRun",
        "parameters": [
          {
            "name": "automationId",
            "in": "path",
            "required": true,
            "description": "Automation ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "description": "Automation run ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Automation run details were returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetAutomationRunCommandSuccess"
                }
              }
            }
          },
          "400": {
            "description": "The path parameters failed command validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent read scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No automation run was found for the authenticated organization, automation, and requested run id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not get the automation run.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/signals/options": {
      "get": {
        "tags": ["Platform API"],
        "summary": "Get signal options",
        "description": "Show signal schemas, condition types, and default signal catalog keys. Read-only.",
        "operationId": "getSignalOptions",
        "responses": {
          "200": {
            "description": "Signal options were returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SignalOptionsCommandSuccess"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent read scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not get signal options.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/signals": {
      "get": {
        "tags": ["Platform API"],
        "summary": "List signals",
        "description": "List configured Outlit automation signals for the authenticated organization. Read-only.",
        "operationId": "listSignals",
        "responses": {
          "200": {
            "description": "Configured signals were returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListSignalsCommandSuccess"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent read scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not list signals.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": ["Platform API"],
        "summary": "Create signal",
        "description": "Create a UI-managed Outlit automation signal.",
        "operationId": "createSignal",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSignalRequest"
              },
              "example": {
                "kind": "EVENT_MATCH",
                "name": "Workspace inactive",
                "description": null,
                "definition": {
                  "grain": "customer",
                  "subjectResolver": "event_customer",
                  "eventNames": ["workspace_inactive"],
                  "propertyConditions": [],
                  "conditionMode": "ALL"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Signal was created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateSignalCommandSuccess"
                }
              }
            }
          },
          "400": {
            "description": "The request body failed command validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent write scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No resource was found for the authenticated organization and requested id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The requested change conflicts with the current platform state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not complete the command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/destinations/options": {
      "get": {
        "tags": ["Platform API"],
        "summary": "Get destination options",
        "description": "Show destination schemas, Slack connection status, and available Slack channel options.",
        "operationId": "getDestinationOptions",
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Filter Slack channels by channel name or ID.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum Slack channels to return.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Destination options were returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DestinationOptionsCommandSuccess"
                }
              }
            }
          },
          "400": {
            "description": "The request query failed command validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent write scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not get destination options.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/destinations": {
      "get": {
        "tags": ["Platform API"],
        "summary": "List destinations",
        "description": "List configured Outlit automation destinations with masked configuration only. Read-only.",
        "operationId": "listDestinations",
        "responses": {
          "200": {
            "description": "Configured destinations were returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListDestinationsCommandSuccess"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent read scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not list destinations.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": ["Platform API"],
        "summary": "Create destination",
        "description": "Create one Slack channel automation destination. Responses include masked configuration only. Passing isDefault true makes it the default fallback destination.",
        "operationId": "createDestination",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDestinationRequest"
              },
              "example": {
                "type": "SLACK_CHANNEL",
                "channelId": "C0123456789",
                "label": "#customer-ops",
                "enabled": true,
                "isDefault": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Destination was created.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreateDestinationCommandSuccess"
                }
              }
            }
          },
          "400": {
            "description": "The request body failed command validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent write scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No resource was found for the authenticated organization and requested id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The requested change conflicts with the current platform state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not complete the command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/settings": {
      "get": {
        "tags": ["Platform API"],
        "summary": "Get workspace settings",
        "description": "Get workspace-level settings used by Outlit agents and automations.",
        "operationId": "getWorkspaceSettings",
        "responses": {
          "200": {
            "description": "Workspace settings were returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetSettingsCommandSuccess"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent read scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not get workspace settings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": ["Platform API"],
        "summary": "Update workspace settings",
        "description": "Update workspace-level settings used by Outlit agents and automations.",
        "operationId": "updateWorkspaceSettings",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWorkspaceSettingsRequest"
              },
              "example": {
                "defaultTimezone": "America/Los_Angeles"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Workspace settings were updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateSettingsCommandSuccess"
                }
              }
            }
          },
          "400": {
            "description": "The request body failed command validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent write scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not update workspace settings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/settings/report": {
      "get": {
        "tags": ["Platform API"],
        "summary": "Get report settings",
        "description": "Get the Slack report channel settings for the workspace.",
        "operationId": "getReportSettings",
        "responses": {
          "200": {
            "description": "Report settings were returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetReportSettingsCommandSuccess"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent read scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not get report settings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": ["Platform API"],
        "summary": "Update report settings",
        "description": "Update the Slack channel used for workspace reports.",
        "operationId": "updateReportSettings",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateReportSettingsRequest"
              },
              "example": {
                "slackChannelId": "C0123456789",
                "slackChannelName": "sales-alerts"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Report settings were updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateReportSettingsCommandSuccess"
                }
              }
            }
          },
          "400": {
            "description": "The request body failed command validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent write scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not update report settings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/settings/report/options": {
      "get": {
        "tags": ["Platform API"],
        "summary": "Get report settings options",
        "description": "Search available Slack channels for report settings.",
        "operationId": "getReportSettingsOptions",
        "parameters": [
          {
            "name": "search",
            "in": "query",
            "required": false,
            "description": "Filter Slack channels by channel name or ID.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 120
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum Slack channels to return.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Report settings options were returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReportSettingsOptionsCommandSuccess"
                }
              }
            }
          },
          "400": {
            "description": "The request query failed command validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent read scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not get report settings options.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/agents/{id}/enable": {
      "post": {
        "tags": ["Platform API"],
        "summary": "Enable agent",
        "description": "Enable one configured Outlit agent by id. Does not run the agent immediately.",
        "operationId": "enableAgent",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Agent ID.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Enable agent completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnableAgentCommandSuccess"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent write scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No resource was found for the authenticated organization and requested id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The requested lifecycle change conflicts with the current platform state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not complete the command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/agents/{id}/disable": {
      "post": {
        "tags": ["Platform API"],
        "summary": "Disable agent",
        "description": "Disable one configured Outlit agent by id. Disabled agents will not run from schedules or automations.",
        "operationId": "disableAgent",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Agent ID.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Disable agent completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DisableAgentCommandSuccess"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent write scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No resource was found for the authenticated organization and requested id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The requested lifecycle change conflicts with the current platform state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not complete the command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/agents/{id}/rename": {
      "post": {
        "tags": ["Platform API"],
        "summary": "Rename agent",
        "description": "Rename one configured Outlit agent display name.",
        "operationId": "renameAgent",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Agent ID.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Rename agent completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RenameAgentCommandSuccess"
                }
              }
            }
          },
          "400": {
            "description": "The request body failed command validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent write scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No resource was found for the authenticated organization and requested id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The requested lifecycle change conflicts with the current platform state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not complete the command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RenameAgentRequest"
              }
            }
          }
        }
      }
    },
    "/api/agents/{agentId}/runs": {
      "get": {
        "tags": ["Platform API"],
        "summary": "List agent runs",
        "description": "List safe run summaries for one configured Outlit agent. Read-only.",
        "operationId": "listAgentRuns",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "description": "Agent ID.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "description": "Maximum runs to return.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "description": "Pagination cursor from the previous response.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Agent run summaries were returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListAgentRunsCommandSuccess"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent read scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No agent was found for the authenticated organization and requested agent ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not list agent runs.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": ["Platform API"],
        "summary": "Start churn agent run",
        "description": "Start a manual run for one configured legacy Outlit churn agent. Template and custom hosted agents run through automations.",
        "operationId": "startAgentRun",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "description": "Agent ID.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartAgentRunRequest"
              },
              "example": {
                "clientRequestId": "smoke-123"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Agent run was started or an idempotent prior run was returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StartAgentRunCommandSuccess"
                }
              }
            }
          },
          "400": {
            "description": "The request body failed command validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent write scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No agent was found for the authenticated organization and requested agent ID.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "Another run is already in progress for the agent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not start the agent run.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/agents/{agentId}/runs/{runId}": {
      "get": {
        "tags": ["Platform API"],
        "summary": "Get agent run",
        "description": "Get safe run details for one configured Outlit agent run. Read-only.",
        "operationId": "getAgentRun",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "description": "Agent ID.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          },
          {
            "name": "runId",
            "in": "path",
            "required": true,
            "description": "Agent run database ID or public run ID.",
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Agent run details were returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetAgentRunCommandSuccess"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent read scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No agent run was found for the authenticated organization, agent, and requested run id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not get the agent run.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/automations/{id}/enable": {
      "post": {
        "tags": ["Platform API"],
        "summary": "Enable automation",
        "description": "Enable one configured Outlit automation by id after validating required resources.",
        "operationId": "enableAutomation",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Automation ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Enable automation completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnableAutomationCommandSuccess"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent write scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No resource was found for the authenticated organization and requested id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The requested lifecycle change conflicts with the current platform state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not complete the command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/automations/{id}/disable": {
      "post": {
        "tags": ["Platform API"],
        "summary": "Disable automation",
        "description": "Disable one configured Outlit automation by id.",
        "operationId": "disableAutomation",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Automation ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Disable automation completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DisableAutomationCommandSuccess"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent write scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No resource was found for the authenticated organization and requested id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The requested lifecycle change conflicts with the current platform state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not complete the command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/automations/{id}/archive": {
      "post": {
        "tags": ["Platform API"],
        "summary": "Archive automation",
        "description": "Archive one UI-managed Outlit automation by id. Archived automations are disabled and removed from normal lists.",
        "operationId": "archiveAutomation",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Automation ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Archive automation completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArchiveAutomationCommandSuccess"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent write scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No resource was found for the authenticated organization and requested id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The requested lifecycle change conflicts with the current platform state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not complete the command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/signals/{id}": {
      "get": {
        "tags": ["Platform API"],
        "summary": "Get signal",
        "description": "Get one configured Outlit automation signal by id. Read-only.",
        "operationId": "getSignal",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Signal ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get signal completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetSignalCommandSuccess"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent read scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No signal was found for the authenticated organization and requested id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not complete the command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": ["Platform API"],
        "summary": "Update signal",
        "description": "Update one UI-managed Outlit automation signal with a full signal configuration body.",
        "operationId": "updateSignal",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Signal ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSignalRequest"
              },
              "example": {
                "kind": "EVENT_MATCH",
                "name": "Workspace inactive",
                "description": null,
                "definition": {
                  "grain": "customer",
                  "subjectResolver": "event_customer",
                  "eventNames": ["workspace_inactive"],
                  "propertyConditions": [],
                  "conditionMode": "ALL"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Signal was updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateSignalCommandSuccess"
                }
              }
            }
          },
          "400": {
            "description": "The request body failed command validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent write scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No resource was found for the authenticated organization and requested id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The requested change conflicts with the current platform state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not complete the command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/signals/{id}/archive": {
      "post": {
        "tags": ["Platform API"],
        "summary": "Archive signal",
        "description": "Archive one UI-managed Outlit automation signal by id.",
        "operationId": "archiveSignal",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Signal ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Archive signal completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArchiveSignalCommandSuccess"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent write scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No resource was found for the authenticated organization and requested id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The requested lifecycle change conflicts with the current platform state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not complete the command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/destinations/{id}": {
      "get": {
        "tags": ["Platform API"],
        "summary": "Get destination",
        "description": "Get one configured Outlit automation destination by id with masked configuration only. Read-only.",
        "operationId": "getDestination",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Destination ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get destination completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetDestinationCommandSuccess"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent read scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No destination was found for the authenticated organization and requested id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not complete the command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": ["Platform API"],
        "summary": "Update destination",
        "description": "Update one Slack channel automation destination. Responses include masked configuration only. Passing isDefault true makes it the default fallback destination and enables it.",
        "operationId": "updateDestination",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Destination ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDestinationRequest"
              },
              "example": {
                "type": "SLACK_CHANNEL",
                "isDefault": true
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Destination was updated.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpdateDestinationCommandSuccess"
                }
              }
            }
          },
          "400": {
            "description": "The request body failed command validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent write scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No resource was found for the authenticated organization and requested id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The requested change conflicts with the current platform state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not complete the command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/destinations/{id}/enable": {
      "post": {
        "tags": ["Platform API"],
        "summary": "Enable destination",
        "description": "Enable one configured Outlit automation destination by id. Does not test or send to the destination.",
        "operationId": "enableDestination",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Destination ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Enable destination completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnableDestinationCommandSuccess"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent write scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No resource was found for the authenticated organization and requested id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The requested lifecycle change conflicts with the current platform state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not complete the command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/destinations/{id}/disable": {
      "post": {
        "tags": ["Platform API"],
        "summary": "Disable destination",
        "description": "Disable one configured Outlit automation destination by id.",
        "operationId": "disableDestination",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Destination ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Disable destination completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DisableDestinationCommandSuccess"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent write scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No resource was found for the authenticated organization and requested id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The requested lifecycle change conflicts with the current platform state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not complete the command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/destinations/{id}/archive": {
      "post": {
        "tags": ["Platform API"],
        "summary": "Archive destination",
        "description": "Archive one configured Outlit automation destination by id. Archived destinations are disabled and removed from normal lists.",
        "operationId": "archiveDestination",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Destination ID.",
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Archive destination completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ArchiveDestinationCommandSuccess"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required agent write scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No resource was found for the authenticated organization and requested id.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The requested lifecycle change conflicts with the current platform state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "503": {
            "description": "The platform could not complete the command.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/identity/merge-suggestions": {
      "get": {
        "tags": ["Platform API"],
        "summary": "List identity merge suggestions",
        "description": "List customer identity merge suggestions from the Identity page. Requires identity:read and the identity resolution feature flag.",
        "operationId": "listIdentityMergeSuggestions",
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/IdentityMergeSuggestionStatus"
            }
          },
          {
            "name": "confidence",
            "in": "query",
            "schema": {
              "$ref": "#/components/schemas/IdentityMergeConfidence"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Identity merge suggestions were returned.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ListIdentityMergeSuggestionsCommandSuccess"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required identity read scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "Identity merge suggestions are not enabled for the workspace.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "The platform could not list identity merge suggestions.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/identity/merge-suggestions/{id}": {
      "get": {
        "tags": ["Platform API"],
        "summary": "Get identity merge suggestion",
        "description": "Get one customer identity merge suggestion by id. Requires identity:read and the identity resolution feature flag.",
        "operationId": "getIdentityMergeSuggestion",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Get identity merge suggestion completed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/GetIdentityMergeSuggestionCommandSuccess"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required identity read scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No identity merge suggestion was found or identity resolution is not enabled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "The platform could not get identity merge suggestion.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/identity/merge-suggestions/{id}/queue": {
      "post": {
        "tags": ["Platform API"],
        "summary": "Queue identity merge suggestion",
        "description": "Queue one suggested customer identity merge for asynchronous processing. Requires identity:write and the identity resolution feature flag.",
        "operationId": "queueIdentityMergeSuggestion",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IdentityMergeSuggestionActionRequest"
              },
              "example": {
                "reviewNotes": "Verified duplicate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Identity merge suggestion was queued.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdentityMergeSuggestionActionCommandSuccess"
                }
              }
            }
          },
          "400": {
            "description": "The request body failed command validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required identity write scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No identity merge suggestion was found or identity resolution is not enabled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The merge suggestion cannot be queued in its current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "The platform could not queue identity merge suggestion.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      }
    },
    "/api/identity/merge-suggestions/{id}/reject": {
      "post": {
        "tags": ["Platform API"],
        "summary": "Reject identity merge suggestion",
        "description": "Reject one suggested customer identity merge. Requires identity:write and the identity resolution feature flag.",
        "operationId": "rejectIdentityMergeSuggestion",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1
            }
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/IdentityMergeSuggestionActionRequest"
              },
              "example": {
                "reviewNotes": "Not a duplicate"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Identity merge suggestion was rejected.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IdentityMergeSuggestionActionCommandSuccess"
                }
              }
            }
          },
          "400": {
            "description": "The request body failed command validation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "description": "The API key is valid but does not have the required identity write scope.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "404": {
            "description": "No identity merge suggestion was found or identity resolution is not enabled.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "409": {
            "description": "The merge suggestion cannot be rejected in its current state.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          },
          "503": {
            "description": "The platform could not reject identity merge suggestion.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CommandErrorEnvelope"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Outlit API key using the Bearer ok_... format."
      }
    },
    "headers": {
      "RateLimitLimit": {
        "description": "Maximum requests allowed in the current window.",
        "schema": {
          "type": "integer",
          "example": 100
        }
      },
      "RateLimitRemaining": {
        "description": "Requests remaining in the current window.",
        "schema": {
          "type": "integer",
          "example": 95
        }
      },
      "RateLimitReset": {
        "description": "Unix timestamp when the current rate limit window resets.",
        "schema": {
          "type": "integer",
          "example": 1699999999
        }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "Invalid request body or parameters.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "error": "Invalid request"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Invalid or missing API key.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "error": "Invalid credentials"
            }
          }
        }
      },
      "PlanLimit": {
        "description": "Plan API-call limit reached.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/PlanLimitError"
            }
          }
        }
      },
      "PlanConnectionLimit": {
        "description": "Plan integration connection limit reached.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/PlanConnectionLimitError"
            }
          }
        }
      },
      "InternalServerError": {
        "description": "Internal server error.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/ErrorResponse"
            },
            "example": {
              "error": "Internal server error"
            }
          }
        }
      }
    },
    "schemas": {
      "ValidateApiKeySuccess": {
        "type": "object",
        "required": ["valid", "organizationId"],
        "properties": {
          "valid": {
            "type": "boolean",
            "const": true
          },
          "organizationId": {
            "type": "string"
          },
          "createdById": {
            "type": ["string", "null"]
          }
        },
        "additionalProperties": false
      },
      "ToolCallRequest": {
        "type": "object",
        "required": ["tool"],
        "properties": {
          "tool": {
            "type": "string",
            "description": "Customer intelligence tool name from @outlit/tools.",
            "enum": [
              "outlit_list_customers",
              "outlit_list_users",
              "outlit_list_workspace_users",
              "outlit_get_customer",
              "outlit_get_timeline",
              "outlit_list_facts",
              "outlit_get_fact",
              "outlit_get_source",
              "outlit_list_sources",
              "outlit_search_customer_context",
              "outlit_query",
              "outlit_schema",
              "outlit_send_notification"
            ]
          },
          "input": {
            "type": "object",
            "description": "Tool-specific input object validated against the shared @outlit/tools contract.",
            "additionalProperties": true,
            "default": {}
          }
        },
        "additionalProperties": false
      },
      "CommandResource": {
        "type": "object",
        "required": ["type", "id"],
        "properties": {
          "type": {
            "type": "string"
          },
          "id": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "CommandResultBase": {
        "type": "object",
        "required": ["operationId", "status", "resources", "data", "warnings"],
        "properties": {
          "operationId": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "const": "completed"
          },
          "resources": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CommandResource"
            }
          },
          "data": {
            "type": "object",
            "additionalProperties": true
          },
          "warnings": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "auditId": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "CommandErrorEnvelope": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "error"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": false
          },
          "commandId": {
            "type": "string"
          },
          "commandVersion": {
            "type": "integer",
            "minimum": 1
          },
          "error": {
            "type": "object",
            "required": ["code", "message", "correlationId", "retryable"],
            "properties": {
              "code": {
                "type": "string",
                "enum": [
                  "validation_failed",
                  "authorization_denied",
                  "conflict",
                  "not_found",
                  "rate_limited",
                  "transient_failure"
                ]
              },
              "message": {
                "type": "string"
              },
              "correlationId": {
                "type": "string"
              },
              "retryable": {
                "type": "boolean"
              },
              "details": {
                "type": "object",
                "additionalProperties": true
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "AgentTemplateKey": {
        "type": "string",
        "enum": ["churn"]
      },
      "AgentTemplateMode": {
        "type": "string",
        "enum": ["draft"]
      },
      "AgentTemplateSummary": {
        "type": "object",
        "required": [
          "key",
          "version",
          "name",
          "description",
          "creates",
          "defaultMode",
          "supportedModes"
        ],
        "properties": {
          "key": {
            "$ref": "#/components/schemas/AgentTemplateKey"
          },
          "version": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "creates": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": ["agent", "signal", "automation"]
            }
          },
          "defaultMode": {
            "$ref": "#/components/schemas/AgentTemplateMode"
          },
          "supportedModes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentTemplateMode"
            }
          }
        },
        "additionalProperties": false
      },
      "AgentActionSummary": {
        "type": "object",
        "required": ["key", "version", "label", "category", "subjectTypes"],
        "properties": {
          "key": {
            "type": "string"
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "label": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "subjectTypes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": ["CUSTOMER"]
            }
          }
        },
        "additionalProperties": false
      },
      "AgentStatus": {
        "type": "string",
        "enum": ["ENABLED", "DISABLED"]
      },
      "AgentScheduleSummary": {
        "type": "object",
        "required": ["enabled", "nextRunAt", "lastRunAt", "lastSuccessfulRunAt"],
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "nextRunAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "lastRunAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "lastSuccessfulRunAt": {
            "type": ["string", "null"],
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "AgentSummary": {
        "type": "object",
        "required": [
          "id",
          "agentKey",
          "displayName",
          "status",
          "templateVersion",
          "actionKeys",
          "schedule",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "agentKey": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/AgentStatus"
          },
          "templateVersion": {
            "type": "string"
          },
          "actionKeys": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "schedule": {
            "$ref": "#/components/schemas/AgentScheduleSummary"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "StartAgentRunRequest": {
        "type": "object",
        "properties": {
          "clientRequestId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 191
          }
        },
        "additionalProperties": false
      },
      "AgentRunStatus": {
        "type": "string",
        "enum": ["RUNNING", "COMPLETED", "FAILED", "PARTIAL"]
      },
      "AgentRunCounts": {
        "type": "object",
        "required": ["candidates", "tools", "artifacts", "outputs"],
        "properties": {
          "candidates": {
            "type": "integer",
            "minimum": 0
          },
          "tools": {
            "type": "integer",
            "minimum": 0
          },
          "artifacts": {
            "type": "integer",
            "minimum": 0
          },
          "outputs": {
            "type": "integer",
            "minimum": 0
          }
        },
        "additionalProperties": false
      },
      "AgentRunOutputSummary": {
        "type": "object",
        "required": ["id", "status", "deliveryStatus", "deliveredAt", "createdAt"],
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/AgentOutputStatus"
          },
          "deliveryStatus": {
            "$ref": "#/components/schemas/AgentOutputDeliveryStatus"
          },
          "deliveredAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "AgentRunSummary": {
        "type": "object",
        "required": [
          "id",
          "runId",
          "agentId",
          "status",
          "trigger",
          "summary",
          "errorSummary",
          "sandboxStatus",
          "startedAt",
          "endedAt",
          "durationMs",
          "counts",
          "outputs"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "runId": {
            "type": "string"
          },
          "agentId": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/AgentRunStatus"
          },
          "trigger": {
            "type": ["string", "null"],
            "enum": ["manual", "scheduled", "event", "signal", null]
          },
          "summary": {
            "type": ["string", "null"]
          },
          "errorSummary": {
            "type": ["string", "null"]
          },
          "sandboxStatus": {
            "type": ["string", "null"]
          },
          "startedAt": {
            "type": "string",
            "format": "date-time"
          },
          "endedAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "durationMs": {
            "type": ["integer", "null"],
            "minimum": 0
          },
          "counts": {
            "$ref": "#/components/schemas/AgentRunCounts"
          },
          "outputs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentRunOutputSummary"
            }
          }
        },
        "additionalProperties": false
      },
      "AgentRunDetail": {
        "type": "object",
        "required": [
          "id",
          "runId",
          "agentId",
          "status",
          "trigger",
          "summary",
          "errorSummary",
          "sandboxStatus",
          "startedAt",
          "endedAt",
          "durationMs",
          "counts",
          "agentKey",
          "executionStrategy",
          "model",
          "thinkingLevel",
          "visibility",
          "triggerEvidence",
          "candidates",
          "outputs",
          "toolCalls",
          "artifacts"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "runId": {
            "type": "string"
          },
          "agentId": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/AgentRunStatus"
          },
          "trigger": {
            "type": ["string", "null"],
            "enum": ["manual", "scheduled", "event", "signal", null]
          },
          "summary": {
            "type": ["string", "null"]
          },
          "errorSummary": {
            "type": ["string", "null"]
          },
          "sandboxStatus": {
            "type": ["string", "null"]
          },
          "startedAt": {
            "type": "string",
            "format": "date-time"
          },
          "endedAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "durationMs": {
            "type": ["integer", "null"],
            "minimum": 0
          },
          "counts": {
            "$ref": "#/components/schemas/AgentRunCounts"
          },
          "agentKey": {
            "type": "string"
          },
          "executionStrategy": {
            "type": "string"
          },
          "model": {
            "type": ["string", "null"]
          },
          "thinkingLevel": {
            "type": ["string", "null"]
          },
          "visibility": {
            "$ref": "#/components/schemas/AgentRunVisibility"
          },
          "triggerEvidence": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/AgentRunTriggerEvidence"
              },
              {
                "type": "null"
              }
            ]
          },
          "candidates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentRunCandidate"
            }
          },
          "outputs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentRunOutputDetail"
            }
          },
          "toolCalls": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentRunToolCallSummary"
            }
          },
          "artifacts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentRunArtifactSummary"
            }
          }
        },
        "additionalProperties": false
      },
      "ListAgentRunsCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "agent.run.list"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "agent.run.list"
                  },
                  "data": {
                    "type": "object",
                    "required": ["runs", "pagination"],
                    "properties": {
                      "runs": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/AgentRunSummary"
                        }
                      },
                      "pagination": {
                        "type": "object",
                        "required": ["hasMore", "nextCursor"],
                        "properties": {
                          "hasMore": {
                            "type": "boolean"
                          },
                          "nextCursor": {
                            "type": ["string", "null"]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "StartAgentRunCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "agent.run.start"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "agent.run.start"
                  },
                  "data": {
                    "type": "object",
                    "required": ["run", "agentRunId", "runId", "startedSandbox", "status"],
                    "properties": {
                      "run": {
                        "$ref": "#/components/schemas/AgentRunSummary"
                      },
                      "agentRunId": {
                        "type": "string"
                      },
                      "runId": {
                        "type": "string"
                      },
                      "startedSandbox": {
                        "type": "boolean"
                      },
                      "status": {
                        "$ref": "#/components/schemas/AgentRunStatus"
                      },
                      "startupError": {
                        "type": "object",
                        "required": ["message"],
                        "properties": {
                          "code": {
                            "type": "string"
                          },
                          "message": {
                            "type": "string"
                          },
                          "retryable": {
                            "type": "boolean"
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "GetAgentRunCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "agent.run.get"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "agent.run.get"
                  },
                  "data": {
                    "type": "object",
                    "required": ["run"],
                    "properties": {
                      "run": {
                        "$ref": "#/components/schemas/AgentRunDetail"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "AutomationRunDeliverySummary": {
        "type": "object",
        "required": [
          "id",
          "sourceType",
          "sourceId",
          "automationRunId",
          "agentOutputId",
          "destinationId",
          "provider",
          "providerEventId",
          "status",
          "queuedAt",
          "enqueueAttemptCount",
          "lastEnqueueAttemptAt",
          "publishedAt",
          "errorCode",
          "errorMessage",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "sourceType": {
            "type": "string",
            "enum": ["AUTOMATION_RUN", "AGENT_OUTPUT"]
          },
          "sourceId": {
            "type": ["string", "null"]
          },
          "automationRunId": {
            "type": ["string", "null"],
            "format": "uuid"
          },
          "agentOutputId": {
            "type": ["string", "null"],
            "format": "uuid"
          },
          "destinationId": {
            "type": "string",
            "format": "uuid"
          },
          "provider": {
            "$ref": "#/components/schemas/DestinationProvider"
          },
          "providerEventId": {
            "type": ["string", "null"]
          },
          "status": {
            "type": "string",
            "enum": ["PENDING_ENQUEUE", "ENQUEUED", "ACCEPTED_BY_PROVIDER", "FAILED", "SKIPPED"]
          },
          "queuedAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "enqueueAttemptCount": {
            "type": "integer",
            "minimum": 0
          },
          "lastEnqueueAttemptAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "publishedAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "errorCode": {
            "type": ["string", "null"]
          },
          "errorMessage": {
            "type": ["string", "null"]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "AutomationRunOccurrenceSummary": {
        "type": "object",
        "required": [
          "id",
          "signalId",
          "grain",
          "subjectType",
          "subjectId",
          "customerId",
          "occurredAt",
          "detectedAt",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "signalId": {
            "type": "string",
            "format": "uuid"
          },
          "grain": {
            "type": "string",
            "enum": ["ORGANIZATION", "CUSTOMER", "SEGMENT"]
          },
          "subjectType": {
            "type": "string",
            "enum": ["ORGANIZATION", "CUSTOMER", "SEGMENT"]
          },
          "subjectId": {
            "type": "string"
          },
          "customerId": {
            "type": ["string", "null"]
          },
          "occurredAt": {
            "type": "string",
            "format": "date-time"
          },
          "detectedAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "AutomationRunSummary": {
        "type": "object",
        "required": [
          "id",
          "automationId",
          "triggerType",
          "status",
          "dedupeKey",
          "eventProcessedId",
          "eventName",
          "eventChannel",
          "eventOccurredAt",
          "matchedAt",
          "destinationCount",
          "acceptedDestinationCount",
          "failedDestinationCount",
          "agentRunId",
          "skipReason",
          "errorCode",
          "errorMessage",
          "createdAt",
          "updatedAt",
          "deliveries",
          "occurrences"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "automationId": {
            "type": "string",
            "format": "uuid"
          },
          "triggerType": {
            "$ref": "#/components/schemas/AutomationTriggerType"
          },
          "status": {
            "$ref": "#/components/schemas/AutomationRunStatus"
          },
          "dedupeKey": {
            "type": ["string", "null"]
          },
          "eventProcessedId": {
            "type": ["string", "null"]
          },
          "eventName": {
            "type": ["string", "null"]
          },
          "eventChannel": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/EventChannel"
              },
              {
                "type": "null"
              }
            ]
          },
          "eventOccurredAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "matchedAt": {
            "type": "string",
            "format": "date-time"
          },
          "destinationCount": {
            "type": "integer",
            "minimum": 0
          },
          "acceptedDestinationCount": {
            "type": "integer",
            "minimum": 0
          },
          "failedDestinationCount": {
            "type": "integer",
            "minimum": 0
          },
          "agentRunId": {
            "type": ["string", "null"]
          },
          "skipReason": {
            "type": ["string", "null"]
          },
          "errorCode": {
            "type": ["string", "null"]
          },
          "errorMessage": {
            "type": ["string", "null"]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "deliveries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AutomationRunDeliverySummary"
            }
          },
          "occurrences": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AutomationRunOccurrenceSummary"
            }
          }
        },
        "additionalProperties": false
      },
      "AutomationRunDetail": {
        "$ref": "#/components/schemas/AutomationRunSummary"
      },
      "ListAutomationRunsCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "automation.run.list"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "automation.run.list"
                  },
                  "data": {
                    "type": "object",
                    "required": ["runs", "pagination"],
                    "properties": {
                      "runs": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/AutomationRunSummary"
                        }
                      },
                      "pagination": {
                        "type": "object",
                        "required": ["hasMore", "nextCursor"],
                        "properties": {
                          "hasMore": {
                            "type": "boolean"
                          },
                          "nextCursor": {
                            "type": ["string", "null"]
                          }
                        },
                        "additionalProperties": false
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "GetAutomationRunCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "automation.run.get"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "automation.run.get"
                  },
                  "data": {
                    "type": "object",
                    "required": ["run"],
                    "properties": {
                      "run": {
                        "$ref": "#/components/schemas/AutomationRunDetail"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "JsonSchemaObject": {
        "type": "object",
        "additionalProperties": true
      },
      "SignalKindOption": {
        "oneOf": [
          {
            "type": "object",
            "required": ["kind", "description", "schemaFormat", "createSchema"],
            "properties": {
              "kind": {
                "type": "string",
                "const": "EVENT_MATCH"
              },
              "description": {
                "type": "string"
              },
              "schemaFormat": {
                "type": "string",
                "const": "json-schema-2020-12"
              },
              "createSchema": {
                "$ref": "#/components/schemas/JsonSchemaObject"
              }
            },
            "additionalProperties": false
          },
          {
            "type": "object",
            "required": ["kind", "description", "schemaFormat", "createSchema", "detectionTypes"],
            "properties": {
              "kind": {
                "type": "string",
                "const": "EVENT_PATTERN"
              },
              "description": {
                "type": "string"
              },
              "schemaFormat": {
                "type": "string",
                "const": "json-schema-2020-12"
              },
              "createSchema": {
                "$ref": "#/components/schemas/JsonSchemaObject"
              },
              "detectionTypes": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SignalDetectionTypeOption"
                }
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "SignalCatalogOption": {
        "type": "object",
        "required": [
          "key",
          "label",
          "conditionId",
          "eventName",
          "eventChannel",
          "state",
          "selectable",
          "statusLabel",
          "materializedSignalId"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "conditionId": {
            "$ref": "#/components/schemas/SignalConditionId"
          },
          "eventName": {
            "type": ["string", "null"]
          },
          "eventChannel": {
            "type": ["string", "null"]
          },
          "state": {
            "type": "string"
          },
          "selectable": {
            "type": "boolean"
          },
          "statusLabel": {
            "type": ["string", "null"]
          },
          "materializedSignalId": {
            "type": ["string", "null"]
          }
        },
        "additionalProperties": false
      },
      "DestinationTypeOption": {
        "type": "object",
        "required": ["type", "label", "schemaFormat", "createSchema"],
        "properties": {
          "type": {
            "type": "string",
            "const": "SLACK_CHANNEL"
          },
          "label": {
            "type": "string"
          },
          "schemaFormat": {
            "type": "string",
            "const": "json-schema-2020-12"
          },
          "createSchema": {
            "$ref": "#/components/schemas/JsonSchemaObject"
          }
        },
        "additionalProperties": false
      },
      "SlackChannelOption": {
        "type": "object",
        "required": ["id", "name", "isPrivate"],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "isPrivate": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "UpdateWorkspaceSettingsRequest": {
        "type": "object",
        "required": ["defaultTimezone"],
        "properties": {
          "defaultTimezone": {
            "type": "string",
            "description": "IANA timezone used as the workspace default."
          }
        },
        "additionalProperties": false
      },
      "WorkspaceSettingsData": {
        "type": "object",
        "required": ["settings"],
        "properties": {
          "settings": {
            "type": "object",
            "required": ["defaultTimezone"],
            "properties": {
              "defaultTimezone": {
                "type": "string",
                "description": "IANA timezone used as the workspace default."
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "UpdateReportSettingsRequest": {
        "type": "object",
        "required": ["slackChannelId", "slackChannelName"],
        "properties": {
          "slackChannelId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 191
          },
          "slackChannelName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          }
        },
        "additionalProperties": false
      },
      "ReportSettingsData": {
        "type": "object",
        "required": ["report"],
        "properties": {
          "report": {
            "type": "object",
            "required": ["slackChannelId", "slackChannelName"],
            "properties": {
              "slackChannelId": {
                "type": ["string", "null"],
                "minLength": 1,
                "maxLength": 191
              },
              "slackChannelName": {
                "type": ["string", "null"],
                "minLength": 1,
                "maxLength": 120
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "SettingsSlackOptionsData": {
        "type": "object",
        "required": ["slack"],
        "properties": {
          "slack": {
            "$ref": "#/components/schemas/DestinationOptionsSlackData"
          }
        },
        "additionalProperties": false
      },
      "GetSettingsCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "settings.get"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "settings.get"
                  },
                  "data": {
                    "$ref": "#/components/schemas/WorkspaceSettingsData"
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "UpdateSettingsCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "settings.update"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "settings.update"
                  },
                  "data": {
                    "$ref": "#/components/schemas/WorkspaceSettingsData"
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "GetReportSettingsCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "settings.report.get"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "settings.report.get"
                  },
                  "data": {
                    "$ref": "#/components/schemas/ReportSettingsData"
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "UpdateReportSettingsCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "settings.report.update"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "settings.report.update"
                  },
                  "data": {
                    "$ref": "#/components/schemas/ReportSettingsData"
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "ReportSettingsOptionsCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "settings.report.options"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "settings.report.options"
                  },
                  "data": {
                    "$ref": "#/components/schemas/SettingsSlackOptionsData"
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "AutomationOptionsCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "automation.options"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "automation.options"
                  },
                  "data": {
                    "$ref": "#/components/schemas/AutomationOptionsData"
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "SignalOptionsCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "signal.options"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "signal.options"
                  },
                  "data": {
                    "$ref": "#/components/schemas/SignalOptionsData"
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "DestinationOptionsCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "destination.options"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "destination.options"
                  },
                  "data": {
                    "$ref": "#/components/schemas/DestinationOptionsData"
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "ListAgentTemplatesCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "agent.listTemplates"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "agent.templates.list"
                  },
                  "data": {
                    "type": "object",
                    "required": ["templates"],
                    "properties": {
                      "templates": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/AgentTemplateSummary"
                        }
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "ListAgentActionsCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "agent.listAvailableActions"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "agent.availableActions.list"
                  },
                  "data": {
                    "type": "object",
                    "required": ["actions"],
                    "properties": {
                      "actions": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/AgentActionSummary"
                        }
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "ListAgentsCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "agent.list"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "agent.list"
                  },
                  "data": {
                    "type": "object",
                    "required": ["agents"],
                    "properties": {
                      "agents": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/AgentSummary"
                        }
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "GetAgentCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "agent.get"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "agent.get"
                  },
                  "data": {
                    "type": "object",
                    "required": ["agent"],
                    "properties": {
                      "agent": {
                        "$ref": "#/components/schemas/AgentDetail"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "CreateAgentTemplateRequest": {
        "type": "object",
        "required": ["type", "templateKey"],
        "properties": {
          "type": {
            "type": "string",
            "const": "template"
          },
          "templateKey": {
            "$ref": "#/components/schemas/AgentTemplateKey"
          },
          "mode": {
            "$ref": "#/components/schemas/AgentTemplateMode"
          }
        },
        "additionalProperties": false
      },
      "CreateAgentRequest": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/CreateAgentTemplateRequest"
          },
          {
            "$ref": "#/components/schemas/CreateAgentCustomRequest"
          }
        ]
      },
      "CreateAgentCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "agent.create"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "agent.create"
                  },
                  "data": {
                    "type": "object",
                    "required": ["agent"],
                    "properties": {
                      "agent": {
                        "$ref": "#/components/schemas/AgentSummary"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "ProviderId": {
        "type": "string",
        "description": "Public integration provider ID.",
        "enum": [
          "hubspot",
          "attio",
          "slack",
          "fireflies",
          "granola",
          "google-calendar",
          "google-mail",
          "posthog",
          "stripe",
          "supabase",
          "clerk",
          "pylon"
        ]
      },
      "Integration": {
        "type": "object",
        "required": ["id", "name", "category", "status"],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/ProviderId"
          },
          "name": {
            "type": "string"
          },
          "category": {
            "type": "string",
            "examples": ["billing", "crm", "analytics"]
          },
          "status": {
            "type": "string",
            "enum": ["connected", "not_connected"]
          },
          "connectionId": {
            "type": ["string", "null"]
          },
          "lastDataReceivedAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "syncStatus": {
            "type": ["string", "null"],
            "examples": ["SUCCESS"]
          },
          "errorMessage": {
            "type": ["string", "null"]
          }
        },
        "additionalProperties": false
      },
      "IntegrationCapabilitiesResponse": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ProviderCapabilityEnvelope"
          },
          {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/ProviderCapability"
            }
          }
        ]
      },
      "ProviderCapabilityEnvelope": {
        "type": "object",
        "required": ["provider"],
        "properties": {
          "provider": {
            "$ref": "#/components/schemas/ProviderCapability"
          }
        },
        "additionalProperties": false
      },
      "ProviderCapability": {
        "type": "object",
        "required": ["cliName", "providerId", "setupMode"],
        "properties": {
          "cliName": {
            "type": "string"
          },
          "providerId": {
            "$ref": "#/components/schemas/ProviderId"
          },
          "setupMode": {
            "type": "string",
            "examples": ["direct_api_key", "browser_session"]
          },
          "credentialType": {
            "type": ["string", "null"],
            "examples": ["api_token"]
          },
          "requiredFields": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProviderCredentialField"
            }
          },
          "commands": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "postConnectSteps": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProviderPostConnectStep"
            }
          }
        },
        "additionalProperties": true
      },
      "ProviderCredentialField": {
        "type": "object",
        "required": ["key", "label"],
        "properties": {
          "key": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "secret": {
            "type": "boolean"
          }
        },
        "additionalProperties": true
      },
      "ProviderPostConnectStep": {
        "type": "object",
        "required": ["id", "required", "supported"],
        "properties": {
          "id": {
            "type": "string",
            "examples": ["webhook-setup", "mappings"]
          },
          "required": {
            "type": "boolean"
          },
          "supported": {
            "type": "boolean"
          },
          "command": {
            "type": "string"
          }
        },
        "additionalProperties": true
      },
      "IntegrationSetupStepRequest": {
        "type": "object",
        "required": ["provider", "step"],
        "properties": {
          "provider": {
            "$ref": "#/components/schemas/ProviderId"
          },
          "step": {
            "type": "string",
            "minLength": 1,
            "examples": ["mappings", "webhooks"]
          },
          "config": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "additionalProperties": false
      },
      "IntegrationConnectRequest": {
        "type": "object",
        "required": ["provider"],
        "properties": {
          "provider": {
            "$ref": "#/components/schemas/ProviderId"
          },
          "config": {
            "type": "object",
            "description": "Direct credential config. Omit to create a browser-auth connection session.",
            "additionalProperties": true
          }
        },
        "additionalProperties": false
      },
      "IntegrationDisconnectRequest": {
        "type": "object",
        "required": ["provider"],
        "properties": {
          "provider": {
            "$ref": "#/components/schemas/ProviderId"
          }
        },
        "additionalProperties": false
      },
      "IntegrationDirectConnectionResponse": {
        "type": "object",
        "required": ["connected", "connectionId", "alreadyConnected"],
        "properties": {
          "connected": {
            "type": "boolean"
          },
          "connectionId": {
            "type": "string"
          },
          "alreadyConnected": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "IntegrationDisconnectResponse": {
        "type": "object",
        "required": ["success"],
        "properties": {
          "success": {
            "type": "boolean",
            "const": true
          }
        },
        "additionalProperties": false
      },
      "IntegrationDisconnectNotConnectedResponse": {
        "type": "object",
        "required": ["success", "message"],
        "properties": {
          "success": {
            "type": "boolean",
            "const": false
          },
          "message": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "IntegrationBrowserSessionResponse": {
        "type": "object",
        "required": ["sessionId", "connectUrl", "alreadyConnected"],
        "properties": {
          "sessionId": {
            "type": "string"
          },
          "connectUrl": {
            "type": "string",
            "format": "uri"
          },
          "alreadyConnected": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "IntegrationConnectionStatusResponse": {
        "type": "object",
        "required": ["status", "provider"],
        "properties": {
          "status": {
            "type": "string",
            "enum": ["pending", "connected", "failed", "expired"]
          },
          "provider": {
            "$ref": "#/components/schemas/ProviderId"
          },
          "error": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "IntegrationSyncStatusResponse": {
        "type": "object",
        "required": ["provider", "name", "category", "status", "syncs"],
        "properties": {
          "provider": {
            "$ref": "#/components/schemas/ProviderId"
          },
          "name": {
            "type": "string"
          },
          "category": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": ["connected", "not_connected"]
          },
          "syncs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/IntegrationSync"
            }
          }
        },
        "additionalProperties": false
      },
      "IntegrationSync": {
        "type": "object",
        "required": ["model", "status"],
        "properties": {
          "model": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "examples": ["SUCCESS", "FAILED", "PENDING"]
          },
          "lastSyncedAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "errorMessage": {
            "type": ["string", "null"]
          }
        },
        "additionalProperties": false
      },
      "IngestEventsRequest": {
        "type": "object",
        "required": ["events"],
        "properties": {
          "visitorId": {
            "type": "string",
            "format": "uuid",
            "description": "Browser visitor identifier. Required for client tracking."
          },
          "source": {
            "type": "string",
            "enum": ["client", "server", "integration"],
            "default": "client"
          },
          "userIdentity": {
            "$ref": "#/components/schemas/UserIdentity"
          },
          "customerIdentity": {
            "$ref": "#/components/schemas/CustomerIdentity"
          },
          "events": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/IngestEvent"
            }
          }
        },
        "additionalProperties": false
      },
      "UserIdentity": {
        "type": "object",
        "properties": {
          "email": {
            "type": "string",
            "format": "email"
          },
          "userId": {
            "type": "string"
          },
          "traits": {
            "$ref": "#/components/schemas/JsonObject"
          }
        },
        "additionalProperties": false
      },
      "CustomerIdentity": {
        "type": "object",
        "properties": {
          "customerId": {
            "type": "string"
          },
          "customerTraits": {
            "$ref": "#/components/schemas/JsonObject"
          }
        },
        "additionalProperties": false
      },
      "IngestEvent": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/PageviewEvent"
          },
          {
            "$ref": "#/components/schemas/CustomEvent"
          },
          {
            "$ref": "#/components/schemas/FormEvent"
          },
          {
            "$ref": "#/components/schemas/IdentifyEvent"
          },
          {
            "$ref": "#/components/schemas/EngagementEvent"
          },
          {
            "$ref": "#/components/schemas/CalendarEvent"
          },
          {
            "$ref": "#/components/schemas/StageEvent"
          },
          {
            "$ref": "#/components/schemas/BillingEvent"
          }
        ]
      },
      "BaseEventFields": {
        "type": "object",
        "required": ["type"],
        "properties": {
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "number",
            "description": "Unix timestamp in milliseconds."
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "path": {
            "type": "string"
          },
          "referrer": {
            "type": "string"
          },
          "utm": {
            "$ref": "#/components/schemas/UtmParameters"
          }
        }
      },
      "PageviewEvent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BaseEventFields"
          },
          {
            "type": "object",
            "required": ["type"],
            "properties": {
              "type": {
                "const": "pageview"
              },
              "title": {
                "type": "string"
              }
            }
          }
        ]
      },
      "CustomEvent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BaseEventFields"
          },
          {
            "type": "object",
            "required": ["type", "eventName"],
            "properties": {
              "type": {
                "const": "custom"
              },
              "eventName": {
                "type": "string"
              },
              "properties": {
                "$ref": "#/components/schemas/JsonObject"
              }
            }
          }
        ]
      },
      "FormEvent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BaseEventFields"
          },
          {
            "type": "object",
            "required": ["type"],
            "properties": {
              "type": {
                "const": "form"
              },
              "formId": {
                "type": "string"
              },
              "formFields": {
                "$ref": "#/components/schemas/JsonObject"
              }
            }
          }
        ]
      },
      "IdentifyEvent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BaseEventFields"
          },
          {
            "type": "object",
            "required": ["type"],
            "properties": {
              "type": {
                "const": "identify"
              },
              "email": {
                "type": "string",
                "format": "email"
              },
              "userId": {
                "type": "string"
              },
              "customerId": {
                "type": "string"
              },
              "traits": {
                "$ref": "#/components/schemas/JsonObject"
              },
              "customerTraits": {
                "$ref": "#/components/schemas/JsonObject"
              }
            }
          }
        ]
      },
      "EngagementEvent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BaseEventFields"
          },
          {
            "type": "object",
            "required": ["type", "activeTimeMs", "totalTimeMs", "sessionId"],
            "properties": {
              "type": {
                "const": "engagement"
              },
              "activeTimeMs": {
                "type": "number",
                "minimum": 0
              },
              "totalTimeMs": {
                "type": "number",
                "minimum": 0
              },
              "sessionId": {
                "type": "string",
                "format": "uuid"
              }
            }
          }
        ]
      },
      "CalendarEvent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BaseEventFields"
          },
          {
            "type": "object",
            "required": ["type", "provider"],
            "properties": {
              "type": {
                "const": "calendar"
              },
              "provider": {
                "type": "string",
                "enum": ["cal.com", "calendly", "unknown"]
              },
              "eventType": {
                "type": "string"
              },
              "startTime": {
                "type": "string",
                "format": "date-time"
              },
              "endTime": {
                "type": "string",
                "format": "date-time"
              },
              "duration": {
                "type": "number"
              },
              "isRecurring": {
                "type": "boolean"
              },
              "inviteeEmail": {
                "type": "string",
                "format": "email"
              },
              "inviteeName": {
                "type": "string"
              }
            }
          }
        ]
      },
      "StageEvent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BaseEventFields"
          },
          {
            "type": "object",
            "required": ["type", "stage"],
            "properties": {
              "type": {
                "const": "stage"
              },
              "stage": {
                "type": "string",
                "enum": ["activated", "engaged", "inactive"]
              },
              "properties": {
                "$ref": "#/components/schemas/JsonObject"
              }
            }
          }
        ]
      },
      "BillingEvent": {
        "allOf": [
          {
            "$ref": "#/components/schemas/BaseEventFields"
          },
          {
            "type": "object",
            "required": ["type", "status"],
            "properties": {
              "type": {
                "const": "billing"
              },
              "status": {
                "type": "string",
                "enum": ["trialing", "paid", "churned"]
              },
              "customerId": {
                "type": "string"
              },
              "stripeCustomerId": {
                "type": "string"
              },
              "properties": {
                "$ref": "#/components/schemas/JsonObject"
              }
            }
          }
        ]
      },
      "UtmParameters": {
        "type": "object",
        "properties": {
          "source": {
            "type": "string"
          },
          "medium": {
            "type": "string"
          },
          "campaign": {
            "type": "string"
          },
          "term": {
            "type": "string"
          },
          "content": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "JsonObject": {
        "type": "object",
        "additionalProperties": true
      },
      "IngestEventsSuccess": {
        "type": "object",
        "required": ["success"],
        "properties": {
          "success": {
            "type": "boolean",
            "const": true
          }
        },
        "additionalProperties": true
      },
      "IngestEventsError": {
        "type": "object",
        "required": ["success", "message"],
        "properties": {
          "success": {
            "type": "boolean",
            "const": false
          },
          "message": {
            "type": "string"
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ValidationIssue"
            }
          }
        },
        "additionalProperties": true
      },
      "ValidationIssue": {
        "type": "object",
        "required": ["path", "message"],
        "properties": {
          "path": {
            "type": "array",
            "items": {
              "type": ["string", "number"]
            }
          },
          "message": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "ErrorResponse": {
        "type": "object",
        "required": ["error"],
        "properties": {
          "error": {
            "type": "string"
          },
          "details": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ValidationIssue"
            }
          }
        },
        "additionalProperties": true
      },
      "PlanLimitError": {
        "type": "object",
        "required": ["error", "code"],
        "properties": {
          "error": {
            "type": "string"
          },
          "code": {
            "type": "string",
            "examples": ["api_limit_exceeded"]
          },
          "plan": {
            "type": "string"
          },
          "feature": {
            "type": "string",
            "examples": ["api_calls"]
          },
          "resetAt": {
            "type": "number"
          }
        },
        "additionalProperties": true
      },
      "PlanConnectionLimitError": {
        "type": "object",
        "required": ["error", "code"],
        "properties": {
          "error": {
            "type": "string"
          },
          "code": {
            "type": "string",
            "examples": ["plan_connection_limit_exceeded"]
          },
          "feature": {
            "type": "string",
            "examples": ["integration_connections"]
          },
          "plan": {
            "type": "string"
          },
          "currentConnections": {
            "type": "integer"
          },
          "limit": {
            "type": "integer"
          }
        },
        "additionalProperties": true
      },
      "PlatformActionManagedBy": {
        "type": "string",
        "enum": ["UI", "CODE"]
      },
      "SignalKind": {
        "type": "string",
        "enum": ["EVENT_MATCH", "EVENT_PATTERN"]
      },
      "AutomationTriggerType": {
        "type": "string",
        "enum": ["SIGNAL_OCCURRENCE", "SCHEDULE"]
      },
      "AutomationOutcomeType": {
        "type": "string",
        "enum": ["DIRECT_DELIVERY", "AGENT_PROCESSOR"]
      },
      "AutomationMatchMode": {
        "type": "string",
        "enum": ["ANY", "ALL", "AT_LEAST"]
      },
      "AutomationRunStatus": {
        "type": "string",
        "enum": [
          "PENDING",
          "SKIPPED",
          "RUNNING_PROCESSOR",
          "READY_FOR_DELIVERY",
          "PENDING_DELIVERY",
          "DELIVERED",
          "PARTIAL_FAILURE",
          "FAILED"
        ]
      },
      "DestinationProvider": {
        "type": "string",
        "enum": ["SLACK", "OUTPOST", "WEBHOOK"]
      },
      "DestinationKind": {
        "type": "string",
        "enum": ["SLACK_CHANNEL", "WEBHOOK_ENDPOINT"]
      },
      "DestinationSyncStatus": {
        "type": "string",
        "enum": ["PENDING_PROVIDER_SYNC", "SYNCED", "PROVIDER_ERROR", "DISABLED_BY_PROVIDER"]
      },
      "SignalRead": {
        "type": "object",
        "required": [
          "id",
          "key",
          "managedBy",
          "name",
          "description",
          "kind",
          "definition",
          "schemaVersion",
          "configHash",
          "archivedAt",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "key": {
            "type": "string"
          },
          "managedBy": {
            "$ref": "#/components/schemas/PlatformActionManagedBy"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": ["string", "null"]
          },
          "kind": {
            "$ref": "#/components/schemas/SignalKind"
          },
          "definition": {},
          "schemaVersion": {
            "type": "string"
          },
          "configHash": {
            "type": ["string", "null"]
          },
          "archivedAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "DestinationRead": {
        "type": "object",
        "required": [
          "id",
          "key",
          "name",
          "description",
          "provider",
          "kind",
          "enabled",
          "maskedConfig",
          "syncStatus",
          "lastSyncedAt",
          "providerErrorCode",
          "providerErrorMessage",
          "isDefault",
          "schemaVersion",
          "configHash",
          "archivedAt",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "key": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": ["string", "null"]
          },
          "provider": {
            "$ref": "#/components/schemas/DestinationProvider"
          },
          "kind": {
            "$ref": "#/components/schemas/DestinationKind"
          },
          "enabled": {
            "type": "boolean"
          },
          "maskedConfig": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": true
              },
              {
                "type": "null"
              }
            ]
          },
          "syncStatus": {
            "$ref": "#/components/schemas/DestinationSyncStatus"
          },
          "lastSyncedAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "providerErrorCode": {
            "type": ["string", "null"]
          },
          "providerErrorMessage": {
            "type": ["string", "null"]
          },
          "isDefault": {
            "type": "boolean"
          },
          "schemaVersion": {
            "type": "string"
          },
          "configHash": {
            "type": ["string", "null"]
          },
          "archivedAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "AutomationRead": {
        "type": "object",
        "required": [
          "id",
          "key",
          "managedBy",
          "name",
          "description",
          "enabled",
          "triggerType",
          "triggerJson",
          "audienceFilterJson",
          "agentId",
          "matchMode",
          "schemaVersion",
          "configHash",
          "archivedAt",
          "lastRunAt",
          "lastRunStatus",
          "nextRunAt",
          "createdAt",
          "updatedAt",
          "signals",
          "destinations",
          "activeSignalCount",
          "activeDestinationCount"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "key": {
            "type": "string"
          },
          "managedBy": {
            "$ref": "#/components/schemas/PlatformActionManagedBy"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": ["string", "null"]
          },
          "enabled": {
            "type": "boolean"
          },
          "triggerType": {
            "$ref": "#/components/schemas/AutomationTriggerType"
          },
          "triggerJson": {},
          "audienceFilterJson": {},
          "matchMode": {
            "$ref": "#/components/schemas/AutomationMatchMode"
          },
          "schemaVersion": {
            "type": "string"
          },
          "configHash": {
            "type": ["string", "null"]
          },
          "archivedAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "lastRunAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "lastRunStatus": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AutomationRunStatus"
              },
              {
                "type": "null"
              }
            ]
          },
          "nextRunAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "signals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SignalRead"
            }
          },
          "destinations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DestinationRead"
            }
          },
          "activeSignalCount": {
            "type": "integer",
            "minimum": 0
          },
          "activeDestinationCount": {
            "type": "integer",
            "minimum": 0
          },
          "agentId": {
            "type": ["string", "null"],
            "format": "uuid"
          }
        },
        "additionalProperties": false
      },
      "ListAutomationsCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "automation.list"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "automation.list"
                  },
                  "data": {
                    "type": "object",
                    "required": ["automations"],
                    "properties": {
                      "automations": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/AutomationRead"
                        }
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "GetAutomationCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "automation.get"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "automation.get"
                  },
                  "data": {
                    "type": "object",
                    "required": ["automation"],
                    "properties": {
                      "automation": {
                        "$ref": "#/components/schemas/AutomationRead"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "ListSignalsCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "signal.list"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "signal.list"
                  },
                  "data": {
                    "type": "object",
                    "required": ["signals"],
                    "properties": {
                      "signals": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/SignalRead"
                        }
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "ListDestinationsCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "destination.list"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "destination.list"
                  },
                  "data": {
                    "type": "object",
                    "required": ["destinations"],
                    "properties": {
                      "destinations": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/DestinationRead"
                        }
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "ArchivedResource": {
        "type": "object",
        "required": ["id", "archivedAt"],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "archivedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "RenameAgentRequest": {
        "type": "object",
        "required": ["displayName"],
        "properties": {
          "displayName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          }
        },
        "additionalProperties": false
      },
      "EnableAgentCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "agent.enable"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "agent.enable"
                  },
                  "data": {
                    "type": "object",
                    "required": ["agent"],
                    "properties": {
                      "agent": {
                        "$ref": "#/components/schemas/AgentSummary"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "DisableAgentCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "agent.disable"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "agent.disable"
                  },
                  "data": {
                    "type": "object",
                    "required": ["agent"],
                    "properties": {
                      "agent": {
                        "$ref": "#/components/schemas/AgentSummary"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "RenameAgentCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "agent.rename"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "agent.rename"
                  },
                  "data": {
                    "type": "object",
                    "required": ["agent"],
                    "properties": {
                      "agent": {
                        "$ref": "#/components/schemas/AgentSummary"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "EnableAutomationCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "automation.enable"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "automation.enable"
                  },
                  "data": {
                    "type": "object",
                    "required": ["automation"],
                    "properties": {
                      "automation": {
                        "$ref": "#/components/schemas/AutomationRead"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "DisableAutomationCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "automation.disable"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "automation.disable"
                  },
                  "data": {
                    "type": "object",
                    "required": ["automation"],
                    "properties": {
                      "automation": {
                        "$ref": "#/components/schemas/AutomationRead"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "ArchiveAutomationCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "automation.archive"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "automation.archive"
                  },
                  "data": {
                    "type": "object",
                    "required": ["automation"],
                    "properties": {
                      "automation": {
                        "$ref": "#/components/schemas/ArchivedResource"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "GetSignalCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "signal.get"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "signal.get"
                  },
                  "data": {
                    "type": "object",
                    "required": ["signal"],
                    "properties": {
                      "signal": {
                        "$ref": "#/components/schemas/SignalRead"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "ArchiveSignalCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "signal.archive"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "signal.archive"
                  },
                  "data": {
                    "type": "object",
                    "required": ["signal"],
                    "properties": {
                      "signal": {
                        "$ref": "#/components/schemas/ArchivedResource"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "GetDestinationCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "destination.get"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "destination.get"
                  },
                  "data": {
                    "type": "object",
                    "required": ["destination"],
                    "properties": {
                      "destination": {
                        "$ref": "#/components/schemas/DestinationDetailRead"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "EnableDestinationCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "destination.enable"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "destination.enable"
                  },
                  "data": {
                    "type": "object",
                    "required": ["destination"],
                    "properties": {
                      "destination": {
                        "$ref": "#/components/schemas/DestinationRead"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "DisableDestinationCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "destination.disable"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "destination.disable"
                  },
                  "data": {
                    "type": "object",
                    "required": ["destination"],
                    "properties": {
                      "destination": {
                        "$ref": "#/components/schemas/DestinationRead"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "ArchiveDestinationCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "destination.archive"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "destination.archive"
                  },
                  "data": {
                    "type": "object",
                    "required": ["destination"],
                    "properties": {
                      "destination": {
                        "$ref": "#/components/schemas/ArchivedResource"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "CreateAgentCustomRequest": {
        "type": "object",
        "required": ["type", "displayName", "instructions"],
        "properties": {
          "type": {
            "type": "string",
            "const": "custom"
          },
          "displayName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "instructions": {
            "type": "string",
            "minLength": 1,
            "maxLength": 32000
          },
          "maxItemsToSurface": {
            "type": "integer",
            "minimum": 1,
            "maximum": 50,
            "default": 10
          },
          "actionKeys": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "default": []
          }
        },
        "additionalProperties": false
      },
      "UpdateAgentRequest": {
        "type": "object",
        "minProperties": 1,
        "properties": {
          "displayName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "instructions": {
            "type": "string",
            "minLength": 1,
            "maxLength": 10000
          },
          "actionKeys": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          }
        },
        "additionalProperties": false
      },
      "CreateAutomationRequest": {
        "type": "object",
        "required": ["agentId", "name", "triggerType"],
        "properties": {
          "agentId": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "description": {
            "type": ["string", "null"],
            "maxLength": 1000,
            "default": null
          },
          "enabled": {
            "type": "boolean",
            "default": true
          },
          "triggerType": {
            "$ref": "#/components/schemas/AutomationTriggerType"
          },
          "signalIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "maxItems": 50,
            "default": []
          },
          "matchMode": {
            "$ref": "#/components/schemas/AutomationMatchMode"
          },
          "triggerWindow": {
            "type": "object",
            "properties": {
              "value": {
                "type": "integer",
                "minimum": 1
              },
              "unit": {
                "type": "string",
                "enum": ["hour", "day"]
              }
            },
            "required": ["value", "unit"],
            "additionalProperties": false
          },
          "triggerThresholdCount": {
            "type": "integer",
            "minimum": 2,
            "maximum": 5
          },
          "schedule": {
            "type": "object",
            "properties": {
              "cadence": {
                "type": "string",
                "enum": ["hourly", "daily", "weekly"]
              },
              "localTime": {
                "type": "object",
                "properties": {
                  "hour": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 23
                  },
                  "minute": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 59
                  },
                  "second": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 59,
                    "default": 0
                  },
                  "millisecond": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 999,
                    "default": 0
                  }
                },
                "required": ["hour", "minute"],
                "additionalProperties": false
              },
              "timezone": {
                "type": "string",
                "default": "America/Los_Angeles"
              },
              "weekday": {
                "type": "string",
                "enum": [
                  "monday",
                  "tuesday",
                  "wednesday",
                  "thursday",
                  "friday",
                  "saturday",
                  "sunday"
                ]
              }
            },
            "required": ["cadence"],
            "additionalProperties": false
          },
          "audienceFilter": {
            "$ref": "#/components/schemas/AutomationAudienceFilter"
          },
          "processorPolicy": {
            "type": "object",
            "properties": {
              "subjectHandling": {
                "type": "string",
                "enum": ["event_customer", "scheduled_customer_pool"],
                "default": "event_customer"
              },
              "maxCustomersPerRun": {
                "type": "integer",
                "minimum": 1,
                "maximum": 500
              },
              "maxConcurrentRuns": {
                "type": "integer",
                "const": 1
              },
              "cooldownHours": {
                "type": "integer",
                "minimum": 0,
                "maximum": 2160
              }
            },
            "additionalProperties": false
          },
          "deliveryPolicy": {
            "type": "object",
            "properties": {
              "requireAllDestinations": {
                "type": "boolean",
                "default": false
              }
            },
            "additionalProperties": false,
            "default": {
              "requireAllDestinations": false
            }
          },
          "destinationIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "maxItems": 25,
            "default": []
          }
        },
        "additionalProperties": false
      },
      "UpdateAutomationRequest": {
        "type": "object",
        "required": ["agentId", "name", "enabled", "triggerType"],
        "properties": {
          "agentId": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "description": {
            "type": ["string", "null"],
            "maxLength": 1000,
            "default": null
          },
          "enabled": {
            "type": "boolean"
          },
          "triggerType": {
            "$ref": "#/components/schemas/AutomationTriggerType"
          },
          "signalIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "maxItems": 50,
            "default": []
          },
          "matchMode": {
            "$ref": "#/components/schemas/AutomationMatchMode"
          },
          "triggerWindow": {
            "type": "object",
            "properties": {
              "value": {
                "type": "integer",
                "minimum": 1
              },
              "unit": {
                "type": "string",
                "enum": ["hour", "day"]
              }
            },
            "required": ["value", "unit"],
            "additionalProperties": false
          },
          "triggerThresholdCount": {
            "type": "integer",
            "minimum": 2,
            "maximum": 5
          },
          "schedule": {
            "type": "object",
            "properties": {
              "cadence": {
                "type": "string",
                "enum": ["hourly", "daily", "weekly"]
              },
              "localTime": {
                "type": "object",
                "properties": {
                  "hour": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 23
                  },
                  "minute": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 59
                  },
                  "second": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 59,
                    "default": 0
                  },
                  "millisecond": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 999,
                    "default": 0
                  }
                },
                "required": ["hour", "minute"],
                "additionalProperties": false
              },
              "timezone": {
                "type": "string",
                "default": "America/Los_Angeles"
              },
              "weekday": {
                "type": "string",
                "enum": [
                  "monday",
                  "tuesday",
                  "wednesday",
                  "thursday",
                  "friday",
                  "saturday",
                  "sunday"
                ]
              }
            },
            "required": ["cadence"],
            "additionalProperties": false
          },
          "audienceFilter": {
            "$ref": "#/components/schemas/AutomationAudienceFilter"
          },
          "processorPolicy": {
            "type": "object",
            "properties": {
              "subjectHandling": {
                "type": "string",
                "enum": ["event_customer", "scheduled_customer_pool"],
                "default": "event_customer"
              },
              "maxCustomersPerRun": {
                "type": "integer",
                "minimum": 1,
                "maximum": 500
              },
              "maxConcurrentRuns": {
                "type": "integer",
                "const": 1
              },
              "cooldownHours": {
                "type": "integer",
                "minimum": 0,
                "maximum": 2160
              }
            },
            "additionalProperties": false
          },
          "deliveryPolicy": {
            "type": "object",
            "properties": {
              "requireAllDestinations": {
                "type": "boolean",
                "default": false
              }
            },
            "additionalProperties": false,
            "default": {
              "requireAllDestinations": false
            }
          },
          "destinationIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid"
            },
            "maxItems": 25,
            "default": []
          }
        },
        "additionalProperties": false
      },
      "CreateSignalRequest": {
        "oneOf": [
          {
            "type": "object",
            "required": ["kind", "name", "definition"],
            "properties": {
              "kind": {
                "type": "string",
                "const": "EVENT_MATCH"
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "description": {
                "type": ["string", "null"],
                "maxLength": 1000,
                "default": null
              },
              "definition": {
                "$ref": "#/components/schemas/EventMatchSignalDefinition"
              }
            },
            "additionalProperties": false
          },
          {
            "type": "object",
            "required": ["kind", "name", "definition"],
            "properties": {
              "kind": {
                "type": "string",
                "const": "EVENT_PATTERN"
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "description": {
                "type": ["string", "null"],
                "maxLength": 1000,
                "default": null
              },
              "definition": {
                "$ref": "#/components/schemas/AuthoredSignalDefinition"
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "UpdateSignalRequest": {
        "oneOf": [
          {
            "type": "object",
            "required": ["kind", "name", "definition"],
            "properties": {
              "kind": {
                "type": "string",
                "const": "EVENT_MATCH"
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "description": {
                "type": ["string", "null"],
                "maxLength": 1000,
                "default": null
              },
              "definition": {
                "$ref": "#/components/schemas/EventMatchSignalDefinition"
              }
            },
            "additionalProperties": false
          },
          {
            "type": "object",
            "required": ["kind", "name", "definition"],
            "properties": {
              "kind": {
                "type": "string",
                "const": "EVENT_PATTERN"
              },
              "name": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "description": {
                "type": ["string", "null"],
                "maxLength": 1000,
                "default": null
              },
              "definition": {
                "$ref": "#/components/schemas/AuthoredSignalDefinition"
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "CreateDestinationRequest": {
        "type": "object",
        "required": ["type", "channelId", "label"],
        "properties": {
          "type": {
            "type": "string",
            "const": "SLACK_CHANNEL"
          },
          "channelId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 191
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "enabled": {
            "type": "boolean",
            "default": true
          },
          "isDefault": {
            "type": "boolean",
            "default": false,
            "description": "Whether to make this Slack destination the default fallback destination."
          }
        },
        "additionalProperties": false
      },
      "UpdateDestinationRequest": {
        "type": "object",
        "required": ["type"],
        "minProperties": 2,
        "properties": {
          "type": {
            "type": "string",
            "const": "SLACK_CHANNEL"
          },
          "label": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "enabled": {
            "type": "boolean"
          },
          "isDefault": {
            "type": "boolean",
            "const": true,
            "description": "Set this Slack destination as the default fallback destination."
          }
        },
        "additionalProperties": false
      },
      "UpdateAgentCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "agent.update"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "agent.update"
                  },
                  "data": {
                    "type": "object",
                    "required": ["agent"],
                    "properties": {
                      "agent": {
                        "$ref": "#/components/schemas/AgentSummary"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "CreateAutomationCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "automation.create"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "automation.create"
                  },
                  "data": {
                    "type": "object",
                    "required": ["automation"],
                    "properties": {
                      "automation": {
                        "$ref": "#/components/schemas/AutomationRead"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "UpdateAutomationCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "automation.update"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "automation.update"
                  },
                  "data": {
                    "type": "object",
                    "required": ["automation"],
                    "properties": {
                      "automation": {
                        "$ref": "#/components/schemas/AutomationRead"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "CreateSignalCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "signal.create"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "signal.create"
                  },
                  "data": {
                    "type": "object",
                    "required": ["signal"],
                    "properties": {
                      "signal": {
                        "$ref": "#/components/schemas/SignalRead"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "UpdateSignalCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "signal.update"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "signal.update"
                  },
                  "data": {
                    "type": "object",
                    "required": ["signal"],
                    "properties": {
                      "signal": {
                        "$ref": "#/components/schemas/SignalRead"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "CreateDestinationCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "destination.create"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "destination.create"
                  },
                  "data": {
                    "type": "object",
                    "required": ["destination"],
                    "properties": {
                      "destination": {
                        "$ref": "#/components/schemas/DestinationRead"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "UpdateDestinationCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "destination.update"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "destination.update"
                  },
                  "data": {
                    "type": "object",
                    "required": ["destination"],
                    "properties": {
                      "destination": {
                        "$ref": "#/components/schemas/DestinationRead"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "IdentityMergeSuggestionStatus": {
        "type": "string",
        "enum": ["suggested", "processing", "merged", "rejected"]
      },
      "IdentityMergeProposalStatus": {
        "type": "string",
        "enum": ["PROPOSED", "STAGED", "STALE", "REJECTED", "APPLIED"]
      },
      "IdentityMergeConfidence": {
        "type": "string",
        "enum": ["HIGH", "MEDIUM", "LOW"]
      },
      "IdentityMergeJobStatus": {
        "type": "string",
        "enum": ["QUEUED", "RUNNING", "COMPLETED", "FAILED"]
      },
      "IdentityMergeSuggestionCustomer": {
        "type": "object",
        "required": ["id", "name", "domain", "type", "status", "identifierCount", "contactCount"],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "domain": {
            "type": ["string", "null"]
          },
          "type": {
            "type": "string",
            "enum": ["COMPANY", "INDIVIDUAL"]
          },
          "status": {
            "type": ["string", "null"],
            "enum": ["PROVISIONAL", "ACTIVE", "CHURNED", "MERGED", null]
          },
          "identifierCount": {
            "type": "integer",
            "minimum": 0
          },
          "contactCount": {
            "type": "integer",
            "minimum": 0
          }
        },
        "additionalProperties": false
      },
      "IdentityMergeImpactSummary": {
        "type": "object",
        "required": [
          "identifiers",
          "users",
          "activities",
          "visitors",
          "billingEvents",
          "facts",
          "supportTickets",
          "calls",
          "accessEntries",
          "analyticsEvents",
          "analyticsDimensions"
        ],
        "properties": {
          "identifiers": {
            "type": "integer",
            "minimum": 0
          },
          "users": {
            "type": "integer",
            "minimum": 0
          },
          "activities": {
            "type": "integer",
            "minimum": 0
          },
          "visitors": {
            "type": "integer",
            "minimum": 0
          },
          "billingEvents": {
            "type": "integer",
            "minimum": 0
          },
          "facts": {
            "type": "integer",
            "minimum": 0
          },
          "supportTickets": {
            "type": "integer",
            "minimum": 0
          },
          "calls": {
            "type": "integer",
            "minimum": 0
          },
          "accessEntries": {
            "type": "integer",
            "minimum": 0
          },
          "analyticsEvents": {
            "type": "integer",
            "minimum": 0
          },
          "analyticsDimensions": {
            "type": "integer",
            "minimum": 0
          }
        },
        "additionalProperties": false
      },
      "IdentityMergeSuggestionJob": {
        "type": "object",
        "required": ["id", "status", "createdAt", "updatedAt"],
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/IdentityMergeJobStatus"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "IdentityMergeSuggestion": {
        "type": "object",
        "required": [
          "id",
          "status",
          "proposalStatus",
          "confidence",
          "survivor",
          "duplicate",
          "reviewNotes",
          "reviewedAt",
          "reviewedByName",
          "appliedAt",
          "appliedByName",
          "createdAt",
          "explanation",
          "impact",
          "latestJob",
          "canMerge",
          "canReject"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/IdentityMergeSuggestionStatus"
          },
          "proposalStatus": {
            "$ref": "#/components/schemas/IdentityMergeProposalStatus"
          },
          "confidence": {
            "$ref": "#/components/schemas/IdentityMergeConfidence"
          },
          "survivor": {
            "$ref": "#/components/schemas/IdentityMergeSuggestionCustomer"
          },
          "duplicate": {
            "$ref": "#/components/schemas/IdentityMergeSuggestionCustomer"
          },
          "reviewNotes": {
            "type": ["string", "null"]
          },
          "reviewedAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "reviewedByName": {
            "type": ["string", "null"]
          },
          "appliedAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "appliedByName": {
            "type": ["string", "null"]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "explanation": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "impact": {
            "$ref": "#/components/schemas/IdentityMergeImpactSummary"
          },
          "latestJob": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/IdentityMergeSuggestionJob"
              },
              {
                "type": "null"
              }
            ]
          },
          "canMerge": {
            "type": "boolean"
          },
          "canReject": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "IdentityMergeSuggestionActionRequest": {
        "type": "object",
        "properties": {
          "reviewNotes": {
            "type": "string",
            "maxLength": 10000
          }
        },
        "additionalProperties": false
      },
      "ListIdentityMergeSuggestionsCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "identity.mergeSuggestion.list"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "identity.mergeSuggestion.list"
                  },
                  "data": {
                    "type": "object",
                    "required": ["suggestions", "canManageIdentityMerges"],
                    "properties": {
                      "suggestions": {
                        "type": "array",
                        "items": {
                          "$ref": "#/components/schemas/IdentityMergeSuggestion"
                        }
                      },
                      "canManageIdentityMerges": {
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "GetIdentityMergeSuggestionCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "const": "identity.mergeSuggestion.get"
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "const": "identity.mergeSuggestion.get"
                  },
                  "data": {
                    "type": "object",
                    "required": ["suggestion", "canManageIdentityMerges"],
                    "properties": {
                      "suggestion": {
                        "$ref": "#/components/schemas/IdentityMergeSuggestion"
                      },
                      "canManageIdentityMerges": {
                        "type": "boolean"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "IdentityMergeSuggestionActionCommandSuccess": {
        "type": "object",
        "required": ["ok", "commandId", "commandVersion", "correlationId", "result"],
        "properties": {
          "ok": {
            "type": "boolean",
            "const": true
          },
          "commandId": {
            "type": "string",
            "enum": ["identity.mergeSuggestion.queue", "identity.mergeSuggestion.reject"]
          },
          "commandVersion": {
            "type": "integer",
            "const": 1
          },
          "correlationId": {
            "type": "string"
          },
          "result": {
            "allOf": [
              {
                "$ref": "#/components/schemas/CommandResultBase"
              },
              {
                "type": "object",
                "properties": {
                  "operationId": {
                    "type": "string",
                    "enum": ["identity.mergeSuggestion.queue", "identity.mergeSuggestion.reject"]
                  },
                  "data": {
                    "type": "object",
                    "required": ["proposalId", "status"],
                    "properties": {
                      "proposalId": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string",
                        "enum": ["STAGED", "REJECTED"]
                      },
                      "jobId": {
                        "type": "string"
                      },
                      "jobStatus": {
                        "$ref": "#/components/schemas/IdentityMergeJobStatus"
                      }
                    },
                    "additionalProperties": false
                  }
                }
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "SignalPropertyCondition": {
        "oneOf": [
          {
            "type": "object",
            "required": ["key", "operator"],
            "properties": {
              "key": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "operator": {
                "type": "string",
                "const": "exists"
              }
            },
            "additionalProperties": false
          },
          {
            "type": "object",
            "required": ["key", "operator", "value"],
            "properties": {
              "key": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "operator": {
                "type": "string",
                "enum": ["equals", "not_equals"]
              },
              "value": {
                "oneOf": [
                  {
                    "type": "string"
                  },
                  {
                    "type": "number"
                  },
                  {
                    "type": "boolean"
                  }
                ]
              }
            },
            "additionalProperties": false
          },
          {
            "type": "object",
            "required": ["key", "operator", "value"],
            "properties": {
              "key": {
                "type": "string",
                "minLength": 1,
                "maxLength": 120
              },
              "operator": {
                "type": "string",
                "const": "starts_with"
              },
              "value": {
                "type": "string"
              }
            },
            "additionalProperties": false
          }
        ]
      },
      "EventChannel": {
        "type": "string",
        "enum": [
          "PRODUCT",
          "COMMUNICATION",
          "MEETING",
          "CRM",
          "BILLING",
          "SUPPORT",
          "IDENTITY",
          "DOCUMENT",
          "SYSTEM"
        ]
      },
      "EventMatchSignalDefinition": {
        "type": "object",
        "required": ["grain", "subjectResolver", "eventNames"],
        "properties": {
          "grain": {
            "type": "string",
            "enum": ["organization", "customer", "segment"]
          },
          "subjectResolver": {
            "type": "string",
            "enum": ["organization", "event_customer", "segment"]
          },
          "eventNames": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "maxItems": 50,
            "minItems": 1
          },
          "eventChannels": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventChannel"
            },
            "maxItems": 9
          },
          "propertyConditions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SignalPropertyCondition"
            },
            "maxItems": 5,
            "default": []
          },
          "conditionMode": {
            "type": "string",
            "const": "ALL",
            "default": "ALL"
          }
        },
        "additionalProperties": false
      },
      "SignalWindow": {
        "type": "object",
        "required": ["value", "unit"],
        "properties": {
          "value": {
            "type": "integer",
            "minimum": 1,
            "maximum": 365
          },
          "unit": {
            "type": "string",
            "enum": ["hour", "day"]
          }
        },
        "additionalProperties": false
      },
      "EventOccurredDetection": {
        "type": "object",
        "required": ["type", "eventNames"],
        "properties": {
          "type": {
            "type": "string",
            "const": "event_occurred"
          },
          "eventNames": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "maxItems": 50,
            "minItems": 1
          },
          "eventChannels": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventChannel"
            },
            "maxItems": 9
          },
          "propertyConditions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SignalPropertyCondition"
            },
            "maxItems": 5,
            "default": []
          }
        },
        "additionalProperties": false
      },
      "EventCountThresholdDetection": {
        "type": "object",
        "required": ["type", "eventNames", "threshold", "window"],
        "properties": {
          "type": {
            "type": "string",
            "const": "event_count_threshold"
          },
          "eventNames": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "maxItems": 50,
            "minItems": 1
          },
          "eventChannels": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventChannel"
            },
            "maxItems": 9
          },
          "propertyConditions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SignalPropertyCondition"
            },
            "maxItems": 5,
            "default": []
          },
          "threshold": {
            "type": "object",
            "required": ["operator", "count"],
            "properties": {
              "operator": {
                "type": "string",
                "enum": [">=", ">"]
              },
              "count": {
                "type": "integer",
                "minimum": 1,
                "maximum": 10000
              }
            },
            "additionalProperties": false
          },
          "window": {
            "$ref": "#/components/schemas/SignalWindow"
          }
        },
        "additionalProperties": false
      },
      "EventAbsenceDetection": {
        "type": "object",
        "required": ["type", "window"],
        "properties": {
          "type": {
            "type": "string",
            "const": "event_absence"
          },
          "eventNameMode": {
            "type": "string",
            "enum": ["exact", "all_except"]
          },
          "eventNames": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "maxItems": 50,
            "default": []
          },
          "excludeEventNames": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            },
            "maxItems": 50
          },
          "eventChannels": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EventChannel"
            },
            "maxItems": 9
          },
          "propertyConditions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SignalPropertyCondition"
            },
            "maxItems": 5,
            "default": []
          },
          "window": {
            "type": "object",
            "required": ["value", "unit"],
            "properties": {
              "value": {
                "type": "integer",
                "minimum": 1,
                "maximum": 30
              },
              "unit": {
                "type": "string",
                "const": "day"
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "ActivityWindow": {
        "type": "object",
        "required": ["value", "unit"],
        "properties": {
          "value": {
            "type": "integer",
            "minimum": 1,
            "maximum": 365
          },
          "unit": {
            "type": "string",
            "const": "day"
          }
        },
        "additionalProperties": false
      },
      "CustomerActivityThresholdDetection": {
        "type": "object",
        "required": ["type", "metric", "window", "operator", "count"],
        "properties": {
          "type": {
            "type": "string",
            "const": "customer_activity_threshold"
          },
          "metric": {
            "type": "string",
            "const": "active_days"
          },
          "window": {
            "$ref": "#/components/schemas/ActivityWindow"
          },
          "operator": {
            "type": "string",
            "enum": ["<=", "<", ">=", ">"]
          },
          "count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 365
          },
          "minimumObservedAgeDays": {
            "type": "integer",
            "minimum": 1,
            "maximum": 365
          }
        },
        "additionalProperties": false
      },
      "CustomerActivityDropDetection": {
        "type": "object",
        "required": [
          "type",
          "metric",
          "window",
          "baselineWindow",
          "dropPercent",
          "minimumBaselineActiveDays",
          "minimumBaselineEventCount"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "customer_activity_drop"
          },
          "metric": {
            "type": "string",
            "const": "active_days"
          },
          "window": {
            "$ref": "#/components/schemas/ActivityWindow"
          },
          "baselineWindow": {
            "$ref": "#/components/schemas/ActivityWindow"
          },
          "dropPercent": {
            "type": "number",
            "minimum": 1,
            "maximum": 100
          },
          "minimumBaselineActiveDays": {
            "type": "integer",
            "minimum": 1,
            "maximum": 365
          },
          "minimumBaselineEventCount": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100000
          }
        },
        "additionalProperties": false
      },
      "RelatedUserInactivityDetection": {
        "type": "object",
        "required": [
          "type",
          "priorWindow",
          "inactiveWindow",
          "minimumPriorActiveDays",
          "minimumPreviouslyActiveUsers"
        ],
        "properties": {
          "type": {
            "type": "string",
            "const": "related_user_inactivity"
          },
          "priorWindow": {
            "$ref": "#/components/schemas/ActivityWindow"
          },
          "inactiveWindow": {
            "$ref": "#/components/schemas/ActivityWindow"
          },
          "minimumPriorActiveDays": {
            "type": "integer",
            "minimum": 1,
            "maximum": 365
          },
          "minimumPreviouslyActiveUsers": {
            "type": "integer",
            "minimum": 1,
            "maximum": 10000
          }
        },
        "additionalProperties": false
      },
      "SignalDetection": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/EventOccurredDetection"
          },
          {
            "$ref": "#/components/schemas/EventCountThresholdDetection"
          },
          {
            "$ref": "#/components/schemas/EventAbsenceDetection"
          },
          {
            "$ref": "#/components/schemas/CustomerActivityThresholdDetection"
          },
          {
            "$ref": "#/components/schemas/CustomerActivityDropDetection"
          },
          {
            "$ref": "#/components/schemas/RelatedUserInactivityDetection"
          }
        ]
      },
      "AuthoredSignalDefinition": {
        "type": "object",
        "required": ["schemaVersion", "subjectType", "detection"],
        "properties": {
          "schemaVersion": {
            "type": "string",
            "const": "2026-06-17"
          },
          "subjectType": {
            "type": "string",
            "const": "customer"
          },
          "catalogSource": {
            "type": "object",
            "required": ["provider", "key", "version"],
            "properties": {
              "provider": {
                "type": "string",
                "const": "outlit"
              },
              "key": {
                "type": "string",
                "minLength": 1,
                "maxLength": 191
              },
              "version": {
                "type": "string",
                "minLength": 1,
                "maxLength": 40
              }
            },
            "additionalProperties": false
          },
          "detection": {
            "$ref": "#/components/schemas/SignalDetection"
          }
        },
        "additionalProperties": false
      },
      "AutomationAudienceRevenueFilter": {
        "type": "object",
        "required": ["metric", "operator", "value"],
        "properties": {
          "metric": {
            "type": "string",
            "enum": ["ARR", "MRR"]
          },
          "operator": {
            "type": "string",
            "enum": [">=", ">", "<=", "<"]
          },
          "value": {
            "type": "number",
            "minimum": 0,
            "maximum": 1000000000
          },
          "currency": {
            "type": "string",
            "const": "USD"
          }
        },
        "additionalProperties": false
      },
      "AutomationAudienceFilter": {
        "type": "object",
        "properties": {
          "customer": {
            "type": "object",
            "properties": {
              "billingStatuses": {
                "type": "array",
                "items": {
                  "type": "string",
                  "enum": ["NONE", "TRIALING", "PAYING", "PAST_DUE", "CHURNED"]
                }
              },
              "customerIds": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "revenue": {
                "$ref": "#/components/schemas/AutomationAudienceRevenueFilter"
              },
              "ownerUserIds": {
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 191
                }
              }
            },
            "additionalProperties": false
          }
        },
        "additionalProperties": false
      },
      "AgentRunOutputAction": {
        "type": "object",
        "required": ["id", "label", "status", "url"],
        "properties": {
          "id": {
            "type": "string"
          },
          "label": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": ["OPEN", "ENGAGED", "EXECUTED", "UNAVAILABLE"]
          },
          "url": {
            "type": ["string", "null"],
            "format": "uri"
          }
        },
        "additionalProperties": false
      },
      "AgentRunOutputDetail": {
        "type": "object",
        "required": [
          "id",
          "contractType",
          "contractVersion",
          "status",
          "deliveryStatus",
          "error",
          "processedAt",
          "deliveredAt",
          "createdAt",
          "notificationCount",
          "referencedCandidateCount",
          "referencedCandidateIds",
          "titles",
          "markdownPreviews",
          "deliverySummary",
          "actions"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "contractType": {
            "type": "string"
          },
          "contractVersion": {
            "type": "integer",
            "minimum": 1
          },
          "status": {
            "$ref": "#/components/schemas/AgentOutputStatus"
          },
          "deliveryStatus": {
            "$ref": "#/components/schemas/AgentOutputDeliveryStatus"
          },
          "error": {
            "type": ["string", "null"]
          },
          "processedAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "deliveredAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "notificationCount": {
            "type": "integer",
            "minimum": 0
          },
          "referencedCandidateCount": {
            "type": "integer",
            "minimum": 0
          },
          "referencedCandidateIds": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "titles": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "markdownPreviews": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "deliverySummary": {
            "type": ["string", "null"]
          },
          "actions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentRunOutputAction"
            }
          }
        },
        "additionalProperties": false
      },
      "AgentRunVisibility": {
        "type": "object",
        "required": ["hiddenCustomerCount", "hiddenOutputCount", "debugLedgerHidden"],
        "properties": {
          "hiddenCustomerCount": {
            "type": "integer",
            "minimum": 0
          },
          "hiddenOutputCount": {
            "type": "integer",
            "minimum": 0
          },
          "debugLedgerHidden": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "AgentRunTriggerEvidenceSignal": {
        "type": "object",
        "required": ["id", "key", "name", "kind"],
        "properties": {
          "id": {
            "type": "string"
          },
          "key": {
            "type": ["string", "null"]
          },
          "name": {
            "type": "string"
          },
          "kind": {
            "type": ["string", "null"]
          }
        },
        "additionalProperties": false
      },
      "AgentRunTriggerEvidencePolicy": {
        "type": "object",
        "required": ["mode", "requiredCount", "selectedCount", "matchedCount"],
        "properties": {
          "mode": {
            "type": "string",
            "enum": ["ALL", "ANY", "COUNT"]
          },
          "requiredCount": {
            "type": "integer",
            "minimum": 0
          },
          "selectedCount": {
            "type": "integer",
            "minimum": 0
          },
          "matchedCount": {
            "type": "integer",
            "minimum": 0
          }
        },
        "additionalProperties": false
      },
      "AgentRunTriggerEvidenceWindow": {
        "type": ["object", "null"],
        "required": ["value", "unit", "startAt", "endAt"],
        "properties": {
          "value": {
            "type": "integer",
            "minimum": 1
          },
          "unit": {
            "type": "string",
            "enum": ["hour", "day"]
          },
          "startAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "endAt": {
            "type": ["string", "null"],
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "AgentRunTriggerEvidenceOccurrence": {
        "type": ["object", "null"],
        "required": ["id"],
        "properties": {
          "id": {
            "type": "string"
          },
          "eventName": {
            "type": "string"
          },
          "eventChannel": {
            "type": "string"
          },
          "eventOccurredAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "AgentRunTriggerEvidence": {
        "type": "object",
        "required": [
          "automationRunId",
          "policy",
          "selectedSignals",
          "matchedSignals",
          "window",
          "primaryOccurrence"
        ],
        "properties": {
          "automationRunId": {
            "type": "string"
          },
          "policy": {
            "$ref": "#/components/schemas/AgentRunTriggerEvidencePolicy"
          },
          "selectedSignals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentRunTriggerEvidenceSignal"
            }
          },
          "matchedSignals": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentRunTriggerEvidenceSignal"
            }
          },
          "window": {
            "$ref": "#/components/schemas/AgentRunTriggerEvidenceWindow"
          },
          "primaryOccurrence": {
            "$ref": "#/components/schemas/AgentRunTriggerEvidenceOccurrence"
          }
        },
        "additionalProperties": false
      },
      "AgentRunCandidate": {
        "type": "object",
        "required": [
          "id",
          "customerId",
          "customerName",
          "customerDomain",
          "billingStatus",
          "lastActivityAt",
          "candidateKey",
          "fingerprint",
          "status",
          "outputId",
          "disposition",
          "surfaceReason",
          "reasons",
          "metrics"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "customerId": {
            "type": "string"
          },
          "customerName": {
            "type": "string"
          },
          "customerDomain": {
            "type": ["string", "null"]
          },
          "billingStatus": {
            "type": ["string", "null"]
          },
          "lastActivityAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "candidateKey": {
            "type": "string"
          },
          "fingerprint": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/AgentRunCustomerStatus"
          },
          "outputId": {
            "type": ["string", "null"]
          },
          "disposition": {
            "type": ["string", "null"]
          },
          "surfaceReason": {
            "type": ["string", "null"]
          },
          "reasons": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "metrics": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "additionalProperties": false
      },
      "AgentRunToolCallSummary": {
        "type": "object",
        "required": [
          "id",
          "toolName",
          "status",
          "error",
          "startedAt",
          "endedAt",
          "latencyMs",
          "inputSummary",
          "outputSummary"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "toolName": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/AgentToolCallStatus"
          },
          "error": {
            "type": ["string", "null"]
          },
          "startedAt": {
            "type": "string",
            "format": "date-time"
          },
          "endedAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "latencyMs": {
            "type": ["integer", "null"],
            "minimum": 0
          },
          "inputSummary": {
            "type": "string"
          },
          "outputSummary": {
            "type": ["string", "null"]
          }
        },
        "additionalProperties": false
      },
      "AgentRunArtifactSummary": {
        "type": "object",
        "required": [
          "id",
          "kind",
          "mimeType",
          "bodySizeBytes",
          "redactionStatus",
          "createdAt",
          "metadataSummary"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "mimeType": {
            "type": "string"
          },
          "bodySizeBytes": {
            "type": ["integer", "null"],
            "minimum": 0
          },
          "redactionStatus": {
            "type": ["string", "null"]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "metadataSummary": {
            "type": ["string", "null"]
          }
        },
        "additionalProperties": false
      },
      "AgentOutputStatus": {
        "type": "string",
        "enum": ["PENDING", "VALID", "INVALID", "PROCESSED"]
      },
      "AgentOutputDeliveryStatus": {
        "type": "string",
        "enum": ["NOT_REQUIRED", "PENDING", "SENT", "FAILED", "PARTIAL"]
      },
      "AgentRunCustomerStatus": {
        "type": "string",
        "enum": ["SELECTED", "SENT_TO_AGENT", "SURFACED", "NOT_SURFACED", "DELIVERY_FAILED"]
      },
      "AgentToolCallStatus": {
        "type": "string",
        "enum": ["PENDING", "SUCCESS", "FAILED"]
      },
      "AutomationScheduleCadence": {
        "type": "string",
        "enum": ["hourly", "daily", "weekly"]
      },
      "AutomationOptionsConstraints": {
        "type": "object",
        "required": [
          "requiresAgentId",
          "enabledAutomationRequiresDestination",
          "signalTriggerRequiresSignalIdsOrCatalogSignalKeys",
          "scheduledAutomationRejectsSignals",
          "scheduledAutomationRejectsCatalogSignalKeys",
          "scheduledAutomationRequiresCustomerOrBillingStatusAudience"
        ],
        "properties": {
          "requiresAgentId": {
            "type": "boolean"
          },
          "enabledAutomationRequiresDestination": {
            "type": "boolean"
          },
          "signalTriggerRequiresSignalIdsOrCatalogSignalKeys": {
            "type": "boolean"
          },
          "scheduledAutomationRejectsSignals": {
            "type": "boolean"
          },
          "scheduledAutomationRejectsCatalogSignalKeys": {
            "type": "boolean"
          },
          "scheduledAutomationRequiresCustomerOrBillingStatusAudience": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "AutomationOptionsData": {
        "type": "object",
        "required": [
          "schemaFormat",
          "triggerTypes",
          "matchModes",
          "scheduleCadences",
          "audienceFilterSchema",
          "processorPolicySchema",
          "deliveryPolicySchema",
          "constraints"
        ],
        "properties": {
          "schemaFormat": {
            "type": "string",
            "const": "json-schema-2020-12"
          },
          "triggerTypes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AutomationTriggerType"
            }
          },
          "matchModes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AutomationMatchMode"
            }
          },
          "scheduleCadences": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AutomationScheduleCadence"
            }
          },
          "audienceFilterSchema": {
            "$ref": "#/components/schemas/JsonSchemaObject"
          },
          "processorPolicySchema": {
            "$ref": "#/components/schemas/JsonSchemaObject"
          },
          "deliveryPolicySchema": {
            "$ref": "#/components/schemas/JsonSchemaObject"
          },
          "constraints": {
            "$ref": "#/components/schemas/AutomationOptionsConstraints"
          }
        },
        "additionalProperties": false
      },
      "SignalConditionId": {
        "type": "string",
        "enum": [
          "schedule",
          "event_happens",
          "activity_spikes",
          "activity_stops",
          "customer_activity_threshold",
          "customer_activity_drop",
          "related_user_inactivity"
        ]
      },
      "SignalDetectionType": {
        "type": "string",
        "enum": [
          "event_occurred",
          "event_count_threshold",
          "event_absence",
          "customer_activity_threshold",
          "customer_activity_drop",
          "related_user_inactivity"
        ]
      },
      "SignalConditionTypeOption": {
        "type": "object",
        "required": ["id", "label", "triggerType"],
        "properties": {
          "id": {
            "$ref": "#/components/schemas/SignalConditionId"
          },
          "label": {
            "type": "string"
          },
          "triggerType": {
            "$ref": "#/components/schemas/AutomationTriggerType"
          }
        },
        "additionalProperties": false
      },
      "SignalDetectionTypeOption": {
        "type": "object",
        "required": ["type", "schemaFormat", "definitionSchema"],
        "properties": {
          "type": {
            "$ref": "#/components/schemas/SignalDetectionType"
          },
          "schemaFormat": {
            "type": "string",
            "const": "json-schema-2020-12"
          },
          "definitionSchema": {
            "$ref": "#/components/schemas/JsonSchemaObject"
          }
        },
        "additionalProperties": false
      },
      "SignalOptionsData": {
        "type": "object",
        "required": ["conditionTypes", "signalKinds", "catalog"],
        "properties": {
          "conditionTypes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SignalConditionTypeOption"
            }
          },
          "signalKinds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SignalKindOption"
            }
          },
          "catalog": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SignalCatalogOption"
            }
          }
        },
        "additionalProperties": false
      },
      "DestinationOptionsSlackData": {
        "type": "object",
        "required": ["connected", "channels", "hasMore", "nextCursor"],
        "properties": {
          "connected": {
            "type": "boolean"
          },
          "channels": {
            "type": "array",
            "maxItems": 100,
            "items": {
              "$ref": "#/components/schemas/SlackChannelOption"
            }
          },
          "hasMore": {
            "type": "boolean"
          },
          "nextCursor": {
            "type": ["string", "null"]
          }
        },
        "additionalProperties": false
      },
      "DestinationOptionsData": {
        "type": "object",
        "required": ["types", "slack"],
        "properties": {
          "types": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DestinationTypeOption"
            }
          },
          "slack": {
            "$ref": "#/components/schemas/DestinationOptionsSlackData"
          }
        },
        "additionalProperties": false
      },
      "AgentScheduleDetail": {
        "type": "object",
        "required": ["enabled", "nextRunAt", "lastRunAt", "lastSuccessfulRunAt", "cadence"],
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "nextRunAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "lastRunAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "lastSuccessfulRunAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "cadence": {
            "type": ["string", "null"],
            "enum": ["daily", "weekly", null]
          }
        },
        "additionalProperties": false
      },
      "AgentDetailDestinationSummary": {
        "type": "object",
        "required": ["destinations", "label", "count", "missing"],
        "properties": {
          "destinations": {
            "type": "array",
            "items": {
              "type": "object",
              "required": ["id", "provider", "channelId", "label", "isDefault"],
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid"
                },
                "provider": {
                  "type": "string",
                  "const": "slack"
                },
                "channelId": {
                  "type": ["string", "null"]
                },
                "label": {
                  "type": ["string", "null"]
                },
                "isDefault": {
                  "type": "boolean"
                }
              },
              "additionalProperties": false
            }
          },
          "label": {
            "type": "string"
          },
          "count": {
            "type": "integer",
            "minimum": 0
          },
          "missing": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "AgentDetailAutomationSummary": {
        "type": "object",
        "required": [
          "id",
          "name",
          "enabled",
          "conditionKind",
          "conditionLabel",
          "audienceLabel",
          "destinationLabel",
          "destinationCount",
          "lastRunStatus",
          "lastRunAt",
          "nextRunAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "conditionKind": {
            "type": "string",
            "enum": [
              "schedule",
              "event_happens",
              "activity_spikes",
              "activity_stops",
              "customer_activity_threshold",
              "customer_activity_drop",
              "related_user_inactivity",
              "unknown"
            ]
          },
          "conditionLabel": {
            "type": "string"
          },
          "audienceLabel": {
            "type": "string"
          },
          "destinationLabel": {
            "type": "string"
          },
          "destinationCount": {
            "type": "integer",
            "minimum": 0
          },
          "lastRunStatus": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AutomationRunStatus"
              },
              {
                "type": "null"
              }
            ]
          },
          "lastRunAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "nextRunAt": {
            "type": ["string", "null"],
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "AgentDetailAutomationRollup": {
        "type": "object",
        "required": ["activeCount", "totalCount", "nextRunAt", "primaryDestinationLabel"],
        "properties": {
          "activeCount": {
            "type": "integer",
            "minimum": 0
          },
          "totalCount": {
            "type": "integer",
            "minimum": 0
          },
          "nextRunAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "primaryDestinationLabel": {
            "type": ["string", "null"]
          }
        },
        "additionalProperties": false
      },
      "CustomAgentSettingsSummary": {
        "type": "object",
        "required": ["instructions", "maxItemsToSurface", "outputMode"],
        "properties": {
          "instructions": {
            "type": "string",
            "maxLength": 32000
          },
          "maxItemsToSurface": {
            "type": "integer",
            "minimum": 1,
            "maximum": 50
          },
          "outputMode": {
            "type": ["string", "null"],
            "enum": ["alert", "digest", "action_list", null]
          }
        },
        "additionalProperties": false
      },
      "AgentDetailSettings": {
        "type": "object",
        "required": ["configSchemaKey", "configSchemaVersion", "custom"],
        "properties": {
          "configSchemaKey": {
            "type": "string"
          },
          "configSchemaVersion": {
            "type": "integer",
            "minimum": 1
          },
          "custom": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/CustomAgentSettingsSummary"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "AgentDetail": {
        "type": "object",
        "required": [
          "id",
          "agentKey",
          "displayName",
          "status",
          "templateVersion",
          "actionKeys",
          "createdAt",
          "updatedAt",
          "schedule",
          "destinationSummary",
          "automationSummary",
          "automations",
          "lastRun",
          "recentRuns",
          "settings"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "agentKey": {
            "type": "string"
          },
          "displayName": {
            "type": "string"
          },
          "status": {
            "$ref": "#/components/schemas/AgentStatus"
          },
          "templateVersion": {
            "type": "string"
          },
          "actionKeys": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "schedule": {
            "$ref": "#/components/schemas/AgentScheduleDetail"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "destinationSummary": {
            "$ref": "#/components/schemas/AgentDetailDestinationSummary"
          },
          "automationSummary": {
            "$ref": "#/components/schemas/AgentDetailAutomationRollup"
          },
          "automations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentDetailAutomationSummary"
            }
          },
          "lastRun": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AgentRunSummary"
              },
              {
                "type": "null"
              }
            ]
          },
          "recentRuns": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentRunSummary"
            }
          },
          "settings": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AgentDetailSettings"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": false
      },
      "DestinationRouteSummary": {
        "type": "object",
        "required": [
          "id",
          "name",
          "enabled",
          "triggerType",
          "agentId",
          "lastRunStatus",
          "lastRunAt",
          "nextRunAt",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "name": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "triggerType": {
            "$ref": "#/components/schemas/AutomationTriggerType"
          },
          "agentId": {
            "type": ["string", "null"],
            "format": "uuid"
          },
          "lastRunStatus": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AutomationRunStatus"
              },
              {
                "type": "null"
              }
            ]
          },
          "lastRunAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "nextRunAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "DestinationDeliverySummary": {
        "type": "object",
        "required": [
          "id",
          "sourceType",
          "sourceId",
          "automationRunId",
          "agentOutputId",
          "destinationId",
          "provider",
          "providerEventId",
          "status",
          "queuedAt",
          "publishedAt",
          "errorCode",
          "errorMessage",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "sourceType": {
            "type": "string"
          },
          "sourceId": {
            "type": ["string", "null"]
          },
          "automationRunId": {
            "type": ["string", "null"],
            "format": "uuid"
          },
          "agentOutputId": {
            "type": ["string", "null"]
          },
          "destinationId": {
            "type": ["string", "null"],
            "format": "uuid"
          },
          "provider": {
            "$ref": "#/components/schemas/DestinationProvider"
          },
          "providerEventId": {
            "type": ["string", "null"]
          },
          "status": {
            "$ref": "#/components/schemas/DeliveryStatus"
          },
          "queuedAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "publishedAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "errorCode": {
            "type": ["string", "null"]
          },
          "errorMessage": {
            "type": ["string", "null"]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "DestinationDeliveryRollup": {
        "type": "object",
        "required": [
          "recentCount",
          "pendingCount",
          "acceptedCount",
          "failedCount",
          "skippedCount",
          "lastDeliveryAt"
        ],
        "properties": {
          "recentCount": {
            "type": "integer",
            "minimum": 0
          },
          "pendingCount": {
            "type": "integer",
            "minimum": 0
          },
          "acceptedCount": {
            "type": "integer",
            "minimum": 0
          },
          "failedCount": {
            "type": "integer",
            "minimum": 0
          },
          "skippedCount": {
            "type": "integer",
            "minimum": 0
          },
          "lastDeliveryAt": {
            "type": ["string", "null"],
            "format": "date-time"
          }
        },
        "additionalProperties": false
      },
      "DestinationDetailRead": {
        "type": "object",
        "required": [
          "id",
          "key",
          "name",
          "description",
          "provider",
          "kind",
          "enabled",
          "maskedConfig",
          "syncStatus",
          "lastSyncedAt",
          "providerErrorCode",
          "providerErrorMessage",
          "isDefault",
          "schemaVersion",
          "configHash",
          "archivedAt",
          "createdAt",
          "updatedAt",
          "routes",
          "automations",
          "recentDeliveries",
          "deliverySummary"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "key": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": ["string", "null"]
          },
          "provider": {
            "$ref": "#/components/schemas/DestinationProvider"
          },
          "kind": {
            "$ref": "#/components/schemas/DestinationKind"
          },
          "enabled": {
            "type": "boolean"
          },
          "maskedConfig": {
            "anyOf": [
              {
                "type": "object",
                "additionalProperties": true
              },
              {
                "type": "null"
              }
            ]
          },
          "syncStatus": {
            "$ref": "#/components/schemas/DestinationSyncStatus"
          },
          "lastSyncedAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "providerErrorCode": {
            "type": ["string", "null"]
          },
          "providerErrorMessage": {
            "type": ["string", "null"]
          },
          "isDefault": {
            "type": "boolean"
          },
          "schemaVersion": {
            "type": "string"
          },
          "configHash": {
            "type": ["string", "null"]
          },
          "archivedAt": {
            "type": ["string", "null"],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "routes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DestinationRouteSummary"
            }
          },
          "automations": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DestinationRouteSummary"
            }
          },
          "recentDeliveries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DestinationDeliverySummary"
            }
          },
          "deliverySummary": {
            "$ref": "#/components/schemas/DestinationDeliveryRollup"
          }
        },
        "additionalProperties": false
      }
    }
  }
}
