{
  "swagger": "2.0",
  "info": {
    "title": "Hast AIP Public API",
    "version": "1.0"
  },
  "host": "backend.hast.so",
  "basePath": "/",
  "schemes": [
    "https"
  ],
  "paths": {
    "/api/public/v1/agent/prompts": {
      "post": {
        "consumes": [
          "application/json"
        ],
        "description": "Omit session_id to create a conversation; include it to continue. request_id makes retries idempotent. Only the saved Agent configuration is used. A 202 response is accepted, not completed; poll conversation events for the returned request_id.",
        "parameters": [
          {
            "description": "Conversation message",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.PublicBoundAgentPrompt"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "202": {
            "description": "Accepted",
            "schema": {
              "$ref": "#/definitions/api.taskAgentWebhookAcceptedEnvelope"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Send a message to the key's bound Agent",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/agent/sessions": {
      "get": {
        "description": "Includes historical conversations belonging to this Agent only. Session IDs can be used with the conversation events tool.",
        "parameters": [
          {
            "description": "Page size (1-100)",
            "in": "query",
            "name": "limit",
            "type": "integer"
          },
          {
            "description": "Next cursor from the previous page",
            "in": "query",
            "name": "cursor",
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.publicSessionListEnvelope"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "List the bound Agent's conversations",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/agent/sessions/{session_id}/events": {
      "get": {
        "description": "Returns user/assistant messages and run lifecycle events, without configuration or tool traces. Poll using next_after until the matching run_id completes, fails or is interrupted. An empty filtered page may still have has_more=true.",
        "parameters": [
          {
            "description": "Conversation ID",
            "in": "path",
            "name": "session_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Last consumed sequence",
            "in": "query",
            "name": "after",
            "type": "integer"
          },
          {
            "description": "Page size (1-200)",
            "in": "query",
            "name": "limit",
            "type": "integer"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentEventListEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Read the bound Agent's conversation messages and status",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/business-resources": {
      "get": {
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "additionalProperties": true,
              "type": "object"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "List CRM resources",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/business-resources/crm": {
      "post": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "Create an optional Twenty workspace request",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.channelCRMCreateRequest"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "additionalProperties": true,
              "type": "object"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Create an optional Twenty workspace",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/business-resources/{resource_id}": {
      "delete": {
        "parameters": [
          {
            "description": "resource_id",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "additionalProperties": true,
              "type": "object"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Delete an unused channel resource configuration",
        "tags": [
          "public-task-agents"
        ]
      },
      "get": {
        "parameters": [
          {
            "description": "resource_id",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "CRM object (default people); use CRM schema for supported objects",
            "in": "query",
            "name": "object",
            "type": "string"
          },
          {
            "description": "CRM next-page cursor",
            "in": "query",
            "name": "cursor",
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "additionalProperties": true,
              "type": "object"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Browse CRM records",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/business-resources/{resource_id}/crm/attachments/upload": {
      "post": {
        "consumes": [
          "application/json"
        ],
        "produces": [
          "application/json"
        ],
        "responses": {},
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Upload a CRM attachment",
        "tags": [
          "Task Agent Channels"
        ]
      }
    },
    "/api/public/v1/business-resources/{resource_id}/crm/schema": {
      "get": {
        "parameters": [
          {
            "description": "resource_id",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "additionalProperties": true,
              "type": "object"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Read CRM business objects and field schema",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/business-resources/{resource_id}/crm/{object}": {
      "get": {
        "parameters": [
          {
            "description": "resource_id",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "object",
            "in": "path",
            "name": "object",
            "required": true,
            "type": "string"
          },
          {
            "description": "Search (maximum 300 bytes, no quotes or line breaks)",
            "in": "query",
            "name": "query",
            "type": "string"
          },
          {
            "description": "Provider cursor returned by the previous page",
            "in": "query",
            "name": "cursor",
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "additionalProperties": true,
              "type": "object"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Search CRM records",
        "tags": [
          "public-task-agents"
        ]
      },
      "post": {
        "consumes": [
          "application/json"
        ],
        "description": "Discover objects and writable fields using the CRM schema endpoint before writing. Read back on uncertain errors before retrying.",
        "parameters": [
          {
            "description": "resource_id",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "object",
            "in": "path",
            "name": "object",
            "required": true,
            "type": "string"
          },
          {
            "description": "Create a CRM record request",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.PublicCRMWriteDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "additionalProperties": true,
              "type": "object"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Create a CRM record",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/business-resources/{resource_id}/crm/{object}/{record_id}": {
      "delete": {
        "parameters": [
          {
            "description": "resource_id",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "object",
            "in": "path",
            "name": "object",
            "required": true,
            "type": "string"
          },
          {
            "description": "record_id",
            "in": "path",
            "name": "record_id",
            "required": true,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "additionalProperties": true,
              "type": "object"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Delete a CRM record",
        "tags": [
          "public-task-agents"
        ]
      },
      "get": {
        "parameters": [
          {
            "description": "resource_id",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "object",
            "in": "path",
            "name": "object",
            "required": true,
            "type": "string"
          },
          {
            "description": "record_id",
            "in": "path",
            "name": "record_id",
            "required": true,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "additionalProperties": true,
              "type": "object"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Read CRM record details",
        "tags": [
          "public-task-agents"
        ]
      },
      "patch": {
        "consumes": [
          "application/json"
        ],
        "description": "Discover objects and writable fields using the CRM schema endpoint before writing. Read back on uncertain errors before retrying.",
        "parameters": [
          {
            "description": "resource_id",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "object",
            "in": "path",
            "name": "object",
            "required": true,
            "type": "string"
          },
          {
            "description": "record_id",
            "in": "path",
            "name": "record_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Update a CRM record request",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.PublicCRMWriteDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "additionalProperties": true,
              "type": "object"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Update a CRM record",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/business-resources/{resource_id}/crm/{object}/{record_id}/files/{field}/{file_id}": {
      "get": {
        "parameters": [
          {
            "description": "resource_id",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "object",
            "in": "path",
            "name": "object",
            "required": true,
            "type": "string"
          },
          {
            "description": "record_id",
            "in": "path",
            "name": "record_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "field",
            "in": "path",
            "name": "field",
            "required": true,
            "type": "string"
          },
          {
            "description": "file_id",
            "in": "path",
            "name": "file_id",
            "required": true,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "additionalProperties": true,
              "type": "object"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Download a file attached to a CRM record",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/business-resources/{resource_id}/crm/{object}/{record_id}/relations/{field}": {
      "get": {
        "parameters": [
          {
            "description": "resource_id",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "object",
            "in": "path",
            "name": "object",
            "required": true,
            "type": "string"
          },
          {
            "description": "record_id",
            "in": "path",
            "name": "record_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "field",
            "in": "path",
            "name": "field",
            "required": true,
            "type": "string"
          },
          {
            "description": "Provider cursor returned by the previous page",
            "in": "query",
            "name": "cursor",
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "additionalProperties": true,
              "type": "object"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Browse related CRM records",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/business-resources/{resource_id}/members": {
      "get": {
        "parameters": [
          {
            "description": "Owned CRM resource ID",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Next cursor from the previous member page",
            "in": "query",
            "name": "cursor",
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/channel.CRMMemberPage"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "List CRM member identities for owner and assignee fields",
        "tags": [
          "public-task-agents"
        ]
      },
      "post": {
        "consumes": [
          "application/json"
        ],
        "description": "Uses the selected managed workspace's existing registration flow. No invitation is sent. Generated passwords are discarded. Does not reset accounts outside this CRM; provider email-verification settings still apply.",
        "parameters": [
          {
            "description": "Owned platform-managed CRM resource ID",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Actual email and name; never a password",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/channel.CRMMemberInput"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/channel.CRMMember"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Create or reuse a CRM member without retaining a password",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/business-resources/{resource_id}/provision": {
      "post": {
        "parameters": [
          {
            "description": "resource_id",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "additionalProperties": true,
              "type": "object"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Retry incomplete business resource creation",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/channels": {
      "get": {
        "produces": [
          "application/json"
        ],
        "responses": {},
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "List user channel connections",
        "tags": [
          "Task Agent Channels"
        ]
      },
      "post": {
        "parameters": [
          {
            "description": "Request body",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.PublicChannelConnectionDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {},
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Connect a verified existing Chatwoot message inbox",
        "tags": [
          "Task Agent Channels"
        ]
      }
    },
    "/api/public/v1/channels/account": {
      "post": {
        "produces": [
          "application/json"
        ],
        "responses": {},
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Initialize a user channel account",
        "tags": [
          "Task Agent Channels"
        ]
      }
    },
    "/api/public/v1/channels/agents": {
      "get": {
        "parameters": [
          {
            "description": "Page number",
            "in": "query",
            "name": "page",
            "type": "integer"
          },
          {
            "description": "Page size, maximum 100",
            "in": "query",
            "name": "page_size",
            "type": "integer"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "additionalProperties": true,
              "type": "object"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "List Agents available for channel assignment",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/channels/authorizations/{provider}": {
      "post": {
        "parameters": [
          {
            "description": "provider",
            "in": "path",
            "name": "provider",
            "required": true,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "additionalProperties": true,
              "type": "object"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Begin channel authorization",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/channels/authorizations/{provider}/complete": {
      "post": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "provider",
            "in": "path",
            "name": "provider",
            "required": true,
            "type": "string"
          },
          {
            "description": "Complete channel authorization request",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.PublicChannelAuthorizationDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "additionalProperties": true,
              "type": "object"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Complete channel authorization",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/channels/automatic": {
      "post": {
        "consumes": [
          "application/json"
        ],
        "description": "Requires channels:write on a Profile key. Creates or reuses a setup under that Profile's channel account. Use a stable request_key UUID for the same provider and name; reconcile uncertain results with that same key. Slack names allow 35 characters, Telegram names 64. The return destination is fixed by this environment's AIP configuration. Next call authorize; provider consent is still required. No Agent is bound automatically.",
        "parameters": [
          {
            "description": "Channel configuration",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.AutomaticChannelSetupRequest"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "201": {
            "description": "Created",
            "schema": {
              "$ref": "#/definitions/channel.AutomaticSetup"
            }
          },
          "400": {
            "description": "Bad Request",
            "schema": {
              "additionalProperties": true,
              "type": "object"
            }
          },
          "409": {
            "description": "Conflict",
            "schema": {
              "additionalProperties": true,
              "type": "object"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Begin automatic Slack or Telegram channel setup",
        "tags": [
          "Task Agent Channels"
        ]
      }
    },
    "/api/public/v1/channels/automatic/{setup_id}": {
      "delete": {
        "description": "Requires channels:write. Cancels an incomplete owned setup, clears temporary configuration credentials and invalidates pending authorization state. Does not delete an already-created Slack App or Telegram Bot. A completed setup returns 409; disconnect or remove its channel through the normal channel lifecycle instead.",
        "parameters": [
          {
            "description": "Owned setup ID",
            "in": "path",
            "name": "setup_id",
            "required": true,
            "type": "string"
          }
        ],
        "responses": {
          "204": {
            "description": "Canceled"
          },
          "409": {
            "description": "Conflict",
            "schema": {
              "additionalProperties": true,
              "type": "object"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Cancel automatic channel setup",
        "tags": [
          "Task Agent Channels"
        ]
      },
      "get": {
        "description": "Requires channels:read. Poll the returned setup ID after provider consent. Only status and safe provider metadata are returned, never bot tokens or Signing Secrets. A complete setup must still be registered through the complete endpoint. Expired, canceled, failed and uncertain states require reconciliation instead of creating another bot.",
        "parameters": [
          {
            "description": "Setup ID returned by automatic setup in this Profile",
            "in": "path",
            "name": "setup_id",
            "required": true,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/channel.AutomaticSetup"
            }
          },
          "404": {
            "description": "Not Found",
            "schema": {
              "additionalProperties": true,
              "type": "object"
            }
          },
          "409": {
            "description": "Conflict",
            "schema": {
              "additionalProperties": true,
              "type": "object"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Read automatic channel setup",
        "tags": [
          "Task Agent Channels"
        ]
      }
    },
    "/api/public/v1/channels/automatic/{setup_id}/authorize": {
      "post": {
        "consumes": [
          "application/json"
        ],
        "description": "Requires channels:write. For Slack supply a temporary Configuration Access Token through a protected request body; never log it. For Telegram send an empty object. Return the official consent URL to the authorized human. Slack additionally requires the official callback Verify action at verification_url. Poll the existing setup after consent; do not replay uncertain creation as a new request. The token is not returned in the response.",
        "parameters": [
          {
            "description": "Owned setup ID",
            "in": "path",
            "name": "setup_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Temporary configuration credential",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/channel.AutomaticSetupAuthorization"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/channel.AutomaticSetup"
            }
          },
          "409": {
            "description": "Conflict",
            "schema": {
              "additionalProperties": true,
              "type": "object"
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "schema": {
              "additionalProperties": true,
              "type": "object"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Authorize automatic channel setup",
        "tags": [
          "Task Agent Channels"
        ]
      }
    },
    "/api/public/v1/channels/automatic/{setup_id}/complete": {
      "post": {
        "description": "Requires channels:write. Verifies that the completed provider inbox belongs to this Profile and registers its channel connection. Repeated completion returns the same connection. Pending provider consent or callback verification returns 409. This does not bind an Agent or send a message; associate the connection using PUT /webhooks/{hook_id}/channels after readback.",
        "parameters": [
          {
            "description": "Owned setup ID",
            "in": "path",
            "name": "setup_id",
            "required": true,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.AutomaticChannelSetupCompletion"
            }
          },
          "201": {
            "description": "Created",
            "schema": {
              "$ref": "#/definitions/api.AutomaticChannelSetupCompletion"
            }
          },
          "409": {
            "description": "Conflict",
            "schema": {
              "additionalProperties": true,
              "type": "object"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Complete automatic channel setup",
        "tags": [
          "Task Agent Channels"
        ]
      }
    },
    "/api/public/v1/channels/deletions/{id}/retry": {
      "post": {
        "produces": [
          "application/json"
        ],
        "responses": {
          "202": {
            "description": "Accepted",
            "schema": {
              "additionalProperties": {
                "type": "string"
              },
              "type": "object"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Retry channel cleanup",
        "tags": [
          "Task Agent Channels"
        ]
      }
    },
    "/api/public/v1/channels/facebook": {
      "post": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "Connect a Facebook page request",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.PublicFacebookConnectDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "additionalProperties": true,
              "type": "object"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Connect a Facebook page",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/channels/facebook/pages": {
      "post": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "List authorized Facebook pages request",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.PublicFacebookPagesDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "additionalProperties": true,
              "type": "object"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "List authorized Facebook pages",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/channels/inboxes": {
      "get": {
        "produces": [
          "application/json"
        ],
        "responses": {},
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "List available Chatwoot message inboxes",
        "tags": [
          "Task Agent Channels"
        ]
      }
    },
    "/api/public/v1/channels/resources": {
      "get": {
        "produces": [
          "application/json"
        ],
        "responses": {},
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "List channel resources and operations",
        "tags": [
          "Task Agent Channels"
        ]
      },
      "post": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "Resource reference",
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/repository.ChannelResource"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {},
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Register an independently bindable channel resource",
        "tags": [
          "Task Agent Channels"
        ]
      }
    },
    "/api/public/v1/channels/resources/crm": {
      "post": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "CRM name and stable request ID",
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.channelCRMCreateRequest"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {},
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Create an optional Twenty workspace",
        "tags": [
          "Task Agent Channels"
        ]
      }
    },
    "/api/public/v1/channels/resources/{resource_id}": {
      "delete": {
        "parameters": [
          {
            "description": "Resource ID",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {},
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Delete an unused channel resource configuration",
        "tags": [
          "Task Agent Channels"
        ]
      }
    },
    "/api/public/v1/channels/resources/{resource_id}/provision": {
      "post": {
        "parameters": [
          {
            "description": "CRM resource ID",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {},
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Retry an incomplete CRM provisioning operation",
        "tags": [
          "Task Agent Channels"
        ]
      }
    },
    "/api/public/v1/channels/resources/{resource_id}/status": {
      "put": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "CRM resource ID",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Request body",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.PublicChannelStatusDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {},
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Disable or reverify a CRM resource",
        "tags": [
          "Task Agent Channels"
        ]
      }
    },
    "/api/public/v1/channels/resources/{resource_id}/verify": {
      "post": {
        "parameters": [
          {
            "description": "CRM resource ID",
            "in": "path",
            "name": "resource_id",
            "required": true,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {},
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Verify a Twenty resource credential and workspace",
        "tags": [
          "Task Agent Channels"
        ]
      }
    },
    "/api/public/v1/channels/schedule_sources": {
      "get": {
        "produces": [
          "application/json"
        ],
        "responses": {},
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "List verified Webhook Schedule destinations",
        "tags": [
          "Task Agent Channels"
        ]
      }
    },
    "/api/public/v1/channels/sends": {
      "get": {
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.channelSendListResponse"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "List user channel sends and provider statuses",
        "tags": [
          "Task Agent Channels"
        ]
      }
    },
    "/api/public/v1/channels/setup": {
      "get": {
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "additionalProperties": true,
              "type": "object"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Read channel setup configuration",
        "tags": [
          "public-task-agents"
        ]
      },
      "post": {
        "description": "Slack accepts optional slack_trigger_rules with require_mention, auto_reply_channel_ids and auto_reply_sender_ids. Omit it for mention-required defaults. Channel and sender exceptions are OR conditions; obtain actual IDs from the authorized Slack workspace.",
        "parameters": [
          {
            "description": "Request body",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.PublicMessageChannelDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {},
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Create a message channel",
        "tags": [
          "Task Agent Channels"
        ]
      }
    },
    "/api/public/v1/channels/whatsapp": {
      "post": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "Create an official WhatsApp Cloud connection request",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.PublicWhatsAppChannelCreateDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "additionalProperties": true,
              "type": "object"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Create an official WhatsApp Cloud connection",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/channels/{connection_id}": {
      "delete": {
        "parameters": [
          {
            "description": "Connection ID",
            "in": "path",
            "name": "connection_id",
            "required": true,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {},
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Disconnect a user channel",
        "tags": [
          "Task Agent Channels"
        ]
      }
    },
    "/api/public/v1/channels/{connection_id}/binding": {
      "put": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "Channel connection ID",
            "in": "path",
            "name": "connection_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Expected Webhook ID and binding version; target must be empty to release the association",
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.taskAgentChannelBindingRequest"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {},
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Release a legacy channel association",
        "tags": [
          "Task Agent Channels"
        ]
      }
    },
    "/api/public/v1/channels/{connection_id}/deletion_preview": {
      "get": {
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/repository.ChannelDeletionPreview"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Preview retained Knowledge affected by channel deletion",
        "tags": [
          "Task Agent Channels"
        ]
      }
    },
    "/api/public/v1/channels/{connection_id}/installation": {
      "get": {
        "description": "WeChat installation includes wechat_trusted_ips, the configured public egress IP list. An empty array means the deployment has not configured it; other platforms omit this field.\nSlack installation includes slack_trigger_rules and the callback URL. Use the returned rules to preserve existing exceptions when updating a Slack channel.",
        "responses": {},
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Read channel installation information",
        "tags": [
          "Task Agent Channels"
        ]
      }
    },
    "/api/public/v1/channels/{connection_id}/reconnect": {
      "post": {
        "description": "Verify the provider inbox before resuming synchronization. Existing history remains associated with this connection. Automatic replies stay off until an Agent is selected again.",
        "parameters": [
          {
            "description": "Connection ID",
            "in": "path",
            "name": "connection_id",
            "required": true,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {},
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Reconnect a disconnected channel",
        "tags": [
          "Task Agent Channels"
        ]
      }
    },
    "/api/public/v1/channels/{connection_id}/remove": {
      "delete": {
        "parameters": [
          {
            "description": "Connection ID",
            "in": "path",
            "name": "connection_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Delete retained originals and derived knowledge in all affected bases",
            "in": "query",
            "name": "purge_knowledge",
            "type": "boolean"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "202": {
            "description": "Accepted",
            "schema": {
              "properties": {
                "deletion": {
                  "$ref": "#/definitions/repository.ChannelDeletion"
                }
              },
              "type": "object"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Delete a channel with optional retained Knowledge cleanup",
        "tags": [
          "Task Agent Channels"
        ]
      }
    },
    "/api/public/v1/channels/{connection_id}/slack": {
      "patch": {
        "consumes": [
          "application/json"
        ],
        "description": "Replace the complete Slack trigger rules. Optional show_tool_progress controls detailed operation streaming (default enabled); omission preserves the saved setting. When disabled, subsequent turns retain plan cards and final replies. Mentions, exempt channel IDs and exempt user or bot IDs independently trigger replies. Both ID arrays support multiple values (up to 100 unique IDs each). Direct messages trigger normally and own-bot echoes are ignored. Requires an owned Slack channel; read /channels/{connection_id}/installation before editing and after saving.",
        "parameters": [
          {
            "description": "Channel ID",
            "in": "path",
            "name": "connection_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Complete Slack trigger rules and optional detailed progress setting",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.updateSlackChannelRequest"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {},
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Set Slack mention requirements and automatic reply exceptions",
        "tags": [
          "Task Agent Channels"
        ]
      }
    },
    "/api/public/v1/channels/{connection_id}/telegram": {
      "patch": {
        "consumes": [
          "application/json"
        ],
        "description": "Optional show_tool_progress controls detailed operation previews and streaming_replies independently controls final-answer previews; both default enabled and omission preserves saved settings. Replace all group rules. Optional default_group_mode controls unlisted groups; omitting it preserves the saved default. New channels default to mention; legacy channels without a default sync knowledge only. Modes: sync_only, mention (mention or reply to the Bot), all. Private chats trigger normally; Agent configuration and member admission are checked independently.",
        "parameters": [
          {
            "description": "Channel ID",
            "in": "path",
            "name": "connection_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Complete Telegram group rules",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.updateTelegramChannelRequest"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {},
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Set Telegram group Agent triggers",
        "tags": [
          "Task Agent Channels"
        ]
      }
    },
    "/api/public/v1/channels/{connection_id}/wechat-kf": {
      "patch": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "connection_id",
            "in": "path",
            "name": "connection_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Complete WeChat customer service setup request",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.PublicWeChatCompleteDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "additionalProperties": true,
              "type": "object"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Complete WeChat customer service setup",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/channels/{connection_id}/wechat-kf/accounts": {
      "post": {
        "consumes": [
          "application/json"
        ],
        "description": "Requires channels:write on a Profile key. Returns account names, IDs and management eligibility for an owned WeChat channel. Does not save the Secret or change bindings. Select an account with manage_privilege=true, then PATCH the WeChat setup with corp_secret and open_kfid.",
        "parameters": [
          {
            "description": "Owned WeChat channel connection ID",
            "in": "path",
            "name": "connection_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Application Secret; never include in prompts or logs",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.WeChatChannelAccountsRequest"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.WeChatChannelAccountsResponse"
            }
          },
          "400": {
            "description": "wechat_credentials_invalid",
            "schema": {
              "$ref": "#/definitions/api.WeChatChannelAccountsErrorDoc"
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "schema": {
              "$ref": "#/definitions/api.WeChatChannelAccountsErrorDoc"
            }
          },
          "403": {
            "description": "Requires a Profile key with channels:write",
            "schema": {
              "$ref": "#/definitions/api.WeChatChannelAccountsErrorDoc"
            }
          },
          "404": {
            "description": "WeChat channel not found",
            "schema": {
              "$ref": "#/definitions/api.WeChatChannelAccountsErrorDoc"
            }
          },
          "409": {
            "description": "Channel account unavailable",
            "schema": {
              "$ref": "#/definitions/api.WeChatChannelAccountsErrorDoc"
            }
          },
          "422": {
            "description": "wechat_credentials_invalid, wechat_permission_denied, wechat_ip_not_allowed or wechat_accounts_unavailable",
            "schema": {
              "$ref": "#/definitions/api.WeChatChannelAccountsErrorDoc"
            }
          },
          "502": {
            "description": "wechat_accounts_unavailable",
            "schema": {
              "$ref": "#/definitions/api.WeChatChannelAccountsErrorDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Discover WeChat customer service accounts without saving credentials",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/channels/{connection_id}/wechat-kf/domain-verification": {
      "post": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "connection_id",
            "in": "path",
            "name": "connection_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Upload a WeCom domain verification file request",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.PublicDomainVerificationDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "additionalProperties": true,
              "type": "object"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Upload a WeCom domain verification file",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/channels/{connection_id}/whatsapp": {
      "patch": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "connection_id",
            "in": "path",
            "name": "connection_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Reauthorize an official WhatsApp Cloud connection request",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.PublicWhatsAppChannelReauthorizeDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "additionalProperties": true,
              "type": "object"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Reauthorize an official WhatsApp Cloud connection",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/connectors/accounts": {
      "get": {
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentConnectorAccountListEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "List public connector accounts",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/connectors/accounts/{id}": {
      "delete": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "Connector account ID",
            "in": "path",
            "name": "id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Connector account request",
            "in": "body",
            "name": "request",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentConnectorAccountRequestDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentConnectorAccountEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Read, update, or delete a public connector account",
        "tags": [
          "public-task-agents"
        ]
      },
      "get": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "Connector account ID",
            "in": "path",
            "name": "id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Connector account request",
            "in": "body",
            "name": "request",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentConnectorAccountRequestDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentConnectorAccountEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Read, update, or delete a public connector account",
        "tags": [
          "public-task-agents"
        ]
      },
      "patch": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "Connector account ID",
            "in": "path",
            "name": "id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Connector account request",
            "in": "body",
            "name": "request",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentConnectorAccountRequestDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentConnectorAccountEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Read, update, or delete a public connector account",
        "tags": [
          "public-task-agents"
        ]
      },
      "put": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "Connector account ID",
            "in": "path",
            "name": "id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Connector account request",
            "in": "body",
            "name": "request",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentConnectorAccountRequestDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentConnectorAccountEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Read, update, or delete a public connector account",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/connectors/catalog": {
      "get": {
        "parameters": [
          {
            "description": "Search toolkits",
            "in": "query",
            "name": "search",
            "type": "string"
          },
          {
            "description": "Next cursor",
            "in": "query",
            "name": "cursor",
            "type": "string"
          },
          {
            "description": "Page size, maximum 100",
            "in": "query",
            "name": "limit",
            "type": "integer"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentConnectorStatusEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "List public connector catalog",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/connectors/status": {
      "get": {
        "parameters": [
          {
            "description": "Search connector catalog",
            "in": "query",
            "name": "search",
            "type": "string"
          },
          {
            "description": "Next cursor",
            "in": "query",
            "name": "cursor",
            "type": "string"
          },
          {
            "description": "Page size, maximum 100",
            "in": "query",
            "name": "limit",
            "type": "integer"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentConnectorStatusEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "List public connector status",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/connectors/{provider}/oauth/authorize": {
      "post": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "Connector provider",
            "in": "path",
            "name": "provider",
            "required": true,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentConnectorStartEnvelopeDoc"
            }
          },
          "422": {
            "description": "Administrator must configure custom authentication in Composio",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentConnectorSetupRequiredDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Start public connector OAuth authorization",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/files": {
      "get": {
        "parameters": [
          {
            "description": "Session ID",
            "in": "query",
            "name": "session_id",
            "type": "string"
          },
          {
            "description": "Workspace directory path",
            "in": "query",
            "name": "path",
            "type": "string"
          },
          {
            "description": "Workspace scope",
            "in": "query",
            "name": "scope",
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.PublicTaskAgentWorkspaceFilesEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "List, download, or delete public workspace files",
        "tags": [
          "public-task-agents"
        ]
      },
      "post": {
        "parameters": [
          {
            "description": "File",
            "in": "formData",
            "name": "file",
            "required": true,
            "type": "file"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "201": {
            "description": "Created",
            "schema": {
              "$ref": "#/definitions/api.PublicTaskAgentUploadEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Upload a public Task Agent file",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/files.zip": {
      "get": {
        "parameters": [
          {
            "description": "Session ID",
            "in": "query",
            "name": "session_id",
            "type": "string"
          },
          {
            "description": "Workspace scope",
            "in": "query",
            "name": "scope",
            "type": "string"
          }
        ],
        "produces": [
          "application/zip"
        ],
        "responses": {
          "200": {
            "description": "Workspace ZIP",
            "schema": {
              "type": "file"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Download a public workspace ZIP",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/files/{relativePath}": {
      "delete": {
        "parameters": [
          {
            "description": "Workspace relative path",
            "in": "path",
            "name": "relativePath",
            "required": true,
            "type": "string"
          },
          {
            "description": "Session ID",
            "in": "query",
            "name": "session_id",
            "type": "string"
          },
          {
            "description": "Opaque file ID",
            "in": "query",
            "name": "file_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Workspace scope",
            "in": "query",
            "name": "scope",
            "type": "string"
          }
        ],
        "produces": [
          "application/octet-stream"
        ],
        "responses": {
          "200": {
            "description": "Workspace file",
            "schema": {
              "type": "file"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Download or delete a public workspace file",
        "tags": [
          "public-task-agents"
        ]
      },
      "get": {
        "parameters": [
          {
            "description": "Workspace relative path",
            "in": "path",
            "name": "relativePath",
            "required": true,
            "type": "string"
          },
          {
            "description": "Session ID",
            "in": "query",
            "name": "session_id",
            "type": "string"
          },
          {
            "description": "Opaque file ID",
            "in": "query",
            "name": "file_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Workspace scope",
            "in": "query",
            "name": "scope",
            "type": "string"
          }
        ],
        "produces": [
          "application/octet-stream"
        ],
        "responses": {
          "200": {
            "description": "Workspace file",
            "schema": {
              "type": "file"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Download or delete a public workspace file",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/guides": {
      "get": {
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "additionalProperties": true,
              "type": "object"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Discover Agent-facing Hast AIP guides",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/guides/{topic}": {
      "get": {
        "parameters": [
          {
            "description": "Topic from GET /guides",
            "in": "path",
            "name": "topic",
            "required": true,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "additionalProperties": true,
              "type": "object"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Read a detailed Hast AIP guide for Agents",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/knowledge-bases": {
      "get": {
        "parameters": [
          {
            "description": "Page number, default 1",
            "in": "query",
            "name": "page",
            "type": "integer"
          },
          {
            "description": "Page size, default 20 and max 100",
            "in": "query",
            "name": "page_size",
            "type": "integer"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentKnowledgeBaseListEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "List public Task Agent Knowledge Bases",
        "tags": [
          "public-task-agents"
        ]
      },
      "post": {
        "consumes": [
          "application/json"
        ],
        "description": "Creates a URL Knowledge Base with JSON or a file Knowledge Base with multipart/form-data. Indexing continues asynchronously.",
        "parameters": [
          {
            "description": "URL Knowledge Base request",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.TaskAgentKnowledgeBaseCreateRequestDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "201": {
            "description": "Created",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentKnowledgeBaseEnvelopeDoc"
            }
          },
          "400": {
            "description": "Bad Request",
            "schema": {
              "$ref": "#/definitions/api.ServeErrorResponse"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Create a public Task Agent Knowledge Base",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/knowledge-bases/{id}": {
      "delete": {
        "description": "Knowledge deletion is disabled to preserve imported originals. This compatibility endpoint returns HTTP 409.",
        "parameters": [
          {
            "description": "Knowledge Base ID",
            "in": "path",
            "name": "id",
            "required": true,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "409": {
            "description": "Conflict",
            "schema": {
              "$ref": "#/definitions/api.ServeErrorResponse"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Delete a public Task Agent Knowledge Base",
        "tags": [
          "public-task-agents"
        ]
      },
      "get": {
        "parameters": [
          {
            "description": "Knowledge Base ID",
            "in": "path",
            "name": "id",
            "required": true,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentKnowledgeBaseEnvelopeDoc"
            }
          },
          "404": {
            "description": "Not Found",
            "schema": {
              "$ref": "#/definitions/api.ServeErrorResponse"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Read a public Task Agent Knowledge Base",
        "tags": [
          "public-task-agents"
        ]
      },
      "patch": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "Knowledge Base ID",
            "in": "path",
            "name": "id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Knowledge Base update request",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.TaskAgentKnowledgeBaseUpdateRequestDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentKnowledgeBaseEnvelopeDoc"
            }
          },
          "404": {
            "description": "Not Found",
            "schema": {
              "$ref": "#/definitions/api.ServeErrorResponse"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Update a public Task Agent Knowledge Base",
        "tags": [
          "public-task-agents"
        ]
      },
      "put": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "Knowledge Base ID",
            "in": "path",
            "name": "id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Knowledge Base update request",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.TaskAgentKnowledgeBaseUpdateRequestDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentKnowledgeBaseEnvelopeDoc"
            }
          },
          "404": {
            "description": "Not Found",
            "schema": {
              "$ref": "#/definitions/api.ServeErrorResponse"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Update a public Task Agent Knowledge Base",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/memories": {
      "get": {
        "parameters": [
          {
            "description": "Filter memory category",
            "enum": [
              "task_agent",
              "webhook"
            ],
            "in": "query",
            "name": "scope_type",
            "type": "string"
          },
          {
            "description": "Webhook ID; empty selects shared, omitted selects all in the category",
            "in": "query",
            "name": "scope_id",
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentMemoryListEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "List public Task Agent memories",
        "tags": [
          "public-task-agents"
        ]
      },
      "post": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "Memory request",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.TaskAgentMemoryRequestDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentMemoryEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Create a public Task Agent memory",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/memories/by-id/{memoryID}": {
      "delete": {
        "parameters": [
          {
            "description": "Memory ID",
            "in": "path",
            "name": "memoryID",
            "required": true,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentOKEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Delete a memory by ID within the authenticated user",
        "tags": [
          "public-task-agents"
        ]
      },
      "get": {
        "parameters": [
          {
            "description": "Memory ID",
            "in": "path",
            "name": "memoryID",
            "required": true,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentMemoryEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Read a memory by ID within the authenticated user",
        "tags": [
          "public-task-agents"
        ]
      },
      "patch": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "Memory ID",
            "in": "path",
            "name": "memoryID",
            "required": true,
            "type": "string"
          },
          {
            "description": "Memory update",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.TaskAgentMemoryRequestDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentMemoryEnvelopeDoc"
            }
          },
          "404": {
            "description": "Not Found",
            "schema": {
              "$ref": "#/definitions/api.ServeErrorResponse"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Update a memory by ID, optionally moving its scope",
        "tags": [
          "public-task-agents"
        ]
      },
      "put": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "Memory ID",
            "in": "path",
            "name": "memoryID",
            "required": true,
            "type": "string"
          },
          {
            "description": "Memory update",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.TaskAgentMemoryRequestDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentMemoryEnvelopeDoc"
            }
          },
          "404": {
            "description": "Not Found",
            "schema": {
              "$ref": "#/definitions/api.ServeErrorResponse"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Update a memory by ID, optionally moving its scope",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/memories/{name}": {
      "delete": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "Memory name",
            "in": "path",
            "name": "name",
            "required": true,
            "type": "string"
          },
          {
            "description": "Memory request",
            "in": "body",
            "name": "request",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentMemoryRequestDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentMemoryEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Read, update, or delete a public Task Agent memory",
        "tags": [
          "public-task-agents"
        ]
      },
      "get": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "Memory name",
            "in": "path",
            "name": "name",
            "required": true,
            "type": "string"
          },
          {
            "description": "Memory request",
            "in": "body",
            "name": "request",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentMemoryRequestDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentMemoryEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Read, update, or delete a public Task Agent memory",
        "tags": [
          "public-task-agents"
        ]
      },
      "patch": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "Memory name",
            "in": "path",
            "name": "name",
            "required": true,
            "type": "string"
          },
          {
            "description": "Memory request",
            "in": "body",
            "name": "request",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentMemoryRequestDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentMemoryEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Read, update, or delete a public Task Agent memory",
        "tags": [
          "public-task-agents"
        ]
      },
      "put": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "Memory name",
            "in": "path",
            "name": "name",
            "required": true,
            "type": "string"
          },
          {
            "description": "Memory request",
            "in": "body",
            "name": "request",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentMemoryRequestDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentMemoryEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Read, update, or delete a public Task Agent memory",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/models": {
      "get": {
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "additionalProperties": true,
              "type": "object"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "List Task Agent Models",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/prompts": {
      "post": {
        "consumes": [
          "application/json"
        ],
        "description": "Creates a normal conversational Task Agent session when session_id is omitted, or appends a turn to an existing session. request_id is idempotent.",
        "parameters": [
          {
            "description": "Public prompt request",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.PublicTaskAgentPromptRequestDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "202": {
            "description": "Accepted",
            "schema": {
              "$ref": "#/definitions/api.PublicTaskAgentPromptEnvelopeDoc"
            }
          },
          "401": {
            "description": "Unauthorized",
            "schema": {
              "$ref": "#/definitions/api.ServeErrorResponse"
            }
          },
          "409": {
            "description": "Conflict",
            "schema": {
              "$ref": "#/definitions/api.ServeErrorResponse"
            }
          },
          "413": {
            "description": "Request Entity Too Large",
            "schema": {
              "$ref": "#/definitions/api.ServeErrorResponse"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Submit a public Task Agent prompt",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/schedules": {
      "get": {
        "parameters": [
          {
            "description": "Schedule page size",
            "in": "query",
            "name": "limit",
            "type": "integer"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentScheduleListEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "List Task Agent schedules",
        "tags": [
          "task-agent-schedules"
        ]
      },
      "post": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "Schedule request",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.TaskAgentScheduleRequestDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentScheduleEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Create Task Agent schedule",
        "tags": [
          "task-agent-schedules"
        ]
      }
    },
    "/api/public/v1/schedules/{scheduleID}": {
      "delete": {
        "parameters": [
          {
            "description": "Schedule ID",
            "in": "path",
            "name": "scheduleID",
            "required": true,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentOKEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Delete Task Agent schedule",
        "tags": [
          "task-agent-schedules"
        ]
      },
      "get": {
        "parameters": [
          {
            "description": "Schedule ID",
            "in": "path",
            "name": "scheduleID",
            "required": true,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentScheduleEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Get Task Agent schedule",
        "tags": [
          "task-agent-schedules"
        ]
      },
      "patch": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "Schedule ID",
            "in": "path",
            "name": "scheduleID",
            "required": true,
            "type": "string"
          },
          {
            "description": "Schedule request",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.TaskAgentScheduleRequestDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentScheduleEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Update Task Agent schedule",
        "tags": [
          "task-agent-schedules"
        ]
      },
      "put": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "Schedule ID",
            "in": "path",
            "name": "scheduleID",
            "required": true,
            "type": "string"
          },
          {
            "description": "Schedule request",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.TaskAgentScheduleRequestDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentScheduleEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Update Task Agent schedule",
        "tags": [
          "task-agent-schedules"
        ]
      }
    },
    "/api/public/v1/schedules/{scheduleID}/runs": {
      "get": {
        "parameters": [
          {
            "description": "Schedule ID",
            "in": "path",
            "name": "scheduleID",
            "required": true,
            "type": "string"
          },
          {
            "description": "Run page size",
            "in": "query",
            "name": "limit",
            "type": "integer"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentScheduleRunListEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "List Task Agent schedule runs",
        "tags": [
          "task-agent-schedules"
        ]
      }
    },
    "/api/public/v1/secrets": {
      "get": {
        "description": "Lists owned User Secret metadata. Secret values are write-only and are never returned.",
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentUserSecretListEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "List User Secrets",
        "tags": [
          "public-task-agents"
        ]
      },
      "post": {
        "consumes": [
          "application/json"
        ],
        "description": "Creates a write-only User Secret. The response returns metadata only.",
        "parameters": [
          {
            "description": "Secret request",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.TaskAgentUserSecretCreateRequestDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "201": {
            "description": "Created",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentUserSecretEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Create a User Secret",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/secrets/{secretID}": {
      "delete": {
        "parameters": [
          {
            "description": "Secret ID",
            "in": "path",
            "name": "secretID",
            "required": true,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "204": {
            "description": "No Content"
          },
          "404": {
            "description": "Not Found",
            "schema": {
              "$ref": "#/definitions/api.ServeErrorResponse"
            }
          },
          "409": {
            "description": "Conflict",
            "schema": {
              "$ref": "#/definitions/api.ServeErrorResponse"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Delete a User Secret",
        "tags": [
          "public-task-agents"
        ]
      },
      "patch": {
        "consumes": [
          "application/json"
        ],
        "description": "Replaces the write-only Secret value. The response returns metadata only.",
        "parameters": [
          {
            "description": "Secret ID",
            "in": "path",
            "name": "secretID",
            "required": true,
            "type": "string"
          },
          {
            "description": "Secret request",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.TaskAgentUserSecretUpdateRequestDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentUserSecretEnvelopeDoc"
            }
          },
          "404": {
            "description": "Not Found",
            "schema": {
              "$ref": "#/definitions/api.ServeErrorResponse"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Update a User Secret value",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/sessions": {
      "get": {
        "parameters": [
          {
            "description": "Page size (1-100, default 50)",
            "in": "query",
            "name": "limit",
            "type": "integer"
          },
          {
            "description": "Opaque cursor returned by the previous page",
            "in": "query",
            "name": "cursor",
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.PublicTaskAgentSessionListEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "List public Task Agent sessions",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/sessions/{id}": {
      "delete": {
        "parameters": [
          {
            "description": "Session ID",
            "in": "path",
            "name": "id",
            "required": true,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentTaskEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Delete a public Task Agent session",
        "tags": [
          "public-task-agents"
        ]
      },
      "get": {
        "parameters": [
          {
            "description": "Session ID",
            "in": "path",
            "name": "id",
            "required": true,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.PublicTaskAgentSessionEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Read a public Task Agent session",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/sessions/{id}/cancel": {
      "post": {
        "parameters": [
          {
            "description": "Session ID",
            "in": "path",
            "name": "id",
            "required": true,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentTaskEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Cancel a public Task Agent session",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/sessions/{id}/events": {
      "get": {
        "parameters": [
          {
            "description": "Session ID",
            "in": "path",
            "name": "id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Return persisted events after this sequence",
            "in": "query",
            "name": "after",
            "type": "integer"
          },
          {
            "description": "Event page size, maximum 200",
            "in": "query",
            "name": "limit",
            "type": "integer"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentEventListEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "List public Task Agent Event v2 events",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/sessions/{id}/events/stream": {
      "get": {
        "description": "Event v2 SSE supports after and Last-Event-ID replay.",
        "parameters": [
          {
            "description": "Session ID",
            "in": "path",
            "name": "id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Return persisted events after this sequence",
            "in": "query",
            "name": "after",
            "type": "integer"
          }
        ],
        "produces": [
          "text/event-stream"
        ],
        "responses": {
          "200": {
            "description": "SSE stream",
            "schema": {
              "type": "string"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Stream public Task Agent events",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/sessions/{id}/interrupt": {
      "post": {
        "parameters": [
          {
            "description": "Session ID",
            "in": "path",
            "name": "id",
            "required": true,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentPromptAcceptedEnvelopeDoc"
            }
          },
          "202": {
            "description": "Accepted",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentPromptAcceptedEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Interrupt a public Task Agent turn",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/skills": {
      "get": {
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentUserSkillListEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "List public Task Agent skills",
        "tags": [
          "public-task-agents"
        ]
      },
      "post": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "Skill request",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.TaskAgentUserSkillRequestDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentUserSkillEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Create a public Task Agent skill",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/skills/{skillID}": {
      "delete": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "Skill ID",
            "in": "path",
            "name": "skillID",
            "required": true,
            "type": "string"
          },
          {
            "description": "Skill request",
            "in": "body",
            "name": "request",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentUserSkillRequestDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentUserSkillEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Read, update, or delete a public Task Agent skill",
        "tags": [
          "public-task-agents"
        ]
      },
      "get": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "Skill ID",
            "in": "path",
            "name": "skillID",
            "required": true,
            "type": "string"
          },
          {
            "description": "Skill request",
            "in": "body",
            "name": "request",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentUserSkillRequestDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentUserSkillEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Read, update, or delete a public Task Agent skill",
        "tags": [
          "public-task-agents"
        ]
      },
      "patch": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "Skill ID",
            "in": "path",
            "name": "skillID",
            "required": true,
            "type": "string"
          },
          {
            "description": "Skill request",
            "in": "body",
            "name": "request",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentUserSkillRequestDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentUserSkillEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Read, update, or delete a public Task Agent skill",
        "tags": [
          "public-task-agents"
        ]
      },
      "put": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "Skill ID",
            "in": "path",
            "name": "skillID",
            "required": true,
            "type": "string"
          },
          {
            "description": "Skill request",
            "in": "body",
            "name": "request",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentUserSkillRequestDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentUserSkillEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Read, update, or delete a public Task Agent skill",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/webhooks": {
      "get": {
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentWebhookListEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "List public Task Agent Webhooks",
        "tags": [
          "public-task-agents"
        ]
      },
      "post": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "Webhook request",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.TaskAgentWebhookRequestDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "201": {
            "description": "Created",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentWebhookEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Create a public Task Agent Webhook",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/webhooks/{hook_id}": {
      "delete": {
        "parameters": [
          {
            "description": "Webhook ID",
            "in": "path",
            "name": "hook_id",
            "required": true,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "204": {
            "description": "No Content"
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Delete a public Task Agent Webhook",
        "tags": [
          "public-task-agents"
        ]
      },
      "get": {
        "parameters": [
          {
            "description": "Webhook ID",
            "in": "path",
            "name": "hook_id",
            "required": true,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentWebhookEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Read a public Task Agent Webhook",
        "tags": [
          "public-task-agents"
        ]
      },
      "patch": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "Webhook ID",
            "in": "path",
            "name": "hook_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Webhook request",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.TaskAgentWebhookRequestDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentWebhookEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Update a public Task Agent Webhook",
        "tags": [
          "public-task-agents"
        ]
      },
      "put": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "Webhook ID",
            "in": "path",
            "name": "hook_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Webhook request",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.TaskAgentWebhookRequestDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentWebhookEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Update a public Task Agent Webhook",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/webhooks/{hook_id}/channels": {
      "get": {
        "parameters": [
          {
            "description": "Webhook ID",
            "in": "path",
            "name": "hook_id",
            "required": true,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {},
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Read Webhook channels and final reply configuration",
        "tags": [
          "Task Agent Channels"
        ]
      },
      "put": {
        "parameters": [
          {
            "description": "Webhook ID",
            "in": "path",
            "name": "hook_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Bindings and final reply policy",
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.taskAgentHookChannelConfigRequest"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {},
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Replace Webhook channels and final reply configuration",
        "tags": [
          "Task Agent Channels"
        ]
      }
    },
    "/api/public/v1/webhooks/{hook_id}/email": {
      "get": {
        "parameters": [
          {
            "description": "Agent ID",
            "in": "path",
            "name": "hook_id",
            "required": true,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.AgentEmailConfigurationResponse"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Read an Agent email channel",
        "tags": [
          "Task Agent Email"
        ]
      },
      "patch": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "Agent ID",
            "in": "path",
            "name": "hook_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Rules and expected version",
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.AgentEmailRulesRequest"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.AgentEmailConfigurationResponse"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Update Agent email triggers",
        "tags": [
          "Task Agent Email"
        ]
      },
      "post": {
        "parameters": [
          {
            "description": "Agent ID",
            "in": "path",
            "name": "hook_id",
            "required": true,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.AgentEmailConfigurationResponse"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Prepare an Agent email channel",
        "tags": [
          "Task Agent Email"
        ]
      }
    },
    "/api/public/v1/webhooks/{hook_id}/email/address": {
      "get": {
        "parameters": [
          {
            "description": "Agent ID",
            "in": "path",
            "name": "hook_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Proposed email name",
            "in": "query",
            "name": "local_part",
            "required": true,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/repository.AgentEmailAddressAvailability"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Check an Agent email name",
        "tags": [
          "Task Agent Email"
        ]
      },
      "put": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "Agent ID",
            "in": "path",
            "name": "hook_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Email name and expected address version",
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.AgentEmailAddressRequest"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.AgentEmailConfigurationResponse"
            }
          },
          "400": {
            "description": "Bad Request",
            "schema": {
              "additionalProperties": {
                "type": "string"
              },
              "type": "object"
            }
          },
          "409": {
            "description": "Conflict",
            "schema": {
              "additionalProperties": {
                "type": "string"
              },
              "type": "object"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Change an Agent email address",
        "tags": [
          "Task Agent Email"
        ]
      }
    },
    "/api/public/v1/webhooks/{hook_id}/email/address-suggestion": {
      "get": {
        "parameters": [
          {
            "description": "Agent ID",
            "in": "path",
            "name": "hook_id",
            "required": true,
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "additionalProperties": {
                "type": "string"
              },
              "type": "object"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Suggest an Agent email address",
        "tags": [
          "Task Agent Email"
        ]
      }
    },
    "/api/public/v1/webhooks/{hook_id}/email/messages": {
      "get": {
        "parameters": [
          {
            "description": "Agent ID",
            "in": "path",
            "name": "hook_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Message cursor",
            "in": "query",
            "name": "before",
            "type": "integer"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {},
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "List Agent email messages",
        "tags": [
          "Task Agent Email"
        ]
      }
    },
    "/api/public/v1/webhooks/{hook_id}/email/messages/{message_id}": {
      "get": {
        "parameters": [
          {
            "description": "Agent ID",
            "in": "path",
            "name": "hook_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Retained email ID",
            "in": "path",
            "name": "message_id",
            "required": true,
            "type": "integer"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {},
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Read an Agent email message",
        "tags": [
          "Task Agent Email"
        ]
      }
    },
    "/api/public/v1/webhooks/{hook_id}/email/preview": {
      "post": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "Agent ID",
            "in": "path",
            "name": "hook_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Retained message and proposed rules",
            "in": "body",
            "name": "body",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.AgentEmailPreviewRequest"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/channel.EmailTriggerDecision"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Preview email trigger matching",
        "tags": [
          "Task Agent Email"
        ]
      }
    },
    "/api/public/v1/webhooks/{hook_id}/invoke": {
      "post": {
        "consumes": [
          "application/json"
        ],
        "description": "action=created starts a session; prompted continues or stops it. Poll the session events endpoint for completion. A 202 response means accepted, not completed.",
        "parameters": [
          {
            "description": "Owned Agent Hook ID",
            "in": "path",
            "name": "hook_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Agent invocation",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.PublicWebhookInvocationDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "202": {
            "description": "Accepted",
            "schema": {
              "$ref": "#/definitions/api.taskAgentWebhookAcceptedEnvelope"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Run or continue a saved AIP Agent",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/webhooks/{hook_id}/memory": {
      "patch": {
        "consumes": [
          "application/json"
        ],
        "parameters": [
          {
            "description": "Webhook ID",
            "in": "path",
            "name": "hook_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Memory settings; shared writes require webhook or all reads",
            "in": "body",
            "name": "request",
            "required": true,
            "schema": {
              "$ref": "#/definitions/api.TaskAgentWebhookMemoryConfigDoc"
            }
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentWebhookEnvelopeDoc"
            }
          },
          "400": {
            "description": "Bad Request",
            "schema": {
              "$ref": "#/definitions/api.ServeErrorResponse"
            }
          },
          "404": {
            "description": "Not Found",
            "schema": {
              "$ref": "#/definitions/api.ServeErrorResponse"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Update only the owned webhook's Memory settings",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/webhooks/{hook_id}/runs": {
      "get": {
        "description": "Profile-scoped management access only. Bound Agent keys retain their message-only conversation interface. updated_at is recorded task activity, not proof of a live heartbeat.",
        "parameters": [
          {
            "description": "Owned Agent Hook ID",
            "in": "path",
            "name": "hook_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Page size (1-100)",
            "in": "query",
            "name": "limit",
            "type": "integer"
          },
          {
            "description": "Next cursor",
            "in": "query",
            "name": "cursor",
            "type": "string"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.taskAgentRunListEnvelope"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "List an Agent's retained execution sessions",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/webhooks/{hook_id}/runs/{task_id}": {
      "get": {
        "description": "Uses the existing public Event v2 sanitizer. Events include recorded tool/plan/file evidence; no business completion percentage is inferred. Empty deliveries mean no recorded send, not successful delivery. Only retained sessions are available.",
        "parameters": [
          {
            "description": "Owned Agent Hook ID",
            "in": "path",
            "name": "hook_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Task ID from runs",
            "in": "path",
            "name": "task_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Last consumed event sequence",
            "in": "query",
            "name": "after",
            "type": "integer"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.taskAgentRunDetailEnvelope"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Read an Agent execution's events and deliveries",
        "tags": [
          "public-task-agents"
        ]
      }
    },
    "/api/public/v1/webhooks/{hook_id}/sessions/{session_id}/events": {
      "get": {
        "description": "Poll with the returned next_after cursor until run.completed, run.failed or run.interrupted. Match the requested request_id. Reads remain scoped to the key's Profile and selected Agent.",
        "parameters": [
          {
            "description": "Owned Agent Hook ID",
            "in": "path",
            "name": "hook_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Session ID returned by invoke",
            "in": "path",
            "name": "session_id",
            "required": true,
            "type": "string"
          },
          {
            "description": "Last consumed event sequence",
            "in": "query",
            "name": "after",
            "type": "integer"
          },
          {
            "description": "Page size (max 200)",
            "in": "query",
            "name": "limit",
            "type": "integer"
          }
        ],
        "produces": [
          "application/json"
        ],
        "responses": {
          "200": {
            "description": "OK",
            "schema": {
              "$ref": "#/definitions/api.TaskAgentEventListEnvelopeDoc"
            }
          }
        },
        "security": [
          {
            "PublicBearer": []
          }
        ],
        "summary": "Read an AIP Agent session's events",
        "tags": [
          "public-task-agents"
        ]
      }
    }
  },
  "definitions": {
    "api.PublicBoundAgentPrompt": {
      "properties": {
        "prompt": {
          "maxLength": 65536,
          "type": "string"
        },
        "request_id": {
          "maxLength": 128,
          "type": "string"
        },
        "session_id": {
          "maxLength": 128,
          "type": "string"
        }
      },
      "required": [
        "prompt"
      ],
      "type": "object"
    },
    "api.taskAgentWebhookAcceptedEnvelope": {
      "properties": {
        "after_event_id": {
          "type": "integer"
        },
        "event_url": {
          "type": "string"
        },
        "request_id": {
          "type": "string"
        },
        "run_id": {
          "type": "string"
        },
        "session_id": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.publicSessionListEnvelope": {
      "properties": {
        "has_more": {
          "type": "boolean"
        },
        "next_cursor": {
          "type": "string"
        },
        "sessions": {
          "items": {
            "$ref": "#/definitions/api.publicSessionReadback"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "api.publicSessionReadback": {
      "properties": {
        "canceled_at": {
          "type": "string"
        },
        "completed_at": {
          "type": "string"
        },
        "created_at": {
          "type": "string"
        },
        "event_cursor": {
          "type": "integer"
        },
        "failed_at": {
          "type": "string"
        },
        "mode": {
          "type": "string"
        },
        "runtime_provider": {
          "type": "string"
        },
        "session_id": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "task_origin": {
          "type": "string"
        },
        "token_usage": {
          "$ref": "#/definitions/repository.TaskAgentSessionUsageView"
        },
        "updated_at": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "repository.TaskAgentSessionUsageView": {
      "properties": {
        "budget_status": {
          "type": "string"
        },
        "budget_unavailable_reason": {
          "type": "string"
        },
        "cache_read_tokens": {
          "type": "integer"
        },
        "cache_write_tokens": {
          "type": "integer"
        },
        "cost_status": {
          "type": "string"
        },
        "cost_unavailable_reason": {
          "type": "string"
        },
        "estimated_cost_usd": {
          "type": "number"
        },
        "input_tokens": {
          "type": "integer"
        },
        "model": {
          "type": "string"
        },
        "output_tokens": {
          "type": "integer"
        },
        "pricing": {
          "$ref": "#/definitions/repository.TaskAgentUsagePricing"
        },
        "reasoning_tokens": {
          "type": "integer"
        },
        "reported_sessions": {
          "type": "integer"
        },
        "schedule_coverage": {
          "type": "string"
        },
        "schedule_coverage_reason": {
          "type": "string"
        },
        "tokens_unavailable_reason": {
          "type": "string"
        },
        "total_tokens": {
          "type": "integer"
        },
        "unpriced_tokens": {
          "type": "integer"
        },
        "unreported_sessions": {
          "type": "integer"
        },
        "updated_at": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "repository.TaskAgentUsagePricing": {
      "properties": {
        "cache_read_usd_per_token": {
          "type": "string"
        },
        "cache_write_usd_per_token": {
          "type": "string"
        },
        "input_usd_per_token": {
          "type": "string"
        },
        "output_usd_per_token": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.TaskAgentEventListEnvelopeDoc": {
      "properties": {
        "events": {
          "items": {
            "$ref": "#/definitions/api.TaskAgentEventDoc"
          },
          "type": "array"
        },
        "has_more": {
          "example": true,
          "type": "boolean"
        },
        "next_after": {
          "example": 42,
          "format": "int64",
          "type": "integer",
          "x-nullable": true
        }
      },
      "type": "object"
    },
    "api.TaskAgentEventDoc": {
      "discriminator": "type",
      "properties": {
        "created_at": {
          "example": "2026-08-16T12:00:00Z",
          "format": "date-time",
          "type": "string"
        },
        "data": {
          "allOf": [
            {
              "$ref": "#/definitions/api.TaskAgentEventDataDoc"
            }
          ],
          "description": "Data is the HAST-owned payload union; Type selects its required shape as\ndefined in openwiki/integrations/task-agent-runtime-protocols.md."
        },
        "engine": {
          "enum": [
            "codex_cli",
            "pi_agent_cli"
          ],
          "example": "codex_cli",
          "type": "string"
        },
        "event_id": {
          "example": "evt_123",
          "type": "string"
        },
        "replayable": {
          "example": true,
          "type": "boolean"
        },
        "run_id": {
          "example": "run_123",
          "type": "string"
        },
        "schema_version": {
          "enum": [
            2
          ],
          "example": 2,
          "type": "integer"
        },
        "sequence": {
          "description": "Sequence is a positive durable order, or null for volatile events.",
          "example": 42,
          "minimum": 1,
          "type": "integer",
          "x-nullable": true
        },
        "session_id": {
          "example": "session_123",
          "type": "string"
        },
        "source": {
          "enum": [
            "runtime",
            "backplane",
            "workspace"
          ],
          "example": "runtime",
          "type": "string"
        },
        "task_id": {
          "example": "task_123",
          "type": "string"
        },
        "type": {
          "enum": [
            "runtime.status",
            "run.queued",
            "run.started",
            "run.retrying",
            "run.completed",
            "run.failed",
            "run.interrupted",
            "message.started",
            "message.delta",
            "message.completed",
            "reasoning.started",
            "reasoning.delta",
            "reasoning.completed",
            "tool.started",
            "tool.updated",
            "tool.completed",
            "plan.updated",
            "plan.completed",
            "usage.updated",
            "file.changed",
            "input.requested",
            "context.compacted",
            "warning",
            "error"
          ],
          "example": "message.completed",
          "type": "string"
        }
      },
      "required": [
        "created_at",
        "data",
        "engine",
        "event_id",
        "replayable",
        "schema_version",
        "sequence",
        "source",
        "task_id",
        "type"
      ],
      "type": "object",
      "x-hast-event-variants": {
        "context.compacted": {
          "$ref": "#/definitions/context.compacted"
        },
        "error": {
          "$ref": "#/definitions/error"
        },
        "file.changed": {
          "$ref": "#/definitions/file.changed"
        },
        "input.requested": {
          "$ref": "#/definitions/input.requested"
        },
        "message.completed": {
          "$ref": "#/definitions/message.completed"
        },
        "message.delta": {
          "$ref": "#/definitions/message.delta"
        },
        "message.started": {
          "$ref": "#/definitions/message.started"
        },
        "plan.completed": {
          "$ref": "#/definitions/plan.completed"
        },
        "plan.updated": {
          "$ref": "#/definitions/plan.updated"
        },
        "reasoning.completed": {
          "$ref": "#/definitions/reasoning.completed"
        },
        "reasoning.delta": {
          "$ref": "#/definitions/reasoning.delta"
        },
        "reasoning.started": {
          "$ref": "#/definitions/reasoning.started"
        },
        "run.completed": {
          "$ref": "#/definitions/run.completed"
        },
        "run.failed": {
          "$ref": "#/definitions/run.failed"
        },
        "run.interrupted": {
          "$ref": "#/definitions/run.interrupted"
        },
        "run.queued": {
          "$ref": "#/definitions/run.queued"
        },
        "run.retrying": {
          "$ref": "#/definitions/run.retrying"
        },
        "run.started": {
          "$ref": "#/definitions/run.started"
        },
        "runtime.status": {
          "$ref": "#/definitions/runtime.status"
        },
        "tool.completed": {
          "$ref": "#/definitions/tool.completed"
        },
        "tool.started": {
          "$ref": "#/definitions/tool.started"
        },
        "tool.updated": {
          "$ref": "#/definitions/tool.updated"
        },
        "usage.updated": {
          "$ref": "#/definitions/usage.updated"
        },
        "warning": {
          "$ref": "#/definitions/warning"
        }
      }
    },
    "api.TaskAgentEventDataDoc": {
      "properties": {
        "attempt": {
          "minimum": 1,
          "type": "integer"
        },
        "attempts": {
          "minimum": 1,
          "type": "integer"
        },
        "channel": {
          "enum": [
            "stdout",
            "stderr",
            "progress"
          ],
          "type": "string"
        },
        "code": {
          "type": "string"
        },
        "context_window": {
          "minimum": 0,
          "type": "integer"
        },
        "cost": {},
        "delta": {
          "type": "string"
        },
        "duration_ms": {
          "minimum": 0,
          "type": "integer"
        },
        "error": {
          "type": "string"
        },
        "exit_code": {
          "type": "integer"
        },
        "files": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "final_message_id": {
          "type": "string"
        },
        "finish_reason": {
          "type": "string"
        },
        "input": {},
        "is_error": {
          "type": "boolean"
        },
        "kind": {
          "type": "string"
        },
        "last": {
          "$ref": "#/definitions/api.TaskAgentEventTokenUsageDoc"
        },
        "message": {
          "type": "string"
        },
        "message_id": {
          "type": "string"
        },
        "model": {
          "type": "string"
        },
        "model_config": {
          "$ref": "#/definitions/api.TaskAgentModelSelectionDoc"
        },
        "model_source": {
          "type": "string"
        },
        "modified_at": {
          "format": "date-time",
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "operation": {
          "enum": [
            "update",
            "delete"
          ],
          "type": "string"
        },
        "options": {
          "items": {},
          "type": "array"
        },
        "output": {},
        "parent_tool_call_id": {
          "type": "string"
        },
        "path": {
          "type": "string"
        },
        "phase": {
          "enum": [
            "final_answer"
          ],
          "type": "string"
        },
        "plan_id": {
          "type": "string"
        },
        "prompt": {
          "type": "string"
        },
        "reason": {
          "type": "string"
        },
        "reasoning_id": {
          "type": "string"
        },
        "request_id": {
          "type": "string"
        },
        "retryable": {
          "type": "boolean"
        },
        "role": {
          "enum": [
            "user",
            "assistant",
            "system"
          ],
          "type": "string"
        },
        "scope": {
          "type": "string"
        },
        "size_bytes": {
          "minimum": 0,
          "type": "integer"
        },
        "snapshot": {
          "type": "string"
        },
        "status": {
          "enum": [
            "starting",
            "ready",
            "failed",
            "released",
            "succeeded",
            "interrupted"
          ],
          "type": "string"
        },
        "steps": {
          "items": {
            "$ref": "#/definitions/api.TaskAgentEventPlanStepDoc"
          },
          "type": "array"
        },
        "text": {
          "type": "string"
        },
        "tokens_after": {
          "minimum": 0,
          "type": "integer"
        },
        "tokens_before": {
          "minimum": 0,
          "type": "integer"
        },
        "tool_call_id": {
          "type": "string"
        },
        "total": {
          "$ref": "#/definitions/api.TaskAgentEventTokenUsageDoc"
        },
        "turn_type": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.TaskAgentEventTokenUsageDoc": {
      "properties": {
        "cache_read_tokens": {
          "minimum": 0,
          "type": "integer"
        },
        "cache_write_tokens": {
          "minimum": 0,
          "type": "integer"
        },
        "input_tokens": {
          "minimum": 0,
          "type": "integer"
        },
        "output_tokens": {
          "minimum": 0,
          "type": "integer"
        },
        "reasoning_tokens": {
          "minimum": 0,
          "type": "integer"
        },
        "total_tokens": {
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "cache_read_tokens",
        "cache_write_tokens",
        "input_tokens",
        "output_tokens",
        "reasoning_tokens",
        "total_tokens"
      ],
      "type": "object"
    },
    "api.TaskAgentModelSelectionDoc": {
      "properties": {
        "model": {
          "type": "string"
        },
        "model_source": {
          "enum": [
            "hast",
            "codex_account"
          ],
          "type": "string"
        },
        "reasoning_effort": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.TaskAgentEventPlanStepDoc": {
      "properties": {
        "status": {
          "enum": [
            "pending",
            "in_progress",
            "completed"
          ],
          "example": "in_progress",
          "type": "string"
        },
        "step": {
          "type": "string"
        }
      },
      "required": [
        "status",
        "step"
      ],
      "type": "object"
    },
    "context.compacted": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDoc"
        },
        {
          "properties": {
            "data": {
              "$ref": "#/definitions/api.TaskAgentEventContextCompactedDataDoc"
            },
            "type": {
              "enum": [
                "context.compacted"
              ],
              "type": "string"
            }
          },
          "required": [
            "type",
            "data"
          ],
          "type": "object"
        }
      ]
    },
    "api.TaskAgentEventContextCompactedDataDoc": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDataDoc"
        },
        {
          "required": [
            "reason"
          ],
          "type": "object"
        }
      ]
    },
    "error": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDoc"
        },
        {
          "properties": {
            "data": {
              "$ref": "#/definitions/api.TaskAgentEventErrorDataDoc"
            },
            "type": {
              "enum": [
                "error"
              ],
              "type": "string"
            }
          },
          "required": [
            "type",
            "data"
          ],
          "type": "object"
        }
      ]
    },
    "api.TaskAgentEventErrorDataDoc": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDataDoc"
        },
        {
          "required": [
            "scope",
            "code",
            "message",
            "retryable"
          ],
          "type": "object"
        }
      ]
    },
    "file.changed": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDoc"
        },
        {
          "properties": {
            "data": {
              "$ref": "#/definitions/api.TaskAgentEventFileChangedDataDoc"
            },
            "type": {
              "enum": [
                "file.changed"
              ],
              "type": "string"
            }
          },
          "required": [
            "type",
            "data"
          ],
          "type": "object"
        }
      ]
    },
    "api.TaskAgentEventFileChangedDataDoc": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDataDoc"
        },
        {
          "required": [
            "path",
            "operation"
          ],
          "type": "object"
        }
      ]
    },
    "input.requested": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDoc"
        },
        {
          "properties": {
            "data": {
              "$ref": "#/definitions/api.TaskAgentEventInputRequestedDataDoc"
            },
            "type": {
              "enum": [
                "input.requested"
              ],
              "type": "string"
            }
          },
          "required": [
            "type",
            "data"
          ],
          "type": "object"
        }
      ]
    },
    "api.TaskAgentEventInputRequestedDataDoc": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDataDoc"
        },
        {
          "required": [
            "request_id",
            "kind",
            "prompt"
          ],
          "type": "object"
        }
      ]
    },
    "message.completed": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDoc"
        },
        {
          "properties": {
            "data": {
              "$ref": "#/definitions/api.TaskAgentEventMessageCompletedDataDoc"
            },
            "type": {
              "enum": [
                "message.completed"
              ],
              "type": "string"
            }
          },
          "required": [
            "type",
            "data"
          ],
          "type": "object"
        }
      ]
    },
    "api.TaskAgentEventMessageCompletedDataDoc": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDataDoc"
        },
        {
          "required": [
            "message_id",
            "role",
            "text"
          ],
          "type": "object"
        }
      ]
    },
    "message.delta": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDoc"
        },
        {
          "properties": {
            "data": {
              "$ref": "#/definitions/api.TaskAgentEventMessageDeltaDataDoc"
            },
            "type": {
              "enum": [
                "message.delta"
              ],
              "type": "string"
            }
          },
          "required": [
            "type",
            "data"
          ],
          "type": "object"
        }
      ]
    },
    "api.TaskAgentEventMessageDeltaDataDoc": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDataDoc"
        },
        {
          "required": [
            "message_id",
            "role",
            "delta"
          ],
          "type": "object"
        }
      ]
    },
    "message.started": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDoc"
        },
        {
          "properties": {
            "data": {
              "$ref": "#/definitions/api.TaskAgentEventMessageStartedDataDoc"
            },
            "type": {
              "enum": [
                "message.started"
              ],
              "type": "string"
            }
          },
          "required": [
            "type",
            "data"
          ],
          "type": "object"
        }
      ]
    },
    "api.TaskAgentEventMessageStartedDataDoc": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDataDoc"
        },
        {
          "required": [
            "message_id",
            "role"
          ],
          "type": "object"
        }
      ]
    },
    "plan.completed": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDoc"
        },
        {
          "properties": {
            "data": {
              "$ref": "#/definitions/api.TaskAgentEventPlanCompletedDataDoc"
            },
            "type": {
              "enum": [
                "plan.completed"
              ],
              "type": "string"
            }
          },
          "required": [
            "type",
            "data"
          ],
          "type": "object"
        }
      ]
    },
    "api.TaskAgentEventPlanCompletedDataDoc": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDataDoc"
        },
        {
          "required": [
            "plan_id"
          ],
          "type": "object"
        }
      ]
    },
    "plan.updated": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDoc"
        },
        {
          "properties": {
            "data": {
              "$ref": "#/definitions/api.TaskAgentEventPlanUpdatedDataDoc"
            },
            "type": {
              "enum": [
                "plan.updated"
              ],
              "type": "string"
            }
          },
          "required": [
            "type",
            "data"
          ],
          "type": "object"
        }
      ]
    },
    "api.TaskAgentEventPlanUpdatedDataDoc": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDataDoc"
        },
        {
          "required": [
            "plan_id"
          ],
          "type": "object"
        }
      ]
    },
    "reasoning.completed": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDoc"
        },
        {
          "properties": {
            "data": {
              "$ref": "#/definitions/api.TaskAgentEventReasoningCompletedDataDoc"
            },
            "type": {
              "enum": [
                "reasoning.completed"
              ],
              "type": "string"
            }
          },
          "required": [
            "type",
            "data"
          ],
          "type": "object"
        }
      ]
    },
    "api.TaskAgentEventReasoningCompletedDataDoc": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDataDoc"
        },
        {
          "required": [
            "reasoning_id",
            "text"
          ],
          "type": "object"
        }
      ]
    },
    "reasoning.delta": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDoc"
        },
        {
          "properties": {
            "data": {
              "$ref": "#/definitions/api.TaskAgentEventReasoningDeltaDataDoc"
            },
            "type": {
              "enum": [
                "reasoning.delta"
              ],
              "type": "string"
            }
          },
          "required": [
            "type",
            "data"
          ],
          "type": "object"
        }
      ]
    },
    "api.TaskAgentEventReasoningDeltaDataDoc": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDataDoc"
        },
        {
          "required": [
            "reasoning_id",
            "delta"
          ],
          "type": "object"
        }
      ]
    },
    "reasoning.started": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDoc"
        },
        {
          "properties": {
            "data": {
              "$ref": "#/definitions/api.TaskAgentEventReasoningStartedDataDoc"
            },
            "type": {
              "enum": [
                "reasoning.started"
              ],
              "type": "string"
            }
          },
          "required": [
            "type",
            "data"
          ],
          "type": "object"
        }
      ]
    },
    "api.TaskAgentEventReasoningStartedDataDoc": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDataDoc"
        },
        {
          "required": [
            "reasoning_id"
          ],
          "type": "object"
        }
      ]
    },
    "run.completed": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDoc"
        },
        {
          "properties": {
            "data": {
              "$ref": "#/definitions/api.TaskAgentEventRunCompletedDataDoc"
            },
            "type": {
              "enum": [
                "run.completed"
              ],
              "type": "string"
            }
          },
          "required": [
            "type",
            "data"
          ],
          "type": "object"
        }
      ]
    },
    "api.TaskAgentEventRunCompletedDataDoc": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDataDoc"
        },
        {
          "required": [
            "final_message_id",
            "finish_reason",
            "attempts"
          ],
          "type": "object"
        }
      ]
    },
    "run.failed": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDoc"
        },
        {
          "properties": {
            "data": {
              "$ref": "#/definitions/api.TaskAgentEventRunFailedDataDoc"
            },
            "type": {
              "enum": [
                "run.failed"
              ],
              "type": "string"
            }
          },
          "required": [
            "type",
            "data"
          ],
          "type": "object"
        }
      ]
    },
    "api.TaskAgentEventRunFailedDataDoc": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDataDoc"
        },
        {
          "required": [
            "code",
            "message",
            "retryable",
            "attempts"
          ],
          "type": "object"
        }
      ]
    },
    "run.interrupted": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDoc"
        },
        {
          "properties": {
            "data": {
              "$ref": "#/definitions/api.TaskAgentEventRunInterruptedDataDoc"
            },
            "type": {
              "enum": [
                "run.interrupted"
              ],
              "type": "string"
            }
          },
          "required": [
            "type",
            "data"
          ],
          "type": "object"
        }
      ]
    },
    "api.TaskAgentEventRunInterruptedDataDoc": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDataDoc"
        },
        {
          "required": [
            "reason"
          ],
          "type": "object"
        }
      ]
    },
    "run.queued": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDoc"
        },
        {
          "properties": {
            "data": {
              "$ref": "#/definitions/api.TaskAgentEventRunQueuedDataDoc"
            },
            "type": {
              "enum": [
                "run.queued"
              ],
              "type": "string"
            }
          },
          "required": [
            "type",
            "data"
          ],
          "type": "object"
        }
      ]
    },
    "api.TaskAgentEventRunQueuedDataDoc": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDataDoc"
        },
        {
          "required": [
            "request_id",
            "turn_type"
          ],
          "type": "object"
        }
      ]
    },
    "run.retrying": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDoc"
        },
        {
          "properties": {
            "data": {
              "$ref": "#/definitions/api.TaskAgentEventRunRetryingDataDoc"
            },
            "type": {
              "enum": [
                "run.retrying"
              ],
              "type": "string"
            }
          },
          "required": [
            "type",
            "data"
          ],
          "type": "object"
        }
      ]
    },
    "api.TaskAgentEventRunRetryingDataDoc": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDataDoc"
        },
        {
          "required": [
            "attempt",
            "code",
            "message"
          ],
          "type": "object"
        }
      ]
    },
    "run.started": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDoc"
        },
        {
          "properties": {
            "data": {
              "$ref": "#/definitions/api.TaskAgentEventRunStartedDataDoc"
            },
            "type": {
              "enum": [
                "run.started"
              ],
              "type": "string"
            }
          },
          "required": [
            "type",
            "data"
          ],
          "type": "object"
        }
      ]
    },
    "api.TaskAgentEventRunStartedDataDoc": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDataDoc"
        },
        {
          "required": [
            "request_id",
            "turn_type"
          ],
          "type": "object"
        }
      ]
    },
    "runtime.status": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDoc"
        },
        {
          "properties": {
            "data": {
              "$ref": "#/definitions/api.TaskAgentEventRuntimeStatusDataDoc"
            },
            "type": {
              "enum": [
                "runtime.status"
              ],
              "type": "string"
            }
          },
          "required": [
            "type",
            "data"
          ],
          "type": "object"
        }
      ]
    },
    "api.TaskAgentEventRuntimeStatusDataDoc": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDataDoc"
        },
        {
          "properties": {
            "status": {
              "enum": [
                "starting",
                "ready",
                "failed",
                "released"
              ],
              "type": "string"
            }
          },
          "required": [
            "status"
          ],
          "type": "object"
        }
      ]
    },
    "tool.completed": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDoc"
        },
        {
          "properties": {
            "data": {
              "$ref": "#/definitions/api.TaskAgentEventToolCompletedDataDoc"
            },
            "type": {
              "enum": [
                "tool.completed"
              ],
              "type": "string"
            }
          },
          "required": [
            "type",
            "data"
          ],
          "type": "object"
        }
      ]
    },
    "api.TaskAgentEventToolCompletedDataDoc": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDataDoc"
        },
        {
          "properties": {
            "status": {
              "enum": [
                "succeeded",
                "failed",
                "interrupted"
              ],
              "type": "string"
            }
          },
          "required": [
            "tool_call_id",
            "kind",
            "name",
            "status",
            "is_error"
          ],
          "type": "object"
        }
      ]
    },
    "tool.started": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDoc"
        },
        {
          "properties": {
            "data": {
              "$ref": "#/definitions/api.TaskAgentEventToolStartedDataDoc"
            },
            "type": {
              "enum": [
                "tool.started"
              ],
              "type": "string"
            }
          },
          "required": [
            "type",
            "data"
          ],
          "type": "object"
        }
      ]
    },
    "api.TaskAgentEventToolStartedDataDoc": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDataDoc"
        },
        {
          "required": [
            "tool_call_id",
            "kind",
            "name"
          ],
          "type": "object"
        }
      ]
    },
    "tool.updated": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDoc"
        },
        {
          "properties": {
            "data": {
              "$ref": "#/definitions/api.TaskAgentEventToolUpdatedDataDoc"
            },
            "type": {
              "enum": [
                "tool.updated"
              ],
              "type": "string"
            }
          },
          "required": [
            "type",
            "data"
          ],
          "type": "object"
        }
      ]
    },
    "api.TaskAgentEventToolUpdatedDataDoc": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDataDoc"
        },
        {
          "required": [
            "tool_call_id",
            "channel",
            "delta"
          ],
          "type": "object"
        }
      ]
    },
    "usage.updated": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDoc"
        },
        {
          "properties": {
            "data": {
              "$ref": "#/definitions/api.TaskAgentEventUsageUpdatedDataDoc"
            },
            "type": {
              "enum": [
                "usage.updated"
              ],
              "type": "string"
            }
          },
          "required": [
            "type",
            "data"
          ],
          "type": "object"
        }
      ]
    },
    "api.TaskAgentEventUsageUpdatedDataDoc": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDataDoc"
        },
        {
          "required": [
            "model",
            "context_window",
            "total"
          ],
          "type": "object"
        }
      ]
    },
    "warning": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDoc"
        },
        {
          "properties": {
            "data": {
              "$ref": "#/definitions/api.TaskAgentEventWarningDataDoc"
            },
            "type": {
              "enum": [
                "warning"
              ],
              "type": "string"
            }
          },
          "required": [
            "type",
            "data"
          ],
          "type": "object"
        }
      ]
    },
    "api.TaskAgentEventWarningDataDoc": {
      "allOf": [
        {
          "$ref": "#/definitions/api.TaskAgentEventDataDoc"
        },
        {
          "required": [
            "scope",
            "code",
            "message",
            "retryable"
          ],
          "type": "object"
        }
      ]
    },
    "api.channelCRMCreateRequest": {
      "properties": {
        "name": {
          "type": "string"
        },
        "request_id": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.PublicCRMWriteDoc": {
      "properties": {
        "request_id": {
          "description": "Stable UUID required on create. Reuse it only for the identical create request.",
          "type": "string"
        },
        "updated_at": {
          "description": "Required on update; use updatedAt from the last record readback.",
          "type": "string"
        },
        "values": {
          "additionalProperties": {},
          "description": "Only writable fields from GET /business-resources/{resource_id}/crm/schema.",
          "type": "object"
        }
      },
      "required": [
        "values"
      ],
      "type": "object"
    },
    "channel.CRMMemberPage": {
      "properties": {
        "has_more": {
          "type": "boolean"
        },
        "members": {
          "items": {
            "$ref": "#/definitions/channel.CRMMember"
          },
          "type": "array"
        },
        "next_cursor": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "channel.CRMMember": {
      "properties": {
        "email": {
          "type": "string"
        },
        "first_name": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "last_name": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "channel.CRMMemberInput": {
      "properties": {
        "email": {
          "type": "string"
        },
        "first_name": {
          "type": "string"
        },
        "last_name": {
          "type": "string"
        }
      },
      "required": [
        "email",
        "first_name"
      ],
      "type": "object"
    },
    "api.PublicChannelConnectionDoc": {
      "properties": {
        "inbox_id": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "require_admission": {
          "type": "boolean"
        }
      },
      "required": [
        "inbox_id",
        "name"
      ],
      "type": "object"
    },
    "api.PublicChannelAuthorizationDoc": {
      "properties": {
        "code": {
          "type": "string"
        },
        "require_admission": {
          "type": "boolean"
        },
        "state": {
          "type": "string"
        }
      },
      "required": [
        "code",
        "state"
      ],
      "type": "object"
    },
    "api.AutomaticChannelSetupRequest": {
      "properties": {
        "name": {
          "type": "string"
        },
        "provider": {
          "enum": [
            "slack",
            "telegram"
          ],
          "type": "string"
        },
        "request_key": {
          "format": "uuid",
          "type": "string"
        },
        "slack_trigger_rules": {
          "$ref": "#/definitions/channel.SlackTriggerRules"
        },
        "telegram_trigger_rules": {
          "$ref": "#/definitions/channel.TelegramTriggerRules"
        }
      },
      "required": [
        "name",
        "provider",
        "request_key"
      ],
      "type": "object"
    },
    "channel.SlackTriggerRules": {
      "properties": {
        "auto_reply_channel_ids": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "auto_reply_sender_ids": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "require_mention": {
          "type": "boolean"
        }
      },
      "required": [
        "require_mention"
      ],
      "type": "object"
    },
    "channel.TelegramTriggerRules": {
      "properties": {
        "default_group_mode": {
          "type": "string"
        },
        "group_rules": {
          "items": {
            "$ref": "#/definitions/channel.TelegramGroupRule"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "channel.TelegramGroupRule": {
      "properties": {
        "chat_id": {
          "type": "string"
        },
        "mode": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "channel.AutomaticSetup": {
      "properties": {
        "bot_name": {
          "type": "string"
        },
        "error_code": {
          "type": "string"
        },
        "expires_at": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "inbox_id": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "provider": {
          "type": "string"
        },
        "provider_id": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "verification_url": {
          "type": "string"
        },
        "workspace_name": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "channel.AutomaticSetupAuthorization": {
      "properties": {
        "configuration_token": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.AutomaticChannelSetupCompletion": {
      "properties": {
        "connection": {
          "$ref": "#/definitions/repository.ChannelConnection"
        }
      },
      "type": "object"
    },
    "repository.ChannelConnection": {
      "properties": {
        "binding_version": {
          "type": "integer"
        },
        "bound_hook_id": {
          "type": "string"
        },
        "bound_hook_status": {
          "type": "string"
        },
        "bound_hook_title": {
          "type": "string"
        },
        "created_at": {
          "type": "string"
        },
        "email_address": {
          "type": "string"
        },
        "email_agent_deleted": {
          "type": "boolean"
        },
        "email_hook_id": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "inbox_id": {
          "type": "integer"
        },
        "name": {
          "type": "string"
        },
        "platform": {
          "type": "string"
        },
        "require_admission": {
          "type": "boolean"
        },
        "retain_content": {
          "type": "boolean"
        },
        "setup_required": {
          "type": "boolean"
        },
        "show_tool_progress": {
          "type": "boolean"
        },
        "status": {
          "type": "string"
        },
        "streaming_replies": {
          "type": "boolean"
        },
        "updated_at": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.PublicFacebookConnectDoc": {
      "properties": {
        "page_id": {
          "type": "string"
        },
        "require_admission": {
          "type": "boolean"
        },
        "token": {
          "type": "string"
        }
      },
      "required": [
        "page_id",
        "token"
      ],
      "type": "object"
    },
    "api.PublicFacebookPagesDoc": {
      "properties": {
        "token": {
          "type": "string"
        }
      },
      "required": [
        "token"
      ],
      "type": "object"
    },
    "repository.ChannelResource": {
      "properties": {
        "base_url": {
          "type": "string"
        },
        "created_at": {
          "type": "string"
        },
        "credential_expires_at": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "kind": {
          "$ref": "#/definitions/repository.ChannelResourceKind"
        },
        "managed": {
          "type": "boolean"
        },
        "name": {
          "type": "string"
        },
        "reference_id": {
          "type": "string"
        },
        "scope_type": {
          "type": "string"
        },
        "secret_id": {
          "type": "string"
        },
        "status": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "repository.ChannelResourceKind": {
      "enum": [
        "hast_memory",
        "cloudflare",
        "knowledge_source",
        "knowledge_collection",
        "twenty",
        "tool",
        "schedule"
      ],
      "type": "string",
      "x-enum-varnames": [
        "ChannelResourceMemory",
        "ChannelResourceKnowledge",
        "ChannelResourceSource",
        "ChannelResourceCollection",
        "ChannelResourceCRM",
        "ChannelResourceTool",
        "ChannelResourceSchedule"
      ]
    },
    "api.PublicChannelStatusDoc": {
      "properties": {
        "status": {
          "type": "string"
        }
      },
      "required": [
        "status"
      ],
      "type": "object"
    },
    "api.channelSendListResponse": {
      "properties": {
        "has_accepted_reply": {
          "type": "boolean"
        },
        "sends": {
          "items": {
            "$ref": "#/definitions/repository.ChannelSend"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "repository.ChannelSend": {
      "properties": {
        "account_id": {
          "type": "integer"
        },
        "automatic": {
          "type": "boolean"
        },
        "binding_version": {
          "type": "integer"
        },
        "connection_id": {
          "type": "string"
        },
        "content": {
          "type": "string"
        },
        "conversation_id": {
          "type": "integer"
        },
        "created_at": {
          "type": "string"
        },
        "delivery": {
          "$ref": "#/definitions/repository.TaskAgentScheduleDelivery"
        },
        "error": {
          "type": "string"
        },
        "file_name": {
          "type": "string"
        },
        "file_size_bytes": {
          "type": "integer"
        },
        "final_message_id": {
          "type": "string"
        },
        "hook_id": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "inbox_id": {
          "type": "integer"
        },
        "origin_conversation_id": {
          "type": "integer"
        },
        "provider_external_id": {
          "type": "string"
        },
        "provider_message_id": {
          "type": "integer"
        },
        "run_id": {
          "type": "string"
        },
        "schedule_id": {
          "type": "string"
        },
        "session_id": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "task_id": {
          "type": "string"
        },
        "updated_at": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "repository.TaskAgentScheduleDelivery": {
      "properties": {
        "connection_id": {
          "type": "string"
        },
        "thread_id": {
          "type": "string"
        },
        "to": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.PublicMessageChannelDoc": {
      "properties": {
        "account_id": {
          "type": "string"
        },
        "account_sid": {
          "type": "string"
        },
        "api_key": {
          "type": "string"
        },
        "api_secret": {
          "type": "string"
        },
        "application_id": {
          "type": "string"
        },
        "auth_token": {
          "type": "string"
        },
        "bot_token": {
          "type": "string"
        },
        "callback_token": {
          "type": "string"
        },
        "corp_id": {
          "type": "string"
        },
        "corp_secret": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "encoding_aes_key": {
          "type": "string"
        },
        "imap_address": {
          "type": "string"
        },
        "imap_login": {
          "type": "string"
        },
        "imap_password": {
          "type": "string"
        },
        "line_channel_id": {
          "type": "string"
        },
        "line_channel_secret": {
          "type": "string"
        },
        "line_channel_token": {
          "type": "string"
        },
        "medium": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "open_kfid": {
          "type": "string"
        },
        "phone_number": {
          "type": "string"
        },
        "platform": {
          "type": "string"
        },
        "require_admission": {
          "type": "boolean"
        },
        "signing_secret": {
          "type": "string"
        },
        "slack_trigger_rules": {
          "$ref": "#/definitions/channel.SlackTriggerRules"
        },
        "smtp_address": {
          "type": "string"
        },
        "smtp_login": {
          "type": "string"
        },
        "smtp_password": {
          "type": "string"
        },
        "telegram_trigger_rules": {
          "$ref": "#/definitions/channel.TelegramTriggerRules"
        },
        "website_url": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.PublicWhatsAppChannelCreateDoc": {
      "properties": {
        "app_secret_id": {
          "type": "string"
        },
        "app_secret_name": {
          "type": "string"
        },
        "app_secret_value": {
          "type": "string"
        },
        "business_account_id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "phone_number": {
          "type": "string"
        },
        "phone_number_id": {
          "type": "string"
        },
        "require_admission": {
          "type": "boolean"
        },
        "token_secret_id": {
          "type": "string"
        },
        "token_secret_name": {
          "type": "string"
        },
        "token_secret_value": {
          "type": "string"
        }
      },
      "required": [
        "business_account_id",
        "name",
        "phone_number",
        "phone_number_id"
      ],
      "type": "object"
    },
    "api.taskAgentChannelBindingRequest": {
      "properties": {
        "expected_binding_version": {
          "type": "integer"
        },
        "expected_hook_id": {
          "type": "string"
        },
        "require_admission": {
          "type": "boolean"
        },
        "target_hook_id": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "repository.ChannelDeletionPreview": {
      "properties": {
        "attachment_count": {
          "type": "integer"
        },
        "bases": {
          "items": {
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": "string"
              }
            },
            "type": "object"
          },
          "type": "array"
        },
        "record_count": {
          "type": "integer"
        },
        "source_count": {
          "type": "integer"
        }
      },
      "type": "object"
    },
    "repository.ChannelDeletion": {
      "properties": {
        "affected_base_ids": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "completed": {
          "type": "integer"
        },
        "connection_id": {
          "type": "string"
        },
        "created_at": {
          "type": "string"
        },
        "error": {
          "type": "string"
        },
        "finished_at": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "name": {
          "type": "string"
        },
        "purge_knowledge": {
          "type": "boolean"
        },
        "stage": {
          "type": "string"
        },
        "state": {
          "type": "string"
        },
        "total": {
          "type": "integer"
        },
        "updated_at": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.updateSlackChannelRequest": {
      "properties": {
        "auto_reply_channel_ids": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "auto_reply_sender_ids": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "require_mention": {
          "type": "boolean"
        },
        "show_tool_progress": {
          "type": "boolean"
        }
      },
      "required": [
        "require_mention"
      ],
      "type": "object"
    },
    "api.updateTelegramChannelRequest": {
      "properties": {
        "default_group_mode": {
          "type": "string"
        },
        "group_rules": {
          "items": {
            "$ref": "#/definitions/channel.TelegramGroupRule"
          },
          "type": "array"
        },
        "show_tool_progress": {
          "type": "boolean"
        },
        "streaming_replies": {
          "type": "boolean"
        }
      },
      "type": "object"
    },
    "api.PublicWeChatCompleteDoc": {
      "properties": {
        "corp_secret": {
          "type": "string"
        },
        "open_kfid": {
          "type": "string"
        }
      },
      "required": [
        "corp_secret",
        "open_kfid"
      ],
      "type": "object"
    },
    "api.WeChatChannelAccountsRequest": {
      "properties": {
        "corp_secret": {
          "maxLength": 4096,
          "type": "string"
        }
      },
      "required": [
        "corp_secret"
      ],
      "type": "object"
    },
    "api.WeChatChannelAccountsResponse": {
      "properties": {
        "accounts": {
          "items": {
            "$ref": "#/definitions/api.WeChatChannelAccount"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "api.WeChatChannelAccount": {
      "properties": {
        "manage_privilege": {
          "type": "boolean"
        },
        "name": {
          "type": "string"
        },
        "open_kfid": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.WeChatChannelAccountsErrorDoc": {
      "properties": {
        "code": {
          "type": "string"
        },
        "error": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.PublicDomainVerificationDoc": {
      "properties": {
        "content": {
          "type": "string"
        },
        "filename": {
          "type": "string"
        }
      },
      "required": [
        "content",
        "filename"
      ],
      "type": "object"
    },
    "api.PublicWhatsAppChannelReauthorizeDoc": {
      "properties": {
        "app_secret_id": {
          "type": "string"
        },
        "app_secret_name": {
          "type": "string"
        },
        "app_secret_value": {
          "type": "string"
        },
        "business_account_id": {
          "type": "string"
        },
        "phone_number_id": {
          "type": "string"
        },
        "token_secret_id": {
          "type": "string"
        },
        "token_secret_name": {
          "type": "string"
        },
        "token_secret_value": {
          "type": "string"
        }
      },
      "required": [
        "business_account_id",
        "phone_number_id"
      ],
      "type": "object"
    },
    "api.TaskAgentConnectorAccountListEnvelopeDoc": {
      "properties": {
        "connector_accounts": {
          "items": {
            "additionalProperties": {},
            "type": "object"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "api.TaskAgentConnectorAccountRequestDoc": {
      "properties": {
        "external_account_ref": {
          "example": "connected-account-id",
          "type": "string"
        },
        "metadata": {
          "additionalProperties": {},
          "type": "object"
        },
        "provider": {
          "example": "github",
          "type": "string"
        },
        "status": {
          "example": "connected",
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.TaskAgentConnectorAccountEnvelopeDoc": {
      "properties": {
        "connector_account": {
          "additionalProperties": {},
          "type": "object"
        }
      },
      "type": "object"
    },
    "api.TaskAgentConnectorStatusEnvelopeDoc": {
      "properties": {
        "agent_id": {
          "type": "string"
        },
        "connection_scope": {
          "type": "string"
        },
        "connectors": {
          "items": {
            "$ref": "#/definitions/api.TaskAgentConnectorStatusDoc"
          },
          "type": "array"
        },
        "has_more": {
          "type": "boolean"
        },
        "limit": {
          "example": 20,
          "type": "integer"
        },
        "next_cursor": {
          "type": "string"
        },
        "profile_id": {
          "type": "string"
        },
        "search": {
          "example": "github",
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.TaskAgentConnectorStatusDoc": {
      "properties": {
        "account_label": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "label": {
          "example": "GitHub",
          "type": "string"
        },
        "logo": {
          "type": "string"
        },
        "provider": {
          "example": "github",
          "type": "string"
        },
        "runtime_provider": {
          "example": "composio",
          "type": "string"
        },
        "start_url": {
          "type": "string"
        },
        "status": {
          "example": "connected",
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.TaskAgentConnectorStartEnvelopeDoc": {
      "properties": {
        "auth_url": {
          "type": "string"
        },
        "connected_account_id": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.TaskAgentConnectorSetupRequiredDoc": {
      "properties": {
        "code": {
          "example": "connector_auth_config_required",
          "type": "string"
        },
        "error": {
          "example": "Ask an administrator to configure custom authentication in Composio, then retry.",
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.PublicTaskAgentWorkspaceFilesEnvelopeDoc": {
      "properties": {
        "has_more": {
          "type": "boolean"
        },
        "items": {
          "items": {
            "$ref": "#/definitions/api.PublicTaskAgentWorkspaceItemDoc"
          },
          "type": "array"
        },
        "next_cursor": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.PublicTaskAgentWorkspaceItemDoc": {
      "properties": {
        "file_id": {
          "example": "opaque-file-id",
          "type": "string"
        },
        "id": {
          "example": "opaque-file-id",
          "type": "string"
        },
        "name": {
          "example": "report.csv",
          "type": "string"
        },
        "path": {
          "example": "uploads/upload-id/report.csv",
          "type": "string"
        },
        "relative_path": {
          "example": "uploads/upload-id/report.csv",
          "type": "string"
        },
        "session_id": {
          "type": "string"
        },
        "size_bytes": {
          "example": 1024,
          "type": "integer"
        },
        "type": {
          "example": "file",
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.PublicTaskAgentUploadEnvelopeDoc": {
      "properties": {
        "file": {
          "$ref": "#/definitions/api.PublicTaskAgentWorkspaceItemDoc"
        }
      },
      "type": "object"
    },
    "api.TaskAgentKnowledgeBaseListEnvelopeDoc": {
      "properties": {
        "knowledge_bases": {
          "items": {
            "$ref": "#/definitions/api.TaskAgentKnowledgeBaseDoc"
          },
          "type": "array"
        },
        "pagination": {
          "$ref": "#/definitions/api.TaskAgentKnowledgeBasePaginationDoc"
        }
      },
      "type": "object"
    },
    "api.TaskAgentKnowledgeBaseDoc": {
      "properties": {
        "cloudflare_instance_id": {
          "example": "hast-kb-product-docs",
          "type": "string"
        },
        "cloudflare_mcp_url": {
          "example": "https://hast-kb-product-docs.search.ai.cloudflare.com/mcp",
          "type": "string"
        },
        "cloudflare_public_endpoint_id": {
          "example": "hast-kb-product-docs",
          "type": "string"
        },
        "created_at": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "error_message": {
          "type": "string"
        },
        "id": {
          "example": "kb_123",
          "type": "string"
        },
        "metadata": {
          "additionalProperties": {},
          "type": "object"
        },
        "name": {
          "example": "Product docs",
          "type": "string"
        },
        "source_content_type": {
          "example": "text/markdown",
          "type": "string"
        },
        "source_filename": {
          "example": "docs.md",
          "type": "string"
        },
        "source_type": {
          "example": "url",
          "type": "string"
        },
        "source_uri": {
          "example": "https://example.com/docs.md",
          "type": "string"
        },
        "status": {
          "example": "indexed",
          "type": "string"
        },
        "updated_at": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.TaskAgentKnowledgeBasePaginationDoc": {
      "properties": {
        "has_more": {
          "example": false,
          "type": "boolean"
        },
        "limit": {
          "example": 20,
          "type": "integer"
        },
        "offset": {
          "example": 0,
          "type": "integer"
        },
        "page": {
          "example": 1,
          "type": "integer"
        },
        "page_size": {
          "example": 20,
          "type": "integer"
        },
        "total": {
          "example": 1,
          "type": "integer"
        }
      },
      "type": "object"
    },
    "api.TaskAgentKnowledgeBaseCreateRequestDoc": {
      "properties": {
        "description": {
          "example": "Public product documentation",
          "type": "string"
        },
        "metadata": {
          "additionalProperties": {},
          "type": "object"
        },
        "name": {
          "example": "Product docs",
          "type": "string"
        },
        "source_type": {
          "example": "url",
          "type": "string"
        },
        "url": {
          "example": "https://example.com/docs.md",
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.TaskAgentKnowledgeBaseEnvelopeDoc": {
      "properties": {
        "knowledge_base": {
          "$ref": "#/definitions/api.TaskAgentKnowledgeBaseDoc"
        }
      },
      "type": "object"
    },
    "api.ServeErrorResponse": {
      "properties": {
        "code": {
          "description": "Code is the business status code (0 = success; see pkg/utils/errors.go).",
          "example": 0,
          "type": "integer"
        },
        "message": {
          "description": "Message is a human-readable status or error description.",
          "example": "ok",
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.TaskAgentKnowledgeBaseUpdateRequestDoc": {
      "properties": {
        "description": {
          "example": "Updated description",
          "type": "string"
        },
        "metadata": {
          "additionalProperties": {},
          "type": "object"
        },
        "name": {
          "example": "Updated product docs",
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.TaskAgentMemoryListEnvelopeDoc": {
      "properties": {
        "memories": {
          "items": {
            "$ref": "#/definitions/api.TaskAgentMemoryDoc"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "api.TaskAgentMemoryDoc": {
      "properties": {
        "content": {
          "type": "string"
        },
        "created_at": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "metadata": {
          "additionalProperties": {},
          "type": "object"
        },
        "name": {
          "type": "string"
        },
        "scope_id": {
          "example": "",
          "type": "string"
        },
        "scope_type": {
          "enum": [
            "task_agent",
            "webhook"
          ],
          "example": "task_agent",
          "type": "string"
        },
        "updated_at": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.TaskAgentMemoryRequestDoc": {
      "properties": {
        "content": {
          "example": "Prefer concise validation notes.",
          "type": "string"
        },
        "metadata": {
          "additionalProperties": {},
          "type": "object"
        },
        "name": {
          "example": "project-preferences",
          "type": "string"
        },
        "scope_id": {
          "example": "",
          "type": "string"
        },
        "scope_type": {
          "enum": [
            "task_agent",
            "webhook"
          ],
          "example": "task_agent",
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.TaskAgentMemoryEnvelopeDoc": {
      "properties": {
        "memory": {
          "$ref": "#/definitions/api.TaskAgentMemoryDoc"
        }
      },
      "type": "object"
    },
    "api.TaskAgentOKEnvelopeDoc": {
      "properties": {
        "ok": {
          "example": true,
          "type": "boolean"
        }
      },
      "type": "object"
    },
    "api.PublicTaskAgentPromptRequestDoc": {
      "properties": {
        "dynamic_tools": {
          "items": {
            "additionalProperties": {},
            "type": "object"
          },
          "type": "array"
        },
        "files": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "model": {
          "example": "hast/auto",
          "type": "string"
        },
        "prompt": {
          "example": "Summarize the release notes.",
          "type": "string"
        },
        "reasoning_effort": {
          "example": "medium",
          "type": "string"
        },
        "request_id": {
          "example": "client-turn-1",
          "type": "string"
        },
        "secret_bindings": {
          "items": {
            "additionalProperties": {},
            "type": "object"
          },
          "type": "array"
        },
        "session_id": {
          "example": "sess_abc123",
          "type": "string"
        },
        "skill_ids": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "system_prompt": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.PublicTaskAgentPromptEnvelopeDoc": {
      "properties": {
        "request_id": {
          "example": "client-turn-1",
          "type": "string"
        },
        "session_id": {
          "example": "sess_abc123",
          "type": "string"
        },
        "status": {
          "example": "dispatch_pending",
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.TaskAgentScheduleListEnvelopeDoc": {
      "properties": {
        "schedules": {
          "items": {
            "$ref": "#/definitions/api.TaskAgentScheduleDoc"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "api.TaskAgentScheduleDoc": {
      "properties": {
        "config": {
          "additionalProperties": {},
          "type": "object"
        },
        "cron_spec": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "last_run_at": {
          "type": "string"
        },
        "last_task_id": {
          "type": "string"
        },
        "mode": {
          "type": "string"
        },
        "next_run_at": {
          "type": "string"
        },
        "prompt": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "timezone": {
          "type": "string"
        },
        "title": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.TaskAgentScheduleRequestDoc": {
      "properties": {
        "config": {
          "additionalProperties": {},
          "type": "object"
        },
        "cron_spec": {
          "example": "0 15 * * 1",
          "type": "string"
        },
        "interval_seconds": {
          "type": "integer"
        },
        "mode": {
          "example": "direct_execute",
          "type": "string"
        },
        "next_run_at": {
          "example": "2026-09-15T01:00:00Z",
          "type": "string"
        },
        "prompt": {
          "example": "Summarize the workspace.",
          "type": "string"
        },
        "status": {
          "example": "active",
          "type": "string"
        },
        "timezone": {
          "example": "Asia/Shanghai",
          "type": "string"
        },
        "title": {
          "example": "Weekly workspace report",
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.TaskAgentScheduleEnvelopeDoc": {
      "properties": {
        "schedule": {
          "$ref": "#/definitions/api.TaskAgentScheduleDoc"
        }
      },
      "type": "object"
    },
    "api.TaskAgentScheduleRunListEnvelopeDoc": {
      "properties": {
        "runs": {
          "items": {
            "$ref": "#/definitions/api.TaskAgentScheduleRunDoc"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "api.TaskAgentScheduleRunDoc": {
      "properties": {
        "execution": {
          "$ref": "#/definitions/repository.TaskAgentScheduleExecution"
        },
        "id": {
          "type": "string"
        },
        "metadata": {
          "additionalProperties": {},
          "type": "object"
        },
        "run_at": {
          "type": "string"
        },
        "schedule_id": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "task_id": {
          "type": "string"
        },
        "token_usage": {
          "$ref": "#/definitions/repository.TaskAgentSessionUsageView"
        },
        "usage_unavailable_reason": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "repository.TaskAgentScheduleExecution": {
      "properties": {
        "hook_id": {
          "type": "string"
        },
        "session_id": {
          "type": "string"
        },
        "task_id": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.TaskAgentUserSecretListEnvelopeDoc": {
      "properties": {
        "secrets": {
          "items": {
            "$ref": "#/definitions/api.TaskAgentUserSecretDoc"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "api.TaskAgentUserSecretDoc": {
      "properties": {
        "created_at": {
          "type": "string"
        },
        "id": {
          "example": "sec_123",
          "type": "string"
        },
        "name": {
          "example": "kubeconfig",
          "type": "string"
        },
        "updated_at": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.TaskAgentUserSecretCreateRequestDoc": {
      "properties": {
        "name": {
          "example": "kubeconfig",
          "type": "string"
        },
        "value": {
          "example": "write-only",
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.TaskAgentUserSecretEnvelopeDoc": {
      "properties": {
        "secret": {
          "$ref": "#/definitions/api.TaskAgentUserSecretDoc"
        }
      },
      "type": "object"
    },
    "api.TaskAgentUserSecretUpdateRequestDoc": {
      "properties": {
        "value": {
          "example": "write-only",
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.PublicTaskAgentSessionListEnvelopeDoc": {
      "properties": {
        "has_more": {
          "type": "boolean"
        },
        "next_cursor": {
          "type": "string"
        },
        "sessions": {
          "items": {
            "$ref": "#/definitions/api.PublicTaskAgentSessionDoc"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "api.PublicTaskAgentSessionDoc": {
      "properties": {
        "event_cursor": {
          "type": "integer"
        },
        "mode": {
          "type": "string"
        },
        "runtime_provider": {
          "type": "string"
        },
        "session_id": {
          "example": "sess_abc123",
          "type": "string"
        },
        "status": {
          "example": "running",
          "type": "string"
        },
        "task_origin": {
          "example": "session",
          "type": "string"
        },
        "token_usage": {
          "$ref": "#/definitions/repository.TaskAgentSessionUsageView"
        }
      },
      "type": "object"
    },
    "api.TaskAgentTaskEnvelopeDoc": {
      "properties": {
        "task": {
          "$ref": "#/definitions/api.TaskAgentTaskDoc"
        }
      },
      "type": "object"
    },
    "api.TaskAgentTaskDoc": {
      "properties": {
        "client_id": {
          "example": "client-main-user-123",
          "type": "string"
        },
        "config": {
          "additionalProperties": {},
          "type": "object"
        },
        "created_at": {
          "type": "string"
        },
        "event_cursor": {
          "example": 42,
          "type": "integer"
        },
        "id": {
          "example": "task-agent-123",
          "type": "string"
        },
        "mode": {
          "example": "agent_run",
          "type": "string"
        },
        "profile_id": {
          "example": "user_123",
          "type": "string"
        },
        "prompt": {
          "type": "string"
        },
        "runtime_provider": {
          "example": "cubesandbox",
          "type": "string"
        },
        "sandbox_id": {
          "example": "sandbox-main-user-123",
          "type": "string"
        },
        "sandbox_scope": {
          "example": "main",
          "type": "string"
        },
        "status": {
          "example": "needs_input",
          "type": "string"
        },
        "task_origin": {
          "example": "session",
          "type": "string"
        },
        "title": {
          "example": "Release validation",
          "type": "string"
        },
        "token_usage": {
          "$ref": "#/definitions/repository.TaskAgentSessionUsageView"
        },
        "updated_at": {
          "type": "string"
        },
        "workspace_object_prefix": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.PublicTaskAgentSessionEnvelopeDoc": {
      "properties": {
        "session": {
          "$ref": "#/definitions/api.PublicTaskAgentSessionDoc"
        }
      },
      "type": "object"
    },
    "api.TaskAgentPromptAcceptedEnvelopeDoc": {
      "properties": {
        "request_id": {
          "example": "task-agent-turn-1710000000000000000",
          "type": "string"
        },
        "status": {
          "example": "queued",
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.TaskAgentUserSkillListEnvelopeDoc": {
      "properties": {
        "skills": {
          "items": {
            "$ref": "#/definitions/api.TaskAgentUserSkillDoc"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "api.TaskAgentUserSkillDoc": {
      "properties": {
        "capability_id": {
          "type": "string"
        },
        "description": {
          "type": "string"
        },
        "directory_name": {
          "example": "e2e-summary",
          "type": "string"
        },
        "display_name": {
          "type": "string"
        },
        "enabled": {
          "type": "boolean"
        },
        "entrypoint_path": {
          "example": "SKILL.md",
          "type": "string"
        },
        "files": {
          "items": {
            "$ref": "#/definitions/api.TaskAgentSkillFileDoc"
          },
          "type": "array"
        },
        "hash": {
          "example": "sha256:abc123",
          "type": "string"
        },
        "skill_id": {
          "example": "e2e-summary",
          "type": "string"
        },
        "source": {
          "example": "user",
          "type": "string"
        },
        "status": {
          "example": "active",
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.TaskAgentSkillFileDoc": {
      "properties": {
        "content": {
          "type": "string"
        },
        "path": {
          "example": "SKILL.md",
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.TaskAgentUserSkillRequestDoc": {
      "properties": {
        "description": {
          "type": "string"
        },
        "directory_name": {
          "example": "e2e-summary",
          "type": "string"
        },
        "display_name": {
          "example": "E2E Summary",
          "type": "string"
        },
        "enabled": {
          "type": "boolean"
        },
        "entrypoint_path": {
          "example": "SKILL.md",
          "type": "string"
        },
        "expected_checksum_sha256": {
          "type": "string"
        },
        "files": {
          "items": {
            "$ref": "#/definitions/api.TaskAgentSkillFileDoc"
          },
          "type": "array"
        },
        "skill_id": {
          "example": "e2e-summary",
          "type": "string"
        },
        "source_type": {
          "example": "upload",
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.TaskAgentUserSkillEnvelopeDoc": {
      "properties": {
        "skill": {
          "$ref": "#/definitions/api.TaskAgentUserSkillDoc"
        }
      },
      "type": "object"
    },
    "api.TaskAgentWebhookListEnvelopeDoc": {
      "properties": {
        "has_recorded_sessions": {
          "type": "boolean"
        },
        "hooks": {
          "items": {
            "$ref": "#/definitions/api.TaskAgentWebhookDoc"
          },
          "type": "array"
        },
        "pagination": {
          "additionalProperties": {},
          "type": "object"
        },
        "policy_options": {
          "items": {
            "additionalProperties": {},
            "type": "object"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "api.TaskAgentWebhookDoc": {
      "properties": {
        "created_at": {
          "type": "string"
        },
        "created_by": {
          "$ref": "#/definitions/repository.TaskAgentWebhookCreator"
        },
        "crm_ids": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "description": {
          "type": "string"
        },
        "dynamic_tools": {
          "items": {
            "additionalProperties": {},
            "type": "object"
          },
          "type": "array"
        },
        "hook_id": {
          "example": "hook_123",
          "type": "string"
        },
        "knowledge_base_list": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "managed_by": {
          "$ref": "#/definitions/api.TaskAgentWebhookManagedByDoc"
        },
        "memory": {
          "$ref": "#/definitions/api.TaskAgentWebhookMemoryConfigDoc"
        },
        "model": {
          "type": "string"
        },
        "model_source": {
          "type": "string"
        },
        "policies": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "reasoning_effort": {
          "type": "string"
        },
        "runtime_tools": {
          "items": {
            "additionalProperties": {},
            "type": "object"
          },
          "type": "array"
        },
        "sandbox_mode": {
          "type": "string"
        },
        "secret_bindings": {
          "items": {
            "additionalProperties": {},
            "type": "object"
          },
          "type": "array"
        },
        "secrets": {
          "items": {
            "$ref": "#/definitions/api.TaskAgentWebhookSecretDoc"
          },
          "type": "array"
        },
        "selected_skills": {
          "items": {
            "$ref": "#/definitions/api.TaskAgentWebhookSelectedSkillDoc"
          },
          "type": "array"
        },
        "status": {
          "type": "string"
        },
        "system_prompt": {
          "type": "string"
        },
        "title": {
          "type": "string"
        },
        "token_usage": {
          "$ref": "#/definitions/api.taskAgentWebhookTokenUsage"
        },
        "updated_at": {
          "type": "string"
        },
        "url": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "repository.TaskAgentWebhookCreator": {
      "properties": {
        "account_id": {
          "type": "string"
        },
        "api_key_id": {
          "type": "string"
        },
        "api_key_name": {
          "type": "string"
        },
        "email": {
          "type": "string"
        },
        "profile_id": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.TaskAgentWebhookManagedByDoc": {
      "properties": {
        "dynamic_tools": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "fields": {
          "example": [
            "system_prompt"
          ],
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "runtime_tools": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "skills": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "source": {
          "example": "apps/fde/hast-fde",
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.TaskAgentWebhookMemoryConfigDoc": {
      "properties": {
        "read_scope": {
          "enum": [
            "self",
            "webhook",
            "all"
          ],
          "example": "self",
          "type": "string"
        },
        "write_scope": {
          "enum": [
            "self",
            "shared"
          ],
          "example": "self",
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.TaskAgentWebhookSecretDoc": {
      "properties": {
        "name": {
          "example": "CRM_TOKEN",
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.TaskAgentWebhookSelectedSkillDoc": {
      "properties": {
        "enabled": {
          "type": "boolean"
        },
        "skill_id": {
          "example": "usr_123",
          "type": "string"
        },
        "source": {
          "example": "user",
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.taskAgentWebhookTokenUsage": {
      "properties": {
        "budget_status": {
          "type": "string"
        },
        "budget_unavailable_reason": {
          "type": "string"
        },
        "cache_read_tokens": {
          "type": "integer"
        },
        "cache_write_tokens": {
          "type": "integer"
        },
        "cost_status": {
          "type": "string"
        },
        "cost_unavailable_reason": {
          "type": "string"
        },
        "estimated_cost_usd": {
          "type": "number"
        },
        "input_tokens": {
          "type": "integer"
        },
        "output_tokens": {
          "type": "integer"
        },
        "reasoning_tokens": {
          "type": "integer"
        },
        "reported_sessions": {
          "type": "integer"
        },
        "schedule_coverage": {
          "type": "string"
        },
        "schedule_coverage_reason": {
          "type": "string"
        },
        "tokens_unavailable_reason": {
          "type": "string"
        },
        "total_tokens": {
          "type": "integer"
        },
        "unpriced_tokens": {
          "type": "integer"
        },
        "unreported_sessions": {
          "type": "integer"
        },
        "updated_at": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.TaskAgentWebhookRequestDoc": {
      "properties": {
        "crm_ids": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "description": {
          "type": "string"
        },
        "dynamic_tools": {
          "items": {
            "additionalProperties": {},
            "type": "object"
          },
          "type": "array"
        },
        "hook_id": {
          "example": "hook_123",
          "type": "string"
        },
        "http_request": {
          "additionalProperties": {},
          "type": "object"
        },
        "knowledge_base_list": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "managed_by": {
          "allOf": [
            {
              "$ref": "#/definitions/api.TaskAgentWebhookManagedByDoc"
            }
          ],
          "description": "Omit to keep the current declaration; an empty source clears it."
        },
        "memory": {
          "$ref": "#/definitions/api.TaskAgentWebhookMemoryConfigDoc"
        },
        "model": {
          "example": "hast/auto",
          "type": "string"
        },
        "model_source": {
          "type": "string"
        },
        "policies": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "reasoning_effort": {
          "example": "medium",
          "type": "string"
        },
        "runtime_tools": {
          "items": {
            "additionalProperties": {},
            "type": "object"
          },
          "type": "array"
        },
        "sandbox_mode": {
          "example": "read_only",
          "type": "string"
        },
        "secret_bindings": {
          "items": {
            "additionalProperties": {},
            "type": "object"
          },
          "type": "array"
        },
        "secrets": {
          "items": {
            "$ref": "#/definitions/api.TaskAgentWebhookSecretInputDoc"
          },
          "type": "array"
        },
        "selected_skills": {
          "items": {
            "$ref": "#/definitions/api.TaskAgentWebhookSelectedSkillDoc"
          },
          "type": "array"
        },
        "status": {
          "example": "active",
          "type": "string"
        },
        "system_prompt": {
          "type": "string"
        },
        "title": {
          "example": "Support Agent",
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.TaskAgentWebhookSecretInputDoc": {
      "properties": {
        "name": {
          "example": "CRM_TOKEN",
          "type": "string"
        },
        "value": {
          "example": "write-only",
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.TaskAgentWebhookEnvelopeDoc": {
      "properties": {
        "hook": {
          "$ref": "#/definitions/api.TaskAgentWebhookDoc"
        },
        "policy_options": {
          "items": {
            "additionalProperties": {},
            "type": "object"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "api.taskAgentHookChannelConfigRequest": {
      "properties": {
        "connection_ids": {
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "api.AgentEmailConfigurationResponse": {
      "properties": {
        "addresses": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "connection": {
          "$ref": "#/definitions/repository.ChannelConnection"
        },
        "email": {
          "$ref": "#/definitions/repository.AgentEmailConnection"
        },
        "name_prefix": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "repository.AgentEmailConnection": {
      "properties": {
        "address": {
          "type": "string"
        },
        "address_version": {
          "type": "integer"
        },
        "connection_id": {
          "type": "string"
        },
        "created_at": {
          "type": "string"
        },
        "hook_id": {
          "type": "string"
        },
        "rules": {
          "$ref": "#/definitions/channel.EmailTriggerRules"
        },
        "rules_version": {
          "type": "integer"
        },
        "source_id": {
          "type": "string"
        },
        "updated_at": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "channel.EmailTriggerRules": {
      "properties": {
        "automatic_reply": {
          "type": "boolean"
        },
        "mode": {
          "type": "string"
        },
        "rules": {
          "items": {
            "$ref": "#/definitions/channel.EmailRule"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "channel.EmailRule": {
      "properties": {
        "body_keywords": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "domains": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "id": {
          "type": "string"
        },
        "senders": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "subject_keywords": {
          "items": {
            "type": "string"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "api.AgentEmailRulesRequest": {
      "properties": {
        "rules": {
          "$ref": "#/definitions/channel.EmailTriggerRules"
        },
        "rules_version": {
          "type": "integer"
        }
      },
      "type": "object"
    },
    "repository.AgentEmailAddressAvailability": {
      "properties": {
        "address": {
          "type": "string"
        },
        "available": {
          "type": "boolean"
        }
      },
      "type": "object"
    },
    "api.AgentEmailAddressRequest": {
      "properties": {
        "address_version": {
          "type": "integer"
        },
        "local_part": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.AgentEmailPreviewRequest": {
      "properties": {
        "message_id": {
          "type": "integer"
        },
        "rules": {
          "$ref": "#/definitions/channel.EmailTriggerRules"
        }
      },
      "type": "object"
    },
    "channel.EmailTriggerDecision": {
      "properties": {
        "reason": {
          "type": "string"
        },
        "rule_id": {
          "type": "string"
        },
        "wake": {
          "type": "boolean"
        }
      },
      "type": "object"
    },
    "api.PublicWebhookInvocationDoc": {
      "properties": {
        "action": {
          "enum": [
            "created",
            "prompted"
          ],
          "type": "string"
        },
        "payload": {
          "$ref": "#/definitions/api.postTaskAgentWebhookRequest"
        }
      },
      "required": [
        "action",
        "payload"
      ],
      "type": "object"
    },
    "api.postTaskAgentWebhookRequest": {
      "properties": {
        "after_event_id": {
          "type": "integer"
        },
        "context": {},
        "knowledge_base_list": {
          "items": {
            "type": "string"
          },
          "type": "array"
        },
        "metadata": {
          "$ref": "#/definitions/repository.TaskAgentJSON"
        },
        "model_config": {
          "$ref": "#/definitions/repository.TaskAgentJSON"
        },
        "prompt": {
          "type": "string"
        },
        "request_id": {
          "type": "string"
        },
        "session_id": {
          "type": "string"
        },
        "signal": {
          "type": "string"
        },
        "system_prompt": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "repository.TaskAgentJSON": {
      "additionalProperties": {},
      "type": "object"
    },
    "api.taskAgentRunListEnvelope": {
      "properties": {
        "has_more": {
          "type": "boolean"
        },
        "next_cursor": {
          "type": "string"
        },
        "runs": {
          "items": {
            "$ref": "#/definitions/api.taskAgentRunReadback"
          },
          "type": "array"
        }
      },
      "type": "object"
    },
    "api.taskAgentRunReadback": {
      "properties": {
        "canceled_at": {
          "type": "string"
        },
        "completed_at": {
          "type": "string"
        },
        "created_at": {
          "type": "string"
        },
        "event_cursor": {
          "type": "integer"
        },
        "events_path": {
          "type": "string"
        },
        "execution_path": {
          "type": "string"
        },
        "failed_at": {
          "type": "string"
        },
        "mode": {
          "type": "string"
        },
        "runtime_provider": {
          "type": "string"
        },
        "session_id": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "task_id": {
          "type": "string"
        },
        "task_origin": {
          "type": "string"
        },
        "token_usage": {
          "$ref": "#/definitions/repository.TaskAgentSessionUsageView"
        },
        "updated_at": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.taskAgentRunDetailEnvelope": {
      "properties": {
        "deliveries": {
          "items": {
            "$ref": "#/definitions/api.taskAgentRunDelivery"
          },
          "type": "array"
        },
        "events": {
          "items": {
            "$ref": "#/definitions/api.taskAgentEventEnvelopeV2"
          },
          "type": "array"
        },
        "has_more": {
          "type": "boolean"
        },
        "next_after": {
          "type": "integer"
        },
        "run": {
          "$ref": "#/definitions/api.taskAgentRunReadback"
        }
      },
      "type": "object"
    },
    "api.taskAgentRunDelivery": {
      "properties": {
        "error": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "run_id": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "updated_at": {
          "type": "string"
        }
      },
      "type": "object"
    },
    "api.taskAgentEventEnvelopeV2": {
      "properties": {
        "created_at": {
          "type": "string"
        },
        "data": {
          "$ref": "#/definitions/repository.TaskAgentJSON"
        },
        "engine": {
          "type": "string"
        },
        "event_id": {
          "type": "string"
        },
        "replayable": {
          "type": "boolean"
        },
        "run_id": {
          "type": "string"
        },
        "schema_version": {
          "type": "integer"
        },
        "sequence": {
          "type": "integer"
        },
        "session_id": {
          "type": "string"
        },
        "source": {
          "type": "string"
        },
        "task_id": {
          "type": "string"
        },
        "type": {
          "type": "string"
        }
      },
      "type": "object"
    }
  },
  "securityDefinitions": {
    "PublicBearer": {
      "description": "Personal API key as `Bearer hast_pk_*` for `/api/public/v1`.",
      "in": "header",
      "name": "Authorization",
      "type": "apiKey"
    },
    "PublicTaskAgentAPIKey": {
      "description": "Personal API key as `Bearer hast_pk_*` for `/api/public/v1`.",
      "in": "header",
      "name": "Authorization",
      "type": "apiKey"
    }
  },
  "x-hast-normalization": "PublicTaskAgentAPIKey is an alias of PublicBearer; the upstream secrets operations reference the undeclared alias.",
  "x-hast-source": "https://backend.hast.so/api/v1/openapi/spec?app=serve",
  "x-hast-retrieved-at": "2026-10-19T06:37:38.187708+00:00",
  "x-hast-generated-from": "Backplane source for this release; generated schemas include Event v2 and public authentication enrichment."
}
