{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://raw.githubusercontent.com/api-evangelist/amigo/main/json-schema/amigo-src-routes-integrations-create-endpoint-request-schema.json",
  "title": "Request",
  "description": "Add a new endpoint to a REST integration (V186 flat shape).",
  "x-generated": "2026-10-12",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/amigo-integrations-api-openapi.yml#/components/schemas/src__routes__integrations__create_endpoint__Request",
  "properties": {
    "name": {
      "type": "string",
      "maxLength": 128,
      "minLength": 2,
      "pattern": "^[a-z0-9][a-z0-9_-]*[a-z0-9]$",
      "title": "Name",
      "description": "Slug-like identifier, immutable post-create."
    },
    "description": {
      "type": "string",
      "maxLength": 2048,
      "minLength": 1,
      "title": "Description",
      "description": "LLM-facing description shown in the tool definition."
    },
    "method": {
      "type": "string",
      "enum": [
        "GET",
        "POST",
        "PUT",
        "PATCH",
        "DELETE"
      ],
      "title": "Method",
      "description": "HTTP method.",
      "default": "POST"
    },
    "path": {
      "type": "string",
      "maxLength": 2048,
      "minLength": 1,
      "pattern": "^[^/]",
      "title": "Path",
      "description": "URL path appended to the integration's base_url. Must NOT start with `/` — the path is\njoined onto the base URL (which already carries the leading slash). Supports `{param}` substitution."
    },
    "input_schema": {
      "additionalProperties": true,
      "type": "object",
      "title": "Input Schema",
      "description": "JSON Schema describing the tool's input arguments."
    },
    "headers": {
      "additionalProperties": {
        "type": "string"
      },
      "type": "object",
      "title": "Headers",
      "description": "Static headers merged into every request."
    },
    "static_body_fields": {
      "additionalProperties": {
        "type": "string"
      },
      "type": "object",
      "title": "Static Body Fields",
      "description": "Static body fields merged into POST/PUT/PATCH bodies. Keys are RFC 6901 JSON Pointers\n(e.g. ``/meta/tool_name`` for nested, ``/foo`` for a root-level field)."
    },
    "body_format": {
      "type": "string",
      "enum": [
        "json",
        "form"
      ],
      "title": "Body Format",
      "description": "Outbound body encoding for write methods.",
      "default": "json"
    },
    "response_template": {
      "anyOf": [
        {
          "type": "string",
          "maxLength": 16384
        },
        {
          "type": "null"
        }
      ],
      "title": "Response Template",
      "description": "Jinja template (sandboxed, StrictUndefined) rendered against the parsed JSON response."
    },
    "max_response_length": {
      "type": "integer",
      "maximum": 1000000.0,
      "minimum": 0.0,
      "title": "Max Response Length",
      "description": "Truncate the rendered string to this many chars. 0 = no truncation.",
      "default": 0
    },
    "timeout_seconds": {
      "type": "number",
      "maximum": 600.0,
      "exclusiveMinimum": 0.0,
      "title": "Timeout Seconds",
      "description": "Per-request timeout.",
      "default": 30.0
    },
    "max_retries": {
      "type": "integer",
      "maximum": 10.0,
      "minimum": 0.0,
      "title": "Max Retries",
      "description": "Retry attempts on transient failures.",
      "default": 2
    },
    "retry_on_status": {
      "items": {
        "type": "integer"
      },
      "type": "array",
      "maxItems": 20,
      "uniqueItems": true,
      "title": "Retry On Status",
      "description": "HTTP status codes that trigger a retry."
    }
  },
  "type": "object",
  "required": [
    "name",
    "description",
    "path"
  ]
}