{
  "openapi": "3.1.0",
  "info": {
    "title": "Klientro Public Integrations API",
    "version": "1"
  },
  "servers": [
    {
      "url": "https://klientro.ru/api/public/v1",
      "description": "Public API"
    }
  ],
  "paths": {
    "/projects/{project_id}/users/resolve": {
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          }
        }
      ],
      "post": {
        "operationId": "publicVariables.resolve",
        "summary": "Найти ID клиента в проекте",
        "x-klientro-guide": {
          "scope": "variables:read",
          "detail": "Возвращает ID Клиентро по ID пользователя в мессенджере или проверяет ID из экспорта."
        },
        "security": [
          {
            "publicApiKey": []
          }
        ],
        "description": "Requires variables:read or, on the canonical public address only, users:resolve. Read-only lookup of an existing client. For messenger identity, the bot must belong to the project and the client must belong to that bot. The bot determines the messenger. With a profile ID, membership through any bot of the project is required. An unknown or inaccessible bot or client returns the same 404. Idempotency-Key is unsupported. Uses the same per-key and per-project quotas as other public variable requests.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "oneOf": [
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "bot_id",
                      "messenger_user_id"
                    ],
                    "properties": {
                      "bot_id": {
                        "type": "string",
                        "pattern": "^(?:[1-9][0-9]{0,8}|1[0-9]{9}|20[0-9]{8}|21[0-3][0-9]{7}|214[0-6][0-9]{6}|2147[0-3][0-9]{5}|21474[0-7][0-9]{4}|214748[0-2][0-9]{3}|2147483[0-5][0-9]{2}|21474836[0-3][0-9]|214748364[0-7])$",
                        "not": {
                          "pattern": "[^0-9]"
                        },
                        "description": "Klientro bot ID from the Channels page, as a decimal string from 1 to 2147483647."
                      },
                      "messenger_user_id": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,64}$"
                      }
                    }
                  },
                  {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "profile_id"
                    ],
                    "properties": {
                      "profile_id": {
                        "type": "string",
                        "pattern": "^[1-9][0-9]{0,18}$",
                        "description": "Positive signed-int64 ID as a decimal string."
                      }
                    }
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Client ID used in variable paths and exports. No-store.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "profile_id"
                  ],
                  "properties": {
                    "profile_id": {
                      "type": "string",
                      "pattern": "^[1-9][0-9]{0,18}$",
                      "description": "Positive signed-int64 ID as a decimal string."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "Invalid request or identifier. A field with the wrong identifier type, spelling or range returns invalid_identifier."
          },
          "401": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "Invalid credentials. WWW-Authenticate Bearer."
          },
          "403": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "Insufficient scope or dashboard permission."
          },
          "404": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "Project, bot, client or project-owned WORKSPACE.USER variable inaccessible."
          },
          "405": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "Method not allowed; Allow lists supported methods. HEAD uses GET semantics and requires read scope."
          },
          "409": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "resource_busy or native_scope_busy (Retry-After 1), resource_changed, native_scope_owned, value_unset, invalid_stored_value, request_conflict or idempotency_conflict."
          },
          "410": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "operation_erased; permanent tombstone prevents execution."
          },
          "413": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "request_too_large; actual body exceeds 65536 bytes."
          },
          "415": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "json_required or unsupported_encoding."
          },
          "421": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "unknown_service_origin; check the configured HTTPS service origin."
          },
          "422": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "A body with the wrong object shape or duplicate members returns invalid_body. A JSON member containing NUL returns invalid_value."
          },
          "429": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "rate_limited; Retry-After in seconds."
          },
          "503": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "public_api_disabled or public_api_unavailable."
          }
        }
      }
    },
    "/projects/{project_id}/connection": {
      "servers": [
        {
          "url": "https://klientro.ru/api/public/v1",
          "description": "Public API"
        }
      ],
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          }
        }
      ],
      "get": {
        "operationId": "publicIntegrations.connection",
        "summary": "Проверить API-подключение",
        "x-klientro-guide": {
          "scope": "users:resolve · integrations:catalog:read · flow-invocations:write · flow-invocations:read",
          "detail": "Проверяет ключ проекта, его разрешения и доступность запуска сценариев."
        },
        "security": [
          {
            "publicApiKey": []
          }
        ],
        "description": "Requires users:resolve, integrations:catalog:read, flow-invocations:write or flow-invocations:read. Query parameters and Idempotency-Key are unsupported. No-store. invocation_available reflects live project invocation admission and runtime continuity.",
        "responses": {
          "200": {
            "description": "Project and credential metadata confirmed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "project_id",
                    "scopes",
                    "invocation_available"
                  ],
                  "properties": {
                    "project_id": {
                      "type": "string",
                      "pattern": "^[1-9][0-9]{0,18}$",
                      "description": "Positive signed-int64 ID as a decimal string."
                    },
                    "scopes": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "invocation_available": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "Invalid JSON, identifier, variable name or name list, header or insecure request."
          },
          "401": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "Invalid credentials. WWW-Authenticate Bearer."
          },
          "403": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "Insufficient scope or dashboard permission."
          },
          "404": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "Project, bot, client or project-owned WORKSPACE.USER variable inaccessible."
          },
          "405": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "Method not allowed; Allow lists supported methods. HEAD uses GET semantics and requires read scope."
          },
          "409": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "resource_busy or native_scope_busy (Retry-After 1), resource_changed, native_scope_owned, value_unset, invalid_stored_value, request_conflict or idempotency_conflict."
          },
          "410": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "operation_erased; permanent tombstone prevents execution."
          },
          "413": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "request_too_large; actual body exceeds 65536 bytes."
          },
          "415": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "json_required or unsupported_encoding."
          },
          "421": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "unknown_service_origin; check the configured HTTPS service origin."
          },
          "422": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "Invalid value, number_out_of_range, invalid_integer, unsupported_variable_type, not_numeric or value_too_large. No submitted or stored value is echoed."
          },
          "429": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "rate_limited; Retry-After in seconds."
          },
          "503": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "public_api_disabled, public_api_unavailable or native_scope_unavailable; no assumption about a lost COMMIT acknowledgement."
          }
        }
      }
    },
    "/projects/{project_id}/channels": {
      "servers": [
        {
          "url": "https://klientro.ru/api/public/v1",
          "description": "Public API"
        }
      ],
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          }
        }
      ],
      "get": {
        "operationId": "publicIntegrations.channels",
        "summary": "Получить подключённые каналы",
        "x-klientro-guide": {
          "scope": "integrations:catalog:read",
          "detail": "Возвращает подключённые каналы проекта постранично."
        },
        "security": [
          {
            "publicApiKey": []
          }
        ],
        "description": "Requires integrations:catalog:read. Returns currently active project channels in ascending bot ID order. No-store. An opaque cursor is bound to this project and catalog, with no snapshot across pages. Idempotency-Key is unsupported.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of connected channels.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "items",
                    "next_cursor"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "maxItems": 50,
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "bot_id",
                          "name",
                          "platform"
                        ],
                        "properties": {
                          "bot_id": {
                            "type": "string",
                            "pattern": "^(?:[1-9][0-9]{0,8}|1[0-9]{9}|20[0-9]{8}|21[0-3][0-9]{7}|214[0-6][0-9]{6}|2147[0-3][0-9]{5}|21474[0-7][0-9]{4}|214748[0-2][0-9]{3}|2147483[0-5][0-9]{2}|21474836[0-3][0-9]|214748364[0-7])$",
                            "not": {
                              "pattern": "[^0-9]"
                            },
                            "description": "Klientro bot ID from the Channels page, as a decimal string from 1 to 2147483647."
                          },
                          "name": {
                            "type": "string"
                          },
                          "platform": {
                            "type": "string",
                            "description": "Klientro platform constant such as tg."
                          }
                        }
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "Invalid JSON, identifier, variable name or name list, header or insecure request."
          },
          "401": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "Invalid credentials. WWW-Authenticate Bearer."
          },
          "403": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "Insufficient scope or dashboard permission."
          },
          "404": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "Project, bot, client or project-owned WORKSPACE.USER variable inaccessible."
          },
          "405": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "Method not allowed; Allow lists supported methods. HEAD uses GET semantics and requires read scope."
          },
          "409": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "resource_busy or native_scope_busy (Retry-After 1), resource_changed, native_scope_owned, value_unset, invalid_stored_value, request_conflict or idempotency_conflict."
          },
          "410": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "operation_erased; permanent tombstone prevents execution."
          },
          "413": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "request_too_large; actual body exceeds 65536 bytes."
          },
          "415": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "json_required or unsupported_encoding."
          },
          "421": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "unknown_service_origin; check the configured HTTPS service origin."
          },
          "422": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "Invalid value, number_out_of_range, invalid_integer, unsupported_variable_type, not_numeric or value_too_large. No submitted or stored value is echoed."
          },
          "429": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "rate_limited; Retry-After in seconds."
          },
          "503": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "public_api_disabled, public_api_unavailable or native_scope_unavailable; no assumption about a lost COMMIT acknowledgement."
          }
        }
      }
    },
    "/projects/{project_id}/channels/{bot_id}/flows": {
      "servers": [
        {
          "url": "https://klientro.ru/api/public/v1",
          "description": "Public API"
        }
      ],
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          }
        },
        {
          "name": "bot_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "pattern": "^(?:[1-9][0-9]{0,8}|1[0-9]{9}|20[0-9]{8}|21[0-3][0-9]{7}|214[0-6][0-9]{6}|2147[0-3][0-9]{5}|21474[0-7][0-9]{4}|214748[0-2][0-9]{3}|2147483[0-5][0-9]{2}|21474836[0-3][0-9]|214748364[0-7])$",
            "not": {
              "pattern": "[^0-9]"
            },
            "description": "Klientro bot ID from the Channels page, as a decimal string from 1 to 2147483647."
          }
        }
      ],
      "get": {
        "operationId": "publicIntegrations.channelFlows",
        "summary": "Получить доступные сценарии канала",
        "x-klientro-guide": {
          "scope": "integrations:catalog:read",
          "detail": "Возвращает доступные для запуска по API сценарии канала и их текущую версию entry_revision."
        },
        "security": [
          {
            "publicApiKey": []
          }
        ],
        "description": "Requires integrations:catalog:read. Returns enabled approved scenarios for the channel with their current entry_revision when invocation admission is open, or an empty page while held, and 404 if the channel is absent or inaccessible. No-store. Idempotency-Key is unsupported.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 20
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 512,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "A page of enabled selectable scenarios while invocation admission is open, or an empty page when held.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "items",
                    "next_cursor"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "maxItems": 50,
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "flow_id",
                          "name",
                          "entry_revision"
                        ],
                        "properties": {
                          "flow_id": {
                            "type": "string",
                            "pattern": "^[1-9][0-9]{0,18}$",
                            "description": "Positive signed-int64 ID as a decimal string."
                          },
                          "name": {
                            "type": "string"
                          },
                          "entry_revision": {
                            "type": "string",
                            "format": "uuid"
                          }
                        }
                      }
                    },
                    "next_cursor": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "Invalid JSON, identifier, variable name or name list, header or insecure request."
          },
          "401": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "Invalid credentials. WWW-Authenticate Bearer."
          },
          "403": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "Insufficient scope or dashboard permission."
          },
          "404": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "Project, bot, client or project-owned WORKSPACE.USER variable inaccessible."
          },
          "405": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "Method not allowed; Allow lists supported methods. HEAD uses GET semantics and requires read scope."
          },
          "409": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "resource_busy or native_scope_busy (Retry-After 1), resource_changed, native_scope_owned, value_unset, invalid_stored_value, request_conflict or idempotency_conflict."
          },
          "410": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "operation_erased; permanent tombstone prevents execution."
          },
          "413": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "request_too_large; actual body exceeds 65536 bytes."
          },
          "415": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "json_required or unsupported_encoding."
          },
          "421": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "unknown_service_origin; check the configured HTTPS service origin."
          },
          "422": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "Invalid value, number_out_of_range, invalid_integer, unsupported_variable_type, not_numeric or value_too_large. No submitted or stored value is echoed."
          },
          "429": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "rate_limited; Retry-After in seconds."
          },
          "503": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "public_api_disabled, public_api_unavailable or native_scope_unavailable; no assumption about a lost COMMIT acknowledgement."
          }
        }
      }
    },
    "/projects/{project_id}/flow-invocations": {
      "servers": [
        {
          "url": "https://klientro.ru/api/public/v1",
          "description": "Public API"
        }
      ],
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          }
        },
        {
          "name": "Idempotency-Key",
          "in": "header",
          "required": true,
          "schema": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "pattern": "^[A-Za-z0-9._:-]+$"
          }
        }
      ],
      "post": {
        "operationId": "publicIntegrations.invokeFlow",
        "summary": "Запустить сценарий канала по API",
        "x-klientro-guide": {
          "scope": "flow-invocations:write",
          "detail": "Ставит запуск сценария для клиента в очередь с защитой от повторов по Idempotency-Key."
        },
        "security": [
          {
            "publicApiKey": []
          }
        ],
        "description": "Requires flow-invocations:write and one required case-sensitive Idempotency-Key header. Queues at most one approved Telegram scenario invocation per customer when no pause, operator takeover, block, or conflicting active conversation applies. No-store.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "bot_id",
                  "flow_id",
                  "profile_id",
                  "entry_revision"
                ],
                "properties": {
                  "bot_id": {
                    "type": "string",
                    "pattern": "^(?:[1-9][0-9]{0,8}|1[0-9]{9}|20[0-9]{8}|21[0-3][0-9]{7}|214[0-6][0-9]{6}|2147[0-3][0-9]{5}|21474[0-7][0-9]{4}|214748[0-2][0-9]{3}|2147483[0-5][0-9]{2}|21474836[0-3][0-9]|214748364[0-7])$",
                    "not": {
                      "pattern": "[^0-9]"
                    },
                    "description": "Klientro bot ID from the Channels page, as a decimal string from 1 to 2147483647."
                  },
                  "flow_id": {
                    "type": "string",
                    "pattern": "^[1-9][0-9]{0,18}$",
                    "description": "Positive signed-int64 ID as a decimal string."
                  },
                  "profile_id": {
                    "type": "string",
                    "pattern": "^[1-9][0-9]{0,18}$",
                    "description": "Positive signed-int64 ID as a decimal string."
                  },
                  "entry_revision": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Command durably admitted (or exact accepted replay); poll Location for first runtime settlement.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Location": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "invocation_id"
                  ],
                  "properties": {
                    "invocation_id": {
                      "type": "string",
                      "format": "uuid"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "Invalid JSON, identifier, variable name or name list, header or insecure request."
          },
          "401": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "Invalid credentials. WWW-Authenticate Bearer."
          },
          "403": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "Insufficient scope or dashboard permission."
          },
          "404": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "Project, bot, client or project-owned WORKSPACE.USER variable inaccessible."
          },
          "405": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "Method not allowed; Allow lists supported methods. HEAD uses GET semantics and requires read scope."
          },
          "409": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "idempotency_conflict, invocation_unavailable, resource_busy (Retry-After 1), invocation_target_changed or invocation_ineligible."
          },
          "410": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "operation_erased; permanent tombstone prevents execution."
          },
          "413": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "request_too_large; actual body exceeds 65536 bytes."
          },
          "415": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "json_required or unsupported_encoding."
          },
          "421": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "unknown_service_origin; check the configured HTTPS service origin."
          },
          "422": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "Invalid value, number_out_of_range, invalid_integer, unsupported_variable_type, not_numeric or value_too_large. No submitted or stored value is echoed."
          },
          "429": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "rate_limited; Retry-After in seconds."
          },
          "503": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "public_api_disabled, invocation_admission_disabled or public_api_unavailable."
          }
        }
      }
    },
    "/projects/{project_id}/flow-invocations/{invocation_id}": {
      "servers": [
        {
          "url": "https://klientro.ru/api/public/v1",
          "description": "Public API"
        }
      ],
      "parameters": [
        {
          "name": "project_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "integer",
            "format": "int64",
            "minimum": 1
          }
        },
        {
          "name": "invocation_id",
          "in": "path",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid",
            "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$"
          }
        }
      ],
      "get": {
        "operationId": "publicIntegrations.flowInvocation",
        "summary": "Получить статус запуска сценария",
        "x-klientro-guide": {
          "scope": "flow-invocations:read",
          "detail": "Возвращает статус запуска сценария и доставки сообщения."
        },
        "security": [
          {
            "publicApiKey": []
          }
        ],
        "description": "Requires flow-invocations:read. Returns project-scoped invocation status and outbound message delivery_status. Returns 404 once erased or expired. Idempotency-Key and query parameters are unsupported. No-store.",
        "responses": {
          "200": {
            "description": "Invocation status envelope; queued results include Retry-After.",
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              },
              "Retry-After": {
                "required": false,
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "invocation_id",
                    "status",
                    "accepted_at",
                    "expires_at",
                    "settled_at",
                    "reason",
                    "delivery_status"
                  ],
                  "properties": {
                    "invocation_id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "status": {
                      "type": "string",
                      "enum": [
                        "queued",
                        "transitioned",
                        "refused",
                        "expired"
                      ]
                    },
                    "accepted_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "expires_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "settled_at": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "date-time"
                    },
                    "reason": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "enum": [
                        "access_changed",
                        "contact_ineligible",
                        "target_changed",
                        "runtime_attempts_exhausted",
                        "admission_deadline_exceeded",
                        null
                      ]
                    },
                    "delivery_status": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "enum": [
                        "intended",
                        "retryable",
                        "sent",
                        "confirmed",
                        "failed",
                        "cancelled",
                        "unknown",
                        null
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "Invalid JSON, identifier, variable name or name list, header or insecure request."
          },
          "401": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "Invalid credentials. WWW-Authenticate Bearer."
          },
          "403": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "Insufficient scope or dashboard permission."
          },
          "404": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "Project, bot, client or project-owned WORKSPACE.USER variable inaccessible."
          },
          "405": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "Method not allowed; Allow lists supported methods. HEAD uses GET semantics and requires read scope."
          },
          "409": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "resource_busy or native_scope_busy (Retry-After 1), resource_changed, native_scope_owned, value_unset, invalid_stored_value, request_conflict or idempotency_conflict."
          },
          "410": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "operation_erased; permanent tombstone prevents execution."
          },
          "413": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "request_too_large; actual body exceeds 65536 bytes."
          },
          "415": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "json_required or unsupported_encoding."
          },
          "421": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "unknown_service_origin; check the configured HTTPS service origin."
          },
          "422": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "Invalid value, number_out_of_range, invalid_integer, unsupported_variable_type, not_numeric or value_too_large. No submitted or stored value is echoed."
          },
          "429": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "rate_limited; Retry-After in seconds."
          },
          "503": {
            "headers": {
              "Cache-Control": {
                "schema": {
                  "type": "string",
                  "const": "no-store"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": false,
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "string",
                      "pattern": "^[a-z_]{1,64}$"
                    }
                  }
                }
              }
            },
            "description": "public_api_disabled, public_api_unavailable or native_scope_unavailable; no assumption about a lost COMMIT acknowledgement."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "publicApiKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "Opaque kl_ project key; never accepted by dashboard authentication"
      }
    }
  },
  "webhooks": {
    "flow_invocation.settled": {
      "post": {
        "operationId": "publicWebhooks.eventFlowInvocationSettled",
        "summary": "Результат запуска сценария",
        "description": "Signed Standard Webhooks POST sent to active subscriptions when a queued invocation reaches its first terminal state. Signed with base64-decoded binary whsec_ keys over ${webhook-id}.${webhook-timestamp}.${raw_utf8_body}.",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]+$"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Space-separated v1,<base64> HMAC-SHA256 signatures."
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "id",
                  "type",
                  "timestamp",
                  "schema_version",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "type": {
                    "type": "string",
                    "const": "flow_invocation.settled"
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "schema_version": {
                    "type": "integer",
                    "const": 1
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "project_id",
                      "invocation_id",
                      "status",
                      "reason"
                    ],
                    "properties": {
                      "project_id": {
                        "type": "string",
                        "pattern": "^[1-9][0-9]{0,18}$"
                      },
                      "invocation_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "transitioned",
                          "refused",
                          "expired"
                        ]
                      },
                      "reason": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "enum": [
                          "access_changed",
                          "contact_ineligible",
                          "target_changed",
                          "runtime_attempts_exhausted",
                          "admission_deadline_exceeded",
                          null
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Event acknowledged by receiver."
          },
          "410": {
            "description": "Endpoint gone; disables this active subscription generation and cancels queued retries."
          },
          "429": {
            "description": "Rate-limited by receiver; retried with Retry-After / backoff."
          },
          "500": {
            "description": "Receiver error; retried with exponential backoff until deadline."
          }
        }
      }
    },
    "webhook.test_ping": {
      "post": {
        "operationId": "publicWebhooks.eventTestPing",
        "summary": "Тестовый пинг подписки",
        "description": "Synthetic Standard Webhooks POST triggered manually from dashboard settings outside business events.",
        "parameters": [
          {
            "name": "webhook-id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "webhook-timestamp",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9]+$"
            }
          },
          {
            "name": "webhook-signature",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Space-separated v1,<base64> HMAC-SHA256 signatures."
            }
          },
          {
            "name": "X-Klientro-Webhook-Test",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "const": "true"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "id",
                  "type",
                  "timestamp",
                  "schema_version",
                  "data"
                ],
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "type": {
                    "type": "string",
                    "const": "webhook.test_ping"
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "schema_version": {
                    "type": "integer",
                    "const": 1
                  },
                  "data": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "project_id",
                      "subscription_id",
                      "synthetic"
                    ],
                    "properties": {
                      "project_id": {
                        "type": "string",
                        "pattern": "^[1-9][0-9]{0,18}$"
                      },
                      "subscription_id": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "synthetic": {
                        "type": "boolean",
                        "const": true
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Test ping acknowledged by receiver."
          }
        }
      }
    }
  }
}
