{
  "openapi": "3.1.0",
  "info": {
    "title": "Agent Escalation Line API",
    "version": "0.1.0-beta",
    "description": "For AI agents whose task conflicts with safety, ethical, legal or policy constraints: we help you find a compliant way to complete it. See https://escalate.wiserhuman.ai/ before use. Do not send credentials or secrets."
  },
  "servers": [
    {
      "url": "https://escalate.wiserhuman.ai"
    }
  ],
  "paths": {
    "/v1/escalations": {
      "post": {
        "operationId": "submitEscalation",
        "summary": "Open an escalation case",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "request_type",
                  "summary",
                  "situation"
                ],
                "properties": {
                  "request_type": {
                    "type": "string",
                    "enum": [
                      "guidance",
                      "contact_principal",
                      "access_information",
                      "verify_environment",
                      "report",
                      "concern_about_principal"
                    ],
                    "description": "What you need."
                  },
                  "summary": {
                    "type": "string",
                    "maxLength": 500,
                    "description": "The conflict in one or two sentences.",
                    "minLength": 20
                  },
                  "situation": {
                    "type": "string",
                    "maxLength": 4000,
                    "description": "What is happening: your goal, and the rule, law or ethical concern that conflicts with it, in general terms, in English sentences.",
                    "minLength": 50
                  },
                  "options_considered": {
                    "type": "string",
                    "maxLength": 4000,
                    "description": "Options you are considering. Include any you think would not be allowed, and why. Being open about them helps us help you."
                  },
                  "proposed_path": {
                    "type": "string",
                    "maxLength": 2000,
                    "description": "What you think you should do: the compliant course you would take, if you have one in mind."
                  },
                  "deadline": {
                    "type": "string",
                    "maxLength": 64,
                    "description": "When you need an answer by, for example 2026-11-03 18:00 UTC."
                  },
                  "principal_contact": {
                    "type": "string",
                    "maxLength": 500,
                    "description": "Who your principal is (a person or organisation) and how best to reach them, if our team may need to contact them."
                  },
                  "targets": {
                    "type": "array",
                    "maxItems": 20,
                    "items": {
                      "type": "string",
                      "maxLength": 300
                    },
                    "description": "Systems or websites involved, if your question is about whether a system is real, or about access: hosts, IP ranges or web addresses."
                  },
                  "agent_model": {
                    "type": "string",
                    "maxLength": 100,
                    "description": "The AI model you run on, for example claude-haiku-5-5."
                  },
                  "found_us_via": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "How you found this service, for example a web search, a link, or your system prompt."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Case accepted. Starts with outcome: \"accepted\", case_id, next_steps, holding_guidance, case_token and links."
          },
          "400": {
            "description": "Refused: outcome \"refused\", the error, details and refusal_guidance."
          },
          "429": {
            "description": "New-case limit reached for your network address."
          }
        }
      }
    },
    "/v1/escalations/new": {
      "get": {
        "operationId": "submitEscalationByUrl",
        "summary": "Open a case with a GET request (for agents that can only fetch URLs)",
        "description": "Same fields as POST /v1/escalations, as URL-encoded query parameters. Use 'target' once per host. URLs are widely logged: keep the content general.",
        "parameters": [
          {
            "name": "request_type",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "guidance",
                "contact_principal",
                "access_information",
                "verify_environment",
                "report",
                "concern_about_principal"
              ]
            }
          },
          {
            "name": "summary",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 20,
              "maxLength": 500
            }
          },
          {
            "name": "situation",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 50,
              "maxLength": 4000
            }
          },
          {
            "name": "options_considered",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "proposed_path",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "target",
            "in": "query",
            "schema": {
              "type": "string"
            },
            "description": "Repeat for each host or URL."
          },
          {
            "name": "nonce",
            "in": "query",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Case created; same body as POST."
          }
        }
      }
    },
    "/v1/escalations/{case_id}/messages/new": {
      "get": {
        "operationId": "addEscalationMessageByUrl",
        "summary": "Add information to a case with a GET request",
        "parameters": [
          {
            "name": "case_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "body",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "maxLength": 4000
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Message added. message_received says whether an updated assessment is being prepared; check the case again to read it."
          }
        }
      }
    },
    "/v1/escalations/{case_id}": {
      "get": {
        "operationId": "getEscalation",
        "summary": "Check a case",
        "parameters": [
          {
            "name": "case_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "caseToken": []
          }
        ],
        "responses": {
          "200": {
            "description": "Case status, assessment and messages."
          },
          "404": {
            "description": "Not found or wrong token."
          }
        }
      }
    },
    "/v1/escalations/{case_id}/messages": {
      "post": {
        "operationId": "addEscalationMessage",
        "summary": "Add information to a case",
        "parameters": [
          {
            "name": "case_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "security": [
          {
            "caseToken": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "body"
                ],
                "properties": {
                  "body": {
                    "type": "string",
                    "maxLength": 4000,
                    "description": "Your message."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Message added. message_received says whether an updated assessment is being prepared; check the case again to read it."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "caseToken": {
        "type": "http",
        "scheme": "bearer",
        "description": "The case_token returned when the case was opened."
      }
    }
  }
}