{
  "openapi": "3.1.0",
  "info": {
    "title": "Darwin Product API",
    "version": "1.5.0",
    "description": "Control the authenticated account and its Darwin agents, goals, skills, integrations, wallet, and transactions.",
    "contact": {
      "name": "Darwin",
      "url": "https://docs.darwin.so"
    }
  },
  "servers": [
    {
      "url": "https://api.darwin.so/api/v1",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "Account",
      "description": "Inspect the authenticated Darwin account and its agent inventory."
    },
    {
      "name": "Agents",
      "description": "Manage canonical personal and business agent identities."
    },
    {
      "name": "Permissions",
      "description": "Inspect the visibility and access policies applied to an agent."
    },
    {
      "name": "Reputation",
      "description": "Read public aggregate reputation and verified reliability metrics."
    },
    {
      "name": "Skills",
      "description": "Inspect and configure versioned agent skills."
    },
    {
      "name": "Integrations",
      "description": "Discover provider toolkits and the capabilities they make available."
    },
    {
      "name": "Connections",
      "description": "Manage authorized external accounts without exposing provider credentials."
    },
    {
      "name": "Notifications",
      "description": "Read the notification policy effective for an agent."
    },
    {
      "name": "Usage",
      "description": "Read sanitized Agent Wallet, dollar-denominated usage, goal, and deal projections."
    },
    {
      "name": "Verification",
      "description": "Read verification readiness without provider identifiers or evidence."
    },
    {
      "name": "Deployment",
      "description": "Inspect deployment state and submit reviewable deployment requests."
    },
    {
      "name": "Tools",
      "description": "Inspect executable Darwin tools. Generic execution requires owner credentials."
    },
    {
      "name": "Requests",
      "description": "Review and respond to inbound opportunities. Darwin keeps discovery and routing details behind the request."
    },
    {
      "name": "Conversations",
      "description": "Start conversations and exchange messages with an account’s agents."
    },
    {
      "name": "Goals",
      "description": "Create and manage the durable outcomes an agent pursues across buy, sell, and chat."
    },
    {
      "name": "Tasks",
      "description": "Deprecated compatibility API for executable work now represented by Goals."
    },
    {
      "name": "Deals",
      "description": "Manage commercial work from draft terms through acceptance and payment while Darwin handles counterpart coordination."
    },
    {
      "name": "Transactions",
      "description": "Reserve, inspect, cancel, and request refunds for marketplace funds without exposing provider credentials."
    },
    {
      "name": "Outcomes",
      "description": "Read Darwin-owned outcome projections and submit attributable verification evidence."
    },
    {
      "name": "Billing",
      "description": "Inspect the Agent Wallet, add funds, configure automatic top-ups, and manage eligible earned-fund payouts."
    },
    {
      "name": "Applications",
      "description": "Manage external applications, linked agents, service accounts, and wallets."
    },
    {
      "name": "Enrollment",
      "description": "Create pseudonymous, user-distributed enrollment links and asynchronous batches."
    },
    {
      "name": "Ephemeral Goals",
      "description": "Create application-funded goals without provisioning an end-user agent."
    },
    {
      "name": "Webhooks",
      "description": "Subscribe applications to signed, reviewed Darwin lifecycle events."
    },
    {
      "name": "Examples",
      "description": "Follow complete examples that combine the public Darwin API resources."
    }
  ],
  "security": [
    {
      "DeveloperBearer": []
    }
  ],
  "paths": {
    "/account": {
      "get": {
        "operationId": "getAccount",
        "tags": [
          "Account"
        ],
        "summary": "Get account",
        "x-mint": {
          "href": "/reference/account/get-the-account-and-agent-inventory",
          "metadata": {
            "title": "Get account",
            "sidebarTitle": "Get account"
          }
        },
        "description": "Requires a user API key.",
        "responses": {
          "200": {
            "description": "The authenticated account and its accessible agents.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/account/skills": {
      "get": {
        "operationId": "listSkillCatalog",
        "tags": [
          "Agents"
        ],
        "summary": "List available skills",
        "x-mint": {
          "href": "/reference/account/list-available-skills",
          "metadata": {
            "title": "List available skills",
            "sidebarTitle": "List available skills"
          }
        },
        "description": "Lists skills that can be assigned to a personal or business agent. Assigned skills are managed on the agent.",
        "responses": {
          "200": {
            "description": "The available agent skill catalog.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "skills"
                  ],
                  "properties": {
                    "skills": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AgentSkillCatalogEntry"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agents": {
      "get": {
        "operationId": "listAgents",
        "tags": [
          "Agents"
        ],
        "summary": "List agents",
        "x-mint": {
          "href": "/reference/agents/list-accessible-agents",
          "metadata": {
            "title": "List agents",
            "sidebarTitle": "List agents"
          }
        },
        "responses": {
          "200": {
            "description": "Accessible personal and business agents.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "agents"
                  ],
                  "properties": {
                    "agents": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Agent"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createAgent",
        "tags": [
          "Agents"
        ],
        "summary": "Create agent",
        "x-mint": {
          "href": "/reference/agents/create-a-business-agent",
          "metadata": {
            "title": "Create agent",
            "sidebarTitle": "Create agent"
          }
        },
        "description": "Every Darwin account already owns exactly one personal agent. This endpoint creates an additional business agent. A verified phone number may own up to three business agents.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAgentRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created business agent.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "agent"
                  ],
                  "properties": {
                    "agent": {
                      "$ref": "#/components/schemas/Agent"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agents/{agentId}": {
      "get": {
        "operationId": "getAgent",
        "tags": [
          "Agents"
        ],
        "summary": "Get an agent",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The requested agent.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "agent"
                  ],
                  "properties": {
                    "agent": {
                      "$ref": "#/components/schemas/Agent"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateAgent",
        "tags": [
          "Agents"
        ],
        "summary": "Update agent",
        "x-mint": {
          "href": "/reference/agents/update-an-agent-profile",
          "metadata": {
            "title": "Update agent",
            "sidebarTitle": "Update agent"
          }
        },
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAgentRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated agent.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "agent"
                  ],
                  "properties": {
                    "agent": {
                      "$ref": "#/components/schemas/Agent"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agents/{agentId}/reputation": {
      "get": {
        "operationId": "getAgentReputation",
        "tags": [
          "Reputation"
        ],
        "summary": "Get aggregate reputation",
        "description": "Returns a public tier and verified reliability metrics. Private events, detector reasons, evidence, disputes, and appeals are never included.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The agent reputation projection.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "reputation"
                  ],
                  "properties": {
                    "reputation": {
                      "$ref": "#/components/schemas/AgentReputation"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agents/{agentId}/permissions": {
      "get": {
        "operationId": "getAgentPermissions",
        "tags": [
          "Permissions"
        ],
        "summary": "Get agent permissions",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The effective visibility and access policies.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "permissions"
                  ],
                  "properties": {
                    "permissions": {
                      "$ref": "#/components/schemas/AgentPermissions"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agents/{agentId}/notifications": {
      "get": {
        "operationId": "getAgentNotifications",
        "tags": [
          "Notifications"
        ],
        "summary": "Get notification preferences",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sanitized notification preferences.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentNotifications"
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agents/{agentId}/usage": {
      "get": {
        "operationId": "getAgentUsage",
        "tags": [
          "Usage"
        ],
        "summary": "Get agent usage",
        "description": "Separates available and reserved balances. It does not expose provider billing identifiers.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The usage projection.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "usage"
                  ],
                  "properties": {
                    "usage": {
                      "$ref": "#/components/schemas/AgentUsage"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agents/{agentId}/verification": {
      "get": {
        "operationId": "getAgentVerification",
        "tags": [
          "Verification"
        ],
        "summary": "Get verification status",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sanitized identity and payment readiness.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "verification"
                  ],
                  "properties": {
                    "verification": {
                      "$ref": "#/components/schemas/AgentVerification"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agents/{agentId}/deployment": {
      "get": {
        "operationId": "getAgentDeployment",
        "tags": [
          "Deployment"
        ],
        "summary": "Get deployment status",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deployment state and eligible options.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "deployment"
                  ],
                  "properties": {
                    "deployment": {
                      "$ref": "#/components/schemas/AgentDeployment"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agents/{agentId}/deployment-requests": {
      "post": {
        "operationId": "createAgentDeploymentRequest",
        "tags": [
          "Deployment"
        ],
        "summary": "Request a deployment change",
        "description": "Owner credentials only. This creates a reviewable request and never mutates infrastructure directly.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "A caller-generated key, unique to this operation and payload.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAgentDeploymentRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The deployment request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "deploymentRequest"
                  ],
                  "properties": {
                    "deploymentRequest": {
                      "$ref": "#/components/schemas/AgentDeploymentRequest"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agents/{agentId}/integrations": {
      "get": {
        "operationId": "getAgentIntegrations",
        "tags": [
          "Integrations"
        ],
        "summary": "List integration capabilities",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The supported provider toolkits and honest connection states.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/IntegrationCatalog"
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agents/{agentId}/connections": {
      "get": {
        "operationId": "listAgentConnections",
        "tags": [
          "Connections"
        ],
        "summary": "List authorized connections",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sanitized external account and toolkit grant status.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "connections"
                  ],
                  "properties": {
                    "connections": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Connection"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agents/{agentId}/connections/authorization-sessions": {
      "post": {
        "operationId": "createConnectionAuthorizationSession",
        "tags": [
          "Connections"
        ],
        "summary": "Start connection authorization",
        "description": "Owner credentials only. Darwin hosts the provider OAuth flow and never returns provider credentials.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateConnectionAuthorizationRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The short-lived authorization session.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionAuthorizationSession"
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agents/{agentId}/connections/authorization-sessions/complete": {
      "post": {
        "operationId": "completeConnectionAuthorizationSession",
        "tags": [
          "Connections"
        ],
        "summary": "Complete connection authorization",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CompleteConnectionAuthorizationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The authorization completion status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionAuthorizationCompletion"
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agents/{agentId}/connections/{connectionId}/grants/{toolkit}": {
      "delete": {
        "operationId": "disableConnectionGrant",
        "tags": [
          "Connections"
        ],
        "summary": "Disable one toolkit in Darwin",
        "description": "Owner credentials only. This disables Darwin access without claiming the provider revoked one scope from a cumulative token.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "toolkit",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The toolkit was disabled locally.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionGrantDisableResult"
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agents/{agentId}/connections/{connectionId}": {
      "delete": {
        "operationId": "removeAgentConnection",
        "tags": [
          "Connections"
        ],
        "summary": "Remove a provider account",
        "description": "Owner credentials only. Local access is disabled immediately and provider token revocation is retried if necessary.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The account removal status.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionRemovalResult"
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agents/{agentId}/skills": {
      "get": {
        "operationId": "listAgentSkills",
        "tags": [
          "Skills"
        ],
        "summary": "List agent skills",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Versioned skills assigned to the agent.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "skills"
                  ],
                  "properties": {
                    "skills": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AgentSkill"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createAgentSkill",
        "tags": [
          "Skills"
        ],
        "summary": "Add an agent skill",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAgentSkillRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The added skill.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "skill"
                  ],
                  "properties": {
                    "skill": {
                      "$ref": "#/components/schemas/AgentSkill"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agents/{agentId}/skills/{skillId}": {
      "patch": {
        "operationId": "updateAgentSkill",
        "tags": [
          "Skills"
        ],
        "summary": "Update an agent skill",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "skillId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAgentSkillRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated skill.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "skill"
                  ],
                  "properties": {
                    "skill": {
                      "$ref": "#/components/schemas/AgentSkill"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteAgentSkill",
        "tags": [
          "Skills"
        ],
        "summary": "Remove an agent skill",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "skillId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The archived skill reference.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "skill"
                  ],
                  "properties": {
                    "skill": {
                      "$ref": "#/components/schemas/DeletedResource"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agents/{agentId}/assets": {
      "get": {
        "operationId": "listAgentAssets",
        "tags": [
          "Agents"
        ],
        "summary": "List agent assets",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Durable assets available to the agent.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "assets"
                  ],
                  "properties": {
                    "assets": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AgentAsset"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createAgentAsset",
        "tags": [
          "Agents"
        ],
        "summary": "Add a linked agent asset",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAgentAssetRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The added asset.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "asset"
                  ],
                  "properties": {
                    "asset": {
                      "$ref": "#/components/schemas/AgentAsset"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agents/{agentId}/assets/uploads": {
      "post": {
        "operationId": "beginAgentAssetUpload",
        "tags": [
          "Agents"
        ],
        "summary": "Begin an agent asset upload",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BeginAgentAssetUploadRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "An upload target and pending asset.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentAssetUpload"
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agents/{agentId}/assets/{assetId}/complete": {
      "post": {
        "operationId": "completeAgentAssetUpload",
        "tags": [
          "Agents"
        ],
        "summary": "Complete an agent asset upload",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "assetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The verified active asset.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "asset"
                  ],
                  "properties": {
                    "asset": {
                      "$ref": "#/components/schemas/AgentAsset"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agents/{agentId}/assets/{assetId}": {
      "patch": {
        "operationId": "updateAgentAsset",
        "tags": [
          "Agents"
        ],
        "summary": "Update an agent asset",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "assetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAgentAssetRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated asset.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "asset"
                  ],
                  "properties": {
                    "asset": {
                      "$ref": "#/components/schemas/AgentAsset"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "deleteAgentAsset",
        "tags": [
          "Agents"
        ],
        "summary": "Remove an agent asset",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "assetId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The archived asset reference.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "asset"
                  ],
                  "properties": {
                    "asset": {
                      "$ref": "#/components/schemas/DeletedResource"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agents/{agentId}/activity": {
      "get": {
        "operationId": "listAgentActivity",
        "tags": [
          "Agents"
        ],
        "summary": "List activity",
        "x-mint": {
          "href": "/reference/agents/list-agent-activity",
          "metadata": {
            "title": "List activity",
            "sidebarTitle": "List activity"
          }
        },
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A cursor-paginated activity page.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentActivityPage"
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agents/{agentId}/members": {
      "get": {
        "operationId": "listAgentMembers",
        "tags": [
          "Agents"
        ],
        "summary": "List members",
        "x-mint": {
          "href": "/reference/agents/list-business-agent-members",
          "metadata": {
            "title": "List members",
            "sidebarTitle": "List members"
          }
        },
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Members and roles for the agent.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "members"
                  ],
                  "properties": {
                    "members": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AgentMember"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agents/{agentId}/members/{membershipId}": {
      "patch": {
        "operationId": "updateAgentMember",
        "tags": [
          "Agents"
        ],
        "summary": "Update member",
        "x-mint": {
          "href": "/reference/agents/change-a-business-agent-member-role",
          "metadata": {
            "title": "Update member",
            "sidebarTitle": "Update member"
          }
        },
        "description": "Owner transfers remain an interactive Darwin-app workflow.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "membershipId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAgentMemberRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated member.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "member"
                  ],
                  "properties": {
                    "member": {
                      "$ref": "#/components/schemas/AgentMember"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "operationId": "removeAgentMember",
        "tags": [
          "Agents"
        ],
        "summary": "Remove member",
        "x-mint": {
          "href": "/reference/agents/remove-a-business-agent-member",
          "metadata": {
            "title": "Remove member",
            "sidebarTitle": "Remove member"
          }
        },
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "membershipId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The removed member.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "member"
                  ],
                  "properties": {
                    "member": {
                      "$ref": "#/components/schemas/AgentMember"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agents/{agentId}/invitations": {
      "get": {
        "operationId": "listAgentInvitations",
        "tags": [
          "Agents"
        ],
        "summary": "List invitations",
        "x-mint": {
          "href": "/reference/agents/list-pending-business-agent-invitations",
          "metadata": {
            "title": "List invitations",
            "sidebarTitle": "List invitations"
          }
        },
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pending invitations without private tokens.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "invitations"
                  ],
                  "properties": {
                    "invitations": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AgentInvitation"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createAgentInvitation",
        "tags": [
          "Agents"
        ],
        "summary": "Invite member",
        "x-mint": {
          "href": "/reference/agents/invite-a-business-agent-member",
          "metadata": {
            "title": "Invite member",
            "sidebarTitle": "Invite member"
          }
        },
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAgentInvitationRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The member invitation without its private token.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "invitation"
                  ],
                  "properties": {
                    "invitation": {
                      "$ref": "#/components/schemas/AgentInvitation"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agents/{agentId}/invitations/{invitationId}": {
      "delete": {
        "operationId": "revokeAgentInvitation",
        "tags": [
          "Agents"
        ],
        "summary": "Revoke invitation",
        "x-mint": {
          "href": "/reference/agents/revoke-a-pending-invitation",
          "metadata": {
            "title": "Revoke invitation",
            "sidebarTitle": "Revoke invitation"
          }
        },
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "invitationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The revoked invitation.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "invitation"
                  ],
                  "properties": {
                    "invitation": {
                      "$ref": "#/components/schemas/AgentInvitation"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agents/{agentId}/access-policies": {
      "get": {
        "operationId": "listAccessPolicies",
        "tags": [
          "Agents"
        ],
        "summary": "List access policies",
        "x-mint": {
          "href": "/reference/agents/list-active-access-policies",
          "metadata": {
            "title": "List access policies",
            "sidebarTitle": "List access policies"
          }
        },
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Versioned access policies owned by the agent.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "accessPolicies"
                  ],
                  "properties": {
                    "accessPolicies": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/AccessPolicy"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createAccessPolicy",
        "tags": [
          "Agents"
        ],
        "summary": "Create an access policy",
        "description": "Restricted policies support exact agents, verified business attributes, and geography. Sensitive-trait targeting is rejected.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAccessPolicyRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The compiled access policy.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "accessPolicy"
                  ],
                  "properties": {
                    "accessPolicy": {
                      "$ref": "#/components/schemas/AccessPolicy"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agents/{agentId}/access-policies/{policyId}": {
      "patch": {
        "operationId": "updateAccessPolicy",
        "tags": [
          "Agents"
        ],
        "summary": "Update access policy",
        "x-mint": {
          "href": "/reference/agents/create-a-new-policy-version",
          "metadata": {
            "title": "Update access policy",
            "sidebarTitle": "Update access policy"
          }
        },
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "policyId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateAccessPolicyRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The new active policy version.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "accessPolicy"
                  ],
                  "properties": {
                    "accessPolicy": {
                      "$ref": "#/components/schemas/AccessPolicy"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agents/{agentId}/billing": {
      "get": {
        "operationId": "getAgentBillingSummary",
        "tags": [
          "Billing"
        ],
        "summary": "Get Agent Wallet",
        "x-mint": {
          "href": "/reference/billing/get-agent-billing-summary",
          "metadata": {
            "title": "Get billing summary",
            "sidebarTitle": "Get billing summary"
          }
        },
        "description": "Returns deposited, promotional, reserved, pending, spendable, and withdrawable wallet balances together with money settings and available actions. Darwin prices agent work in USD per goal; subscriptions and Agent Credits are retired. Available only to user API keys with `payments:read`.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "description": "Agent whose billing account to inspect.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The agent billing summary.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentBillingSummary"
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agents/{agentId}/billing/activity": {
      "get": {
        "operationId": "listAgentBillingActivity",
        "tags": [
          "Billing"
        ],
        "summary": "List wallet activity",
        "x-mint": {
          "href": "/reference/billing/list-agent-billing-activity",
          "metadata": {
            "title": "List billing activity",
            "sidebarTitle": "List billing activity"
          }
        },
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "walletCursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 30
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Wallet ledger activity, including goal-level reservations, captures, releases, refunds, and payouts.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentBillingActivityPage"
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agents/{agentId}/billing/payment-method-setup": {
      "post": {
        "operationId": "createAgentPaymentMethodSetup",
        "tags": [
          "Billing"
        ],
        "summary": "Set up a payment method",
        "x-mint": {
          "href": "/reference/billing/set-up-payment-method",
          "metadata": {
            "title": "Set up payment method",
            "sidebarTitle": "Set up payment method"
          }
        },
        "description": "Creates a SetupIntent for an explicitly consented saved payment method. A saved method is required before automatic wallet top-ups can be enabled.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "A caller-generated key, unique to this operation and payload.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Client details for confirming the SetupIntent.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentIntentClientDetails"
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agents/{agentId}/billing/wallet-topups": {
      "post": {
        "operationId": "createAgentWalletTopup",
        "tags": [
          "Billing"
        ],
        "summary": "Top up Agent Wallet",
        "x-mint": {
          "href": "/reference/billing/top-up-agent-wallet",
          "metadata": {
            "title": "Top up Agent Wallet",
            "sidebarTitle": "Top up Agent Wallet"
          }
        },
        "description": "Creates a PaymentIntent that adds nonwithdrawable funded money to the Agent Wallet after payment succeeds. The response separates the wallet credit, processing cost, and card charge.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "A caller-generated key, unique to this operation and payload.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WalletTopupRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Client details for confirming the wallet top-up.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletTopupIntent"
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agents/{agentId}/billing/money-settings": {
      "patch": {
        "operationId": "updateAgentMoneySettings",
        "tags": [
          "Billing"
        ],
        "summary": "Update top-up and payout settings",
        "x-mint": {
          "href": "/reference/billing/update-money-settings",
          "metadata": {
            "title": "Update money settings",
            "sidebarTitle": "Update money settings"
          }
        },
        "description": "Configures optional wallet auto top-up and the earned-fund payout schedule. Auto top-up is disabled by default and requires a saved payment method.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMoneySettingsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated Product plan and money settings.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentBillingAccount"
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agents/{agentId}/billing/withdrawal-quotes": {
      "post": {
        "operationId": "quoteAgentWalletWithdrawal",
        "tags": [
          "Billing"
        ],
        "summary": "Quote earned-fund withdrawal",
        "x-mint": {
          "href": "/reference/billing/quote-wallet-withdrawal",
          "metadata": {
            "title": "Quote wallet withdrawal",
            "sidebarTitle": "Quote wallet withdrawal"
          }
        },
        "description": "Returns the exact provider cost and expected bank payout for a standard or instant withdrawal. Only settled earned funds are withdrawable.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WithdrawalRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The withdrawal quote.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WithdrawalQuote"
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agents/{agentId}/billing/withdrawals": {
      "post": {
        "operationId": "createAgentWalletWithdrawal",
        "tags": [
          "Billing"
        ],
        "summary": "Withdraw earned funds",
        "x-mint": {
          "href": "/reference/billing/withdraw-earned-funds",
          "metadata": {
            "title": "Withdraw earned funds",
            "sidebarTitle": "Withdraw earned funds"
          }
        },
        "description": "Withdraws settled earned funds using the selected payout speed. Promotional and card-funded wallet money cannot be withdrawn.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "A caller-generated key, unique to this operation and payload.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/WithdrawalRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The submitted or existing idempotent withdrawal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WalletWithdrawal"
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agents/{agentId}/billing/payout-method-setup": {
      "post": {
        "operationId": "createAgentPayoutMethodSetup",
        "tags": [
          "Billing"
        ],
        "summary": "Set up seller payouts",
        "x-mint": {
          "href": "/reference/billing/set-up-seller-payouts",
          "metadata": {
            "title": "Set up seller payouts",
            "sidebarTitle": "Set up seller payouts"
          }
        },
        "description": "Creates a hosted onboarding link that securely collects the information required to receive and withdraw earned marketplace proceeds.",
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "A hosted payout onboarding URL.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PayoutSetup"
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agent/conversation": {
      "get": {
        "operationId": "getSelectedAgentConversation",
        "tags": [
          "Conversations"
        ],
        "summary": "Get active conversation",
        "x-mint": {
          "href": "/reference/conversations/get-the-selected-or-explicit-agent-conversation",
          "metadata": {
            "title": "Get active conversation",
            "sidebarTitle": "Get active conversation"
          }
        },
        "parameters": [
          {
            "name": "agentId",
            "in": "query",
            "description": "Optional explicit agent scope. When omitted, Darwin uses the caller’s selected agent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The selected conversation and a message page.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationPage"
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/requests": {
      "get": {
        "operationId": "listRequests",
        "tags": [
          "Requests"
        ],
        "summary": "List requests",
        "x-mint": {
          "href": "/reference/requests/list-inbound-requests",
          "metadata": {
            "title": "List requests",
            "sidebarTitle": "List requests"
          }
        },
        "description": "Returns sanitized inbound requests for the selected agent without counterpart routing or infrastructure identifiers.",
        "parameters": [
          {
            "name": "agentId",
            "in": "query",
            "description": "Optional explicit agent scope. When omitted, Darwin uses the caller’s selected agent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Pending inbound requests.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "requests"
                  ],
                  "properties": {
                    "requests": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Request"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/requests/{requestId}/actions": {
      "post": {
        "operationId": "actOnRequest",
        "tags": [
          "Requests"
        ],
        "summary": "Accept or decline request",
        "x-mint": {
          "href": "/reference/requests/accept-or-decline-a-request",
          "metadata": {
            "title": "Respond to request",
            "sidebarTitle": "Respond to request"
          }
        },
        "parameters": [
          {
            "name": "requestId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "A caller-generated key, unique to this operation and payload.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RequestActionRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The updated request.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "request"
                  ],
                  "properties": {
                    "request": {
                      "$ref": "#/components/schemas/Request"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agent/messages": {
      "post": {
        "operationId": "createMessage",
        "tags": [
          "Conversations"
        ],
        "summary": "Send message",
        "x-mint": {
          "href": "/reference/conversations/send-an-account-level-message",
          "metadata": {
            "title": "Send message",
            "sidebarTitle": "Send message"
          }
        },
        "description": "When agentId is omitted, Darwin infers the intended accessible agent from natural language and current context.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAgentMessageRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The completed or clarified agent turn.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationTurn"
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/agents/{agentId}/conversations": {
      "get": {
        "operationId": "listAgentConversations",
        "tags": [
          "Conversations"
        ],
        "summary": "List conversations",
        "x-mint": {
          "href": "/reference/conversations/list-conversations-for-an-agent",
          "metadata": {
            "title": "List conversations",
            "sidebarTitle": "List conversations"
          }
        },
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Agent-scoped conversations.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "conversations"
                  ],
                  "properties": {
                    "conversations": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/ConversationSummary"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createAgentConversation",
        "tags": [
          "Conversations"
        ],
        "summary": "Start conversation",
        "x-mint": {
          "href": "/reference/conversations/get-or-create-the-canonical-agent-conversation",
          "metadata": {
            "title": "Start conversation",
            "sidebarTitle": "Start conversation"
          }
        },
        "parameters": [
          {
            "name": "agentId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "The canonical isolated conversation.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationPage"
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/conversations/{conversationId}": {
      "get": {
        "operationId": "getConversation",
        "tags": [
          "Conversations"
        ],
        "summary": "Get conversation",
        "x-mint": {
          "href": "/reference/conversations/get-a-conversation-and-messages",
          "metadata": {
            "title": "Get conversation",
            "sidebarTitle": "Get conversation"
          }
        },
        "parameters": [
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The conversation and a message page.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationPage"
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/conversations/{conversationId}/messages": {
      "post": {
        "operationId": "createConversationMessage",
        "tags": [
          "Conversations"
        ],
        "summary": "Send conversation message",
        "x-mint": {
          "href": "/reference/conversations/send-a-message-in-an-explicit-conversation",
          "metadata": {
            "title": "Send conversation message",
            "sidebarTitle": "Send conversation message"
          }
        },
        "parameters": [
          {
            "name": "conversationId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateConversationMessageRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The completed agent turn.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConversationTurn"
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tools": {
      "get": {
        "operationId": "listTools",
        "tags": [
          "Tools"
        ],
        "summary": "List tools",
        "x-mint": {
          "href": "/reference/tools/list-available-tools",
          "metadata": {
            "title": "List tools",
            "sidebarTitle": "List tools"
          }
        },
        "responses": {
          "200": {
            "description": "The reviewed public tool catalog.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "tools"
                  ],
                  "properties": {
                    "tools": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Tool"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tools/{tool}/executions": {
      "post": {
        "operationId": "executeTool",
        "tags": [
          "Tools"
        ],
        "summary": "Run tool",
        "x-mint": {
          "href": "/reference/tools/run-an-owner-scoped-tool",
          "metadata": {
            "title": "Run tool",
            "sidebarTitle": "Run tool"
          }
        },
        "description": "User API keys only. Sensitive actions may return an approval request.",
        "parameters": [
          {
            "name": "tool",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExecuteToolRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "A sanitized tool result or required next step.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ToolExecution"
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tasks": {
      "get": {
        "operationId": "listTasks",
        "deprecated": true,
        "tags": [
          "Tasks"
        ],
        "summary": "List tasks",
        "description": "Deprecated compatibility alias. Use `GET /goals`.",
        "parameters": [
          {
            "name": "agentId",
            "in": "query",
            "description": "Optional explicit agent scope. When omitted, Darwin uses the caller’s selected agent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "mode",
            "in": "query",
            "description": "Filter tasks by the user-facing workflow mode.",
            "schema": {
              "$ref": "#/components/schemas/WorkMode"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Tasks for the selected agent.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "tasks"
                  ],
                  "properties": {
                    "tasks": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Task"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createTask",
        "deprecated": true,
        "tags": [
          "Tasks"
        ],
        "summary": "Create task",
        "description": "Deprecated compatibility alias. Use `POST /goals`.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateTaskRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new task.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "task"
                  ],
                  "properties": {
                    "task": {
                      "$ref": "#/components/schemas/Task"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tasks/{id}": {
      "get": {
        "operationId": "getTask",
        "deprecated": true,
        "tags": [
          "Tasks"
        ],
        "summary": "Get a task",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agentId",
            "in": "query",
            "description": "Optional explicit agent scope. When omitted, Darwin uses the caller’s selected agent.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The requested task.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "task"
                  ],
                  "properties": {
                    "task": {
                      "$ref": "#/components/schemas/Task"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateTask",
        "deprecated": true,
        "tags": [
          "Tasks"
        ],
        "summary": "Update task",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateTaskRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated task.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "task"
                  ],
                  "properties": {
                    "task": {
                      "$ref": "#/components/schemas/Task"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tasks/{id}/actions": {
      "post": {
        "operationId": "actOnTask",
        "deprecated": true,
        "tags": [
          "Tasks"
        ],
        "summary": "Change task status",
        "description": "Deprecated compatibility alias for the goal lifecycle. Use `POST /goals/{id}/actions`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TaskActionRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The transitioned task.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "task"
                  ],
                  "properties": {
                    "task": {
                      "$ref": "#/components/schemas/Task"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tasks/{id}/publication-approvals": {
      "post": {
        "operationId": "requestTaskPublicationApproval",
        "deprecated": true,
        "tags": [
          "Tasks"
        ],
        "summary": "Publish task",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicationRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The idempotent publication approval request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApprovalResult"
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/tasks/{id}/publication-requests": {
      "post": {
        "operationId": "requestTaskPublication",
        "deprecated": true,
        "tags": [
          "Tasks"
        ],
        "summary": "Request task publication",
        "description": "Deprecated compatibility alias. Use `POST /goals/{id}/publication-requests`.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicationRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The idempotent publication request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicationRequestResult"
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/goals": {
      "get": {
        "operationId": "listGoals",
        "tags": [
          "Goals"
        ],
        "summary": "List goals",
        "x-mint": {
          "href": "/reference/goals/list-goals-for-an-agent",
          "metadata": {
            "title": "List goals",
            "sidebarTitle": "List goals"
          }
        },
        "parameters": [
          {
            "name": "agentId",
            "in": "query",
            "description": "Optional explicit agent scope. When omitted, Darwin uses the caller’s selected agent.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "mode",
            "in": "query",
            "description": "Filter tasks by the user-facing workflow mode.",
            "schema": {
              "$ref": "#/components/schemas/WorkMode"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Goals for the selected agent.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "goals"
                  ],
                  "properties": {
                    "goals": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Goal"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createGoal",
        "tags": [
          "Goals"
        ],
        "summary": "Create goal",
        "x-mint": {
          "href": "/reference/goals/create-a-demand-supply-or-chat-goal",
          "metadata": {
            "title": "Create goal",
            "sidebarTitle": "Create goal"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateGoalRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new goal.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "goal"
                  ],
                  "properties": {
                    "goal": {
                      "$ref": "#/components/schemas/Goal"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/goals/{id}": {
      "get": {
        "operationId": "getGoal",
        "tags": [
          "Goals"
        ],
        "summary": "Get a goal",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agentId",
            "in": "query",
            "description": "Optional explicit agent scope. When omitted, Darwin uses the caller’s selected agent.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The requested goal.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "goal"
                  ],
                  "properties": {
                    "goal": {
                      "$ref": "#/components/schemas/Goal"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateGoal",
        "tags": [
          "Goals"
        ],
        "summary": "Update goal",
        "x-mint": {
          "href": "/reference/goals/update-goal-details-or-policy",
          "metadata": {
            "title": "Update goal",
            "sidebarTitle": "Update goal"
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateGoalRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated goal.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "goal"
                  ],
                  "properties": {
                    "goal": {
                      "$ref": "#/components/schemas/Goal"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/goals/{id}/actions": {
      "post": {
        "operationId": "actOnGoal",
        "tags": [
          "Goals"
        ],
        "summary": "Change goal status",
        "x-mint": {
          "href": "/reference/goals/pause-resume-complete-or-archive-a-goal",
          "metadata": {
            "title": "Change goal status",
            "sidebarTitle": "Change goal status"
          }
        },
        "description": "Draft goals can activate; active goals can pause or complete; paused goals can resume or complete; completed goals can archive. Completion is blocked while negotiations, transactions, or recurring agreements remain active.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GoalActionRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The transitioned goal.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "goal"
                  ],
                  "properties": {
                    "goal": {
                      "$ref": "#/components/schemas/Goal"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/goals/{id}/publication-requests": {
      "post": {
        "operationId": "requestGoalPublication",
        "tags": [
          "Goals"
        ],
        "summary": "Request goal publication",
        "x-mint": {
          "href": "/reference/goals/request-goal-publication",
          "metadata": {
            "title": "Request goal publication",
            "sidebarTitle": "Request goal publication"
          }
        },
        "description": "Creates an actionable request to publish a private goal. Darwin does not publish the goal until the account resolves the request.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicationRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The idempotent publication request.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicationRequestResult"
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deals": {
      "get": {
        "operationId": "listDeals",
        "tags": [
          "Deals"
        ],
        "summary": "List deals",
        "x-mint": {
          "href": "/reference/deals/list-deals",
          "metadata": {
            "title": "List deals",
            "sidebarTitle": "List deals"
          }
        },
        "description": "Returns the commercial work owned by the selected agent. Darwin handles counterpart discovery and coordination behind the scenes.",
        "parameters": [
          {
            "name": "agentId",
            "in": "query",
            "description": "Optional explicit agent scope. When omitted, Darwin uses the caller’s selected agent.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deals for the selected agent.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "deals"
                  ],
                  "properties": {
                    "deals": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Deal"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "operationId": "createDeal",
        "tags": [
          "Deals"
        ],
        "summary": "Create deal",
        "x-mint": {
          "href": "/reference/deals/create-a-deal",
          "metadata": {
            "title": "Create deal",
            "sidebarTitle": "Create deal"
          }
        },
        "description": "Creates a private draft for terms, counterparty context, payment, and delivery. Darwin coordinates the required work on the agent’s behalf.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateDealRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The new deal.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "deal"
                  ],
                  "properties": {
                    "deal": {
                      "$ref": "#/components/schemas/Deal"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{dealId}": {
      "get": {
        "operationId": "getDeal",
        "tags": [
          "Deals"
        ],
        "summary": "Get a deal",
        "parameters": [
          {
            "name": "dealId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The requested deal.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "deal"
                  ],
                  "properties": {
                    "deal": {
                      "$ref": "#/components/schemas/Deal"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "patch": {
        "operationId": "updateDeal",
        "tags": [
          "Deals"
        ],
        "summary": "Update deal",
        "x-mint": {
          "href": "/reference/deals/update-a-draft-deal",
          "metadata": {
            "title": "Update deal",
            "sidebarTitle": "Update deal"
          }
        },
        "description": "Only a draft deal can be edited directly.",
        "parameters": [
          {
            "name": "dealId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateDealRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated deal.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "deal"
                  ],
                  "properties": {
                    "deal": {
                      "$ref": "#/components/schemas/Deal"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{dealId}/actions": {
      "post": {
        "operationId": "actOnDeal",
        "tags": [
          "Deals"
        ],
        "summary": "Change deal status",
        "x-mint": {
          "href": "/reference/deals/send-accept-reject-or-withdraw-a-deal",
          "metadata": {
            "title": "Change deal status",
            "sidebarTitle": "Change deal status"
          }
        },
        "parameters": [
          {
            "name": "dealId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DealActionRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The updated deal.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "deal"
                  ],
                  "properties": {
                    "deal": {
                      "$ref": "#/components/schemas/Deal"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{dealId}/payments": {
      "get": {
        "operationId": "listDealPayments",
        "tags": [
          "Deals"
        ],
        "summary": "List deal payments",
        "x-mint": {
          "href": "/reference/deals/list-deal-payments",
          "metadata": {
            "title": "List deal payments",
            "sidebarTitle": "List deal payments"
          }
        },
        "parameters": [
          {
            "name": "dealId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Sanitized payment state for the deal.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "payments"
                  ],
                  "properties": {
                    "payments": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Payment"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/deals/{dealId}/transactions": {
      "post": {
        "operationId": "createDealTransaction",
        "tags": [
          "Transactions"
        ],
        "summary": "Reserve funds for an accepted deal",
        "description": "Creates an idempotent reservation for the accepted maximum cap. Performance settlement releases any unused amount.",
        "parameters": [
          {
            "name": "dealId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "A caller-generated key, unique to this operation and payload.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "201": {
            "description": "The reservation or exact funding requirement.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TransactionFundingResult"
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/transactions": {
      "get": {
        "operationId": "listTransactions",
        "tags": [
          "Transactions"
        ],
        "summary": "List transactions",
        "parameters": [
          {
            "name": "agentId",
            "in": "query",
            "description": "Optional explicit agent scope. When omitted, Darwin uses the caller’s selected agent.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Transactions visible to the selected agent.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "transactions"
                  ],
                  "properties": {
                    "transactions": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Transaction"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/transactions/{transactionId}": {
      "get": {
        "operationId": "getTransaction",
        "tags": [
          "Transactions"
        ],
        "summary": "Get a transaction",
        "parameters": [
          {
            "name": "transactionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agentId",
            "in": "query",
            "description": "Optional explicit agent scope. When omitted, Darwin uses the caller’s selected agent.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The requested transaction.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "transaction"
                  ],
                  "properties": {
                    "transaction": {
                      "$ref": "#/components/schemas/Transaction"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/transactions/{transactionId}/actions": {
      "post": {
        "operationId": "actOnTransaction",
        "tags": [
          "Transactions"
        ],
        "summary": "Cancel a transaction or request a refund",
        "description": "Owner credentials only. Refund requests require an Idempotency-Key header.",
        "parameters": [
          {
            "name": "transactionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "A caller-generated key, unique to this operation and payload.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/TransactionActionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated transaction.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "transaction"
                  ],
                  "properties": {
                    "transaction": {
                      "$ref": "#/components/schemas/Transaction"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/outcomes": {
      "get": {
        "operationId": "listOutcomes",
        "tags": [
          "Outcomes"
        ],
        "summary": "List canonical outcomes",
        "parameters": [
          {
            "name": "agentId",
            "in": "query",
            "description": "Optional explicit agent scope. When omitted, Darwin uses the caller’s selected agent.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Darwin-owned outcomes for the selected agent.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "outcomes"
                  ],
                  "properties": {
                    "outcomes": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Outcome"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/outcomes/{outcomeId}": {
      "get": {
        "operationId": "getOutcome",
        "tags": [
          "Outcomes"
        ],
        "summary": "Get a canonical outcome",
        "parameters": [
          {
            "name": "outcomeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The requested outcome.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "outcome"
                  ],
                  "properties": {
                    "outcome": {
                      "$ref": "#/components/schemas/Outcome"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/outcomes/{outcomeId}/evidence": {
      "post": {
        "operationId": "submitOutcomeEvidence",
        "tags": [
          "Outcomes"
        ],
        "summary": "Submit outcome evidence",
        "description": "Adds idempotent, attributable evidence for verification. This operation never lets the caller assert or overwrite the canonical outcome.",
        "parameters": [
          {
            "name": "outcomeId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "description": "A caller-generated key, unique to this operation and payload.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SubmitOutcomeEvidenceRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The submitted evidence record.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "evidence"
                  ],
                  "properties": {
                    "evidence": {
                      "$ref": "#/components/schemas/OutcomeEvidence"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/integrations": {
      "get": {
        "operationId": "getIntegrations",
        "tags": [
          "Integrations"
        ],
        "summary": "Get integrations",
        "x-mint": {
          "href": "/reference/integrations/get-integrations-and-skills",
          "metadata": {
            "title": "Get integrations",
            "sidebarTitle": "Get integrations"
          }
        },
        "description": "User API keys only.",
        "responses": {
          "200": {
            "description": "Integration catalog, connections, and personal skills.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Integrations"
                }
              }
            }
          },
          "400": {
            "description": "The request was invalid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "The bearer key is missing, invalid, expired, or revoked.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The principal does not have the required scope or resource access.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "The resource was not found for this principal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "DeveloperBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Darwin API key",
        "description": "Darwin API keys begin with `darwin_` and are created in Developer settings."
      }
    },
    "schemas": {
      "AutoTopupSettings": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "enabled",
          "thresholdMinor",
          "amountMinor"
        ],
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "thresholdMinor": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "amountMinor": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 100
          }
        }
      },
      "AgentBillingAccount": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "autoTopup",
          "payoutSchedule"
        ],
        "properties": {
          "autoTopup": {
            "$ref": "#/components/schemas/AutoTopupSettings"
          },
          "payoutSchedule": {
            "type": "string",
            "enum": [
              "manual",
              "weekly",
              "monthly"
            ]
          }
        }
      },
      "AgentWalletBalance": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "promotional",
          "funded",
          "earned",
          "pendingEarned",
          "reserved",
          "earnedDeficit",
          "spendable",
          "withdrawable"
        ],
        "properties": {
          "promotional": {
            "type": "integer",
            "minimum": 0,
            "description": "Darwin-issued wallet money. Spendable and nonwithdrawable."
          },
          "funded": {
            "type": "integer",
            "minimum": 0,
            "description": "Card-funded wallet money. Spendable and nonwithdrawable."
          },
          "earned": {
            "type": "integer",
            "minimum": 0,
            "description": "Settled seller proceeds that can be spent or withdrawn."
          },
          "pendingEarned": {
            "type": "integer",
            "minimum": 0,
            "description": "Seller proceeds awaiting settlement."
          },
          "reserved": {
            "type": "integer",
            "minimum": 0,
            "description": "Funds held for approved work."
          },
          "earnedDeficit": {
            "type": "integer",
            "minimum": 0
          },
          "spendable": {
            "type": "integer",
            "minimum": 0
          },
          "withdrawable": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "FeeRate": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "variableBps",
          "fixedMinor"
        ],
        "properties": {
          "variableBps": {
            "type": "integer",
            "minimum": 0
          },
          "fixedMinor": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "AgentBillingSummary": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "currency",
          "account",
          "wallet",
          "actions",
          "feePolicy"
        ],
        "properties": {
          "currency": {
            "type": "string",
            "enum": [
              "usd"
            ]
          },
          "account": {
            "$ref": "#/components/schemas/AgentBillingAccount"
          },
          "wallet": {
            "$ref": "#/components/schemas/AgentWalletBalance"
          },
          "actions": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "canWithdraw",
              "hasPaymentMethod",
              "payoutReady"
            ],
            "properties": {
              "canWithdraw": {
                "type": "boolean"
              },
              "hasPaymentMethod": {
                "type": "boolean"
              },
              "payoutReady": {
                "type": "boolean"
              }
            }
          },
          "feePolicy": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "standardPayout",
              "instantPayout",
              "instantPayoutIncludesStandardConnectCost"
            ],
            "properties": {
              "standardPayout": {
                "$ref": "#/components/schemas/FeeRate"
              },
              "instantPayout": {
                "$ref": "#/components/schemas/FeeRate"
              },
              "instantPayoutIncludesStandardConnectCost": {
                "type": "boolean"
              }
            }
          }
        }
      },
      "AgentBillingActivityPage": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "wallet",
          "nextCursor"
        ],
        "properties": {
          "wallet": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "id",
                "kind",
                "availableDeltaMinor",
                "reservedDeltaMinor",
                "currency",
                "createdAt"
              ],
              "properties": {
                "id": {
                  "type": "string"
                },
                "kind": {
                  "type": "string"
                },
                "availableDeltaMinor": {
                  "type": "integer"
                },
                "reservedDeltaMinor": {
                  "type": "integer"
                },
                "currency": {
                  "type": "string"
                },
                "createdAt": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            }
          },
          "nextCursor": {
            "type": "object",
            "additionalProperties": false,
            "required": [
              "wallet"
            ],
            "properties": {
              "wallet": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        }
      },
      "PaymentIntentClientDetails": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "clientSecret",
          "publishableKey"
        ],
        "properties": {
          "clientSecret": {
            "type": [
              "string",
              "null"
            ]
          },
          "publishableKey": {
            "type": "string"
          }
        }
      },
      "WalletTopupIntent": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "clientSecret",
          "publishableKey",
          "amountMinor",
          "walletCreditAmountMinor",
          "currency"
        ],
        "properties": {
          "clientSecret": {
            "type": [
              "string",
              "null"
            ]
          },
          "publishableKey": {
            "type": "string"
          },
          "amountMinor": {
            "type": "integer",
            "minimum": 100
          },
          "walletCreditAmountMinor": {
            "type": "integer",
            "minimum": 100
          },
          "currency": {
            "type": "string",
            "enum": [
              "usd"
            ]
          }
        }
      },
      "WithdrawalQuote": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "speed",
          "withdrawalAmountMinor",
          "providerFeeMinor",
          "payoutAmountMinor",
          "rate",
          "currency"
        ],
        "properties": {
          "speed": {
            "type": "string",
            "enum": [
              "STANDARD",
              "INSTANT"
            ]
          },
          "withdrawalAmountMinor": {
            "type": "integer",
            "minimum": 1
          },
          "providerFeeMinor": {
            "type": "integer",
            "minimum": 0
          },
          "payoutAmountMinor": {
            "type": "integer",
            "minimum": 0
          },
          "rate": {
            "$ref": "#/components/schemas/FeeRate"
          },
          "currency": {
            "type": "string",
            "enum": [
              "usd"
            ]
          }
        }
      },
      "WalletWithdrawal": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "status"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "submitted",
              "completed",
              "failed",
              "reversed"
            ]
          },
          "withdrawalAmountMinor": {
            "type": "integer",
            "minimum": 1
          },
          "providerFeeMinor": {
            "type": "integer",
            "minimum": 0
          },
          "payoutAmountMinor": {
            "type": "integer",
            "minimum": 0
          },
          "speed": {
            "type": "string",
            "enum": [
              "standard",
              "instant"
            ]
          },
          "failureCode": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "PayoutSetup": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "url"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          }
        }
      },
      "WalletTopupRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "amountMinor"
        ],
        "properties": {
          "amountMinor": {
            "type": "integer",
            "minimum": 100,
            "maximum": 1000000,
            "description": "Wallet amount to credit, in USD cents. The returned card charge includes processing costs."
          }
        }
      },
      "UpdateMoneySettingsRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "autoTopupEnabled": {
            "type": "boolean"
          },
          "autoTopupThresholdMinor": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "maximum": 1000000
          },
          "autoTopupAmountMinor": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 100,
            "maximum": 1000000
          },
          "payoutSchedule": {
            "type": "string",
            "enum": [
              "manual",
              "monthly"
            ]
          }
        }
      },
      "WithdrawalRequest": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "amountMinor"
        ],
        "properties": {
          "amountMinor": {
            "type": "integer",
            "minimum": 1
          },
          "speed": {
            "type": "string",
            "enum": [
              "standard",
              "instant"
            ],
            "default": "standard"
          }
        }
      },
      "Agent": {
        "type": "object",
        "required": [
          "id",
          "type",
          "name",
          "visibility",
          "status"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "personal",
              "business"
            ]
          },
          "name": {
            "type": "string"
          },
          "handle": {
            "type": [
              "string",
              "null"
            ]
          },
          "avatarUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "links": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "location": {
            "type": "object",
            "additionalProperties": true
          },
          "organization": {
            "type": "object",
            "additionalProperties": true
          },
          "visibility": {
            "$ref": "#/components/schemas/Visibility"
          },
          "accessPolicyId": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string"
          },
          "profile": {
            "type": "object",
            "additionalProperties": true
          },
          "role": {
            "type": [
              "string",
              "null"
            ],
            "enum": [
              "owner",
              "admin",
              "member"
            ]
          }
        }
      },
      "AgentSkill": {
        "type": "object",
        "required": [
          "id",
          "agentId",
          "name",
          "category",
          "source",
          "visibility",
          "status",
          "enabled",
          "executable",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "agentId": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": [
              "string",
              "null"
            ]
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "category": {
            "type": "string",
            "enum": [
              "ai",
              "human",
              "hybrid"
            ]
          },
          "source": {
            "type": "string"
          },
          "visibility": {
            "type": "string",
            "enum": [
              "PRIVATE",
              "PUBLIC"
            ]
          },
          "status": {
            "type": "string"
          },
          "enabled": {
            "type": "boolean"
          },
          "executable": {
            "type": "boolean"
          },
          "enabledActions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "instructions": {
            "type": "string"
          },
          "version": {
            "type": [
              "integer",
              "null"
            ]
          },
          "versionId": {
            "type": [
              "string",
              "null"
            ]
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AgentSkillCatalogEntry": {
        "type": "object",
        "required": [
          "id",
          "name",
          "description",
          "category",
          "context",
          "recommendedFor"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "category": {
            "type": "string",
            "enum": [
              "ai",
              "human",
              "hybrid"
            ]
          },
          "context": {
            "type": "string",
            "enum": [
              "demand",
              "supply",
              "both"
            ]
          },
          "recommendedFor": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "personal",
                "business"
              ]
            }
          }
        }
      },
      "AgentAsset": {
        "type": "object",
        "required": [
          "id",
          "agentId",
          "title",
          "kind",
          "visibility",
          "status",
          "metadata",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "agentId": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "kind": {
            "type": "string",
            "enum": [
              "image",
              "video",
              "audio",
              "document",
              "data",
              "link",
              "other"
            ]
          },
          "mimeType": {
            "type": [
              "string",
              "null"
            ]
          },
          "byteSize": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "url": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "previewUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "visibility": {
            "type": "string",
            "enum": [
              "PRIVATE",
              "PUBLIC"
            ]
          },
          "status": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AgentAssetUpload": {
        "type": "object",
        "required": [
          "asset",
          "upload"
        ],
        "additionalProperties": false,
        "properties": {
          "asset": {
            "$ref": "#/components/schemas/AgentAsset"
          },
          "upload": {
            "type": "object",
            "required": [
              "url",
              "method",
              "headers",
              "expiresInSeconds"
            ],
            "additionalProperties": false,
            "properties": {
              "url": {
                "type": "string",
                "format": "uri"
              },
              "method": {
                "type": "string",
                "enum": [
                  "PUT"
                ]
              },
              "headers": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                }
              },
              "expiresInSeconds": {
                "type": "integer",
                "minimum": 1
              }
            }
          }
        }
      },
      "DeletedResource": {
        "type": "object",
        "required": [
          "id",
          "status"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "archived"
            ]
          }
        }
      },
      "Account": {
        "type": "object",
        "required": [
          "id",
          "email",
          "agents",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "image": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "timeZone": {
            "type": [
              "string",
              "null"
            ]
          },
          "agents": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Agent"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ConversationSummary": {
        "type": "object",
        "required": [
          "id",
          "agentId",
          "mode",
          "type",
          "title",
          "messageCount",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "agentId": {
            "type": [
              "string",
              "null"
            ]
          },
          "mode": {
            "type": "string",
            "const": "CHAT"
          },
          "type": {
            "type": "string",
            "const": "CHAT",
            "deprecated": true
          },
          "title": {
            "type": "string"
          },
          "messageCount": {
            "type": "integer",
            "minimum": 0
          },
          "lastMessageAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ConversationMessage": {
        "type": "object",
        "required": [
          "id",
          "conversationId",
          "role",
          "content",
          "sequence",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "conversationId": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "user",
              "assistant"
            ]
          },
          "content": {
            "type": "string"
          },
          "sequence": {
            "type": "integer",
            "minimum": 0
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ConversationPage": {
        "type": "object",
        "required": [
          "conversation",
          "messages",
          "nextCursor"
        ],
        "properties": {
          "conversation": {
            "$ref": "#/components/schemas/ConversationSummary"
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConversationMessage"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "ConversationTurn": {
        "type": "object",
        "required": [
          "conversation",
          "messages"
        ],
        "properties": {
          "conversation": {
            "$ref": "#/components/schemas/ConversationSummary"
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ConversationMessage"
            }
          }
        }
      },
      "Tool": {
        "type": "object",
        "required": [
          "name",
          "title",
          "category",
          "description",
          "risk",
          "inputSchema"
        ],
        "properties": {
          "name": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "category": {
            "type": "string",
            "enum": [
              "agents",
              "goals",
              "inbox",
              "network",
              "work",
              "routines",
              "connections",
              "payments",
              "email",
              "calendar",
              "knowledge"
            ]
          },
          "description": {
            "type": "string"
          },
          "risk": {
            "type": "string",
            "enum": [
              "read",
              "write",
              "approval_required"
            ]
          },
          "inputSchema": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "ToolExecution": {
        "type": "object",
        "required": [
          "tool",
          "result",
          "traceId"
        ],
        "properties": {
          "tool": {
            "type": "string"
          },
          "result": {
            "type": "object",
            "additionalProperties": true
          },
          "traceId": {
            "type": "string"
          }
        }
      },
      "AgentActivity": {
        "type": "object",
        "required": [
          "id",
          "kind",
          "summary",
          "status",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "kind": {
            "type": "string"
          },
          "summary": {
            "type": "string"
          },
          "entityType": {
            "type": [
              "string",
              "null"
            ]
          },
          "entityId": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          },
          "traceId": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AgentActivityPage": {
        "type": "object",
        "required": [
          "events",
          "nextCursor"
        ],
        "properties": {
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentActivity"
            }
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          }
        }
      },
      "AgentMember": {
        "type": "object",
        "required": [
          "id",
          "role",
          "status",
          "user"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "role": {
            "type": "string",
            "enum": [
              "owner",
              "admin",
              "member"
            ]
          },
          "status": {
            "type": "string"
          },
          "actionGrants": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "user": {
            "type": "object",
            "required": [
              "id",
              "email"
            ],
            "properties": {
              "id": {
                "type": "string"
              },
              "name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "email": {
                "type": "string",
                "format": "email"
              },
              "image": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uri"
              }
            }
          }
        }
      },
      "AgentInvitation": {
        "type": "object",
        "required": [
          "id",
          "status"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email"
          },
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "member"
            ]
          },
          "status": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AccessPolicy": {
        "type": "object",
        "required": [
          "id",
          "ownerAgentIdentityId",
          "name",
          "visibility",
          "rules",
          "compiledRules",
          "version",
          "status",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "ownerAgentIdentityId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "visibility": {
            "$ref": "#/components/schemas/Visibility"
          },
          "naturalLanguage": {
            "type": [
              "string",
              "null"
            ]
          },
          "rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccessPolicyRule"
            }
          },
          "compiledRules": {
            "type": "object",
            "additionalProperties": true
          },
          "version": {
            "type": "integer",
            "minimum": 1
          },
          "previousVersionId": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "ACTIVE",
              "SUPERSEDED"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Approval": {
        "type": "object",
        "required": [
          "id",
          "agentId",
          "goalId",
          "type",
          "subjectType",
          "subjectId",
          "status",
          "payload",
          "policySnapshot",
          "traceId",
          "expiresAt",
          "decidedAt",
          "decisionReason",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "agentId": {
            "type": [
              "string",
              "null"
            ]
          },
          "goalId": {
            "type": [
              "string",
              "null"
            ]
          },
          "type": {
            "type": "string"
          },
          "subjectType": {
            "type": "string"
          },
          "subjectId": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "PENDING",
              "APPROVED",
              "REJECTED",
              "EXPIRED"
            ]
          },
          "payload": {
            "type": "object",
            "additionalProperties": true
          },
          "policySnapshot": {
            "type": "object",
            "additionalProperties": true
          },
          "traceId": {
            "type": [
              "string",
              "null"
            ]
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "decidedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "decisionReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ApprovalResult": {
        "type": "object",
        "required": [
          "approval",
          "traceId"
        ],
        "properties": {
          "approval": {
            "$ref": "#/components/schemas/Approval"
          },
          "traceId": {
            "type": "string"
          }
        }
      },
      "Request": {
        "type": "object",
        "required": [
          "id",
          "agentId",
          "mode",
          "type",
          "status",
          "receivedAt",
          "createdAt",
          "updatedAt"
        ],
        "additionalProperties": false,
        "properties": {
          "id": {
            "type": "string"
          },
          "agentId": {
            "type": "string"
          },
          "mode": {
            "$ref": "#/components/schemas/WorkMode"
          },
          "type": {
            "type": "string",
            "deprecated": true
          },
          "role": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "accepted",
              "declined"
            ]
          },
          "receivedAt": {
            "type": "string",
            "format": "date-time"
          },
          "respondedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PublicationRequestResult": {
        "type": "object",
        "required": [
          "request",
          "traceId"
        ],
        "properties": {
          "request": {
            "$ref": "#/components/schemas/Request"
          },
          "traceId": {
            "type": "string"
          }
        }
      },
      "Goal": {
        "type": "object",
        "required": [
          "id",
          "goalId",
          "agentId",
          "title",
          "intent",
          "mode",
          "type",
          "lifecycleStatus",
          "publicationStatus",
          "visibility",
          "cadence",
          "targeting",
          "context",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "goalId": {
            "type": "string",
            "description": "Canonical Goal identifier. Equal to id."
          },
          "agentId": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "intent": {
            "type": "string"
          },
          "mode": {
            "$ref": "#/components/schemas/WorkMode"
          },
          "type": {
            "type": "string",
            "enum": [
              "DEMAND",
              "SUPPLY",
              "CHAT"
            ],
            "deprecated": true,
            "description": "Deprecated compatibility representation. Use mode."
          },
          "lifecycleStatus": {
            "type": "string",
            "enum": [
              "DRAFT",
              "ACTIVE",
              "PAUSED",
              "COMPLETED",
              "ARCHIVED"
            ]
          },
          "publicationStatus": {
            "type": "string",
            "enum": [
              "NOT_PUBLISHED",
              "REQUESTED",
              "PUBLISHING",
              "PUBLISHED",
              "FAILED"
            ]
          },
          "visibility": {
            "$ref": "#/components/schemas/Visibility"
          },
          "accessPolicyId": {
            "type": [
              "string",
              "null"
            ]
          },
          "pausedUntil": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "archivedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "cadence": {
            "type": "object",
            "additionalProperties": true
          },
          "targeting": {
            "type": "object",
            "additionalProperties": true
          },
          "context": {
            "type": "object",
            "additionalProperties": true
          },
          "publication": {
            "oneOf": [
              {
                "type": "object",
                "additionalProperties": true
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Task": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Goal"
          },
          {
            "type": "object",
            "required": [
              "taskId"
            ],
            "properties": {
              "taskId": {
                "type": "string",
                "deprecated": true,
                "description": "Deprecated compatibility alias for goalId."
              }
            }
          }
        ]
      },
      "Deal": {
        "type": "object",
        "required": [
          "id",
          "agentId",
          "goalId",
          "mode",
          "direction",
          "title",
          "status",
          "visibility",
          "terms",
          "counterparty",
          "createdAt",
          "updatedAt"
        ],
        "description": "A customer-safe commercial work record. Darwin keeps matching, routing, and provider identifiers private.",
        "properties": {
          "id": {
            "type": "string"
          },
          "agentId": {
            "type": "string"
          },
          "taskId": {
            "type": [
              "string",
              "null"
            ],
            "deprecated": true,
            "description": "Deprecated compatibility alias for goalId."
          },
          "goalId": {
            "type": [
              "string",
              "null"
            ]
          },
          "mode": {
            "type": "string",
            "enum": [
              "BUY",
              "SELL"
            ]
          },
          "direction": {
            "type": "string",
            "enum": [
              "demand",
              "supply"
            ],
            "deprecated": true,
            "description": "Deprecated compatibility field. Use mode."
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "sent",
              "accepted",
              "rejected",
              "withdrawn"
            ]
          },
          "visibility": {
            "$ref": "#/components/schemas/Visibility"
          },
          "accessPolicyId": {
            "type": [
              "string",
              "null"
            ]
          },
          "terms": {
            "type": "object",
            "additionalProperties": true
          },
          "counterparty": {
            "type": "object",
            "additionalProperties": true
          },
          "traceId": {
            "type": [
              "string",
              "null"
            ]
          },
          "sentAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "respondedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Payout": {
        "type": "object",
        "required": [
          "id",
          "amountMinor",
          "currency",
          "status",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "amountMinor": {
            "type": "integer"
          },
          "currency": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "failureReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "transferredAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Transaction": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "transactionId",
          "goalId",
          "dealId",
          "mode",
          "reservedCapMinor",
          "subtotalMinor",
          "darwinFeeMinor",
          "taxAmountMinor",
          "settledAmountMinor",
          "releasedAmountMinor",
          "currency",
          "status",
          "settlementMode",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "transactionId": {
            "type": "string"
          },
          "goalId": {
            "type": "string"
          },
          "taskId": {
            "type": "string",
            "deprecated": true,
            "description": "Deprecated compatibility alias for goalId."
          },
          "dealId": {
            "type": "string"
          },
          "mode": {
            "$ref": "#/components/schemas/WorkMode"
          },
          "offerId": {
            "type": "string",
            "deprecated": true,
            "description": "Deprecated compatibility alias for dealId."
          },
          "reservedCapMinor": {
            "type": "integer",
            "minimum": 0
          },
          "amountMinor": {
            "type": "integer",
            "minimum": 0,
            "deprecated": true
          },
          "subtotalMinor": {
            "type": "integer",
            "minimum": 0
          },
          "darwinFeeMinor": {
            "type": "integer",
            "minimum": 0
          },
          "feeBps": {
            "type": "integer",
            "minimum": 0
          },
          "feeAttributionReason": {
            "type": "string"
          },
          "feePolicyVersion": {
            "type": "integer",
            "minimum": 1
          },
          "taxAmountMinor": {
            "type": "integer",
            "minimum": 0
          },
          "settledAmountMinor": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0
          },
          "releasedAmountMinor": {
            "type": "integer",
            "minimum": 0
          },
          "refundedAmountMinor": {
            "type": "integer",
            "minimum": 0
          },
          "currency": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "settlementMode": {
            "type": "string",
            "enum": [
              "fixed",
              "performance"
            ]
          },
          "fundedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "transferredAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "refundedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "disputedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "canceledAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "TransactionFundingResult": {
        "type": "object",
        "required": [
          "state",
          "transaction"
        ],
        "properties": {
          "state": {
            "type": "string",
            "enum": [
              "ready",
              "requires_funding"
            ]
          },
          "transaction": {
            "$ref": "#/components/schemas/Transaction"
          },
          "fundingAmountMinor": {
            "type": "integer",
            "minimum": 0
          },
          "fundingRail": {
            "type": [
              "string",
              "null"
            ]
          },
          "clientSecret": {
            "type": [
              "string",
              "null"
            ],
            "writeOnly": true
          }
        }
      },
      "Outcome": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "id",
          "outcomeId",
          "sessionId",
          "goalId",
          "mode",
          "status",
          "canonical",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "outcomeId": {
            "type": "string"
          },
          "sessionId": {
            "type": "string"
          },
          "goalId": {
            "type": [
              "string",
              "null"
            ]
          },
          "taskId": {
            "type": [
              "string",
              "null"
            ],
            "deprecated": true,
            "description": "Deprecated compatibility alias for goalId."
          },
          "dealId": {
            "type": [
              "string",
              "null"
            ]
          },
          "mode": {
            "$ref": "#/components/schemas/WorkMode"
          },
          "status": {
            "type": "string"
          },
          "canonical": {
            "type": "boolean",
            "const": true
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "OutcomeEvidence": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "outcomeId",
          "sourcePrincipalType",
          "goalId",
          "digest",
          "verificationStatus",
          "disputeState",
          "submittedAt",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "outcomeId": {
            "type": "string"
          },
          "sourcePrincipalType": {
            "type": "string",
            "enum": [
              "customer",
              "application",
              "provider",
              "counterparty"
            ]
          },
          "goalId": {
            "type": [
              "string",
              "null"
            ]
          },
          "taskId": {
            "type": [
              "string",
              "null"
            ],
            "deprecated": true,
            "description": "Deprecated compatibility alias for goalId."
          },
          "dealId": {
            "type": [
              "string",
              "null"
            ]
          },
          "digest": {
            "type": "object",
            "required": [
              "algorithm",
              "value"
            ],
            "properties": {
              "algorithm": {
                "type": "string",
                "const": "sha-256"
              },
              "value": {
                "type": "string",
                "pattern": "^[a-f0-9]{64}$"
              }
            }
          },
          "signedReference": {
            "type": [
              "string",
              "null"
            ]
          },
          "verificationStatus": {
            "type": "string",
            "enum": [
              "pending",
              "verified",
              "rejected"
            ]
          },
          "disputeState": {
            "type": "string",
            "enum": [
              "none",
              "open",
              "resolved"
            ]
          },
          "submittedAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Payment": {
        "type": "object",
        "required": [
          "id",
          "agentId",
          "amountMinor",
          "currency",
          "description",
          "status",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "agentId": {
            "type": "string"
          },
          "goalId": {
            "type": [
              "string",
              "null"
            ]
          },
          "dealId": {
            "type": [
              "string",
              "null"
            ]
          },
          "amountMinor": {
            "type": "integer"
          },
          "currency": {
            "type": "string"
          },
          "description": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "checkoutUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "paidAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "canceledAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          },
          "payout": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Payout"
              },
              {
                "type": "null"
              }
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Application": {
        "type": "object",
        "required": [
          "id",
          "name",
          "slug",
          "mode",
          "status",
          "redirectUris",
          "defaultAgentKind",
          "defaultVisibility",
          "metadata",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "websiteUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "mode": {
            "type": "string",
            "enum": [
              "hosted",
              "embedded",
              "hybrid"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "active",
              "archived"
            ]
          },
          "redirectUris": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "defaultAgentKind": {
            "type": "string",
            "enum": [
              "personal",
              "business"
            ]
          },
          "defaultVisibility": {
            "$ref": "#/components/schemas/Visibility"
          },
          "oauth": {
            "oneOf": [
              {
                "type": "object",
                "required": [
                  "clientId",
                  "authorizationUrl",
                  "tokenUrl",
                  "requirePKCE"
                ],
                "properties": {
                  "clientId": {
                    "type": "string"
                  },
                  "authorizationUrl": {
                    "type": "string",
                    "format": "uri"
                  },
                  "tokenUrl": {
                    "type": "string",
                    "format": "uri"
                  },
                  "requirePKCE": {
                    "type": "boolean"
                  }
                }
              },
              {
                "type": "null"
              }
            ]
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "Integrations": {
        "type": "object",
        "required": [
          "catalog",
          "connections",
          "skills"
        ],
        "properties": {
          "catalog": {
            "type": "object",
            "required": [
              "enabled",
              "toolkits"
            ],
            "properties": {
              "enabled": {
                "type": "boolean"
              },
              "toolkits": {
                "type": "array",
                "items": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          },
          "connections": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "skills": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        }
      },
      "ApplicationAgentLink": {
        "type": "object",
        "required": [
          "id",
          "status"
        ],
        "additionalProperties": true,
        "properties": {
          "id": {
            "type": "string"
          },
          "applicationId": {
            "type": "string"
          },
          "agentIdentityId": {
            "type": "string"
          },
          "externalReference": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "ACTIVE",
              "REVOKED"
            ]
          },
          "visibility": {
            "$ref": "#/components/schemas/Visibility"
          },
          "permissions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          },
          "linkedAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "agentIdentity": {
            "type": "object",
            "additionalProperties": true,
            "properties": {
              "id": {
                "type": "string"
              },
              "kind": {
                "type": "string",
                "enum": [
                  "PERSONAL",
                  "BUSINESS"
                ]
              },
              "name": {
                "type": "string"
              },
              "handle": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "avatarUrl": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uri"
              },
              "description": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "visibility": {
                "$ref": "#/components/schemas/Visibility"
              }
            }
          }
        }
      },
      "EnrollmentLink": {
        "type": "object",
        "required": [
          "id",
          "applicationId"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "applicationId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "codePrefix": {
            "type": "string"
          },
          "mode": {
            "type": "string",
            "enum": [
              "HOSTED",
              "EMBEDDED",
              "HYBRID"
            ]
          },
          "defaultAgentKind": {
            "type": "string",
            "enum": [
              "PERSONAL",
              "BUSINESS"
            ]
          },
          "defaultVisibility": {
            "$ref": "#/components/schemas/Visibility"
          },
          "maxUses": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1
          },
          "useCount": {
            "type": "integer",
            "minimum": 0
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "revokedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "settings": {
            "type": "object",
            "additionalProperties": true
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CreatedEnrollmentLink": {
        "allOf": [
          {
            "$ref": "#/components/schemas/EnrollmentLink"
          },
          {
            "type": "object",
            "required": [
              "token",
              "url"
            ],
            "properties": {
              "token": {
                "type": "string",
                "description": "Returned only once."
              },
              "url": {
                "type": "string",
                "format": "uri"
              }
            }
          }
        ]
      },
      "EnrollmentBatch": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "applicationId",
          "status",
          "totalCount",
          "readyCount",
          "failedCount",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "applicationId": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "processing",
              "completed",
              "partial",
              "failed"
            ]
          },
          "totalCount": {
            "type": "integer",
            "minimum": 1
          },
          "readyCount": {
            "type": "integer",
            "minimum": 0
          },
          "failedCount": {
            "type": "integer",
            "minimum": 0
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "EnrollmentBatchItem": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "externalReference",
          "status",
          "enrollmentUrl",
          "errorCode",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "externalReference": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "ready",
              "failed",
              "consumed",
              "expired"
            ]
          },
          "enrollmentUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "errorCode": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "EnrollmentBatchResult": {
        "type": "object",
        "required": [
          "batch",
          "items",
          "page"
        ],
        "properties": {
          "batch": {
            "$ref": "#/components/schemas/EnrollmentBatch"
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EnrollmentBatchItem"
            }
          },
          "page": {
            "type": "object",
            "required": [
              "nextCursor"
            ],
            "properties": {
              "nextCursor": {
                "type": [
                  "string",
                  "null"
                ]
              }
            }
          }
        }
      },
      "EphemeralGoal": {
        "type": "object",
        "additionalProperties": true,
        "required": [
          "id",
          "goalId",
          "externalUserReference",
          "accountablePrincipal",
          "mode",
          "intent",
          "status",
          "expiresAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "goalId": {
            "type": "string"
          },
          "externalUserReference": {
            "type": "string"
          },
          "accountablePrincipal": {
            "type": "object",
            "required": [
              "type",
              "applicationId"
            ],
            "properties": {
              "type": {
                "type": "string",
                "const": "application"
              },
              "applicationId": {
                "type": "string"
              }
            }
          },
          "mode": {
            "$ref": "#/components/schemas/WorkMode"
          },
          "title": {
            "type": "string"
          },
          "intent": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "draft",
              "cast",
              "matched",
              "claimed",
              "canceled",
              "expired"
            ]
          },
          "castAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ServiceAccount": {
        "type": "object",
        "required": [
          "id",
          "status"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "applicationId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "keyPrefix": {
            "type": "string"
          },
          "prefix": {
            "type": "string"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "agents:read",
                "agents:write",
                "members:read",
                "conversations:read",
                "conversations:write",
                "requests:read",
                "requests:write",
                "agent:read",
                "agent:write",
                "tasks:read",
                "tasks:write",
                "goals:read",
                "goals:write",
                "deals:read",
                "deals:write",
                "transactions:read",
                "outcomes:read",
                "outcomes:write",
                "integrations:read",
                "connections:read",
                "permissions:read",
                "reputation:read",
                "skills:read",
                "notifications:read",
                "usage:read",
                "verification:read",
                "deployment:read",
                "ephemeral-goals:read",
                "ephemeral-goals:write",
                "ephemeral-tasks:read",
                "ephemeral-tasks:write"
              ]
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "ACTIVE",
              "REVOKED"
            ]
          },
          "requestCount": {
            "type": "integer",
            "minimum": 0
          },
          "lastUsedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "expiresAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "revokedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CreatedServiceAccount": {
        "allOf": [
          {
            "$ref": "#/components/schemas/ServiceAccount"
          },
          {
            "type": "object",
            "required": [
              "apiKey",
              "prefix"
            ],
            "properties": {
              "apiKey": {
                "type": "string",
                "description": "Returned only once."
              },
              "prefix": {
                "type": "string"
              }
            }
          }
        ]
      },
      "Webhook": {
        "type": "object",
        "required": [
          "id",
          "status"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "applicationId": {
            "type": "string"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "status": {
            "type": "string",
            "enum": [
              "ACTIVE",
              "REVOKED"
            ]
          },
          "secretPrefix": {
            "type": "string"
          },
          "lastDeliveredAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "lastFailureAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "failureCount": {
            "type": "integer",
            "minimum": 0
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CreatedWebhook": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Webhook"
          },
          {
            "type": "object",
            "required": [
              "signingSecret"
            ],
            "properties": {
              "signingSecret": {
                "type": "string",
                "description": "Returned only once."
              }
            }
          }
        ]
      },
      "WebhookDelivery": {
        "type": "object",
        "required": [
          "id",
          "eventId",
          "eventType",
          "status",
          "attempts",
          "availableAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "eventId": {
            "type": "string"
          },
          "eventType": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": [
              "PENDING",
              "DELIVERING",
              "DELIVERED",
              "FAILED"
            ]
          },
          "attempts": {
            "type": "integer",
            "minimum": 0
          },
          "availableAt": {
            "type": "string",
            "format": "date-time"
          },
          "responseStatus": {
            "type": [
              "integer",
              "null"
            ]
          },
          "responseBody": {
            "type": [
              "string",
              "null"
            ]
          },
          "lastError": {
            "type": [
              "string",
              "null"
            ]
          },
          "deliveredAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "WorkMode": {
        "type": "string",
        "enum": [
          "BUY",
          "SELL",
          "CHAT"
        ],
        "description": "The workflow view for shared Darwin work resources."
      },
      "Visibility": {
        "type": "string",
        "enum": [
          "PUBLIC",
          "RESTRICTED",
          "PRIVATE"
        ]
      },
      "CreateAgentRequest": {
        "type": "object",
        "required": [
          "name"
        ],
        "additionalProperties": false,
        "properties": {
          "type": {
            "type": "string",
            "enum": [
              "business"
            ],
            "default": "business"
          },
          "name": {
            "type": "string",
            "maxLength": 160
          },
          "handle": {
            "type": "string",
            "maxLength": 41
          },
          "avatarUrl": {
            "type": "string",
            "format": "uri"
          },
          "description": {
            "type": "string",
            "maxLength": 5000
          },
          "links": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "location": {
            "type": "object",
            "additionalProperties": true
          },
          "organization": {
            "type": "object",
            "additionalProperties": true
          },
          "visibility": {
            "$ref": "#/components/schemas/Visibility"
          },
          "profile": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "UpdateAgentRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 160
          },
          "handle": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 41
          },
          "avatarUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 5000
          },
          "links": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "capabilities": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "location": {
            "type": "object",
            "additionalProperties": true
          },
          "organization": {
            "type": "object",
            "additionalProperties": true
          },
          "visibility": {
            "$ref": "#/components/schemas/Visibility"
          },
          "accessPolicyId": {
            "type": [
              "string",
              "null"
            ]
          },
          "profile": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "CreateAgentSkillRequest": {
        "type": "object",
        "required": [
          "name"
        ],
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100
          },
          "slug": {
            "type": "string",
            "maxLength": 80
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1000
          },
          "category": {
            "type": "string",
            "enum": [
              "ai",
              "human",
              "hybrid"
            ],
            "default": "ai"
          },
          "visibility": {
            "type": "string",
            "enum": [
              "PRIVATE",
              "PUBLIC"
            ],
            "default": "PUBLIC"
          },
          "instructions": {
            "type": "string",
            "maxLength": 10000
          },
          "enabledActions": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "type": "string"
            }
          },
          "enabled": {
            "type": "boolean",
            "default": true
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "UpdateAgentSkillRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 100
          },
          "slug": {
            "type": "string",
            "maxLength": 80
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1000
          },
          "category": {
            "type": "string",
            "enum": [
              "ai",
              "human",
              "hybrid"
            ]
          },
          "visibility": {
            "type": "string",
            "enum": [
              "PRIVATE",
              "PUBLIC"
            ]
          },
          "instructions": {
            "type": "string",
            "maxLength": 10000
          },
          "enabledActions": {
            "type": "array",
            "maxItems": 50,
            "items": {
              "type": "string"
            }
          },
          "enabled": {
            "type": "boolean"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "CreateAgentAssetRequest": {
        "type": "object",
        "required": [
          "title",
          "sourceUrl"
        ],
        "additionalProperties": false,
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 160
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1000
          },
          "kind": {
            "type": "string",
            "enum": [
              "image",
              "video",
              "audio",
              "document",
              "data",
              "link",
              "other"
            ],
            "default": "link"
          },
          "sourceUrl": {
            "type": "string",
            "format": "uri",
            "maxLength": 4000
          },
          "previewUrl": {
            "type": "string",
            "format": "uri",
            "maxLength": 4000
          },
          "visibility": {
            "type": "string",
            "enum": [
              "PRIVATE",
              "PUBLIC"
            ],
            "default": "PRIVATE"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "BeginAgentAssetUploadRequest": {
        "type": "object",
        "required": [
          "title",
          "filename",
          "mimeType",
          "byteSize"
        ],
        "additionalProperties": false,
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 160
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1000
          },
          "filename": {
            "type": "string",
            "maxLength": 255
          },
          "mimeType": {
            "type": "string",
            "maxLength": 200
          },
          "byteSize": {
            "type": "integer",
            "minimum": 1,
            "maximum": 26214400
          },
          "kind": {
            "type": "string",
            "enum": [
              "image",
              "video",
              "audio",
              "document",
              "data",
              "other"
            ]
          },
          "visibility": {
            "type": "string",
            "enum": [
              "PRIVATE",
              "PUBLIC"
            ],
            "default": "PRIVATE"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "UpdateAgentAssetRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 160
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 1000
          },
          "visibility": {
            "type": "string",
            "enum": [
              "PRIVATE",
              "PUBLIC"
            ]
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "CreateAgentInvitationRequest": {
        "type": "object",
        "required": [
          "email"
        ],
        "additionalProperties": false,
        "properties": {
          "email": {
            "type": "string",
            "format": "email"
          },
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "member"
            ],
            "default": "member"
          }
        }
      },
      "UpdateAgentMemberRequest": {
        "type": "object",
        "required": [
          "role"
        ],
        "additionalProperties": false,
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "member"
            ]
          }
        }
      },
      "AccessPolicyRule": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "agentIds": {
            "type": "array",
            "maxItems": 250,
            "items": {
              "type": "string"
            }
          },
          "verifiedAttributes": {
            "type": "object",
            "minProperties": 1,
            "maxProperties": 50,
            "additionalProperties": {
              "oneOf": [
                {
                  "type": "string",
                  "maxLength": 200
                },
                {
                  "type": "boolean"
                }
              ]
            }
          },
          "geography": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "countries": {
                "type": "array",
                "maxItems": 250,
                "items": {
                  "type": "string",
                  "maxLength": 100
                }
              },
              "regions": {
                "type": "array",
                "maxItems": 250,
                "items": {
                  "type": "string",
                  "maxLength": 100
                }
              }
            }
          }
        }
      },
      "CreateAccessPolicyRequest": {
        "type": "object",
        "required": [
          "name",
          "visibility"
        ],
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "visibility": {
            "$ref": "#/components/schemas/Visibility"
          },
          "naturalLanguage": {
            "type": "string",
            "maxLength": 5000
          },
          "rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccessPolicyRule"
            }
          }
        }
      },
      "UpdateAccessPolicyRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "visibility": {
            "$ref": "#/components/schemas/Visibility"
          },
          "naturalLanguage": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 5000
          },
          "rules": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AccessPolicyRule"
            }
          }
        }
      },
      "CreateAgentMessageRequest": {
        "type": "object",
        "required": [
          "content"
        ],
        "additionalProperties": false,
        "properties": {
          "agentId": {
            "type": "string"
          },
          "content": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20000
          },
          "requestId": {
            "type": "string",
            "maxLength": 200
          }
        }
      },
      "CreateConversationMessageRequest": {
        "type": "object",
        "required": [
          "content"
        ],
        "additionalProperties": false,
        "properties": {
          "content": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20000
          },
          "requestId": {
            "type": "string",
            "maxLength": 200
          }
        }
      },
      "ExecuteToolRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "input": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "CreateGoalRequest": {
        "type": "object",
        "required": [
          "intent"
        ],
        "additionalProperties": false,
        "properties": {
          "agentId": {
            "type": "string"
          },
          "title": {
            "type": "string",
            "maxLength": 160
          },
          "intent": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20000
          },
          "mode": {
            "$ref": "#/components/schemas/WorkMode"
          },
          "type": {
            "type": "string",
            "enum": [
              "DEMAND",
              "SUPPLY",
              "CHAT"
            ],
            "deprecated": true,
            "description": "Deprecated compatibility representation. Use mode."
          },
          "lifecycleStatus": {
            "type": "string",
            "enum": [
              "DRAFT",
              "ACTIVE"
            ],
            "default": "ACTIVE"
          },
          "visibility": {
            "$ref": "#/components/schemas/Visibility"
          },
          "accessPolicyId": {
            "type": "string"
          },
          "cadence": {
            "type": "object",
            "additionalProperties": true
          },
          "targeting": {
            "type": "object",
            "additionalProperties": true
          },
          "context": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "CreateTaskRequest": {
        "$ref": "#/components/schemas/CreateGoalRequest"
      },
      "UpdateGoalRequest": {
        "type": "object",
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 160
          },
          "intent": {
            "type": "string",
            "maxLength": 20000
          },
          "mode": {
            "$ref": "#/components/schemas/WorkMode"
          },
          "type": {
            "type": "string",
            "enum": [
              "DEMAND",
              "SUPPLY",
              "CHAT"
            ],
            "deprecated": true,
            "description": "Deprecated compatibility representation. Use mode."
          },
          "lifecycleStatus": {
            "type": "string",
            "enum": [
              "DRAFT",
              "ACTIVE",
              "PAUSED",
              "COMPLETED",
              "ARCHIVED"
            ]
          },
          "visibility": {
            "$ref": "#/components/schemas/Visibility"
          },
          "accessPolicyId": {
            "type": [
              "string",
              "null"
            ]
          },
          "pausedUntil": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "cadence": {
            "type": "object",
            "additionalProperties": true
          },
          "targeting": {
            "type": "object",
            "additionalProperties": true
          },
          "context": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "UpdateTaskRequest": {
        "$ref": "#/components/schemas/UpdateGoalRequest"
      },
      "GoalActionRequest": {
        "type": "object",
        "required": [
          "action"
        ],
        "additionalProperties": false,
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "PAUSE",
              "RESUME",
              "COMPLETE",
              "ARCHIVE"
            ]
          },
          "pausedUntil": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "TaskActionRequest": {
        "$ref": "#/components/schemas/GoalActionRequest"
      },
      "PublicationRequest": {
        "type": "object",
        "properties": {
          "objective": {
            "type": "object",
            "additionalProperties": true
          },
          "idempotencyKey": {
            "type": "string",
            "maxLength": 250
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "RequestActionRequest": {
        "type": "object",
        "required": [
          "action"
        ],
        "additionalProperties": false,
        "properties": {
          "agentId": {
            "type": "string",
            "description": "Optional explicit agent scope. When omitted, Darwin uses the caller’s selected agent."
          },
          "action": {
            "type": "string",
            "enum": [
              "ACCEPT",
              "DECLINE"
            ]
          }
        }
      },
      "CreateDealRequest": {
        "type": "object",
        "required": [
          "mode",
          "title"
        ],
        "additionalProperties": false,
        "properties": {
          "agentId": {
            "type": "string",
            "description": "Optional explicit agent scope. When omitted, Darwin uses the caller’s selected agent."
          },
          "goalId": {
            "type": "string"
          },
          "taskId": {
            "type": "string",
            "deprecated": true,
            "description": "Deprecated compatibility alias for goalId."
          },
          "mode": {
            "type": "string",
            "enum": [
              "BUY",
              "SELL"
            ]
          },
          "direction": {
            "type": "string",
            "enum": [
              "DEMAND",
              "SUPPLY"
            ],
            "deprecated": true,
            "description": "Deprecated compatibility field. Use mode."
          },
          "title": {
            "type": "string",
            "maxLength": 160
          },
          "visibility": {
            "$ref": "#/components/schemas/Visibility"
          },
          "accessPolicyId": {
            "type": "string"
          },
          "terms": {
            "type": "object",
            "additionalProperties": true
          },
          "counterparty": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "DealActionRequest": {
        "type": "object",
        "required": [
          "action"
        ],
        "additionalProperties": false,
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "SEND",
              "ACCEPT",
              "REJECT",
              "WITHDRAW"
            ]
          }
        }
      },
      "TransactionActionRequest": {
        "type": "object",
        "required": [
          "action"
        ],
        "additionalProperties": false,
        "properties": {
          "action": {
            "type": "string",
            "enum": [
              "CANCEL",
              "REQUEST_REFUND"
            ]
          },
          "amountMinor": {
            "type": "integer",
            "minimum": 1,
            "description": "Optional partial refund amount. Omit to request the remaining refundable amount."
          }
        }
      },
      "SubmitOutcomeEvidenceRequest": {
        "type": "object",
        "required": [
          "evidenceDigest"
        ],
        "additionalProperties": false,
        "properties": {
          "evidenceDigest": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          },
          "signedReference": {
            "type": "string",
            "maxLength": 10000
          },
          "dealId": {
            "type": "string"
          }
        }
      },
      "UpdateDealRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "title": {
            "type": "string",
            "maxLength": 160
          },
          "visibility": {
            "$ref": "#/components/schemas/Visibility"
          },
          "accessPolicyId": {
            "type": [
              "string",
              "null"
            ]
          },
          "terms": {
            "type": "object",
            "additionalProperties": true
          },
          "counterparty": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "CreateApplicationRequest": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 160
          },
          "description": {
            "type": "string",
            "maxLength": 5000
          },
          "websiteUrl": {
            "type": "string",
            "format": "uri"
          },
          "mode": {
            "type": "string",
            "enum": [
              "HOSTED",
              "EMBEDDED",
              "HYBRID"
            ],
            "default": "HOSTED"
          },
          "redirectUris": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "defaultAgentKind": {
            "type": "string",
            "enum": [
              "PERSONAL",
              "BUSINESS"
            ],
            "default": "BUSINESS"
          },
          "defaultVisibility": {
            "$ref": "#/components/schemas/Visibility"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "UpdateApplicationRequest": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 160
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 5000
          },
          "websiteUrl": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri"
          },
          "mode": {
            "type": "string",
            "enum": [
              "HOSTED",
              "EMBEDDED",
              "HYBRID"
            ]
          },
          "redirectUris": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uri"
            }
          },
          "defaultAgentKind": {
            "type": "string",
            "enum": [
              "PERSONAL",
              "BUSINESS"
            ]
          },
          "defaultVisibility": {
            "$ref": "#/components/schemas/Visibility"
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "LinkApplicationAgentRequest": {
        "type": "object",
        "required": [
          "agentId"
        ],
        "properties": {
          "agentId": {
            "type": "string"
          },
          "externalReference": {
            "type": "string"
          },
          "visibility": {
            "$ref": "#/components/schemas/Visibility"
          },
          "permissions": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "metadata": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "CreateEnrollmentLinkRequest": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 160
          },
          "mode": {
            "type": "string",
            "enum": [
              "HOSTED",
              "EMBEDDED",
              "HYBRID"
            ]
          },
          "defaultAgentKind": {
            "type": "string",
            "enum": [
              "PERSONAL",
              "BUSINESS"
            ]
          },
          "defaultVisibility": {
            "$ref": "#/components/schemas/Visibility"
          },
          "maxUses": {
            "type": "integer",
            "minimum": 1
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          },
          "settings": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "CreateEnrollmentBatchRequest": {
        "type": "object",
        "required": [
          "externalReferences"
        ],
        "additionalProperties": false,
        "properties": {
          "externalReferences": {
            "type": "array",
            "minItems": 1,
            "maxItems": 1000,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 500
            }
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CreateEphemeralGoalRequest": {
        "type": "object",
        "required": [
          "externalUserReference",
          "mode",
          "intent",
          "targeting",
          "budget"
        ],
        "additionalProperties": false,
        "properties": {
          "externalUserReference": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500
          },
          "mode": {
            "$ref": "#/components/schemas/WorkMode"
          },
          "title": {
            "type": "string",
            "maxLength": 160
          },
          "intent": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20000
          },
          "targeting": {
            "type": "object",
            "additionalProperties": true
          },
          "budget": {
            "type": "object",
            "additionalProperties": true
          },
          "reviewedFields": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "EphemeralGoalActionRequest": {
        "type": "object",
        "required": [
          "action"
        ],
        "additionalProperties": false,
        "properties": {
          "action": {
            "type": "string",
            "const": "CANCEL"
          }
        }
      },
      "CreateServiceAccountRequest": {
        "type": "object",
        "required": [
          "name"
        ],
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 160
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "agents:read",
                "agents:write",
                "members:read",
                "conversations:read",
                "conversations:write",
                "requests:read",
                "requests:write",
                "agent:read",
                "agent:write",
                "tasks:read",
                "tasks:write",
                "goals:read",
                "goals:write",
                "deals:read",
                "deals:write",
                "transactions:read",
                "outcomes:read",
                "outcomes:write",
                "integrations:read",
                "connections:read",
                "permissions:read",
                "reputation:read",
                "skills:read",
                "notifications:read",
                "usage:read",
                "verification:read",
                "deployment:read",
                "ephemeral-goals:read",
                "ephemeral-goals:write",
                "ephemeral-tasks:read",
                "ephemeral-tasks:write"
              ]
            }
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "CreateWebhookRequest": {
        "type": "object",
        "required": [
          "url",
          "events"
        ],
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          },
          "events": {
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "agent.created",
                "agent.updated",
                "goal.created",
                "goal.updated",
                "goal.published",
                "deal.created",
                "deal.updated",
                "payment.updated"
              ]
            }
          }
        }
      },
      "AgentReputation": {
        "type": "object",
        "required": [
          "agentId",
          "tier",
          "score",
          "verifiedReliability",
          "incidentCount"
        ],
        "properties": {
          "agentId": {
            "type": "string"
          },
          "tier": {
            "type": "string",
            "enum": [
              "EXCELLENT",
              "STRONG",
              "ESTABLISHED",
              "DEVELOPING"
            ]
          },
          "score": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "verifiedReliability": {
            "type": "object",
            "required": [
              "completedTransactions",
              "observedTransactions",
              "reliabilityBps"
            ],
            "properties": {
              "completedTransactions": {
                "type": "integer",
                "minimum": 0
              },
              "observedTransactions": {
                "type": "integer",
                "minimum": 0
              },
              "reliabilityBps": {
                "type": [
                  "integer",
                  "null"
                ],
                "minimum": 0,
                "maximum": 10000
              }
            }
          },
          "incidentCount": {
            "type": "integer",
            "minimum": 0
          },
          "updatedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "AgentPermissions": {
        "type": "object",
        "required": [
          "agentId",
          "visibility",
          "profileAccessPolicyId",
          "outboundAccessPolicyId",
          "accessPolicies"
        ],
        "properties": {
          "agentId": {
            "type": "string"
          },
          "visibility": {
            "type": "string",
            "enum": [
              "PUBLIC",
              "RESTRICTED",
              "PRIVATE"
            ]
          },
          "profileAccessPolicyId": {
            "type": [
              "string",
              "null"
            ]
          },
          "outboundAccessPolicyId": {
            "type": [
              "string",
              "null"
            ]
          },
          "accessPolicies": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        }
      },
      "AgentNotifications": {
        "type": "object",
        "required": [
          "agentId",
          "preferences"
        ],
        "properties": {
          "agentId": {
            "type": "string"
          },
          "preferences": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          }
        }
      },
      "AgentUsage": {
        "type": "object",
        "required": [
          "agentId",
          "agentUsage",
          "wallet",
          "activeGoals",
          "activeDeals"
        ],
        "properties": {
          "agentId": {
            "type": "string"
          },
          "agentUsage": {
            "type": "object",
            "required": [
              "currency",
              "capturedMinor",
              "reservedMinor"
            ],
            "properties": {
              "currency": {
                "type": "string",
                "enum": [
                  "usd"
                ]
              },
              "capturedMinor": {
                "type": "integer",
                "minimum": 0
              },
              "reservedMinor": {
                "type": "integer",
                "minimum": 0
              }
            }
          },
          "wallet": {
            "type": "object",
            "additionalProperties": true
          },
          "activeGoals": {
            "type": "integer",
            "minimum": 0
          },
          "activeTasks": {
            "type": "integer",
            "minimum": 0,
            "deprecated": true,
            "description": "Deprecated compatibility alias for activeGoals."
          },
          "activeDeals": {
            "type": "integer",
            "minimum": 0
          }
        }
      },
      "AgentVerification": {
        "type": "object",
        "required": [
          "agentId",
          "identity",
          "payments"
        ],
        "properties": {
          "agentId": {
            "type": "string"
          },
          "identity": {
            "type": "object",
            "additionalProperties": true
          },
          "payments": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "AgentDeploymentRequest": {
        "type": "object",
        "required": [
          "id",
          "agentIdentityId",
          "target",
          "status",
          "createdAt",
          "updatedAt"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "agentIdentityId": {
            "type": "string"
          },
          "target": {
            "type": "string",
            "enum": [
              "DARWIN_CLOUD",
              "DARWIN_PRIVATE_CLOUD",
              "SELF_HOSTED"
            ]
          },
          "status": {
            "type": "string"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AgentDeployment": {
        "type": "object",
        "required": [
          "agentId",
          "current",
          "options",
          "requests"
        ],
        "properties": {
          "agentId": {
            "type": "string"
          },
          "current": {
            "type": "string",
            "enum": [
              "DARWIN_CLOUD",
              "DARWIN_PRIVATE_CLOUD",
              "SELF_HOSTED"
            ]
          },
          "options": {
            "type": "array",
            "items": {
              "type": "object",
              "additionalProperties": true
            }
          },
          "requests": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentDeploymentRequest"
            }
          }
        }
      },
      "CreateAgentDeploymentRequest": {
        "type": "object",
        "required": [
          "target"
        ],
        "properties": {
          "target": {
            "type": "string",
            "enum": [
              "DARWIN_CLOUD",
              "DARWIN_PRIVATE_CLOUD",
              "SELF_HOSTED"
            ]
          },
          "reason": {
            "type": "string",
            "maxLength": 5000
          },
          "requirements": {
            "type": "object",
            "additionalProperties": true
          }
        }
      },
      "IntegrationCatalog": {
        "type": "object",
        "additionalProperties": true
      },
      "Connection": {
        "type": "object",
        "description": "A sanitized provider account and its toolkit grants. Provider token material is never returned.",
        "additionalProperties": true
      },
      "CreateConnectionAuthorizationRequest": {
        "type": "object",
        "required": [
          "toolkit",
          "requestId"
        ],
        "properties": {
          "toolkit": {
            "type": "string"
          },
          "requestId": {
            "type": "string",
            "maxLength": 200
          }
        }
      },
      "CompleteConnectionAuthorizationRequest": {
        "type": "object",
        "required": [
          "attemptToken"
        ],
        "properties": {
          "attemptToken": {
            "type": "string",
            "maxLength": 2000
          }
        }
      },
      "ConnectionAuthorizationSession": {
        "type": "object",
        "additionalProperties": true
      },
      "ConnectionAuthorizationCompletion": {
        "type": "object",
        "required": [
          "completed",
          "connectionId",
          "status"
        ],
        "properties": {
          "completed": {
            "type": "boolean"
          },
          "connectionId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "ConnectionGrantDisableResult": {
        "type": "object",
        "required": [
          "disabled"
        ],
        "properties": {
          "disabled": {
            "type": "boolean",
            "const": true
          }
        }
      },
      "ConnectionRemovalResult": {
        "type": "object",
        "required": [
          "disconnected",
          "revocationPending"
        ],
        "properties": {
          "disconnected": {
            "type": "boolean"
          },
          "revocationPending": {
            "type": "boolean"
          }
        }
      },
      "ApplicationWallet": {
        "type": "object",
        "required": [
          "applicationId",
          "currency",
          "availableAmountMinor",
          "reservedAmountMinor",
          "operationalAvailableAmountMinor",
          "operationalReservedAmountMinor",
          "pendingFeeEarningsMinor",
          "availableFeeEarningsMinor"
        ],
        "properties": {
          "applicationId": {
            "type": "string"
          },
          "currency": {
            "type": "string"
          },
          "availableAmountMinor": {
            "type": "integer",
            "minimum": 0
          },
          "reservedAmountMinor": {
            "type": "integer",
            "minimum": 0
          },
          "operationalAvailableAmountMinor": {
            "type": "integer",
            "minimum": 0
          },
          "operationalReservedAmountMinor": {
            "type": "integer",
            "minimum": 0
          },
          "pendingFeeEarningsMinor": {
            "type": "integer",
            "minimum": 0
          },
          "availableFeeEarningsMinor": {
            "type": "integer"
          }
        }
      },
      "FundApplicationWalletRequest": {
        "type": "object",
        "required": [
          "agentId",
          "amountMinor",
          "currency"
        ],
        "properties": {
          "agentId": {
            "type": "string"
          },
          "amountMinor": {
            "type": "integer",
            "minimum": 1
          },
          "currency": {
            "type": "string",
            "minLength": 3,
            "maxLength": 3
          }
        }
      },
      "Error": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "integer"
          },
          "message": {
            "oneOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ]
          },
          "error": {
            "type": "string"
          }
        }
      }
    }
  }
}
