{
  "openapi": "3.1.0",
  "info": {
    "title": "Whiskers Public API",
    "description": "Whiskers agent'larını dışa açan public REST yüzeyi.\n\n**Kimlik doğrulama:** `/agents/*` uçları `Authorization: Bearer wsk_...` API key ya da `WhiskersHMAC` imzalı istek ister.\n\n**İstisna — `/shares/{token}`:** paylaşılan konuşma görünümü kimlik doğrulaması İSTEMEZ; yetki linkin kendisidir. Yalnız okunur ve donmuş bir kopyayı döndürür; kapılar süre sonu, iptal ve kurumun paylaşım anahtarıdır.",
    "version": "0.1.0"
  },
  "paths": {
    "/api/public/v1/agents/{agent_slug}/invoke": {
      "post": {
        "tags": [
          "public-agents"
        ],
        "summary": "Public Invoke Agent",
        "operationId": "public_invoke_agent_api_public_v1_agents__agent_slug__invoke_post",
        "parameters": [
          {
            "name": "agent_slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Agent Slug"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicInvokeRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicExecutionRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/agents/{agent_slug}/invoke-async": {
      "post": {
        "tags": [
          "public-agents"
        ],
        "summary": "Public Invoke Agent Async",
        "description": "Background'da çalıştır + execution bitince sonucu `callback_url`'e POST et.\n\nYalnız API anahtarı: callback kaydı anahtara bağlıdır. OAuth\nkullanıcı token'ı → 403 `api_key_required`; `invoke` + `\"async\": true` +\ndurum sorgusu kullanılır.",
        "operationId": "public_invoke_agent_async_api_public_v1_agents__agent_slug__invoke_async_post",
        "parameters": [
          {
            "name": "agent_slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Agent Slug"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicInvokeAsyncRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicExecutionRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/agents/{agent_slug}/documents": {
      "post": {
        "tags": [
          "public-agents"
        ],
        "summary": "Public Upload Document",
        "description": "Agent'a geçici (TTL'li) doküman yükle —\ntxt/pdf/docx/xlsx/pptx/odt/ods/odp/doc/xls/ppt.\n\n`conversation_id` verilmezse yeni bir konuşma açılır ve yanıtta döner; onu\n`invoke`'a geçirerek dokümanı bağlama sokarsın.\n\n**Varsayılan senkron:** yanıt `ingested` ise doküman hazırdır. `?async=true`\nile arka plana alınırsa `pending` döner ve **`ingested` görene kadar invoke\nedilmemelidir** — aksi halde agent dokümanı görmeden cevaplar. Durum\n`GET .../documents/{document_id}` ile sorgulanır; koruma olarak `pending`\ndoküman varken invoke 409 döner.\n\n`agent:upload_document` scope'u ister ve ayrı saatlik yükleme limitine tabidir.",
        "operationId": "public_upload_document_api_public_v1_agents__agent_slug__documents_post",
        "parameters": [
          {
            "name": "agent_slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Agent Slug"
            }
          },
          {
            "name": "async",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Ingest'i arka plana al (devasa dosya). Varsayılan senkron: yanıt `ingested` döner ve doküman hemen invoke edilebilir.",
              "default": false,
              "title": "Async"
            },
            "description": "Ingest'i arka plana al (devasa dosya). Varsayılan senkron: yanıt `ingested` döner ve doküman hemen invoke edilebilir."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "multipart/form-data": {
              "schema": {
                "$ref": "#/components/schemas/Body_public_upload_document_api_public_v1_agents__agent_slug__documents_post"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicDocumentRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/agents/{agent_slug}/documents/{document_id}": {
      "get": {
        "tags": [
          "public-agents"
        ],
        "summary": "Public Document Status",
        "description": "Yüklenen dokümanın durumu — `?async=true` yolunda `ingested` görene kadar poll et.\n\nSenkron yolda (varsayılan) gerekmez: yükleme zaten `ingested` döner.",
        "operationId": "public_document_status_api_public_v1_agents__agent_slug__documents__document_id__get",
        "parameters": [
          {
            "name": "agent_slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Agent Slug"
            }
          },
          {
            "name": "document_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Document Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicDocumentRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/agents/{agent_slug}/executions/{execution_id}": {
      "get": {
        "tags": [
          "public-agents"
        ],
        "summary": "Public Execution Status",
        "operationId": "public_execution_status_api_public_v1_agents__agent_slug__executions__execution_id__get",
        "parameters": [
          {
            "name": "agent_slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Agent Slug"
            }
          },
          {
            "name": "execution_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Execution Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicExecutionRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/agents/{agent_slug}/executions/{execution_id}/events": {
      "get": {
        "tags": [
          "public-agents"
        ],
        "summary": "Public Execution Events",
        "description": "Koşuyu canlı izle: bekleme ekranı için Server-Sent Events.\n\nYalnız koşuyu başlatan anahtar ya da kişi bağlanır. İlk olay `snapshot`\n(durum ucunun gövdesi); koşu bitmiş ya da onay bekliyorsa onun yerine\n`completed` · `failed` · `cancelled` · `awaiting_human` gelir ve akış kapanır.\nSonra `started`, `stage` (aşama metni değişince), `token` (yalnız\n`tokens=true`), `ping`. Bağlantı koparsa yeniden bağlanın — yeni bağlantı\ngüncel özetle başlar. Aynı anda açık akış sayısı sınırlıdır (429\n`api_key_stream_limit`); bağlantı ömrü dolunca `snapshot` gönderilip kapanır.",
        "operationId": "public_execution_events_api_public_v1_agents__agent_slug__executions__execution_id__events_get",
        "parameters": [
          {
            "name": "agent_slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Agent Slug"
            }
          },
          {
            "name": "execution_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Execution Id"
            }
          },
          {
            "name": "tokens",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "description": "Cevap metni yazıldıkça `token` olaylarıyla aksın (varsayılan kapalı).",
              "default": false,
              "title": "Tokens"
            },
            "description": "Cevap metni yazıldıkça `token` olaylarıyla aksın (varsayılan kapalı)."
          }
        ],
        "responses": {
          "200": {
            "description": "Server-Sent Events akışı (`text/event-stream`).",
            "content": {
              "text/event-stream": {}
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/agents/{agent_slug}/executions/{execution_id}/cancel": {
      "post": {
        "tags": [
          "public-agents"
        ],
        "summary": "Public Cancel Execution",
        "description": "Koşuyu iptal et: yalnız koşuyu başlatan anahtar ya da kişi.\n\nKoşu durur (arka planda koşuyorsa yürüten süreç sinyalle durdurulur, alt\najanlar da durur) ve `cancelled` olur; callback kaydı varsa `cancelled` ile\nteslim edilir. Başkasının koşusu 404, bitmiş koşu 409 `execution_not_active`.",
        "operationId": "public_cancel_execution_api_public_v1_agents__agent_slug__executions__execution_id__cancel_post",
        "parameters": [
          {
            "name": "agent_slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Agent Slug"
            }
          },
          {
            "name": "execution_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Execution Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicExecutionRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/agents/{agent_slug}/executions/{execution_id}/decision": {
      "post": {
        "tags": [
          "public-agents"
        ],
        "summary": "Public Execution Decision",
        "description": "Onay bekleyen koşuda karar ver: `approve` · `deny` · `revise`.\n\nKonsoldaki onay kartıyla aynı kural: karar yetkisi onay adımının onaycı\nlistesinden gelir (yoksa ajanın onay listesi, o da yoksa ajanın erişim\nlistesi); liste varken koşuyu başlatan kendi adımını geçemez ve bir koşuda\nbir adımı onaylayan sonraki adımı onaylayamaz. `deny` ve `revise` `note`\nister; `revise` adımın düzeltme hakkı dolunca 409 döner. `gate` ZORUNLUDUR:\ndurum ucunun `awaiting_gate` değeri; koşu başka bir adımda bekliyorsa 409\n`gate_mismatch` (tekrar denenen istek sonraki kademeyi onaylayamaz). Aynı\nadıma ikinci karar 409.\n\nİki kimlik: **kişi token'ı** (PAT/OAuth, `agent:approve` kapsamı) — kural\nyukarıdaki gibi; **onaycı API anahtarı** (`agent:approve` kapsamı, `subject`\nzorunlu) — yalnız onay adımına ADIYLA yazıldığı adımı onaylar, koşuyu\nkendisi başlattıysa onaylayamaz; `subject` her kararda zorunludur ve kimlik\ndeğil beyandır (\"X sistemi, şu kişi adına\"). Oda ve test koşuları dış karara\nkapalıdır (403). `approve`/`revise` koşuyu istek içinde sürdürür; devam\nkoşusunun kotası koşuyu başlatandan düşer. Yanıt koşunun yeni durumudur (bir\nsonraki adımda bekliyorsa yine `awaiting_human`).",
        "operationId": "public_execution_decision_api_public_v1_agents__agent_slug__executions__execution_id__decision_post",
        "parameters": [
          {
            "name": "agent_slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Agent Slug"
            }
          },
          {
            "name": "execution_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Execution Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PublicDecisionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicExecutionRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/api/public/v1/shares/{token}": {
      "get": {
        "tags": [
          "public-shares"
        ],
        "summary": "View Public Shared Conversation",
        "description": "**Anonim** paylaşılan konuşma görünümü — kimlik doğrulaması YOKTUR.\n\nTüm ret sebepleri (yok · süresi dolmuş · iptal · kurum içi bir link ·\ntenant anahtarı kapalı) ayrımsız **404** döner: \"var ama süresi dolmuş\"\nbilgisi bile token'ın bir zamanlar geçerli olduğunu doğrulardı.\n\nTenant anahtarı **okuma anında** kontrol edilir → admin anahtarı\nkapattığında mevcut linkler de anında körelir (kill-switch).\n\nIP başına dakikalık rate limit uygulanır; yanıt arama motorlarına\nkapatılır (`X-Robots-Tag`).",
        "operationId": "view_public_shared_conversation_api_public_v1_shares__token__get",
        "parameters": [
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Token"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicSharedConversationRead"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Body_public_upload_document_api_public_v1_agents__agent_slug__documents_post": {
        "properties": {
          "file": {
            "type": "string",
            "contentMediaType": "application/octet-stream",
            "title": "File"
          },
          "conversation_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Conversation Id"
          },
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "subject": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subject"
          }
        },
        "type": "object",
        "required": [
          "file"
        ],
        "title": "Body_public_upload_document_api_public_v1_agents__agent_slug__documents_post"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "PublicDecisionRequest": {
        "properties": {
          "decision": {
            "type": "string",
            "enum": [
              "approve",
              "deny",
              "revise"
            ],
            "title": "Decision"
          },
          "gate": {
            "type": "string",
            "maxLength": 255,
            "minLength": 1,
            "title": "Gate"
          },
          "note": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 4000
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          },
          "subject": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subject"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "decision",
          "gate"
        ],
        "title": "PublicDecisionRequest",
        "description": "Onay bekleyen koşuda karar gövdesi: `approve` · `deny` · `revise`.\n\n`gate`: durum ucunun `awaiting_gate` değeri; koşu başka bir adımda bekliyorsa\n409 `gate_mismatch`. `note`: red ve düzeltmede zorunlu (yoksa 422), onayda\nisteğe bağlı. `subject` yalnız onaycı API anahtarında anlamlıdır ve zorunludur;\nkişi token'ında yok sayılır."
      },
      "PublicDocumentRead": {
        "properties": {
          "conversation_id": {
            "type": "string",
            "format": "uuid",
            "title": "Conversation Id"
          },
          "document_id": {
            "type": "string",
            "format": "uuid",
            "title": "Document Id"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "chunk_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Chunk Count"
          }
        },
        "type": "object",
        "required": [
          "conversation_id",
          "document_id",
          "status"
        ],
        "title": "PublicDocumentRead",
        "description": "Doküman yükleme yanıtı.\n\n`status`: `ingested` → doküman hazır, invoke edilebilir. `pending` → yalnız\n`?async=true` yolunda görülür; **çağıran `ingested` görene kadar invoke\nETMEMELİDİR** (etse agent dokümanı görmeden cevaplar). `failed` → ingest\nhata aldı, doküman bağlama girmez.\n\n`conversation_id` invoke'a geçirilecek anahtardır: dokümanı bağlama sokan şey\nodur. Doküman TTL'lidir (varsayılan 24 saat) ve süre sonunda temizlenir."
      },
      "PublicExecutionError": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code"
          }
        },
        "type": "object",
        "required": [
          "code"
        ],
        "title": "PublicExecutionError",
        "description": "`failed` koşunun makine-okunur sebebi (ör. `execution_stale`, `tenant_suspended`)."
      },
      "PublicExecutionRead": {
        "properties": {
          "execution_id": {
            "type": "string",
            "format": "uuid",
            "title": "Execution Id"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "output": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Output"
          },
          "conversation_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Conversation Id"
          },
          "output_truncated": {
            "type": "boolean",
            "title": "Output Truncated",
            "default": false
          },
          "blocked_tools": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Blocked Tools"
          },
          "model_fallback": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Fallback"
          },
          "subject": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subject"
          },
          "decision": {
            "anyOf": [
              {
                "type": "string",
                "const": "denied"
              },
              {
                "type": "null"
              }
            ],
            "title": "Decision"
          },
          "reason": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PublicHumanDecisionReason"
              },
              {
                "type": "null"
              }
            ]
          },
          "error": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/PublicExecutionError"
              },
              {
                "type": "null"
              }
            ]
          },
          "awaiting_gate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Awaiting Gate"
          },
          "queued_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Queued At"
          },
          "started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Started At"
          },
          "elapsed_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Elapsed Ms"
          },
          "current_stage": {
            "anyOf": [
              {
                "type": "string",
                "enum": [
                  "queued",
                  "running",
                  "awaiting_human"
                ]
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Stage"
          },
          "stage_label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stage Label"
          },
          "stage_code": {
            "anyOf": [
              {
                "type": "string",
                "const": "reviewing_results"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stage Code"
          }
        },
        "type": "object",
        "required": [
          "execution_id",
          "status"
        ],
        "title": "PublicExecutionRead",
        "description": "Koşu yanıtı (invoke, durum ucu ve callback).\n\n`output_truncated`: koşu `completed` bitti ama model çıktı sınırını doldurdu\nve cevap cümlenin ortasında kesildi — içerik gerçektir, yalnız yarımdır.\n`status` bunu söylemez.\n\n`blocked_tools`: koşu `completed` bitti ama model bu araçları çalıştıramadı\n(izin ya da yapılandırma sorunu); cevap o araçların verisi olmadan yazıldı."
      },
      "PublicHumanDecisionReason": {
        "properties": {
          "gate": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Gate"
          },
          "note": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Note"
          },
          "by": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "By"
          },
          "by_type": {
            "type": "string",
            "enum": [
              "user",
              "api_key"
            ],
            "title": "By Type",
            "default": "user"
          },
          "subject": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Subject"
          }
        },
        "type": "object",
        "title": "PublicHumanDecisionReason",
        "description": "İnsan onayında reddin gerekçesi — callback gövdesindeki `reason` ile aynı şekil."
      },
      "PublicInvokeAsyncRequest": {
        "properties": {
          "input_message": {
            "type": "string",
            "minLength": 1,
            "title": "Input Message"
          },
          "callback_url": {
            "type": "string",
            "minLength": 1,
            "title": "Callback Url"
          },
          "conversation_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Conversation Id"
          },
          "start_conversation": {
            "type": "boolean",
            "title": "Start Conversation",
            "default": false
          },
          "subject": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 256
              },
              {
                "type": "null"
              }
            ],
            "title": "Subject"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "input_message",
          "callback_url"
        ],
        "title": "PublicInvokeAsyncRequest",
        "description": "Async invoke + webhook callback — execution bitince sonuç callback_url'e POST edilir."
      },
      "PublicInvokeRequest": {
        "properties": {
          "input_message": {
            "type": "string",
            "minLength": 1,
            "title": "Input Message"
          },
          "async": {
            "type": "boolean",
            "title": "Async",
            "default": false
          },
          "conversation_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Conversation Id"
          },
          "start_conversation": {
            "type": "boolean",
            "title": "Start Conversation",
            "default": false
          },
          "subject": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 256
              },
              {
                "type": "null"
              }
            ],
            "title": "Subject"
          }
        },
        "additionalProperties": false,
        "type": "object",
        "required": [
          "input_message"
        ],
        "title": "PublicInvokeRequest"
      },
      "PublicSharedConversationRead": {
        "properties": {
          "title": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Title"
          },
          "messages": {
            "items": {
              "$ref": "#/components/schemas/SharedMessage"
            },
            "type": "array",
            "title": "Messages"
          },
          "header": {
            "$ref": "#/components/schemas/ShareHeader"
          },
          "watermark": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ShareWatermark"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "title",
          "messages",
          "header"
        ],
        "title": "PublicSharedConversationRead",
        "description": "Herkese açık paylaşım bağlantısının görünümü (kimlik doğrulaması istemez)."
      },
      "ShareHeader": {
        "properties": {
          "tenant_display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tenant Display Name"
          },
          "agent_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Name"
          },
          "shared_at": {
            "type": "string",
            "format": "date-time",
            "title": "Shared At"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expires At"
          }
        },
        "type": "object",
        "required": [
          "shared_at",
          "expires_at"
        ],
        "title": "ShareHeader",
        "description": "Paylaşım sayfasının başlık verisi — her yanıtta bulunur (filigran kapalı olsa da)."
      },
      "ShareWatermark": {
        "properties": {
          "tenant_display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Tenant Display Name"
          },
          "agent_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Agent Name"
          },
          "shared_at": {
            "type": "string",
            "format": "date-time",
            "title": "Shared At"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expires At"
          },
          "shared_by_display_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Shared By Display Name"
          }
        },
        "type": "object",
        "required": [
          "shared_at",
          "expires_at"
        ],
        "title": "ShareWatermark",
        "description": "Filigran verisi — kurum filigranı kapattıysa `null` gelir.\n\nBaşlık alanlarına ek olarak yalnız paylaşan kişinin görünen adını taşır\n(e-postasını taşımaz)."
      },
      "SharedMessage": {
        "properties": {
          "role": {
            "type": "string",
            "title": "Role"
          },
          "content": {
            "type": "string",
            "title": "Content"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "output_truncated": {
            "type": "boolean",
            "title": "Output Truncated",
            "default": false
          },
          "truncated_sub_agents": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Truncated Sub Agents"
          },
          "blocked_tools": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Blocked Tools"
          },
          "model_fallback": {
            "anyOf": [
              {
                "additionalProperties": true,
                "type": "object"
              },
              {
                "type": "null"
              }
            ],
            "title": "Model Fallback"
          },
          "rag_sources": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Rag Sources"
          }
        },
        "type": "object",
        "required": [
          "role",
          "content",
          "created_at"
        ],
        "title": "SharedMessage",
        "description": "Paylaşılan konuşmadaki tek mesaj — paylaşım anında dondurulmuş kopya.\n\nEksiklik işaretleri (`output_truncated`, `truncated_sub_agents`,\n`blocked_tools`, `model_fallback`) paylaşımda da korunur."
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      }
    }
  }
}
