{"openapi":"3.1.0","info":{"title":"ZvonAI Developer API","description":"Programmatic access to ZvonAI: calls, appointments, analytics, knowledge and webhooks. Authenticate with a `zv_live_` API key as a Bearer token (Business plan or higher), or a `zv_test_` sandbox key: test keys have full read parity, but every write is SIMULATED, validated and idempotency-checked, never persisted, no side effects (no webhooks, SMS or calendar writes). Every v2 response carries `livemode` (true/false) plus an `X-ZvonAI-Livemode` header. v2 is the current contract (cursor pagination, error envelope, `Idempotency-Key` on writes, `RateLimit-*` headers); v1 is read-only and frozen. The hosted MCP endpoint (`POST /v2/mcp`) is also reachable on the dedicated host `https://mcp.zvonai.ai`.","version":"2.0.0","x-mcp":{"url":"https://mcp.zvonai.ai/v2/mcp","transport":"streamable-http","description":"Hosted remote MCP endpoint (read tools; same API key)."}},"paths":{"/health":{"get":{"tags":["status"],"summary":"Health","operationId":"health_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health/detailed":{"get":{"tags":["status"],"summary":"Health Detailed","operationId":"health_detailed_health_detailed_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SystemHealthResponse"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/health/live":{"get":{"tags":["status"],"summary":"Liveness","operationId":"liveness_health_live_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/health/ready":{"get":{"tags":["status"],"summary":"Readiness","operationId":"readiness_health_ready_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/status":{"get":{"tags":["status"],"summary":"Public Status","description":"Public status payload: drives zvonai.ai/status and the dashboard widget.","operationId":"public_status_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusPageResponse"}}}}}}},"/status/incidents/{incident_id}":{"get":{"tags":["status"],"summary":"Get Incident","operationId":"get_incident_status_incidents__incident_id__get","parameters":[{"name":"incident_id","in":"path","required":true,"schema":{"type":"string","title":"Incident Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IncidentDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/status/subscribe":{"post":{"tags":["status"],"summary":"Subscribe","operationId":"subscribe_status_subscribe_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscribeBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/status/confirm":{"get":{"tags":["status"],"summary":"Confirm Subscription","operationId":"confirm_subscription_status_confirm_get","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/status/unsubscribe":{"get":{"tags":["status"],"summary":"Unsubscribe","operationId":"unsubscribe_status_unsubscribe_get","parameters":[{"name":"token","in":"query","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/incidents":{"get":{"tags":["admin"],"summary":"Admin Incidents","description":"Last 10 provider downtime and auto-fallback events from the audit log.","operationId":"admin_incidents_admin_incidents_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/AuditLogEntry"},"type":"array","title":"Response Admin Incidents Admin Incidents Get"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]},"post":{"tags":["status"],"summary":"Admin Create Incident","operationId":"admin_create_incident_admin_incidents_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IncidentCreateBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IncidentDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/incidents/{incident_id}/updates":{"post":{"tags":["status"],"summary":"Admin Post Update","operationId":"admin_post_update_admin_incidents__incident_id__updates_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"incident_id","in":"path","required":true,"schema":{"type":"string","title":"Incident Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IncidentUpdateBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IncidentDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/status/incidents":{"post":{"tags":["status"],"summary":"Ci Open Incident","description":"Open a status incident from CI (post-deploy gate failure).\n\nUsed by .github/workflows/ci.yaml when post-deploy synthetic call fails.\nThe deploy SHA is recorded so the incident can be correlated with the\nbad release for instant rollback targeting.\n\nDedup: if an open auto-opened incident already covers any of the affected\ncomponents, a timeline update is appended to it instead of opening a new\nrow. Without this, a repeatedly-failing signal (e.g. the auth canary every\n30 min) piles a fresh public major_outage incident onto the status page per\nrun (2026-08-05: six duplicates for one root cause).","operationId":"ci_open_incident_internal_status_incidents_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CiIncidentBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IncidentDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/status/incidents/auto-resolve":{"post":{"tags":["status"],"summary":"Ci Auto Resolve Incidents","description":"Resolve open AUTO-OPENED incidents for a component from a recovered signal.\n\nCounterpart to ci_open_incident for signals the in-process health reconciler\ncannot see: health_checker has no probe for e.g. `dashboard`, so incidents\nthe auth canary opens are never transitioned by reconcile_with_health and\nsit open forever (2026-08-01..05). The canary calls this on a PASS, exactly\nlike reconcile_with_synthetic_call(success=True) does for voice.\n\nManual (admin-posted) incidents are never touched.","operationId":"ci_auto_resolve_incidents_internal_status_incidents_auto_resolve_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CiResolveBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/canary/ensure-chat-fixture":{"post":{"tags":["status"],"summary":"Ensure Canary Chat Fixture","description":"Idempotently make the auth-canary user Zvon-chat-probe ready.\n\nThe chat canary (infrastructure/auth-canary/ + post-deploy chat smoke)\nPOSTs a real /agent/chat message as auth-canary@zvonai.ai. That endpoint\nrequires a verified user WITH a tenant — the canary account was seeded for\nlogin testing only (unverified, tenant-less; its e-mail is suppressed in\nEmailService so it can never verify itself). This endpoint repairs the\nfixture per environment without manual SQL: marks the canary user verified\nand binds it to a deterministic, is_internal tenant (excluded from customer\nmetrics, mirrors the admin scratch-tenant pattern in routers/agent.py).\n\nTouches ONLY the settings.auth_canary_email user. Safe to call every run.","operationId":"ensure_canary_chat_fixture_internal_canary_ensure_chat_fixture_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/status/deploy-event":{"post":{"tags":["status"],"summary":"Ci Deploy Event","description":"Record a successful deploy as a status-page event (low-noise).\n\nJust writes a structured log entry — these don't open incidents, they\ncorrelate with the next signal failure (so we can blame a deploy).","operationId":"ci_deploy_event_internal_status_deploy_event_post","parameters":[{"name":"authorization","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Authorization"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CiDeployEventBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/metrics":{"get":{"tags":["status"],"summary":"Metrics","operationId":"metrics_metrics_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/auth/register":{"post":{"tags":["auth"],"summary":"Register","description":"Register a new user (creates user without tenant - tenant assigned during onboarding).","operationId":"register_auth_register_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserRegister"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/login":{"post":{"tags":["auth"],"summary":"Login","description":"Login and get access token.\n\nA session lasts an hour so a stolen token dies quickly. Owners work in the\npanel every day and were retyping their password each hour, so ticking\n\"keep me signed in\" asks for REMEMBER_ME_DAYS instead. It stays opt-in, and\n\"log out everywhere\" still revokes it because the token carries a jti.","operationId":"login_auth_login_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_login_auth_login_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/me":{"get":{"tags":["auth"],"summary":"Get Me","description":"Get current user info including subscription tier from tenant.","operationId":"get_me_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]},"delete":{"tags":["auth"],"summary":"Delete My Account","description":"Erase the calling user's OWN account (GDPR Art. 17).\n\nTombstone: PII nulled, row retained for audit-log referential integrity\n(Art. 17(3)(b)+(e)); every session dies immediately.\n\nGuards:\n- password re-auth (Google-only accounts must set a password first —\n  same rule as change-password)\n- a SOLE OWNER of a live tenant cannot self-delete: they must transfer\n  ownership (Settings → Team) or delete the whole business account\n  first. An ownerless tenant taking calls is not a valid state.","operationId":"delete_my_account_auth_me_delete","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteMyAccountRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]},"patch":{"tags":["auth"],"summary":"Update Me","description":"Update the signed-in account's own name and SMS phone.","operationId":"update_me_auth_me_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MeUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/auth/logout":{"post":{"tags":["auth"],"summary":"Logout","description":"Blacklist the current JWT so it can't be reused.","operationId":"logout_auth_logout_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/auth/logout-all":{"post":{"tags":["auth"],"summary":"Logout All Sessions","description":"Log out every device: invalidate all JWTs issued before now.\n\nReuses the permissions_changed_at mechanism (get_current_user rejects\ntokens issued before it), so it works even when Redis is down. A fresh\ntoken keeps THIS device logged in — same UX as change-password.","operationId":"logout_all_sessions_auth_logout_all_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/auth/refresh":{"post":{"tags":["auth"],"summary":"Refresh Token","description":"Issue a new token and blacklist the old one.","operationId":"refresh_token_auth_refresh_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/auth/change-password":{"post":{"tags":["auth"],"summary":"Change Password","description":"Change password.","operationId":"change_password_auth_change_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordChange"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/auth/set-password":{"post":{"tags":["auth"],"summary":"Set Password","description":"A Google-login account adds a password from Settings so both ways of\nsigning in work. Only for accounts that have no password yet; an account\nwith one uses /change-password (current password required). The session\nthat sets it is already authenticated, and the owner is emailed.","operationId":"set_password_auth_set_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordSet"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/auth/verify-password":{"post":{"tags":["auth"],"summary":"Verify Password Endpoint","description":"Re-authenticate: verify the user's password for sensitive actions (e.g., delete account).","operationId":"verify_password_endpoint_auth_verify_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/auth/me/avatar":{"post":{"tags":["auth"],"summary":"Upload Avatar","description":"Set the signed-in account's profile picture (PNG/JPG/WebP, max 2 MB).","operationId":"upload_avatar_auth_me_avatar_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_avatar_auth_me_avatar_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]},"delete":{"tags":["auth"],"summary":"Delete Avatar","description":"Remove the profile picture: the dashboard falls back to initials.","operationId":"delete_avatar_auth_me_avatar_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/auth/oauth/google/url":{"get":{"tags":["auth"],"summary":"Get Google Auth Url","description":"Return the Google OAuth consent URL.\n\nIncludes a signed, short-lived `state` JWT — the callback must echo it\nback and /oauth/google verifies it, closing the login-CSRF hole where an\nattacker could complete OAuth in the victim's browser with the\nattacker's code (journey audit 2026-07-14, P1-4).","operationId":"get_google_auth_url_auth_oauth_google_url_get","parameters":[{"name":"redirect_uri","in":"query","required":true,"schema":{"type":"string","title":"Redirect Uri"}},{"name":"remember","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Remember"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleAuthUrlResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/oauth/google":{"post":{"tags":["auth"],"summary":"Google Oauth Login","description":"Exchange Google authorization code for JWT token.","operationId":"google_oauth_login_auth_oauth_google_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GoogleOAuthRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/2fa/challenge":{"post":{"tags":["auth"],"summary":"Two Factor Challenge","description":"Verify 2FA code and issue full access token.","operationId":"two_factor_challenge_auth_2fa_challenge_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TwoFactorChallengeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/2fa/resend":{"post":{"tags":["auth"],"summary":"Two Factor Resend","description":"Re-send the email 2FA code during a login challenge (audit P2 —\na delayed/spam-foldered email previously dead-ended the login; the\nonly escape was restarting the whole flow).","operationId":"two_factor_resend_auth_2fa_resend_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TwoFactorResendRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/change-email":{"post":{"tags":["auth"],"summary":"Request Email Change","description":"Start an email change: password re-auth, then a 6-digit code is sent\nto the NEW address (proves ownership). The old email stays live until\n/confirm-email-change, so a typo can't lock the user out.","operationId":"request_email_change_auth_change_email_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailChangeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/auth/confirm-email-change":{"post":{"tags":["auth"],"summary":"Confirm Email Change","description":"Complete the email change with the code sent to the new address.","operationId":"confirm_email_change_auth_confirm_email_change_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailChangeConfirm"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/auth/forgot-password":{"post":{"tags":["auth"],"summary":"Forgot Password","description":"Send password reset email.","operationId":"forgot_password_auth_forgot_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ForgotPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/reset-password":{"post":{"tags":["auth"],"summary":"Reset Password","description":"Reset password using a valid reset token.","operationId":"reset_password_auth_reset_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResetPasswordRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/verify-email":{"post":{"tags":["auth"],"summary":"Verify Email","description":"Verify email address using the token from the verification email.","operationId":"verify_email_auth_verify_email_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyEmailRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/verify-email-code":{"post":{"tags":["auth"],"summary":"Verify Email Code","description":"Verify email address using the 6-digit code sent to the user's inbox.\n\nRate-limited + per-code attempt counter: a 6-digit code is only 10^6\npossibilities, and this endpoint had NO limiter (audit 2026-07-08 A2) —\nbrute-forceable from distributed IPs. The Redis attempt counter is keyed\non the email so rotating IPs doesn't help: 5 wrong codes invalidates the\ncode and the user must request a fresh one.","operationId":"verify_email_code_auth_verify_email_code_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyEmailCodeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/resend-verification-by-email":{"post":{"tags":["auth"],"summary":"Resend Verification By Email","description":"Resend email verification code without requiring auth token (for post-registration flow).","operationId":"resend_verification_by_email_auth_resend_verification_by_email_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResendVerificationByEmailRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/resend-verification":{"post":{"tags":["auth"],"summary":"Resend Verification","description":"Resend email verification link (rate limited to 3 per 15 minutes).","operationId":"resend_verification_auth_resend_verification_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/onboarding/complete":{"post":{"tags":["onboarding"],"summary":"Complete Onboarding","description":"Complete onboarding: create tenant, provision number, optionally start Stripe checkout.\n\nConcurrent-submit guard (audit fix): Redis SET NX claim per user_id with\n60s TTL. Prevents duplicate tenant creation + double Telnyx purchase when\nthe dashboard double-submits (mobile double-tap, retry on 502 from Stripe).","operationId":"complete_onboarding_onboarding_complete_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/onboarding/scrape-faq":{"post":{"tags":["onboarding"],"summary":"Onboarding Scrape Faq","description":"Scrape FAQ from a website during onboarding (no tenant required).","operationId":"onboarding_scrape_faq_onboarding_scrape_faq_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingScrapeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingScrapeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/onboarding/request-number":{"post":{"tags":["onboarding"],"summary":"Request Phone Number","description":"Provision an additional number for an existing tenant.","operationId":"request_phone_number_onboarding_request_number_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneNumberRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/onboarding/status":{"get":{"tags":["onboarding"],"summary":"Get Onboarding Status","description":"Get current onboarding status for user.","operationId":"get_onboarding_status_onboarding_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/onboarding/forwarding-instructions":{"get":{"tags":["onboarding"],"summary":"Get Forwarding Instructions","description":"Get carrier-specific call forwarding instructions for the tenant's ZvonAI number.\n\nThe GSM/USSD codes are identical across every Polish carrier (3GPP standard);\nonly the no-answer ring timer is tenant-selectable (3/5/7 rings). Returns the\nstored ``answering_mode`` and a ready-to-paste backup greeting so the owner\ncan wire up AI-as-backup without leaving the dashboard.","operationId":"get_forwarding_instructions_onboarding_forwarding_instructions_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"rings","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"null"}],"description":"Rings before the AI answers on no-answer: 3, 5 or 7. Omit to use the tenant's saved preference (#181).","title":"Rings"},"description":"Rings before the AI answers on no-answer: 3, 5 or 7. Omit to use the tenant's saved preference (#181)."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/onboarding/verify-forwarding":{"post":{"tags":["onboarding"],"summary":"Verify Call Forwarding","description":"Place a test call to verify call forwarding reaches our voice engine.\n\nThe owner sets up forwarding on their carrier, then clicks \"Test\" in the UI.\nWe call their original number — if forwarding is set up correctly, the call\nreaches our voice engine and the AI greeting plays.","operationId":"verify_call_forwarding_onboarding_verify_forwarding_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyForwardingRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/onboarding/draft":{"get":{"tags":["onboarding"],"summary":"Get Onboarding Draft","description":"Load onboarding draft from server.\n\nAlso carries deployment flags the wizard needs BEFORE a tenant exists\n(tenant-scoped responses can't serve a user who hasn't finished signup).","operationId":"get_onboarding_draft_onboarding_draft_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]},"put":{"tags":["onboarding"],"summary":"Save Onboarding Draft","description":"Persist onboarding draft to the server so progress survives across devices.\n\nHard-caps the JSON body at 64 KiB to prevent unauthenticated DB bloat —\npre-onboarding users can hit this endpoint and would otherwise be able to\nwrite unbounded JSON into users.onboarding_data.","operationId":"save_onboarding_draft_onboarding_draft_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SaveDraftRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/tenants/trial-by-owner-phone/{phone_number}":{"get":{"tags":["tenants"],"summary":"Get Trial Tenant By Owner Phone","description":"Resolve a TRIAL tenant by its owner's registered phone number.\n\nCalled by the voice engine when the SHARED trial number receives a call:\nif the caller is the owner of exactly one active trial tenant, the call is\ntreated as an owner test call (TRYB TESTOWY — their own AI config, signed\ntest sentinel, no minute deduction) instead of the generic demo persona.\n\nService-to-service only (X-Internal-Key) — phone numbers are enumerable\nand this maps them to tenant identity (same rationale as /by-number, H3).\n\nEligibility = \"parked on a shared number\" (no dedicated line yet): that\ncovers tier-trial tenants AND paid-tier signups still in their pre-payment\ntrial period (e.g. Solo/status=trialing) — both can only test via the\nshared line. Once a dedicated number is provisioned the shared row is\nreleased and recognition stops matching them, automatically. Ambiguity\n(0 or 2+ matches) returns 404 — the caller then gets the polite fallback.","operationId":"get_trial_tenant_by_owner_phone_tenants_trial_by_owner_phone__phone_number__get","parameters":[{"name":"phone_number","in":"path","required":true,"schema":{"type":"string","title":"Phone Number"}},{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/by-number/{phone_number}":{"get":{"tags":["tenants"],"summary":"Get Tenant By Number","description":"Get tenant config by assigned phone number.\n\nCalled by voice engine to load config when a call comes in.\n\nService-to-service only (X-Internal-Key): returns the full tenant config\n(system prompt, FAQ, transfer numbers, data sources). Must never be\nanonymously reachable — phone numbers are enumerable. See SECURITY_REVIEW_2026-06-18 H3.","operationId":"get_tenant_by_number_tenants_by_number__phone_number__get","parameters":[{"name":"phone_number","in":"path","required":true,"schema":{"type":"string","title":"Phone Number"}},{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/":{"get":{"tags":["tenants"],"summary":"List Tenants","description":"List all tenants (admin only).","operationId":"list_tenants_tenants__get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"skip","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/src__routers__tenants__TenantListResponse"},"title":"Response List Tenants Tenants  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["tenants"],"summary":"Create Tenant","description":"Create a new tenant.","operationId":"create_tenant_tenants__post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routers__tenants__TenantListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/nip-lookup":{"get":{"tags":["tenants"],"summary":"Nip Lookup","description":"Look up company data from GUS BIR by NIP.\n\nReturns 400 if NIP format is invalid, 404 if not in GUS,\n503 if GUS is unreachable.","operationId":"nip_lookup_tenants_nip_lookup_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"nip","in":"query","required":true,"schema":{"type":"string","description":"10-digit NIP number","title":"Nip"},"description":"10-digit NIP number"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NipLookupResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}":{"get":{"tags":["tenants"],"summary":"Get Tenant","description":"Get full tenant config by ID.\n\nDual auth: X-Internal-Key (service-to-service) OR owner/admin JWT. The\nvoice-engine's Telnyx stream-token path loads tenant config through this\nendpoint with only the internal key — when it required a JWT, every\nTelnyx call 401'd → no_tenant_configured → dead line while the daily\ncall test stayed green (2026-07-13 incident, degraded since the 06-19\nstream-token release). by-number/{phone} and {id}/context use the same\ninternal-key trust level, so this exposes nothing new to services.","operationId":"get_tenant_tenants__tenant_id__get","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["tenants"],"summary":"Update Tenant","description":"Update tenant settings.","operationId":"update_tenant_tenants__tenant_id__patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routers__tenants__TenantListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["tenants"],"summary":"Delete Tenant Account","description":"Delete tenant account and all associated data (GDPR Art. 17 - right to erasure).\n\nGuards:\n- Must own the tenant (or be admin)\n- Subscription must be cancelled or non-existent (can't delete while paying)\n- No outstanding invoices\n\nHard deletes: tenant profile, phone numbers, departments, calls, transcripts, usage.\nRetains (7 years, Polish tax law): invoices, payment records.","operationId":"delete_tenant_account_tenants__tenant_id__delete","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAccountRequest"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/settings":{"get":{"tags":["tenants"],"summary":"Get Tenant Settings","description":"Get billing/quota and data-retention settings for a tenant.","operationId":"get_tenant_settings_tenants__tenant_id__settings_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantSettingsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["tenants"],"summary":"Update Tenant Settings","description":"Update billing/quota and data-retention settings.","operationId":"update_tenant_settings_tenants__tenant_id__settings_put","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantSettingsUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantSettingsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/readiness":{"get":{"tags":["tenants"],"summary":"Get Tenant Readiness","description":"Go-live readiness checklist — what's done, what's left, and deep-links.\n\nSingle source of truth shared with the Zvon agent's check_readiness tool.","operationId":"get_tenant_readiness_tenants__tenant_id__readiness_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/knowledge-score":{"get":{"tags":["tenants"],"summary":"Get Knowledge Score","description":"Knowledge score (0–100) + „zna już N odpowiedzi\" + next best actions.\n\nComputed on read from the tenant's own corpus (FAQ, resolved missed\nquestions, guidance rules, documents, services, sources). Same formula as\nthe Zvon get_knowledge_score tool (services/knowledge_score.py). Crossing\nan answer-count milestone (25/50/100) creates the one-time in-app\nnotification + `knowledge.milestone_reached` webhook as a side effect.","operationId":"get_knowledge_score_tenants__tenant_id__knowledge_score_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeScoreResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/forwarding/check":{"post":{"tags":["tenants"],"summary":"Start Forwarding Check","description":"Ring the owner's business phone from a ZvonAI platform number and time the\ncarrier forwarding it back (owner objection 2026-09-11: \"we cannot see what timer is\nsaved on your phone\" is a button, not a sentence).","operationId":"start_forwarding_check_tenants__tenant_id__forwarding_check_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["tenants"],"summary":"Read Forwarding Check","operationId":"read_forwarding_check_tenants__tenant_id__forwarding_check_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/go-live":{"post":{"tags":["tenants"],"summary":"Go Live","description":"Activate the AI to take real calls. Refuses if required setup is missing.","operationId":"go_live_tenants__tenant_id__go_live_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/verification-config":{"get":{"tags":["tenants"],"summary":"Get Verification Config","description":"Return the tenant's caller verification config (with defaults if not yet set).","operationId":"get_verification_config_tenants__tenant_id__verification_config_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerificationConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["tenants"],"summary":"Update Verification Config","description":"Update caller verification config for a tenant.","operationId":"update_verification_config_tenants__tenant_id__verification_config_patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerificationConfigUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerificationConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/reminder-config":{"get":{"tags":["tenants"],"summary":"Get Reminder Config","description":"Return the tenant's appointment reminder config (with defaults if not yet set).","operationId":"get_reminder_config_tenants__tenant_id__reminder_config_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReminderConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["tenants"],"summary":"Update Reminder Config","description":"Update appointment reminder config for a tenant.","operationId":"update_reminder_config_tenants__tenant_id__reminder_config_patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReminderConfigUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReminderConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/quota":{"get":{"tags":["tenants"],"summary":"Check Tenant Quota","description":"Check if tenant has quota to accept a NEW inbound call.\n\nCalled by voice engine at the TwiML layer before opening a media stream.\nCalls already in progress are never interrupted — quota is only checked\nat call START. If this returns allowed=False, voice engine plays a polite\nrejection TwiML and hangs up before any stream is opened.\n\ncaller_hash (optional, salted SHA-256 — never the raw number) enables the\nper-caller daily abuse cap: a single number can't burn the tenant's monthly\nquota by calling repeatedly. Enforced HERE (pre-answer) so the voice engine\ncan speak a polite message and forward to the business, not drop to silence.","operationId":"check_tenant_quota_tenants__tenant_id__quota_get","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"caller_hash","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caller Hash"}},{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QuotaResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/usage":{"get":{"tags":["tenants"],"summary":"Get Tenant Usage","description":"Get detailed usage breakdown for the dashboard.\n\nDual auth: X-Internal-Key (service-to-service) OR owner/admin JWT — same\ntrust model as get_tenant above. The 2026-07-08 A4 hardening made this\ninternal-key-only, which silently 422'd the dashboard billing page's\nBearer-only call (it swallowed the error and showed fallback trial\nmeters instead of real usage — E2E audit 2026-07-31).","operationId":"get_tenant_usage_tenants__tenant_id__usage_get","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/anomalies":{"get":{"tags":["tenants"],"summary":"Get Tenant Anomalies","description":"Return anomaly alerts for this tenant from the last 24 hours (max 5).\n\nOnly the tenant's own user may query this endpoint.","operationId":"get_tenant_anomalies_tenants__tenant_id__anomalies_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AnomalyEntry"},"title":"Response Get Tenant Anomalies Tenants  Tenant Id  Anomalies Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/usage/sms":{"post":{"tags":["tenants"],"summary":"Increment Sms Usage","description":"Increment tenant's SMS usage counter. Called by voice engine after sending SMS.","operationId":"increment_sms_usage_tenants__tenant_id__usage_sms_post","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SMSUsageIncrement"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/phone-numbers":{"post":{"tags":["tenants"],"summary":"Assign Phone Number","description":"Assign a phone number to a tenant.","operationId":"assign_phone_number_tenants__tenant_id__phone_numbers_post","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneNumberAssign"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["tenants"],"summary":"List Phone Numbers","description":"List all phone numbers assigned to this tenant.\n\nCalled by the owner's dashboard with their JWT — was previously gated\nbehind X-Internal-Key, which 422'd every dashboard load and (via the\noverview's Promise.all) blanked the whole panel including the quota\nwidget. Scoped to the caller's own tenant for isolation.","operationId":"list_phone_numbers_tenants__tenant_id__phone_numbers_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/phone-numbers/{phone_id}":{"patch":{"tags":["tenants"],"summary":"Update Phone Number","description":"Update phone number label or active status.","operationId":"update_phone_number_tenants__tenant_id__phone_numbers__phone_id__patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"phone_id","in":"path","required":true,"schema":{"type":"string","title":"Phone Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneNumberUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["tenants"],"summary":"Delete Phone Number","description":"Remove an assigned phone number.","operationId":"delete_phone_number_tenants__tenant_id__phone_numbers__phone_id__delete","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"phone_id","in":"path","required":true,"schema":{"type":"string","title":"Phone Id"}},{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/phone-numbers/request":{"post":{"tags":["tenants"],"summary":"Request Phone Number","description":"Request a new phone number (creates a pending audit log entry for admin review).","operationId":"request_phone_number_tenants__tenant_id__phone_numbers_request_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneNumberRequestBody"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/phone-numbers/provision":{"post":{"tags":["tenants"],"summary":"Provision Phone Number","description":"Instantly provision a new Polish phone number for a Business+ tenant.","operationId":"provision_phone_number_tenants__tenant_id__phone_numbers_provision_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/departments":{"get":{"tags":["tenants"],"summary":"List Departments","description":"List all departments for a tenant.","operationId":"list_departments_tenants__tenant_id__departments_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DepartmentResponse"},"title":"Response List Departments Tenants  Tenant Id  Departments Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["tenants"],"summary":"Add Department","description":"Add a department to a tenant.","operationId":"add_department_tenants__tenant_id__departments_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepartmentCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/departments/{department_id}":{"patch":{"tags":["tenants"],"summary":"Update Department","description":"Update a department.","operationId":"update_department_tenants__tenant_id__departments__department_id__patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"department_id","in":"path","required":true,"schema":{"type":"string","title":"Department Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepartmentCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepartmentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["tenants"],"summary":"Delete Department","description":"Delete a department.","operationId":"delete_department_tenants__tenant_id__departments__department_id__delete","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"department_id","in":"path","required":true,"schema":{"type":"string","title":"Department Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/export":{"get":{"tags":["tenants"],"summary":"Export Tenant Data","description":"Export all tenant data (GDPR Art. 20 - right to data portability).\n\nReturns complete JSON export of tenant's data including:\n- Profile information\n- Call history and transcripts\n- Appointments\n- CRM caller profiles and notes\n- Consent records (tenant + caller)\n- Usage statistics\n- Configuration settings\n\nCalls and appointments (the large tables) are windowed by ?offset= and\n?limit= (max 1000); clients page until both lists come back shorter than\nthe limit. calls_pagination echoes the window used.","operationId":"export_tenant_data_tenants__tenant_id__export_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":1000,"minimum":1,"default":1000,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataExportResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/undelete":{"post":{"tags":["tenants"],"summary":"Undelete Tenant Account","description":"Restore a tenant account that is in the 30-day delete grace period.\n\nRequires admin role OR the original owner whose user record still\nreferences this tenant_id. Phone numbers were released to the provider\non delete (audit fix #50), so the owner needs to reprovision via\n/onboarding/request-number — that's a deliberate UX choice to avoid\nleaving paid Telnyx numbers attached to dormant accounts.","operationId":"undelete_tenant_account_tenants__tenant_id__undelete_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/calls/active":{"get":{"tags":["tenants"],"summary":"Get Active Calls","description":"Get current active calls count for a tenant. Called by voice engine pre-call.","operationId":"get_active_calls_tenants__tenant_id__calls_active_get","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/calls/active/increment":{"post":{"tags":["tenants"],"summary":"Increment Active Calls","description":"Atomically increment calls_active when a call starts.\n\nGating (\"no call missed while the plan has fuel\", owner decision\n2026-08-10):\n  - TRIALING → atomically gated at concurrent_calls_limit; the loser\n    gets `accepted=False` and the voice engine plays \"all lines busy\".\n    Trials share the trial line — the cap is the abuse guard.\n  - PAID, below the plan's concurrent limit → accepted (unchanged).\n  - PAID, AT/OVER the concurrent limit → accepted IF the concurrent-\n    overage toggle is on (overage_enabled — default ON since migration\n    151; OFF = the tenant explicitly prefers a polite busy message) AND\n    the plan still has fuel: minutes_used_this_month < minutes_limit,\n    or billed minute-overage consent (minute_overage_enabled). The extra\n    simultaneous call is flagged is_overage=True and draws from the SAME\n    monthly minute quota — there is NO separate concurrency charge\n    (double-counting removed 2026-06-11). Toggle off / no fuel → busy.\n\nReturns:\n    accepted: bool          — False when the concurrent limit is hit and\n                              the extra simultaneous call is not opted into\n    calls_active: int       — the post-increment count (or pre if rejected)\n    limit: int              — the plan's concurrent calls limit\n    is_overage: bool        — True when this call exceeded the concurrent\n                              limit (analytics only; not billed separately)","operationId":"increment_active_calls_tenants__tenant_id__calls_active_increment_post","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/calls/active/decrement":{"post":{"tags":["tenants"],"summary":"Decrement Active Calls","description":"Atomically decrement calls_active when a call ends. Called by voice engine.","operationId":"decrement_active_calls_tenants__tenant_id__calls_active_decrement_post","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/calls/overage":{"post":{"tags":["tenants"],"summary":"Record Call Overage","description":"Record overage minutes from a concurrent-overage call. Called by voice engine at call end.\n\nAtomically adds minutes to overage_minutes counter. Month-end cron bills at the tier's cennik rate.","operationId":"record_call_overage_tenants__tenant_id__calls_overage_post","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OverageRecordRequest"}}}},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/security-events":{"post":{"tags":["tenants"],"summary":"Log Security Event","description":"Log a security event from voice engine (social engineering, prompt injection).","operationId":"log_security_event_tenants__tenant_id__security_events_post","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SecurityEventCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/calendar":{"get":{"tags":["tenants"],"summary":"Get Calendar Status","description":"Get calendar integration status for a tenant.\n\nOwner-only: leaks the connected Google account email otherwise.\nSee SECURITY_REVIEW_2026-06-18 M2.","operationId":"get_calendar_status_tenants__tenant_id__calendar_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["tenants"],"summary":"Disconnect Calendar","description":"Disconnect calendar integration (remove stored tokens).\n\nOwner-only: prevents an anonymous request from wiping any tenant's calendar\nintegration. See SECURITY_REVIEW_2026-06-18 H6.","operationId":"disconnect_calendar_tenants__tenant_id__calendar_delete","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/payment-config":{"get":{"tags":["tenants"],"summary":"Get Payment Config","description":"Return the payment configuration for a tenant.","operationId":"get_payment_config_tenants__tenant_id__payment_config_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["tenants"],"summary":"Update Payment Config","description":"Create or update the payment configuration for a tenant.","operationId":"update_payment_config_tenants__tenant_id__payment_config_put","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentConfigUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/data-sources":{"get":{"tags":["tenants"],"summary":"List Data Sources","description":"List all data sources for a tenant.","operationId":"list_data_sources_tenants__tenant_id__data_sources_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DataSourceResponse"},"title":"Response List Data Sources Tenants  Tenant Id  Data Sources Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["tenants"],"summary":"Create Data Source","description":"Create a new data source for a tenant. Requires Business plan or higher.","operationId":"create_data_source_tenants__tenant_id__data_sources_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataSourceCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataSourceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/data-sources/service-account":{"get":{"tags":["tenants"],"summary":"Get Sheets Service Account","description":"The service-account e-mail owners must share their Google Sheet with.","operationId":"get_sheets_service_account_tenants__tenant_id__data_sources_service_account_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/data-sources/{source_id}":{"patch":{"tags":["tenants"],"summary":"Update Data Source","description":"Update a data source.","operationId":"update_data_source_tenants__tenant_id__data_sources__source_id__patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"source_id","in":"path","required":true,"schema":{"type":"string","title":"Source Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataSourceUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataSourceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["tenants"],"summary":"Delete Data Source","description":"Delete a data source.","operationId":"delete_data_source_tenants__tenant_id__data_sources__source_id__delete","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"source_id","in":"path","required":true,"schema":{"type":"string","title":"Source Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/data-sources/{source_id}/consent":{"get":{"tags":["tenants"],"summary":"Get Data Source Consent","description":"Return latest consent for this source, or null if owner hasn't given any.\nUsed by the dashboard to know whether to show the modal or proceed.","operationId":"get_data_source_consent_tenants__tenant_id__data_sources__source_id__consent_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"source_id","in":"path","required":true,"schema":{"type":"string","title":"Source Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["tenants"],"summary":"Post Data Source Consent","description":"Record owner consent for AI processing of sensitive data on this source.\n\nAppend-only — every call inserts a new row. Captures IP + user-agent +\npinned terms/privacy versions for non-repudiation. Owner re-consents\nif previously-unseen sensitive columns appear in a later fetch.","operationId":"post_data_source_consent_tenants__tenant_id__data_sources__source_id__consent_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"source_id","in":"path","required":true,"schema":{"type":"string","title":"Source Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/consent/legal-basis-options":{"get":{"tags":["tenants"],"summary":"Get Consent Legal Basis Options","description":"List the plain-language legal-basis options for the consent modal.","operationId":"get_consent_legal_basis_options_tenants__tenant_id__consent_legal_basis_options_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"locale","in":"query","required":false,"schema":{"type":"string","default":"pl","title":"Locale"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/data-sources/{source_id}/test":{"post":{"tags":["tenants"],"summary":"Test Data Source","description":"Test the connection to a Google Sheet by reading its first row.","operationId":"test_data_source_tenants__tenant_id__data_sources__source_id__test_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"source_id","in":"path","required":true,"schema":{"type":"string","title":"Source Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/data-sources/{source_id}/sync":{"post":{"tags":["tenants"],"summary":"Sync Data Source","description":"Trigger an immediate manual sync for one data source.\n\nAlso (re-)registers the Google Drive push notification watch channel.\nReturns {success, row_count, last_synced_at}.","operationId":"sync_data_source_tenants__tenant_id__data_sources__source_id__sync_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"source_id","in":"path","required":true,"schema":{"type":"string","title":"Source Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/data-sources/{source_id}/sync-status":{"get":{"tags":["tenants"],"summary":"Get Sync Status","description":"Return sync status for a data source.\n\nResponse: {last_synced_at: ISO str | null, row_count: int | null, is_stale: bool}\nis_stale = True when last sync was >5 minutes ago or never synced.","operationId":"get_sync_status_tenants__tenant_id__data_sources__source_id__sync_status_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"source_id","in":"path","required":true,"schema":{"type":"string","title":"Source Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/data-sources/import-excel":{"post":{"tags":["tenants"],"summary":"Import Excel","description":"Parse an uploaded .xlsx file and return a preview + detected column names.\n\nMulti-sheet workbooks: one sheet is imported per call (`sheet_name` selects it;\ndefault = the workbook's active sheet). The response lists every sheet plus the\nones NOT imported, so the client can warn the user and offer to import the\nremaining sheets as separate data sources instead of dropping them silently.\n\nThe parsed rows are stored in Redis under a temporary import key (TTL 30d).\nThe caller should then POST /data-sources with type='excel_imported' and the\nreturned import_id to create a permanent data source backed by the cached rows.","operationId":"import_excel_tenants__tenant_id__data_sources_import_excel_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"sheet_name","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sheet Name"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_import_excel_tenants__tenant_id__data_sources_import_excel_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/clients/lookup":{"get":{"tags":["tenants"],"summary":"Clients Lookup","description":"Verify a caller against the tenant's client records (voice engine, internal).\n\nTHE identity check behind verify_caller: a match here means the calling\nnumber appears in records the business itself maintains — an appointment\nthey booked, or a row in the business's client sheet/Excel. An impersonator\nwould have to be calling FROM the client's own number.\n\nMatched against, in order:\n  1. appointments.patient_phone (any non-cancelled appointment)\n  2. cached data-source rows (phone-synonym columns), same normalisation\n     the sheet tooling uses (+48/0048 stripped, 9-digit national compare)\n\nReturns 200 {\"name\": ..., \"matched_in\": ...} on match, 404 when unknown.\nNever returns case data — verification yields identity only; data flows\nthrough search_client_data with its own redaction rules.\n\nNOTE: this endpoint existed only as a voice-engine CLIENT until 2026-07-09\n— every call 404'd, so verified=true was unreachable and Business+ tenants\ncould never answer case-status questions. (Journey audit fix.)","operationId":"clients_lookup_tenants__tenant_id__clients_lookup_get","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"phone","in":"query","required":true,"schema":{"type":"string","description":"Caller phone number (raw, from telephony)","title":"Phone"},"description":"Caller phone number (raw, from telephony)"},{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/crm/callers":{"get":{"tags":["tenants"],"summary":"Crm Lookup Caller","description":"Look up a caller's CRM profile and call stats by phone number.","operationId":"crm_lookup_caller_tenants__tenant_id__crm_callers_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"phone","in":"query","required":true,"schema":{"type":"string","description":"Caller phone number","title":"Phone"},"description":"Caller phone number"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/crm/callers/export":{"get":{"tags":["tenants"],"summary":"Crm Export Callers Csv","description":"GDPR-safe CSV export: phone_hash + name only (no raw phone numbers).","operationId":"crm_export_callers_csv_tenants__tenant_id__crm_callers_export_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/crm/callers/list":{"get":{"tags":["tenants"],"summary":"Crm List Callers","description":"List all caller profiles for this tenant, optionally filtered by name.","operationId":"crm_list_callers_tenants__tenant_id__crm_callers_list_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"search","in":"query","required":false,"schema":{"type":"string","description":"Search by name","default":"","title":"Search"},"description":"Search by name"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/crm/callers/history":{"get":{"tags":["tenants"],"summary":"Crm Get Call History","description":"Get the last N calls for a caller.\n\nThe dashboard only holds `phone_hash` (raw numbers are never sent to the\nclient for RODO reasons), so we match on the indexed `caller_number_hash`.\nThe voice engine, which has the raw number, may pass `phone` instead.","operationId":"crm_get_call_history_tenants__tenant_id__crm_callers_history_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"phone","in":"query","required":false,"schema":{"type":"string","description":"Caller phone number (raw)","default":"","title":"Phone"},"description":"Caller phone number (raw)"},{"name":"phone_hash","in":"query","required":false,"schema":{"type":"string","description":"Salted SHA-256 of the caller number","default":"","title":"Phone Hash"},"description":"Salted SHA-256 of the caller number"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":5,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/crm/callers/notes":{"post":{"tags":["tenants"],"summary":"Crm Add Caller Note","description":"Add a note to a caller's CRM profile.","operationId":"crm_add_caller_note_tenants__tenant_id__crm_callers_notes_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallerNoteRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/crm/callers/name":{"put":{"tags":["tenants"],"summary":"Crm Update Caller Name","description":"Set or update the caller's display name.\n\nAccepts either `phone_hash` (from the dashboard, which never holds raw\nnumbers) or `phone_number` (from the voice engine). Profiles are keyed by\nhash, so a hash from the list lookup updates the existing row directly.","operationId":"crm_update_caller_name_tenants__tenant_id__crm_callers_name_put","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallerNameRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/crm/callers/{phone_hash}":{"delete":{"tags":["tenants"],"summary":"Crm Delete Caller Profile","description":"GDPR Art. 17. Delete caller profile and notes. Call records are retained (legitimate interest).","operationId":"crm_delete_caller_profile_tenants__tenant_id__crm_callers__phone_hash__delete","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"phone_hash","in":"path","required":true,"schema":{"type":"string","title":"Phone Hash"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/crm/config":{"get":{"tags":["tenants"],"summary":"Get Crm Config","description":"Return current external CRM integration config (api_key masked).","operationId":"get_crm_config_tenants__tenant_id__crm_config_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["tenants"],"summary":"Save Crm Config","description":"Save external CRM integration settings.","operationId":"save_crm_config_tenants__tenant_id__crm_config_put","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CrmConfigRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/crm/test":{"post":{"tags":["tenants"],"summary":"Test Crm Connection","description":"Test the external CRM connection using saved credentials.","operationId":"test_crm_connection_tenants__tenant_id__crm_test_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/crm/specialists":{"get":{"tags":["tenants"],"summary":"Get Crm Specialists","description":"Return specialists/doctors from the connected CRM (used by dashboard wizard).","operationId":"get_crm_specialists_tenants__tenant_id__crm_specialists_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/crm/services":{"get":{"tags":["tenants"],"summary":"Get Crm Services","description":"Return services/treatments from the connected CRM (used by dashboard wizard).","operationId":"get_crm_services_tenants__tenant_id__crm_services_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"specialist_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Specialist Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/context":{"get":{"tags":["tenants"],"summary":"Get Tenant Context","description":"Return the full business context the AI agent needs at call start.\n\nIncludes greeting, FAQ, business hours, policies, voice config, and\ndata sources where ai_access=true and is_active=true.\n\nService-to-service only (X-Internal-Key): this dumps system prompt + FAQ +\nimported data-source rows (may contain customer/patient lists), so it must\nnever be anonymously reachable. See SECURITY_REVIEW_2026-06-18 H2.","operationId":"get_tenant_context_tenants__tenant_id__context_get","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/calendar/appointments":{"get":{"tags":["tenants"],"summary":"List Appointments","description":"List appointments for a date range (default: current week).","operationId":"list_appointments_tenants__tenant_id__calendar_appointments_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"from_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO date YYYY-MM-DD (default: start of current week)","title":"From Date"},"description":"ISO date YYYY-MM-DD (default: start of current week)"},{"name":"to_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO date YYYY-MM-DD (default: end of current week)","title":"To Date"},"description":"ISO date YYYY-MM-DD (default: end of current week)"},{"name":"assigned_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Filter by assigned team member user ID","title":"Assigned To"},"description":"Filter by assigned team member user ID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AppointmentResponse"},"title":"Response List Appointments Tenants  Tenant Id  Calendar Appointments Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["tenants"],"summary":"Create Appointment","description":"Create a new appointment.","operationId":"create_appointment_tenants__tenant_id__calendar_appointments_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppointmentCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppointmentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/calendar/availability":{"get":{"tags":["tenants"],"summary":"Get Availability","description":"Single source of truth for available booking slots on a given date.\n\nLayers: working hours (with day overrides) → minus buffer-expanded busy\nslots → minus blocked time → free slots. Both the voice engine and booking\nwidget call this.","operationId":"get_availability_tenants__tenant_id__calendar_availability_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"date","in":"query","required":true,"schema":{"type":"string","description":"ISO date YYYY-MM-DD","title":"Date"},"description":"ISO date YYYY-MM-DD"},{"name":"duration","in":"query","required":false,"schema":{"anyOf":[{"type":"integer","maximum":480,"minimum":5},{"type":"null"}],"description":"Slot duration in minutes (default: tenant setting)","title":"Duration"},"description":"Slot duration in minutes (default: tenant setting)"},{"name":"service","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Service"}},{"name":"language","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Only when the caller asked to be served in this language","title":"Language"},"description":"Only when the caller asked to be served in this language"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AvailableSlot"},"title":"Response Get Availability Tenants  Tenant Id  Calendar Availability Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/calendar/appointments/{appointment_id}":{"patch":{"tags":["tenants"],"summary":"Update Appointment","description":"Update appointment status, reschedule, or edit notes.","operationId":"update_appointment_tenants__tenant_id__calendar_appointments__appointment_id__patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"appointment_id","in":"path","required":true,"schema":{"type":"string","title":"Appointment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppointmentUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppointmentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["tenants"],"summary":"Cancel Appointment","description":"Cancel an appointment (sets status=cancelled, does not delete the row).","operationId":"cancel_appointment_tenants__tenant_id__calendar_appointments__appointment_id__delete","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"appointment_id","in":"path","required":true,"schema":{"type":"string","title":"Appointment Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/calendar/appointments/requests":{"get":{"tags":["tenants"],"summary":"List Booking Requests","description":"Booking requests waiting for the owner (booking_mode = request).","operationId":"list_booking_requests_tenants__tenant_id__calendar_appointments_requests_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/calendar/appointments/{appointment_id}/request/confirm":{"patch":{"tags":["tenants"],"summary":"Confirm Booking Request","description":"Owner confirms a phone booking request (optionally at another time):\nthe slot is checked, the visit becomes scheduled, the client gets the\nconfirmation SMS with the booking code.","operationId":"confirm_booking_request_tenants__tenant_id__calendar_appointments__appointment_id__request_confirm_patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"appointment_id","in":"path","required":true,"schema":{"type":"string","title":"Appointment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookingRequestConfirm"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/calendar/appointments/{appointment_id}/request/decline":{"patch":{"tags":["tenants"],"summary":"Decline Booking Request","operationId":"decline_booking_request_tenants__tenant_id__calendar_appointments__appointment_id__request_decline_patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"appointment_id","in":"path","required":true,"schema":{"type":"string","title":"Appointment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookingRequestDecline"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/calendar/appointments/{appointment_id}/no-show":{"patch":{"tags":["tenants"],"summary":"Mark Appointment No Show","description":"Mark an appointment as no-show (KC art. 394 — deposit is retained).\n\nOnly owner/manager can mark. Appointment must be in 'scheduled' or\n'completed' status AND start_time must be in the past. NO_SHOW is terminal.","operationId":"mark_appointment_no_show_tenants__tenant_id__calendar_appointments__appointment_id__no_show_patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"appointment_id","in":"path","required":true,"schema":{"type":"string","title":"Appointment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppointmentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/calendar/callers/{phone}/no-show-count":{"get":{"tags":["tenants"],"summary":"Get Caller No Show Count","description":"Get the no-show count for a caller phone number within a tenant.\n\nUsed by the voice engine to inject no-show awareness into booking context.","operationId":"get_caller_no_show_count_tenants__tenant_id__calendar_callers__phone__no_show_count_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"phone","in":"path","required":true,"schema":{"type":"string","title":"Phone"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/test-call":{"post":{"tags":["tenants"],"summary":"Initiate Test Call","description":"Place an outbound call to the pro's phone to demo their own AI receptionist.\n\nZvonAI calls the pro from the shared number. When they answer, the voice\nengine streams their own AI configuration — same experience as a real patient\ncalling. Available on trial and all paid tiers.\n\nRate limited: 3 calls per hour, 5 per day per tenant; only placed calls count.","operationId":"initiate_test_call_tenants__tenant_id__test_call_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestCallRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestCallResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/polish-invoices":{"get":{"tags":["tenants"],"summary":"List Polish Invoices","description":"List Polish iFirma invoices for a tenant, newest first.","operationId":"list_polish_invoices_tenants__tenant_id__polish_invoices_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolishInvoiceListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/polish-invoices/{invoice_id}/pdf":{"get":{"tags":["tenants"],"summary":"Download Polish Invoice Pdf","description":"Stream a Polish invoice PDF straight from iFirma. Tenant-scoped.\n\nWe don't cache the PDF locally — iFirma is the source of truth and\ntenants download Faktury infrequently (once a month for the bookkeeper).","operationId":"download_polish_invoice_pdf_tenants__tenant_id__polish_invoices__invoice_id__pdf_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","title":"Invoice Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/calls/live":{"get":{"tags":["calls"],"summary":"Live Calls","description":"Calls in progress right now, with what the card can do about them.","operationId":"live_calls_tenants__tenant_id__calls_live_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/calls/{call_id}/handoff":{"post":{"tags":["calls"],"summary":"Handoff Call","description":"Pass the caller to a department or a colleague while keeping them on the line.","operationId":"handoff_call_tenants__tenant_id__calls__call_id__handoff_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"call_id","in":"path","required":true,"schema":{"type":"string","title":"Call Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HandoffRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/data-sources/{tenant_id}/google/connect":{"post":{"tags":["data-sources"],"summary":"Start Google Connect","description":"Where the browser goes to sign in with Google. State lives in Redis for ten minutes.","operationId":"start_google_connect_data_sources__tenant_id__google_connect_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/data-sources/callback/google":{"get":{"tags":["data-sources"],"summary":"Google Connect Callback","description":"Google sends the owner back here; we swap the code for tokens and return them to Settings.","operationId":"google_connect_callback_data_sources_callback_google_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/data-sources/{tenant_id}/google/status":{"get":{"tags":["data-sources"],"summary":"Google Connect Status","operationId":"google_connect_status_data_sources__tenant_id__google_status_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/data-sources/{tenant_id}/google/picker-token":{"post":{"tags":["data-sources"],"summary":"Google Picker Token","description":"A short-lived token for Google's file picker, plus the browser key and project number it needs.","operationId":"google_picker_token_data_sources__tenant_id__google_picker_token_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/data-sources/{tenant_id}/google":{"delete":{"tags":["data-sources"],"summary":"Google Disconnect","operationId":"google_disconnect_data_sources__tenant_id__google_delete","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/funnel":{"get":{"tags":["admin"],"summary":"Funnel","operationId":"funnel_admin_funnel_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"since","in":"query","required":false,"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}-\\d{2}$","default":"2026-07-01","title":"Since"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/packs":{"get":{"tags":["packs"],"summary":"Packs Catalogue","description":"Which industries have a researched pack (onboarding picker, landing pages).","operationId":"packs_catalogue_packs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/packs/{pack_id}":{"get":{"tags":["packs"],"summary":"Pack Preview","description":"The pack as the owner will see it before confirming: services, FAQ, rules.","operationId":"pack_preview_packs__pack_id__get","parameters":[{"name":"pack_id","in":"path","required":true,"schema":{"type":"string","title":"Pack Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/packs/{pack_id}/apply":{"post":{"tags":["packs"],"summary":"Apply Pack","description":"Pre-fill the tenant's empty fields from the pack; owner edits are never touched.","operationId":"apply_pack_tenants__tenant_id__packs__pack_id__apply_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"pack_id","in":"path","required":true,"schema":{"type":"string","title":"Pack Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/packs/status":{"get":{"tags":["packs"],"summary":"Pack Status","description":"Which pack pre-filled this tenant, what it filled, and whether the owner confirmed it.","operationId":"pack_status_tenants__tenant_id__packs_status_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/packs/confirm":{"post":{"tags":["packs"],"summary":"Confirm Pack","description":"The owner has reviewed the pre-filled services and FAQ; they now count towards go-live.","operationId":"confirm_pack_tenants__tenant_id__packs_confirm_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/calls/":{"post":{"tags":["calls"],"summary":"Create Call","description":"Record a new call (called by voice engine at call start).\n\nIdempotent on twilio_call_sid: the voice engine retries this POST on\ntransient failures (a lost create = invisible call: no record, billing,\nor transcript — journey audit 2026-07-14, P0-6), so a re-delivered\nrequest must return the existing row instead of double-creating.","operationId":"create_call_calls__post","parameters":[{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/calls/{call_id}":{"patch":{"tags":["calls"],"summary":"Update Call","description":"Update call record (called by voice engine at call end).","operationId":"update_call_calls__call_id__patch","parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","title":"Call Id"}},{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["calls"],"summary":"Get Call","description":"Get full call details including transcript (gated by plan).\n\nAdmins (tenant_id is null) may open any call — the /admin/calls drawer needs\nthis; the tenant scope still applies to every non-admin. (Audit 2026-06-19\nadmin-call-drawer.)","operationId":"get_call_calls__call_id__get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Call Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/calls/by-sid/{twilio_call_sid}":{"patch":{"tags":["calls"],"summary":"Update Call By Sid","description":"Update call by Twilio SID (convenience for voice engine).","operationId":"update_call_by_sid_calls_by_sid__twilio_call_sid__patch","parameters":[{"name":"twilio_call_sid","in":"path","required":true,"schema":{"type":"string","title":"Twilio Call Sid"}},{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/calls/{call_id}/transcript":{"post":{"tags":["calls"],"summary":"Add Transcript","description":"Add transcript to a call (called by voice engine after call).\n\nIdempotent: voice-engine retry on 5xx must not 500 the second call with\nUNIQUE violation on call_id. If a transcript row already exists we\nupdate it in place and return 200.","operationId":"add_transcript_calls__call_id__transcript_post","parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","title":"Call Id"}},{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranscriptCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/calls/{call_id}/usage":{"post":{"tags":["calls"],"summary":"Record Call Usage","description":"Record per-call cost breakdown (called by voice engine after call ends).\n\nAccepts both the legacy fields (stt_duration_seconds, tts_chars, etc.) and the\npreferred per-provider fields (elevenlabs_chars, deepgram_seconds, gemini_tokens,\ntwilio_minutes). Per-provider fields take precedence when non-zero.","operationId":"record_call_usage_calls__call_id__usage_post","parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","title":"Call Id"}},{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallUsageCreate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallUsageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/calls/tenant/{tenant_id}":{"get":{"tags":["calls"],"summary":"List Calls For Tenant","description":"List calls for a tenant (dashboard).\n\nThe Calls page sent Today/Yesterday/7 days for months and this route ignored\nthem, so every preset showed the latest calls of all time (2026-09-15).\nDays are Warsaw days, the last one included.","operationId":"list_calls_for_tenant_calls_tenant__tenant_id__get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"First day, YYYY-MM-DD, Warsaw time","title":"Date From"},"description":"First day, YYYY-MM-DD, Warsaw time"},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"description":"Last day included, YYYY-MM-DD, Warsaw time","title":"Date To"},"description":"Last day included, YYYY-MM-DD, Warsaw time"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CallResponse"},"title":"Response List Calls For Tenant Calls Tenant  Tenant Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/calls/search":{"get":{"tags":["calls"],"summary":"Search Calls","description":"Search calls with filters (Pro+ plan).\n\nAudit A5/47: q parameter does ILIKE match across summary, summary_pl,\nand outcome. Postgres full-text (with pg_trgm + GIN index) would scale\nbetter — deferred until call volume justifies the index cost.","operationId":"search_calls_calls_search_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date To"}},{"name":"phone_number","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"description":"Full-text query. Matches summary, summary_pl, outcome","title":"Q"},"description":"Full-text query. Matches summary, summary_pl, outcome"},{"name":"callback_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Callback Only"}},{"name":"callback_unresolved","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Callback Unresolved"}},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/calls":{"get":{"tags":["calls"],"summary":"List Calls","description":"List calls for a tenant, optionally filtered by caller phone number.\n\nUsed by the privacy dashboard to search for a specific caller's data, and\nby the digest \"Zobacz rozmowy do sprawdzenia\" link (filter=errors) to show\ncalls where the AI promised something that failed (audit 2026-06-30).","operationId":"list_calls_calls_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"query","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"caller_phone","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caller Phone"}},{"name":"filter","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"'errors' = only calls with a broken promise, 'callbacks' = pending callbacks","title":"Filter"},"description":"'errors' = only calls with a broken promise, 'callbacks' = pending callbacks"},{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/calls/stats/monthly":{"get":{"tags":["calls"],"summary":"Get Monthly Stats","description":"Monthly aggregate stats for the call summary view.\n\nUngated: these are the tenant's OWN basic call counts (like the funnel\nendpoint), not a premium analytics feature. Gating it behind business_insights\nblanked the summary page + dashboard stat cards for Solo/Trial. Ownership is\nstill enforced via current_user.tenant_id below.","operationId":"get_monthly_stats_calls_stats_monthly_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"month","in":"query","required":false,"schema":{"type":"string","description":"YYYY-MM format, defaults to current month","title":"Month"},"description":"YYYY-MM format, defaults to current month"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonthlyCallStats"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/calls/export/csv":{"get":{"tags":["calls"],"summary":"Export Calls Csv","description":"Export calls as CSV (Business+ plan). No raw transcripts per RODO.","operationId":"export_calls_csv_calls_export_csv_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"date_from","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date From"}},{"name":"date_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Date To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/calls/review-allowance":{"get":{"tags":["calls"],"summary":"Get Review Allowance","description":"This month's recording plays and transcript reads, used and allowed\n(every plan is metered; features.REVIEW_ALLOWANCE).","operationId":"get_review_allowance_calls_review_allowance_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/calls/{call_id}/transcript/unlock":{"post":{"tags":["calls"],"summary":"Unlock Call Transcript","description":"Spend one transcript read of this month's allowance on this call and\nreturn its transcript; re-opening the same call this month is free.","operationId":"unlock_call_transcript_calls__call_id__transcript_unlock_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","title":"Call Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranscriptUnlockResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/calls/{call_id}/recording":{"get":{"tags":["calls"],"summary":"Proxy Call Recording","description":"Stream the recording for a call, or hand over a copy of it.\n\nProxies audio from the carrier (or our own bucket) so raw credentials are\nnever exposed to the frontend. Requires: the caller's tenant owns the call\nand recording_available is true.\n\n`download=true` returns the same audio with an attachment filename and is\nrecorded as a download rather than a play. It costs the same allowance and\nis written to the access log under its own kind, because a copy taken out\nof the panel outlives our 30-day retention and any later erasure: from that\nmoment the customer holds it as controller (DPA §recordings).","operationId":"proxy_call_recording_calls__call_id__recording_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","title":"Call Id"}},{"name":"download","in":"query","required":false,"schema":{"type":"boolean","description":"Save a copy instead of streaming it in the panel","default":false,"title":"Download"},"description":"Save a copy instead of streaming it in the panel"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/calls/tenant/{tenant_id}/stats":{"get":{"tags":["calls"],"summary":"Get Call Stats","description":"Get call statistics for a tenant (dashboard home stat cards).\n\nUngated (same reasoning as /stats/monthly): the tenant's own call counts,\nneeded by the dashboard home for every tier. Ownership enforced below.","operationId":"get_call_stats_calls_tenant__tenant_id__stats_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallStats"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/calls/tenant/{tenant_id}/funnel":{"get":{"tags":["calls"],"summary":"Get Call Funnel","description":"Outcome funnel for the dashboard. Available on every plan — the funnel\nIS the product (we run the reception, we don't take messages). Revenue\nestimation only fires when avg_appointment_value_grosze is configured.","operationId":"get_call_funnel_calls_tenant__tenant_id__funnel_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"range","in":"query","required":false,"schema":{"type":"string","pattern":"^(today|7d|30d|month)$","default":"month","title":"Range"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallFunnel"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/calls/{call_id}/callback-resolved":{"post":{"tags":["calls"],"summary":"Resolve Callback","description":"Mark a callback request as resolved.","operationId":"resolve_callback_calls__call_id__callback_resolved_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","title":"Call Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallbackResolveResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/calls/{call_id}/note":{"patch":{"tags":["calls"],"summary":"Update Team Note","description":"Add or update a team note on a call (Business+ plan).","operationId":"update_team_note_calls__call_id__note_patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","title":"Call Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamNoteUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamNoteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/calls/{call_id}/flag":{"post":{"tags":["calls"],"summary":"Flag Call","description":"Flag a call as problematic. Creates a MissedQuestion entry for AI improvement review.","operationId":"flag_call_calls__call_id__flag_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","title":"Call Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallFlagRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallFlagResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/calls/data/by-phone/{phone_number}":{"delete":{"tags":["calls"],"summary":"Delete Caller Data","description":"GDPR Art. 17 — Right to erasure for a specific caller.\n\nHard-deletes transcripts, redacts caller_number, clears summary/sentiment,\nand tags the call record with 'gdpr_deleted'.","operationId":"delete_caller_data_calls_data_by_phone__phone_number__delete","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"phone_number","in":"path","required":true,"schema":{"type":"string","title":"Phone Number"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/calls/{call_id}/data":{"delete":{"tags":["calls"],"summary":"Delete Call Data","description":"GDPR Art. 17 — Right to erasure for a single call record (tenant self-service).\n\nRedacts: transcript turns → sentinel string, audio_url → None, summary → None,\n         caller_number → \"REDACTED\".\nKeeps:   duration_seconds, outcome, sentiment_score, called_at / started_at\n         (anonymised metadata for billing and audit trail).\nLogs:    AuditLog entry with action=\"gdpr_art17_request\".","operationId":"delete_call_data_calls__call_id__data_delete","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","title":"Call Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallDataDeleteResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/calls/by-caller":{"delete":{"tags":["calls"],"summary":"Wipe Calls By Caller","description":"GDPR Art. 17 — Right to erasure for all calls from a given caller.\n\nNormalizes E.164, then redacts transcript turns, summary, and caller_number\nacross all matching calls for this tenant.","operationId":"wipe_calls_by_caller_calls_by_caller_delete","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ByCallerWipeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ByCallerWipeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/calls/tenant/{tenant_id}/stream":{"get":{"tags":["calls"],"summary":"Call Stream","description":"Server-Sent Events stream for live call updates.\n\nDashboard subscribes to this to get real-time call feed without polling.\nAuth via auth_token cookie ONLY in production (query token leaks into\naccess logs / proxies). The query param is allowed in dev so EventSource\nintegrations that can't set cookies still work.","operationId":"call_stream_calls_tenant__tenant_id__stream_get","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}},{"name":"auth_token","in":"cookie","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Auth Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/checkout/top-up":{"post":{"tags":["billing"],"summary":"Create Top Up Checkout","description":"Create Stripe Checkout Session for credit top-up (minutes or SMS).\n\nFlexible top-up: user specifies resource type and quantity.\nPrice: 1,00 PLN/min, 0,50 PLN/SMS.","operationId":"create_top_up_checkout_billing_checkout_top_up_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCheckoutRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/billing/checkout/subscribe":{"post":{"tags":["billing"],"summary":"Create Subscribe Checkout","description":"Create Stripe Checkout Session for a new subscription with 14-day trial.\n\nSCA/3DS is handled automatically by Stripe Checkout.\nIdempotency key prevents duplicate sessions on retried requests.","operationId":"create_subscribe_checkout_billing_checkout_subscribe_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routers__billing__SubscribeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/billing/upgrade":{"post":{"tags":["billing"],"summary":"Upgrade Subscription","description":"Change subscription plan (upgrade or downgrade).\n\nUpgrade (higher tier): immediate proration — user pays the difference now.\nDowngrade (lower tier): scheduled at period end — no proration, change\ntakes effect at the start of the next billing cycle.\n\nDelegates to services.plan_change.change_plan — the single source of truth\nshared with the Zvon agent's change_plan tool.","operationId":"upgrade_subscription_billing_upgrade_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpgradeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpgradeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/billing/portal":{"post":{"tags":["billing"],"summary":"Create Billing Portal","description":"Create a Stripe Customer Portal session.\n\nAllows the customer to: update payment method, cancel subscription,\nview past invoices, and switch plans.\n\nAnnual-in-commitment customers get a restricted session: card update\nallowed, cancellation/downgrade disabled. Cancellation requests must\ngo through /billing/request-cancellation which emails admin.","operationId":"create_billing_portal_billing_portal_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/billing/request-cancellation":{"post":{"tags":["billing"],"summary":"Request Cancellation","description":"Request cancellation for annual customers in their commitment window.\n\nThese customers cannot self-cancel via Stripe Portal (the portal is locked\ndown for them). They submit a request here, which:\n1. Creates a SupportTicket of category=billing, severity=high\n2. Emails the admin team with the customer's reason and contact info\n3. Returns the ticket ID so the customer can reference it\n\nAdmin reviews the request manually and either:\n- Schedules cancel-at-commitment-end via Stripe (most common)\n- Negotiates early termination + fee\n- Reaches out to retain them","operationId":"request_cancellation_billing_request_cancellation_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancellationRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/billing/cancellation-eligibility":{"get":{"tags":["billing"],"summary":"Cancellation Eligibility","description":"Tell the dashboard whether the customer can self-cancel or must request.\n\nUsed by the cancel-flow UI to decide which modal to show.","operationId":"cancellation_eligibility_billing_cancellation_eligibility_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/billing/subscription":{"get":{"tags":["billing"],"summary":"Get Subscription","description":"Return current subscription state for the tenant dashboard.","operationId":"get_subscription_billing_subscription_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscriptionResponse"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/billing/cancel-downgrade":{"post":{"tags":["billing"],"summary":"Cancel Pending Downgrade","description":"Cancel a scheduled downgrade before the period rolls (audit P1-6).\n\nplan_change.schedule already swapped the Stripe price (proration none,\nanchor unchanged), so cancelling must swap Stripe BACK to the current\ntier's price — otherwise the next invoice bills the lower plan while\nquotas stay high.","operationId":"cancel_pending_downgrade_billing_cancel_downgrade_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/billing/cancel":{"post":{"tags":["billing"],"summary":"Cancel Subscription","description":"Schedule subscription cancellation at the end of the current billing period.\n\nService remains active until period_end. No immediate interruption.\nA reason is required (2026-08-30): the first paying customer cancelled on\n2026-08-23 and nothing recorded why, no ticket, no alert.","operationId":"cancel_subscription_billing_cancel_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CancelBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/billing/reactivate":{"post":{"tags":["billing"],"summary":"Reactivate Subscription","description":"Undo a scheduled cancellation: subscription continues as normal.","operationId":"reactivate_subscription_billing_reactivate_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/billing/payment-methods":{"get":{"tags":["billing"],"summary":"List Payment Methods","description":"Return all saved cards for the tenant plus the current default.","operationId":"list_payment_methods_billing_payment_methods_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentMethodsResponse"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/billing/payment-methods/setup":{"post":{"tags":["billing"],"summary":"Create Setup Intent","description":"Create a Stripe SetupIntent so the frontend can securely collect a new card.\n\nThe card is attached to the customer without charging it. After setup, the\nfrontend calls /payment-methods/{id}/set-default to activate the card.","operationId":"create_setup_intent_billing_payment_methods_setup_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/billing/payment-methods/{payment_method_id}/set-default":{"post":{"tags":["billing"],"summary":"Set Default Payment Method","description":"Set a card as the default payment method for future invoices.\n\nThe card must already be attached to the customer (via SetupIntent or Checkout).","operationId":"set_default_payment_method_billing_payment_methods__payment_method_id__set_default_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"payment_method_id","in":"path","required":true,"schema":{"type":"string","title":"Payment Method Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/payment-methods/{payment_method_id}":{"delete":{"tags":["billing"],"summary":"Remove Payment Method","description":"Remove a saved card.\n\nBLOCKED if the card is the current default AND there is an active subscription\nwith no other card on file. This prevents payment failures.\nThe user must add a new card and set it as default before removing the old one.","operationId":"remove_payment_method_billing_payment_methods__payment_method_id__delete","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"payment_method_id","in":"path","required":true,"schema":{"type":"string","title":"Payment Method Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/retention-offer":{"post":{"tags":["billing"],"summary":"Apply Retention Offer","description":"Retention offer (Samuel 2026-08-30): 50% off ONE month, charged\nimmediately on acceptance (billing cycle re-anchored to now), once per\naccount, paying subscriptions only. A trial cannot take it, a scheduled\ncancel is lifted by taking it, and it never stacks with another coupon.\n\nRules:\n- Subscription must be active (not already cancelled)\n- Offer can only be used ONCE per tenant (retention_offer_used flag)\n- Applies a Stripe coupon giving 50% off for the next billing cycle\n- Does NOT cancel the subscription","operationId":"apply_retention_offer_billing_retention_offer_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/billing/plans":{"get":{"tags":["billing"],"summary":"List Plans","description":"Return subscription plan catalogue and top-up pricing.","operationId":"list_plans_billing_plans_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/billing/usage":{"get":{"tags":["billing"],"summary":"Get Usage","description":"Return current-month usage and quota for the authenticated tenant.","operationId":"get_usage_billing_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/billing/quota/check":{"post":{"tags":["billing"],"summary":"Check Quota","description":"Check if the current tenant is allowed to make calls (used by voice engine).","operationId":"check_quota_billing_quota_check_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/billing/invoices":{"get":{"tags":["billing"],"summary":"List Invoices","description":"Return recent Stripe invoices for the tenant.\n\nReturns up to `limit` invoices ordered newest-first. Each invoice\nincludes amount, status, due date, and a hosted PDF download URL.","operationId":"list_invoices_billing_invoices_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":12,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/billing/setup-service":{"get":{"tags":["billing"],"summary":"Get Setup Service","description":"What the readiness card shows: the two options at this plan's prices, or the order in progress.","operationId":"get_setup_service_billing_setup_service_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupServiceState"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]},"post":{"tags":["billing"],"summary":"Create Setup Service Checkout","description":"Order \"Uruchomienie z nami\" from the dashboard: a payment link, or straight into\nthe queue when the plan includes it.","operationId":"create_setup_service_checkout_billing_setup_service_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupServiceCheckoutRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupServiceOrderResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/billing/sms-topup":{"post":{"tags":["billing"],"summary":"Create Sms Topup Checkout","description":"Create Stripe Checkout Session for a 100-SMS pack at 50 PLN.\n\nOn checkout.session.completed, the webhook increments `sms_purchased` by 100.\nIdempotency key: tenant_id + timestamp (minute precision to allow retries).","operationId":"create_sms_topup_checkout_billing_sms_topup_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SMSTopUpRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/billing/seats":{"get":{"tags":["billing"],"summary":"Get Team Seats","description":"Where the team stands on seats: used, included, bought, cap, price (58.16).","operationId":"get_team_seats_billing_seats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]},"post":{"tags":["billing"],"summary":"Set Team Seats","description":"Buy (or release) extra team seats: a quantity on the team-seat price on\nthe running subscription, capped per plan so seats cannot dodge an upgrade\n(58.16). Buying is immediate and lands on the next invoice; releasing takes\neffect at the end of the paid period with no credit for the unused days, so\nthe seat keeps working until then. Logic lives in services.seats_billing.","operationId":"set_team_seats_billing_seats_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamSeatsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/billing/topup/session":{"post":{"tags":["billing"],"summary":"Create Topup Session By Pack","description":"Create Stripe Checkout Session for a predefined top-up pack.\n\nAccepts a pack_id from TOPUP_PACKS. Uses a pre-created Stripe price ID\nif configured in settings (for clean invoice line items); falls back to\ninline price_data so the endpoint works before Stripe products are set up.\n\nMetadata carries pack_id, resource_type, and quantity so the webhook\nhandler can credit the correct amount regardless of which path was taken.","operationId":"create_topup_session_by_pack_billing_topup_session_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TopUpPackRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/billing/invoice-address":{"get":{"tags":["billing"],"summary":"Get Invoice Address","description":"What currently prints on the tenant's invoices.","operationId":"get_invoice_address_billing_invoice_address_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceAddress"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]},"patch":{"tags":["billing"],"summary":"Update Invoice Address","description":"Correct the details that print on invoices.\n\nOnly affects invoices issued from now on. Changing a document already in\niFirma is a correction note, not an edit, and is deliberately not offered.","operationId":"update_invoice_address_billing_invoice_address_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceAddress"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvoiceAddress"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/consents/{tenant_id}/grant":{"post":{"tags":["consents"],"summary":"Grant Consent","description":"Record user consent (GDPR Art. 7).\n\nController must be able to demonstrate that data subject has consented.\nWe record:\n- What they consented to (consent_type + consent_text)\n- When they consented (granted_at)\n- How they consented (consent_method)\n- Where they consented from (ip_address + user_agent)","operationId":"grant_consent_consents__tenant_id__grant_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantConsentRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/consents/{tenant_id}/revoke/{consent_type}":{"post":{"tags":["consents"],"summary":"Revoke Consent","description":"Revoke consent (GDPR Art. 7(3) - right to withdraw consent).\n\n\"The data subject shall have the right to withdraw his or her consent\nat any time. The withdrawal of consent shall not affect the lawfulness\nof processing based on consent before its withdrawal.\"","operationId":"revoke_consent_consents__tenant_id__revoke__consent_type__post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"consent_type","in":"path","required":true,"schema":{"type":"string","title":"Consent Type"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/consents/{tenant_id}/status":{"get":{"tags":["consents"],"summary":"Get Consent Status","description":"Get current consent status for all consent types.\n\nReturns which consents are currently active (granted and not revoked).\n\nOwner-only: otherwise anyone could enumerate tenant UUIDs and read each\ntenant's consent matrix. See SECURITY_REVIEW_2026-06-18 M2.","operationId":"get_consent_status_consents__tenant_id__status_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/consents/{tenant_id}/history":{"get":{"tags":["consents"],"summary":"Get Consent History","description":"Get consent history for audit purposes (paginated).\n\nShows all consent grants and revocations with timestamps.","operationId":"get_consent_history_consents__tenant_id__history_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":500,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/consents/{tenant_id}/all":{"delete":{"tags":["consents"],"summary":"Revoke All Consents","description":"Revoke all consents (used when account is deleted).\n\nRequires explicit confirmation.","operationId":"revoke_all_consents_consents__tenant_id__all_delete","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"confirm","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Confirm"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/consents/caller":{"post":{"tags":["consents"],"summary":"Log Caller Consent","description":"Log that an inbound caller was informed of AI handling (EU AI Act Art. 50).\n\nService-to-service only (X-Internal-Key): the voice engine calls this at call\nstart. Otherwise anyone could forge Art. 50 audit records under any tenant.\nSee SECURITY_REVIEW_2026-06-18 M2.\n\nThe caller's phone number must be pre-hashed (SHA-256) by the caller before\nsending to this endpoint — raw phone numbers must never be stored here.\nEach call creates a new consent record (immutable audit log).","operationId":"log_caller_consent_consents_caller_post","parameters":[{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallerConsentRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallerConsentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/consents/caller/{phone_hash}":{"get":{"tags":["consents"],"summary":"Get Caller Consent","description":"Retrieve the most recent consent record for a hashed caller number.\n\nReturns 404 if no consent has ever been logged for this hash.\n\nService-to-service only (X-Internal-Key): the phone hash is an unsalted\nSHA-256 of an E.164 number (brute-forceable across the PL mobile space), so\nan anonymous caller could confirm \"did this number call any clinic\" and\nrecover the tenant_id. See SECURITY_REVIEW_2026-06-18 M2.","operationId":"get_caller_consent_consents_caller__phone_hash__get","parameters":[{"name":"phone_hash","in":"path","required":true,"schema":{"type":"string","title":"Phone Hash"}},{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallerConsentDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/consents/voice-cloning":{"post":{"tags":["consents"],"summary":"Record Voice Cloning Consent","description":"Record acceptance of ElevenLabs voice cloning terms (GDPR Art. 7).\n\nMust be called before uploading a voice sample. Records who consented,\nfrom which IP, and with which client, for audit purposes.","operationId":"record_voice_cloning_consent_consents_voice_cloning_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceCloningConsentRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceCloningConsentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/consents/voice-cloning/{tenant_id}":{"get":{"tags":["consents"],"summary":"Get Voice Cloning Consent","description":"Retrieve the most recent voice cloning consent for a tenant.\n\nReturns 404 if no consent has been recorded.","operationId":"get_voice_cloning_consent_consents_voice_cloning__tenant_id__get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceCloningConsentDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/privacy/template":{"get":{"tags":["privacy"],"summary":"Get Privacy Template","description":"Return a GDPR-compliant privacy notice template (PL + EN) for this tenant.\n\nIncludes the tenant's business name, contact email, retention periods,\nand caller rights — ready to display on website or reception area.","operationId":"get_privacy_template_privacy_template_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrivacyTemplate"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/privacy/tenants/{tenant_id}/notice":{"get":{"tags":["privacy"],"summary":"Get Tenant Privacy Notice","description":"Return a rendered privacy notice for a specific tenant.\n\nValues are filled in from the tenant record:\n- tenant name\n- transcript_retention_days (default 90)\n- contact_phone (tenant.phone)\n\nIntended to be shown to callers at reception or on the tenant's website.","operationId":"get_tenant_privacy_notice_privacy_tenants__tenant_id__notice_get","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"lang","in":"query","required":false,"schema":{"type":"string","pattern":"^(pl|en)$","default":"pl","title":"Lang"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PrivacyNoticeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/privacy/dpa/{tenant_id}":{"get":{"tags":["privacy"],"summary":"Generate Dpa","description":"Generate a Data Processing Agreement (Umowa Powierzenia) for the tenant.","operationId":"generate_dpa_privacy_dpa__tenant_id__get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DPAResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/privacy/sub-processors":{"get":{"tags":["privacy"],"summary":"List Sub Processors","description":"Public endpoint: list all sub-processors used by ZvonAI.","operationId":"list_sub_processors_privacy_sub_processors_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubProcessorListResponse"}}}}}}},"/compliance/ai-act-register":{"get":{"tags":["compliance"],"summary":"Get Ai Act Register","description":"Return the formal EU AI Act system registration document.\n\nPublic endpoint — no auth required. Per Art. 50 (renumbered from 52\nin the final regulation), limited-risk AI systems that interact with\nnatural persons must disclose they are AI. Transparency obligations\napply from 2026-08-02. Risk level: LIMITED (not high-risk under Annex III).","operationId":"get_ai_act_register_compliance_ai_act_register_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AIActRegister"}}}}}}},"/compliance/admin/summary":{"get":{"tags":["compliance"],"summary":"Get Compliance Summary","description":"Live compliance posture for the admin Compliance Center.\n\nAggregates real data from existing tables — consents, DSAR support tickets,\nsub-processor register, retention AuditLog — so the admin can see (and print)\nthe current posture at a glance. Read-only; every number is live.","operationId":"get_compliance_summary_compliance_admin_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComplianceSummary"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/compliance/admin/legal-manifest":{"get":{"tags":["compliance"],"summary":"Get Legal Manifest","description":"Version register of every legal document (liability shield P2).\n\nReads the build-time manifest (scripts/gen-legal-manifest.py, kept fresh by\nthe legal-sync-guard CI job): per doc the content sha, the git commit/date\nof its last change (= effective version), and the PDF snapshot sha. The\nadmin sees at a glance which version of each document is in force and that\nthe AI corpus is pinned to it.","operationId":"get_legal_manifest_compliance_admin_legal_manifest_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegalManifestResponse"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/compliance/admin/policy-answers":{"get":{"tags":["compliance"],"summary":"List Policy Answers","description":"Recent AI answers that touched policy topics, each pinned to the legal\nmanifest version in force when it was given (Moffatt v. Air Canada\nevidence trail).","operationId":"list_policy_answers_compliance_admin_policy_answers_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyAnswersResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/data-subject/request":{"post":{"tags":["data-subject"],"summary":"Submit Data Subject Request","description":"Public, rate-limited endpoint where a caller exercises GDPR rights.\n\nNo authentication: data subjects don't have ZvonAI accounts. We rate\nlimit aggressively to deter abuse and do not echo back any record\ncontents — the admin processes the request out-of-band.","operationId":"submit_data_subject_request_data_subject_request_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataSubjectRequestPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataSubjectRequestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/data-subject/verify":{"post":{"tags":["data-subject"],"summary":"Verify Data Subject Request","description":"Public: the requester proves the DSAR is theirs by echoing the code\nwe emailed them. 3 attempts, constant-time hash compare, then locked.","operationId":"verify_data_subject_request_data_subject_verify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataSubjectVerifyPayload"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DataSubjectVerifyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sms/opt-out/{code}":{"get":{"tags":["sms-opt-out"],"summary":"Sms Opt Out Confirm","description":"Render the confirmation page. Side-effect-free (GET).","operationId":"sms_opt_out_confirm_sms_opt_out__code__get","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","title":"Code"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["sms-opt-out"],"summary":"Sms Opt Out Confirmed","description":"Record the opt-out after explicit confirmation. Idempotent.","operationId":"sms_opt_out_confirmed_sms_opt_out__code__post","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","title":"Code"}}],"responses":{"200":{"description":"Successful Response","content":{"text/html":{"schema":{"type":"string"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/sms/internal/opt-out":{"get":{"tags":["sms-opt-out"],"summary":"Sms Opt Out Internal Check","description":"Service-to-service opt-out lookup (X-Internal-Key) for an E.164 number.\n\nThe voice engine has no DB access to the sms_opt_out table but must honor\nthe same suppression list as send_patient_sms before sending any SMS\n(UKE art. 172 / RODO Art. 7(3) — exposure audit 2026-08, TASK #147).\nCross-tenant by design (the opt-out list is platform-wide), hence\nget_system_db like the other internal-key endpoints.","operationId":"sms_opt_out_internal_check_sms_internal_opt_out_get","parameters":[{"name":"phone","in":"query","required":true,"schema":{"type":"string","minLength":5,"maxLength":32,"title":"Phone"}},{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Sms Opt Out Internal Check Sms Internal Opt Out Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/my-calendar":{"get":{"tags":["my-calendar"],"summary":"My Calendar","description":"Everything Mój kalendarz shows: the person's own ZvonAI calendar and their connections.","operationId":"my_calendar_tenants__tenant_id__my_calendar_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["my-calendar"],"summary":"Create My Calendar","description":"An owner or manager who takes visits gives themselves a calendar in one tap.","operationId":"create_my_calendar_tenants__tenant_id__my_calendar_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/people/{resource_id}/calendars":{"get":{"tags":["my-calendar"],"summary":"List Connections","operationId":"list_connections_tenants__tenant_id__people__resource_id__calendars_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","title":"Resource Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/people/{resource_id}/calendars/connect/{provider}":{"get":{"tags":["my-calendar"],"summary":"Start Connect","operationId":"start_connect_tenants__tenant_id__people__resource_id__calendars_connect__provider__get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","title":"Resource Id"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/people/{resource_id}/calendars/apple":{"post":{"tags":["my-calendar"],"summary":"Connect Apple","operationId":"connect_apple_tenants__tenant_id__people__resource_id__calendars_apple_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","title":"Resource Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppleConnectIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/people/{resource_id}/calendars/{provider}/calendars":{"get":{"tags":["my-calendar"],"summary":"Provider Calendars","operationId":"provider_calendars_tenants__tenant_id__people__resource_id__calendars__provider__calendars_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","title":"Resource Id"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/people/{resource_id}/calendars/{provider}/preview":{"get":{"tags":["my-calendar"],"summary":"Preview Connection","operationId":"preview_connection_tenants__tenant_id__people__resource_id__calendars__provider__preview_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","title":"Resource Id"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"calendar_ids","in":"query","required":false,"schema":{"type":"string","default":"","title":"Calendar Ids"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/people/{resource_id}/calendars/{provider}":{"patch":{"tags":["my-calendar"],"summary":"Update Connection","operationId":"update_connection_tenants__tenant_id__people__resource_id__calendars__provider__patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","title":"Resource Id"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionSettingsIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["my-calendar"],"summary":"Disconnect Connection","operationId":"disconnect_connection_tenants__tenant_id__people__resource_id__calendars__provider__delete","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","title":"Resource Id"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/people/{resource_id}/calendars/{provider}/blocking":{"patch":{"tags":["my-calendar"],"summary":"Stop Or Resume Blocking","description":"The owner's override when a personal calendar hides someone too much.","operationId":"stop_or_resume_blocking_tenants__tenant_id__people__resource_id__calendars__provider__blocking_patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","title":"Resource Id"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Body_stop_or_resume_blocking_tenants__tenant_id__people__resource_id__calendars__provider__blocking_patch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/people/{resource_id}/calendars/link":{"post":{"tags":["my-calendar"],"summary":"Send Connect Link","description":"The owner sends the person a link so they can connect their own calendar.","operationId":"send_connect_link_tenants__tenant_id__people__resource_id__calendars_link_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","title":"Resource Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendLinkIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/public/person-calendar/{token}":{"get":{"tags":["my-calendar-public"],"summary":"Link Overview","operationId":"link_overview_public_person_calendar__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/public/person-calendar/{token}/connect/{provider}":{"get":{"tags":["my-calendar-public"],"summary":"Link Start Connect","operationId":"link_start_connect_public_person_calendar__token__connect__provider__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/public/person-calendar/{token}/apple":{"post":{"tags":["my-calendar-public"],"summary":"Link Connect Apple","operationId":"link_connect_apple_public_person_calendar__token__apple_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppleConnectIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/public/person-calendar/{token}/{provider}/calendars":{"get":{"tags":["my-calendar-public"],"summary":"Link Provider Calendars","operationId":"link_provider_calendars_public_person_calendar__token___provider__calendars_get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/public/person-calendar/{token}/{provider}/preview":{"get":{"tags":["my-calendar-public"],"summary":"Link Preview","operationId":"link_preview_public_person_calendar__token___provider__preview_get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"calendar_ids","in":"query","required":false,"schema":{"type":"string","default":"","title":"Calendar Ids"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/public/person-calendar/{token}/{provider}":{"patch":{"tags":["my-calendar-public"],"summary":"Link Update","operationId":"link_update_public_person_calendar__token___provider__patch","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionSettingsIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["my-calendar-public"],"summary":"Link Disconnect","operationId":"link_disconnect_public_person_calendar__token___provider__delete","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/twilio/call-status":{"post":{"tags":["webhooks"],"summary":"Twilio Call Status","description":"Handle Twilio call status updates.\n\nConfigure in Twilio console: Status Callback URL = https://api.zvonai.ai/webhooks/twilio/call-status","operationId":"twilio_call_status_webhooks_twilio_call_status_post","parameters":[{"name":"x-twilio-signature","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Twilio-Signature"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/twilio/recording-status":{"post":{"tags":["webhooks"],"summary":"Twilio Recording Status","description":"Handle Twilio RecordingStatusCallback.\n\nTwilio fires this when a recording is ready (RecordingStatus=completed).\nConfigure in Twilio console: RecordingStatusCallback = https://api.zvonai.ai/webhooks/twilio/recording-status\n\nValidates the Twilio signature, then stores recording metadata on the call record.","operationId":"twilio_recording_status_webhooks_twilio_recording_status_post","parameters":[{"name":"x-twilio-signature","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Twilio-Signature"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/twilio/transcription":{"post":{"tags":["webhooks"],"summary":"Twilio Transcription","description":"Handle Twilio transcription webhooks (if using Twilio transcription).","operationId":"twilio_transcription_webhooks_twilio_transcription_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/webhooks/twilio/inbound-sms":{"post":{"tags":["webhooks"],"summary":"Twilio Inbound Sms","description":"Handle inbound SMS replies — primarily STOP/START for opt-out (RODO Art. 7(3),\nPL UKE). Returns empty TwiML; we send our own confirmation SMS so the wording is\ncontrolled and localised.\n\nConfigure in Twilio console: Messaging → A message comes in →\nhttps://api.zvonai.ai/webhooks/twilio/inbound-sms","operationId":"twilio_inbound_sms_webhooks_twilio_inbound_sms_post","parameters":[{"name":"x-twilio-signature","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Twilio-Signature"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/stripe":{"post":{"tags":["webhooks"],"summary":"Stripe Webhook","description":"Handle Stripe webhook events.\n\nConfigure in Stripe dashboard: Webhook URL = https://api.zvonai.ai/webhooks/stripe\nEvents to listen for:\n- customer.subscription.created\n- customer.subscription.updated\n- customer.subscription.deleted\n- customer.subscription.trial_will_end\n- invoice.paid\n- invoice.payment_failed\n- checkout.session.completed\n- checkout.session.expired\n- charge.dispute.created\n- payment_intent.requires_action","operationId":"stripe_webhook_webhooks_stripe_post","parameters":[{"name":"Stripe-Signature","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe-Signature"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/autopay":{"post":{"tags":["webhooks"],"summary":"Autopay Webhook","description":"Handle Autopay payment notifications.\n\nConfigure in Autopay panel: Notification URL = https://api.zvonai.ai/webhooks/autopay","operationId":"autopay_webhook_webhooks_autopay_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutopayNotification"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/przelewy24":{"post":{"tags":["webhooks"],"summary":"Przelewy24 Webhook","description":"Handle Przelewy24 payment notifications.","operationId":"przelewy24_webhook_webhooks_przelewy24_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/webhooks/sync/google/{tenant_id}/{source_id}":{"post":{"tags":["webhooks"],"summary":"Google Drive Webhook","description":"Receive Google Drive push notifications for spreadsheet changes.\n\nGoogle headers:\n  X-Goog-Channel-ID      — our channel UUID\n  X-Goog-Resource-State  — sync | add | update | remove | trash\n  X-Goog-Channel-Token   — our secret token (verification)\n  X-Goog-Resource-ID     — Drive resource identifier\n\nReturns 200 immediately (required by Google); cache refresh is async.","operationId":"google_drive_webhook_webhooks_sync_google__tenant_id___source_id__post","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"source_id","in":"path","required":true,"schema":{"type":"string","title":"Source Id"}},{"name":"x-goog-channel-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Goog-Channel-Id"}},{"name":"x-goog-resource-state","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Goog-Resource-State"}},{"name":"x-goog-channel-token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Goog-Channel-Token"}},{"name":"x-goog-resource-id","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Goog-Resource-Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/sync/msgraph/{tenant_id}/{source_id}":{"post":{"tags":["webhooks"],"summary":"Msgraph Webhook","description":"Receive Microsoft Graph change notifications for OneDrive/Excel.\n\nMS Graph sends a POST with validationToken on subscription creation —\nwe echo it back as plain text. On real notifications: body.value[].changeType.","operationId":"msgraph_webhook_webhooks_sync_msgraph__tenant_id___source_id__post","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"source_id","in":"path","required":true,"schema":{"type":"string","title":"Source Id"}},{"name":"validationToken","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Validationtoken"}}],"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/sync/hubspot/{tenant_id}":{"post":{"tags":["webhooks"],"summary":"Hubspot Webhook","description":"Receive HubSpot CRM change events.\n\nVerifies HMAC-SHA256 signature using stored HubSpot app secret (in Redis).\nTriggers cache refresh for HubSpot-type data sources on contact changes.","operationId":"hubspot_webhook_webhooks_sync_hubspot__tenant_id__post","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"x-hubspot-signature-v3","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Hubspot-Signature-V3"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/sync/pipedrive/{tenant_id}":{"post":{"tags":["webhooks"],"summary":"Pipedrive Webhook","description":"Receive Pipedrive CRM change events.\n\nVerifies X-Pipedrive-Signature (HMAC-SHA256) using stored Redis secret.\nTriggers cache refresh for Pipedrive-type data sources on person changes.","operationId":"pipedrive_webhook_webhooks_sync_pipedrive__tenant_id__post","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"x-pipedrive-signature","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Pipedrive-Signature"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/sendgrid/events":{"post":{"tags":["webhooks"],"summary":"Sendgrid Event Webhook","description":"Handle SendGrid Event Webhook (bounce, dropped, spam, unsubscribe, etc).\n\nConfigure in SendGrid: Settings → Mail Settings → Event Webhook\nPOST URL: https://api.zvonai.ai/webhooks/sendgrid/events\nVerification key (ECDSA P-256 public key) lives in GCP Secret Manager\nas zvonai-sendgrid-webhook-key. If missing, this endpoint refuses to\nprocess events (503) — accepting unverified events would let anyone\nwith the URL forge bounce/spam/unsubscribe events.","operationId":"sendgrid_event_webhook_webhooks_sendgrid_events_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/webhooks/stripe-connect":{"post":{"tags":["webhooks"],"summary":"Stripe Connect Webhook","operationId":"stripe_connect_webhook_webhooks_stripe_connect_post","parameters":[{"name":"Stripe-Signature","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe-Signature"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/voices/":{"get":{"tags":["voices"],"summary":"List Voices","description":"List the curated voice catalog: 6 voices, 3 female + 3 male.\n\nRegistered on BOTH \"\" and \"/\" — a bare GET /voices used to 307-redirect to\n/voices/, and behind the Cloud Run proxy the Location header downgraded to\nhttp:// → browsers blocked it as mixed content → the dashboard showed\n\"No voices available\" (recurrence 2026-08-03, older bundle calling the raw\nrun.app URL without the slash). The alias kills the redirect entirely.\n\nFilter by gender: ?gender=female|male\nFilter by language: ?languages=pl or ?languages=pl,en — returns only voices\napproved in ALL of them. Ignored while the single-language choice flag is\noff, so the served catalog is byte-identical to before the feature.","operationId":"list_voices_voices__get","parameters":[{"name":"gender","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Gender"}},{"name":"languages","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Languages"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/VoiceOption"},"title":"Response List Voices Voices  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/voices/{voice_id}":{"get":{"tags":["voices"],"summary":"Get Voice","description":"Get a specific voice by ID from the curated catalog.","operationId":"get_voice_voices__voice_id__get","parameters":[{"name":"voice_id","in":"path","required":true,"schema":{"type":"string","title":"Voice Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceOption"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/voices/tenant/{tenant_id}":{"patch":{"tags":["voices"],"summary":"Update Tenant Voice","description":"Update tenant's selected voice. User must belong to the tenant.","operationId":"update_tenant_voice_voices_tenant__tenant_id__patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceSelect"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Tenant Voice Voices Tenant  Tenant Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/voices/preview":{"post":{"tags":["voices"],"summary":"Preview Voice","description":"Generate a TTS preview for a given voice.\n\nReturns base64-encoded MP3 audio. Auth required (any logged-in tenant user).\nText defaults to the standard Polish greeting if not provided.","operationId":"preview_voice_voices_preview_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoicePreviewRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoicePreviewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/voices/clone":{"post":{"tags":["voices"],"summary":"Clone Voice","description":"Clone a custom voice via ElevenLabs. Enterprise plan only.\n\nAccepts a WAV/MP3/M4A audio sample (max 10 MB).","operationId":"clone_voice_voices_clone_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_clone_voice_voices_clone_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CloneVoiceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/voices/clone/{voice_id}":{"delete":{"tags":["voices"],"summary":"Delete Cloned Voice","description":"Delete a cloned voice from ElevenLabs and remove it from tenant config.","operationId":"delete_cloned_voice_voices_clone__voice_id__delete","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"voice_id","in":"path","required":true,"schema":{"type":"string","title":"Voice Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/voices/test-greeting":{"post":{"tags":["voices"],"summary":"Test Greeting","description":"Generate TTS preview using the tenant's configured greeting text.\n\nAuth required. Uses the tenant's current greeting as the TTS input.","operationId":"test_greeting_voices_test_greeting_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestGreetingRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoicePreviewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/overview":{"get":{"tags":["admin"],"summary":"Admin Overview","description":"Platform-wide summary for the admin dashboard.","operationId":"admin_overview_admin_overview_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminOverviewResponse"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/tenants":{"get":{"tags":["admin"],"summary":"List Tenants","description":"Paginated tenant list with filters.\n\n`knowledge=low` filters to knowledge score < 40 — the churn-risk list\n(low per-tenant context = low switching cost). The score is computed on\nread, so this filter loads the matching tenant set (capped) and paginates\nin Python — fine at current tenant counts, revisit if we store the score.\n\n`sort=embedding` orders ascending by the 0–5 operational-embedding score\n(moat #2) so the lowest-embedded (churn-risk) tenants float up. Same\ncapped-set-then-paginate approach as `knowledge=low`.","operationId":"list_tenants_admin_tenants_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"search","in":"query","required":false,"schema":{"type":"string","default":"","title":"Search"}},{"name":"tier","in":"query","required":false,"schema":{"type":"string","default":"","title":"Tier"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","default":"","title":"Status"}},{"name":"knowledge","in":"query","required":false,"schema":{"type":"string","pattern":"^(|low)$","default":"","title":"Knowledge"}},{"name":"sort","in":"query","required":false,"schema":{"type":"string","pattern":"^(|embedding)$","default":"","title":"Sort"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routers__admin__TenantListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/signup-sources":{"get":{"tags":["admin"],"summary":"Signup Source Breakdown","description":"Breakdown of signup_source values across all users with a tenant.\nUsers on internal (seed/CI/team-test) or demo tenants are excluded (#136).","operationId":"signup_source_breakdown_admin_signup_sources_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/SignupSourceBreakdown"},"type":"array","title":"Response Signup Source Breakdown Admin Signup Sources Get"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/calls":{"get":{"tags":["admin"],"summary":"List All Calls","description":"Paginated call list across all tenants.\n\n`kind` separates real customer calls from platform noise:\nreal | demo_line | automated_test (empty = all).","operationId":"list_all_calls_admin_calls_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"status","in":"query","required":false,"schema":{"type":"string","default":"","title":"Status"}},{"name":"tenant_id","in":"query","required":false,"schema":{"type":"string","default":"","title":"Tenant Id"}},{"name":"caller","in":"query","required":false,"schema":{"type":"string","maxLength":32,"default":"","title":"Caller"}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","default":"","title":"Kind"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCallsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/zvon-feedback":{"get":{"tags":["admin"],"summary":"Admin Zvon Feedback","description":"What owners thought of Zvon's answers, worst first.\n\nZvon speaks first and walks owners through setup, so a wrong answer gets\nfollowed rather than ignored. A cluster of thumbs-down on one page is the\nfastest signal we have that a flow is broken, and it arrives from people\nwho would never file a ticket.\n\nReturns the answer alongside the rating: a rating on its own cannot be\nacted on, and the conversation it came from is trimmed.","operationId":"admin_zvon_feedback_admin_zvon_feedback_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"rating","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rating"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/demo-calls":{"get":{"tags":["admin"],"summary":"List Demo Calls","description":"Demo call log — all calls to the ZvonAI demo number, newest first.\n\n`kind` splits human demo callers (demo_line) from our own synthetic\ncalls (automated_test); empty = all.","operationId":"list_demo_calls_admin_demo_calls_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","default":"","title":"Kind"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemoCallsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/demo-calls/{call_id}":{"get":{"tags":["admin"],"summary":"Get Demo Call","description":"Full demo call detail including transcript.","operationId":"get_demo_call_admin_demo_calls__call_id__get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","title":"Call Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemoCallDetail"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/costs":{"get":{"tags":["admin"],"summary":"Cost Summary","description":"Platform cost and revenue breakdown.","operationId":"cost_summary_admin_costs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CostSummaryResponse"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/tenants/{tenant_id}":{"get":{"tags":["admin"],"summary":"Get Tenant Detail","description":"Full tenant detail for the admin drill-in page. Combines core record\nfields, billing-address fields and a fresh health snapshot in one round-trip\nso the page renders without a waterfall.","operationId":"get_tenant_detail_admin_tenants__tenant_id__get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantDetailResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["admin"],"summary":"Update Tenant Tier","description":"Set a tenant's subscription tier. Admin only.","operationId":"update_tenant_tier_admin_tenants__tenant_id__patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantTierUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantTierResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/critical-signals":{"get":{"tags":["admin"],"summary":"Critical Signals","description":"Aggregated 'what needs my attention' signals for the overview page.\nOne round-trip; each signal carries a drill-in href and severity.\nIntentionally read-only — no triggers, no side effects.","operationId":"critical_signals_admin_critical_signals_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CriticalSignalsResponse"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/stripe-events":{"get":{"tags":["admin"],"summary":"List Stripe Events","description":"List Stripe webhook events processed (idempotency table). Confirms\nevery Stripe event we acknowledged. If something's missing here that\nStripe shows as delivered, we lost it.","operationId":"list_stripe_events_admin_stripe_events_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"event_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Event Type"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StripeEventsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/webhooks/health":{"get":{"tags":["admin"],"summary":"Webhook Health","description":"Webhook delivery health across providers. Stripe pulls from the\nprocessed_events table (DB-backed dedup). Others (SendGrid, Twilio,\nTelnyx) don't have DB tables yet — they show 'unknown' with a hint\npointing at Cloud Logging until we add structured tables (P5+).","operationId":"webhook_health_admin_webhooks_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookHealthResponse"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/overage":{"get":{"tags":["admin"],"summary":"Tenant Overage Overview","description":"Tenants near/over their minute quota + their overage consent state.\n\nThe follow-up surface for minute overage (task #19): sales/support see who\nis approaching the limit (default ≥80% used), who is already accruing paid\noverage minutes, and exactly when/how each tenant consented (or opted out)\n— so every overage invoice line is defensible and outreach happens BEFORE\nthe invoice surprises anyone. Sorted by usage_pct descending.","operationId":"tenant_overage_overview_admin_overage_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"threshold_pct","in":"query","required":false,"schema":{"type":"number","default":80.0,"title":"Threshold Pct"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantOverageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/quotas":{"get":{"tags":["admin"],"summary":"Provider Quotas","description":"Aggregated provider balance/quota check. Each provider is one HTTP\ncall done in parallel; total round-trip is the slowest provider's\nresponse time (typically 1-3 seconds). Read-only — no side effects.","operationId":"provider_quotas_admin_quotas_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderQuotasResponse"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/consents":{"get":{"tags":["admin"],"summary":"List Consents","description":"List GDPR consent records (Art. 7 proof of consent). Filterable by\nconsent_type (call_recording, analytics, marketing, sms_notifications)\nand granted status. Includes type_counts for the filter UI.","operationId":"list_consents_admin_consents_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"consent_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Consent Type"}},{"name":"granted_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Granted Only"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/scheduler/jobs":{"get":{"tags":["admin"],"summary":"List Scheduler Jobs","description":"Live status of every APScheduler job. Used by /admin/scheduler to\ncatch the silent-job-drop pattern that bit us on 2026-06-09 — when a\nstale Redis-persisted reference fails to reconstitute, newly added\njobs may never register and the cron simply never fires. This endpoint\nreads scheduler.get_jobs() directly (not the boot log) so it always\nreflects reality.","operationId":"list_scheduler_jobs_admin_scheduler_jobs_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchedulerStatusResponse"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/polish-invoices/{invoice_id}/retry":{"post":{"tags":["admin"],"summary":"Retry Polish Invoice","description":"Manually re-run iFirma issuance for a stuck or errored invoice.\nReturns 'already_issued' if the row has an ifirma_id (no-op).\nOtherwise clears error_message and queues a background re-attempt\nvia the same code path the Stripe webhook uses.","operationId":"retry_polish_invoice_admin_polish_invoices__invoice_id__retry_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","title":"Invoice Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolishInvoiceRetryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/polish-invoices/{invoice_id}/resend-email":{"post":{"tags":["admin"],"summary":"Resend Polish Invoice Email","description":"Send an already-issued invoice to the customer again.\n\nThe PDF only ever left the building during issuance, so anything that\ninterrupted that path left the customer with no invoice and no way to get\none: admin can compose a message but cannot attach a file, and there was no\nresend anywhere. Rachunek 1/9/2026 was issued at iFirma on 2026-09-01 while\nthe write-back crashed, so the mail never fired and had to be sent by hand.\n\nFetches from iFirma rather than storing anything, so what the customer\nreceives is always the authoritative document and nobody can attach the\nwrong file.","operationId":"resend_polish_invoice_email_admin_polish_invoices__invoice_id__resend_email_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"invoice_id","in":"path","required":true,"schema":{"type":"string","title":"Invoice Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolishInvoiceRetryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/polish-invoices":{"get":{"tags":["admin"],"summary":"List Admin Polish Invoices","description":"List Polish iFirma invoices across all tenants (admin view).\nFilters: tenant_id (single tenant), only_errored (rows with non-null\nerror_message OR no ifirma_id past 5 minutes since creation).","operationId":"list_admin_polish_invoices_admin_polish_invoices_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"}},{"name":"only_errored","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Only Errored"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminPolishInvoicesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/tenants/{tenant_id}/health":{"get":{"tags":["admin"],"summary":"Tenant Health","description":"Per-tenant health snapshot.","operationId":"tenant_health_admin_tenants__tenant_id__health_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantHealthResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/audit-log":{"get":{"tags":["admin"],"summary":"List Audit Log","description":"Paginated admin audit log.","operationId":"list_audit_log_admin_audit_log_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditLogResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/uptime":{"get":{"tags":["admin"],"summary":"Admin Uptime","description":"Check live status of all external provider dependencies.","operationId":"admin_uptime_admin_uptime_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UptimeResponse"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/alert/pod-restart":{"post":{"tags":["admin"],"summary":"Pod Restart Alert","description":"Called by Cloud Run on service restart. Logs and alerts ops.\n\nService-to-service only (X-Internal-Key): without it, anyone could write\nAuditLog rows and fire ops alerts (audit poisoning + pager spam). Matches\nthe internal-key convention used by /internal/* routes.\nSee SECURITY_REVIEW_2026-06-18 M3.","operationId":"pod_restart_alert_admin_alert_pod_restart_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PodRestartRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/alerts/stream-token":{"post":{"tags":["admin"],"summary":"Mint Alerts Stream Token","description":"Mint a short-lived (60s), single-purpose token for the alerts SSE.\n\nEventSource can't send Authorization headers, so the URL carries a token —\na 24h full JWT in the URL leaks into access logs/history. This scopes the\nleak to a 60-second purpose-locked token. (Audit 2026-06-19 JWT-in-URL.)","operationId":"mint_alerts_stream_token_admin_alerts_stream_token_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/alerts/stream":{"get":{"tags":["admin"],"summary":"Alerts Stream","description":"Stream admin alerts via Server-Sent Events from the admin:alerts Redis channel.\nAccepts `?token=<jwt>` for EventSource compatibility (see helper above).","operationId":"alerts_stream_admin_alerts_stream_get","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/alerts/test":{"post":{"tags":["admin"],"summary":"Publish Test Alert","description":"Publish a test alert to the admin:alerts channel. Only available in debug mode.","operationId":"publish_test_alert_admin_alerts_test_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestAlertRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/tenants/{tenant_id}/forwarding":{"patch":{"tags":["admin"],"summary":"Update Tenant Forwarding","description":"Set a tenant's phone, transfer number, ring time and answering mode. Admin\nonly, for preparing test tenants. Obeys the same rules as the owner's save.","operationId":"update_tenant_forwarding_admin_tenants__tenant_id__forwarding_patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantForwardingAdminUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/tenants/{tenant_id}/reconcile-subscription":{"post":{"tags":["admin"],"summary":"Reconcile Tenant Subscription","description":"Re-sync a tenant's plan state from their live Stripe subscription.\n\nFixes tenants stranded on trial/starter defaults because a Stripe\nsubscription was created OUTSIDE our own checkout and never linked — the\ncustomer.subscription.created webhook used to silently drop it (DG Water /\n#117). Finds the subscription by the linked customer id, or by matching the\ntenant's email to a Stripe customer, links it, and replays the canonical\nwebhook applier so tier / limits / amount match live billing. Idempotent;\npreserves the current period's usage counters.","operationId":"reconcile_tenant_subscription_admin_tenants__tenant_id__reconcile_subscription_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReconcileSubscriptionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/tenants/{tenant_id}/active":{"patch":{"tags":["admin"],"summary":"Set Tenant Active","description":"Suspend an account, or bring it back. Admin only, audited.\n\nThere was no way to do this from the panel until 2026-09-16, when a scripted\nsignup took a number and started probing our API: the only lever we had was\na deploy. Suspending stops their tokens working at once (every login carries\npermissions_changed_at) and takes the account out of the active lists.","operationId":"set_tenant_active_admin_tenants__tenant_id__active_patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantActiveUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/tenants/{tenant_id}/internal":{"patch":{"tags":["admin"],"summary":"Update Tenant Internal","description":"Flag a tenant as internal (seed / CI / team-test) or back to real.\n\nInternal tenants' calls are folded into the automated_test bucket in admin\ncall views, so seeded / team-test data never inflates \"real customer\ntraffic\". Reversible; the classification is derived at read time.","operationId":"update_tenant_internal_admin_tenants__tenant_id__internal_patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantInternalUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantInternalResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/tenants/{tenant_id}/stt-mode":{"patch":{"tags":["admin"],"summary":"Update Tenant Stt Mode","description":"Choose how this tenant's calls are transcribed.\n\n\"pinned\" recognises one language at a time, which is markedly more accurate\nfor Polish than multilingual auto-detect; when the caller asks for another\nlanguage the engine re-pins the recogniser in code. \"auto\" is the\nmultilingual auto-detect. None hands the choice back to the environment\ndefault. Nothing else about the call changes.","operationId":"update_tenant_stt_mode_admin_tenants__tenant_id__stt_mode_patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SttModeUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SttModeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/tenants/{tenant_id}/trial-allowance":{"patch":{"tags":["admin"],"summary":"Update Tenant Trial Allowance","description":"Give one trial a different minute / SMS allowance than the standard cap.\n\nThe trial cap (30 min / 20 SMS regardless of plan) is enforced in code for\nevery trialing tenant. This is the one place to make an exception for a\nsingle account: a promising trial that deserves more room, or a tenant that\nwas grandfathered by migration 175. Takes effect on the next call; nothing\nis written to the plan limits themselves, so paying still unlocks the full\nplan exactly as before.","operationId":"update_tenant_trial_allowance_admin_tenants__tenant_id__trial_allowance_patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrialAllowanceUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrialAllowanceResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/tenants/{tenant_id}/billing-management":{"patch":{"tags":["admin"],"summary":"Update Tenant Billing Management","description":"Mark a tenant as billed by hand — or hand them back to self-serve billing.\n\nON = a real customer whose billing we run ourselves: comped, partner,\ninvoiced offline, or Stripe collection deliberately paused. Self-serve\nbilling automation stops touching them — no trial-expiry reminder emails, no\nauto-expiry (which zeroes entitlements and stops the line answering), and no\nnumber reclaim. Everything else is unchanged: they stay a real customer in\nmetrics (unlike is_internal), keep their tier and features, and quota\nenforcement still applies.\n\nOFF hands the account back to the normal lifecycle. If its trial_ends_at is\nalready in the past it becomes expirable on the next nightly run — so only\nturn it off for an account that really should lapse.","operationId":"update_tenant_billing_management_admin_tenants__tenant_id__billing_management_patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingManagementUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingManagementResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/tenants/{tenant_id}/seed-data-sources":{"post":{"tags":["admin"],"summary":"Admin Seed Data Sources","description":"Seed data sources for a business-tier-or-higher tenant. Admin only.","operationId":"admin_seed_data_sources_admin_tenants__tenant_id__seed_data_sources_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AdminDataSourceCreate"},"title":"Sources"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/tenants/{tenant_id}/assign-number":{"post":{"tags":["admin"],"summary":"Assign Dedicated Number","description":"Assign a dedicated phone number to a tenant.\n\nAtomic: deactivates any prior active number on this tenant before adding the new one,\nso the tenant always has at most one active row. Validates E.164 phone format.","operationId":"assign_dedicated_number_admin_tenants__tenant_id__assign_number_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignNumberRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/phone-pool":{"get":{"tags":["admin"],"summary":"Phone Pool","description":"What is left in the Vonage pool, and where it disagrees with our table.\n\nPoland cannot be bought on demand: /number/buy answers 403 \"available on\nrequest\", so numbers arrive in manually requested batches and running out\nis a thing that has to be SEEN coming. Until now the only sign was a\nvonage_pool_exhausted log written after a customer had already been dropped\nonto the shared line.\n\nThe two mismatch lists matter as much as the count. `orphaned` is a number\nlinked at Vonage that no tenant is using, so we are paying for a line\nnobody has. `stale_rows` is the opposite and worse: a tenant believes they\nhave a number that is not linked, so their callers reach nothing.","operationId":"phone_pool_admin_phone_pool_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhonePoolResponse"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/phone-numbers":{"get":{"tags":["admin"],"summary":"List Phone Inventory","description":"All provisioned phone numbers across all tenants.\n\n`search` answers \"whose number is this?\" — matches the number (spaces/dashes\nignored) or the tenant business name, case-insensitively.","operationId":"list_phone_inventory_admin_phone_numbers_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"provider","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"}},{"name":"is_active","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"Reverse lookup: match a phone number or tenant name","title":"Search"},"description":"Reverse lookup: match a phone number or tenant name"},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PhoneInventoryResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/failover/incidents":{"get":{"tags":["admin"],"summary":"List Failover Incidents","description":"Carrier call-failover incidents — powers the admin banner.\n\nactive=true → only open incidents (calls currently forwarding); otherwise\nthe most recent incidents including recovered ones.","operationId":"list_failover_incidents_admin_failover_incidents_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"active","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Active"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FailoverIncidentsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/phone-numbers/{phone_id}":{"delete":{"tags":["admin"],"summary":"Admin Release Phone Number","description":"Manually release a phone number (admin override).","operationId":"admin_release_phone_number_admin_phone_numbers__phone_id__delete","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"phone_id","in":"path","required":true,"schema":{"type":"string","title":"Phone Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/phone-numbers/reprovision/{tenant_id}":{"post":{"tags":["admin"],"summary":"Admin Reprovision Phone Number","description":"Manually trigger provisioning for a tenant.\n\nIdempotency: if the tenant already has an active dedicated number, this is a\nno-op unless `force=true` is set. Without this guard a double-click would\npurchase a second number — guaranteed double-charge.\n\nReal provisioning errors (cap exceeded, address missing, provider auth) are\nsurfaced to the admin instead of being collapsed into a generic 400.","operationId":"admin_reprovision_phone_number_admin_phone_numbers_reprovision__tenant_id__post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReprovisionRequest","default":{"force":false}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/voice-engine/stats":{"get":{"tags":["admin"],"summary":"Voice Engine Stats","description":"Real-time voice engine stats for admin monitoring dashboard.\nInternal/demo/CI traffic is excluded so the numbers reflect customers (#136).","operationId":"voice_engine_stats_admin_voice_engine_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceEngineStats"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/voice-engine/latency":{"get":{"tags":["admin"],"summary":"Latency Timeseries","description":"P50/P95/P99 latency by hour for the last N hours (default 24, max 168/7 days).","operationId":"latency_timeseries_admin_voice_engine_latency_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"hours","in":"query","required":false,"schema":{"type":"integer","maximum":168,"minimum":1,"default":24,"title":"Hours"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/LatencyDataPoint"},"title":"Response Latency Timeseries Admin Voice Engine Latency Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/users":{"get":{"tags":["admin"],"summary":"List Users","description":"Paginated user list with plan, auth method, and signup info.","operationId":"list_users_admin_users_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"search","in":"query","required":false,"schema":{"type":"string","default":"","title":"Search"}},{"name":"has_tenant","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"description":"false lists signups that never created a business, the segment no lifecycle job could see before signup_recovery existed","title":"Has Tenant"},"description":"false lists signups that never created a business, the segment no lifecycle job could see before signup_recovery existed"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUsersResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/users/{user_id}":{"patch":{"tags":["admin"],"summary":"Admin Update User","description":"Admin: update user account flags (verify, activate/deactivate).","operationId":"admin_update_user_admin_users__user_id__patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUpdateUserRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/tenants/{tenant_id}/send-welcome":{"post":{"tags":["admin"],"summary":"Send Welcome To Tenant","description":"Send, or re-send, the real welcome email and bell entry to one tenant.\n\nThe broadcast form below can carry any text, but its email renders the\nmessage as a single flat paragraph, so the welcome's numbered steps,\nbooking link and founder signature would arrive as run-together prose.\nThis sends the actual template.\n\nNeeded because onboarding sent the customer nothing at all until\n2026-08-23: every tenant created before then is owed this email, and\nAroma Serwis is the first of them.\n\nSafe to run twice. It is a welcome, not a state change, so re-sending\ncosts an extra email and nothing else.","operationId":"send_welcome_to_tenant_admin_tenants__tenant_id__send_welcome_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendWelcomeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/message-drafts":{"get":{"tags":["admin"],"summary":"List Message Drafts","operationId":"list_message_drafts_admin_message_drafts_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"include_sent","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Sent"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MessageDraftOut"},"title":"Response List Message Drafts Admin Message Drafts Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["admin"],"summary":"Create Message Draft","description":"Prepare a message to ONE tenant now; send it later with /message-drafts/{id}/send.","operationId":"create_message_draft_admin_message_drafts_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageDraftIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageDraftOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/message-drafts/{draft_id}":{"delete":{"tags":["admin"],"summary":"Delete Message Draft","operationId":"delete_message_draft_admin_message_drafts__draft_id__delete","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","title":"Draft Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/message-drafts/{draft_id}/send":{"post":{"tags":["admin"],"summary":"Send Message Draft","description":"One click: deliver the draft through the broadcast path (in-app + e-mail),\nsigned by the chosen sender, and mark it sent (idempotent: a sent draft is refused).","operationId":"send_message_draft_admin_message_drafts__draft_id__send_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"draft_id","in":"path","required":true,"schema":{"type":"string","title":"Draft Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BroadcastNotificationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/notifications/broadcast":{"post":{"tags":["admin"],"summary":"Broadcast Notification","description":"Send an in-app notification (and optional email) to one or all tenants.\nAdmin-only. Supports targeting: all, trialing, active, plan:<tier>, or a single tenant.","operationId":"broadcast_notification_admin_notifications_broadcast_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BroadcastNotificationRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BroadcastNotificationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/notifications/announcements":{"get":{"tags":["admin"],"summary":"List Feature Announcements","description":"The feature-announcement catalog with per-entry delivery counts (admin UI).","operationId":"list_feature_announcements_admin_notifications_announcements_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Response List Feature Announcements Admin Notifications Announcements Get"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/setup-funnel":{"get":{"tags":["admin"],"summary":"Setup Funnel","description":"Per-step setup measurement for the weekly review: how many tenants did\neach step and from where (zvon, wizard, guide), forwarding-check verdicts,\nguide chapters opened, and tenants that started but are not live.","operationId":"setup_funnel_admin_setup_funnel_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/notifications/announce":{"post":{"tags":["admin"],"summary":"Announce Feature Endpoint","description":"Run the feature-announcement ritual for one catalog key. Idempotent per\n(tenant, key) — safe to re-run. `dry_run=true` previews recipient counts.","operationId":"announce_feature_endpoint_admin_notifications_announce_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnnounceFeatureRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnnounceFeatureResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/notifications/announcements/{key}":{"put":{"tags":["admin"],"summary":"Update Feature Announcement Copy","description":"Polish the copy of one catalog announcement before sending (owner\nritual 2026-08-02: code seeds → admin edits → preview → send). Returns the\nmerged entry the Send button will use.","operationId":"update_feature_announcement_copy_admin_notifications_announcements__key__put","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnnouncementOverrideRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Feature Announcement Copy Admin Notifications Announcements  Key  Put"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/notifications/announcements/{key}/override":{"delete":{"tags":["admin"],"summary":"Reset Feature Announcement Copy","description":"Drop the admin override and go back to the code-seeded catalog copy.","operationId":"reset_feature_announcement_copy_admin_notifications_announcements__key__override_delete","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Reset Feature Announcement Copy Admin Notifications Announcements  Key  Override Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/notifications/announcements/{key}/preview":{"get":{"tags":["admin"],"summary":"Preview Feature Announcement","description":"Exact merged copy on every surface: the in-app bell card (PL + EN) and\nthe byte-for-byte branded email HTML `announce_feature` would send —\nrendered by the SAME function, so the preview can never drift.","operationId":"preview_feature_announcement_admin_notifications_announcements__key__preview_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string","title":"Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Preview Feature Announcement Admin Notifications Announcements  Key  Preview Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/notifications/history":{"get":{"tags":["admin"],"summary":"List Recent Notifications","description":"List the most recent in-app notifications across all tenants (admin view).\nTranslates to the admin's own locale when the row carries an i18n key (newer\nrows); legacy rows fall back to their stored text. Archived rows (admin-only\nflag — tenants' bells are unaffected) are hidden unless include_archived.\n\n`q` narrows to tenants matched by business name, phone number, or tenant-id\nprefix, so operators can filter the feed to one customer without knowing\ntheir UUID. Rows carry `business_name` for the same reason.\n\nCaller-facing operational notifications (callbacks, messages, call events,\nlead intakes) are EXCLUDED — they contain callers' personal data that the\ntenant, not the platform operator, is the controller for (RODO\nminimisation). Those live only in the tenant's own bell.","operationId":"list_recent_notifications_admin_notifications_history_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type"}},{"name":"lang","in":"query","required":false,"schema":{"type":"string","default":"pl","title":"Lang"}},{"name":"include_archived","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Include Archived"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":100},{"type":"null"}],"title":"Q"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","additionalProperties":true},"title":"Response List Recent Notifications Admin Notifications History Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/notifications/history/archive":{"post":{"tags":["admin"],"summary":"Archive Notifications History","description":"Archive (or unarchive) rows in the admin history feed.\n\nSets the ADMIN-only admin_archived flag — the tenants' own notification\nbells are untouched, so this can never remove a customer's copy. Bulk by\nid so the UI's \"archive all shown\" is one request. Reversible.","operationId":"archive_notifications_history_admin_notifications_history_archive_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ArchiveNotificationsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Archive Notifications History Admin Notifications History Archive Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/users/{user_id}/reset-2fa":{"post":{"tags":["admin"],"summary":"Admin Reset 2Fa","description":"Disable a locked-out user's 2FA after out-of-band identity verification.\n\nAudit P2: a user who lost both their authenticator AND backup codes had\nno recovery path at all. Platform-admin only, fully audit-logged; the\nuser re-enrolls 2FA on next login. All existing sessions are killed so\nthe reset can't be used to ride an already-stolen session.","operationId":"admin_reset_2fa_admin_users__user_id__reset_2fa_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/tenants/{tenant_id}/extend-trial":{"post":{"tags":["admin"],"summary":"Extend Trial","description":"Extend a tenant's trial period by N days (admin only).","operationId":"extend_trial_admin_tenants__tenant_id__extend_trial_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrialExtensionRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrialExtensionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/tenants/{tenant_id}/comp-minutes":{"post":{"tags":["admin"],"summary":"Grant Comp Minutes","description":"Grant goodwill/comp BONUS minutes to a tenant (admin only).\n\nAdds to ``minutes_purchased`` — a top-up bucket that does NOT reset monthly and\nis NEVER a Stripe credit — so the tenant gets more headroom WITHOUT changing the\nsubscription price. When Stripe bills, the invoice is exactly the plan price.\n(A Stripe coupon WOULD lower the bill; we deliberately never do that here.)\n\nIdempotent per (tenant, period) when ``period`` (YYYY-MM) is set. On success the\ntenant gets an in-app notification + email in their language unless ``notify`` is\nfalse. The free-text ``reason`` is stored in the audit log only (never shown to\nthe customer).","operationId":"grant_comp_minutes_admin_tenants__tenant_id__comp_minutes_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompMinutesRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompMinutesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/tenants/{tenant_id}/reset-onboarding":{"delete":{"tags":["admin"],"summary":"Reset Onboarding","description":"Delete a tenant and unlink all users so they can re-do onboarding.\n\nDESTRUCTIVE + irreversible: cascades delete all phone_numbers, departments,\netc. Requires ?confirm=<business_name> echo to guard against misclicks, and\nwrites an audit-log row. (Audit 2026-06-19 admin reset-onboarding.)","operationId":"reset_onboarding_admin_tenants__tenant_id__reset_onboarding_delete","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"confirm","in":"query","required":false,"schema":{"type":"string","description":"Must equal the tenant's business_name to proceed","default":"","title":"Confirm"},"description":"Must equal the tenant's business_name to proceed"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/internal/reset-user-onboarding":{"post":{"tags":["admin"],"summary":"Internal Reset User Onboarding","description":"Reset onboarding for a user by email. Requires X-Internal-Key header.","operationId":"internal_reset_user_onboarding_admin_internal_reset_user_onboarding_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/calls/{call_id}/content":{"get":{"tags":["admin"],"summary":"Get Admin Call Content","description":"Admin-only: metadata + AI summary of a single call. Never the raw transcript.\n\nLets the owner see what happened on a tenant↔client call while keeping the\ncaller's verbatim transcript private (RODO data minimisation).","operationId":"get_admin_call_content_admin_calls__call_id__content_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","title":"Call Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminCallContentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/cache/lookup":{"post":{"tags":["internal-cache"],"summary":"Cache Lookup","description":"Search the semantic cache for a similar question.\n\nEmbeds the question and searches for cached entries with\ncosine similarity >= 0.92 for the given tenant.","operationId":"cache_lookup_internal_cache_lookup_post","parameters":[{"name":"x-internal-key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CacheLookupRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CacheLookupResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/cache/store":{"post":{"tags":["internal-cache"],"summary":"Cache Store","description":"Store a new question-answer pair in the semantic cache.","operationId":"cache_store_internal_cache_store_post","parameters":[{"name":"x-internal-key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CacheStoreRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CacheStoreResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/cache/invalidate/{tenant_id}":{"post":{"tags":["internal-cache"],"summary":"Cache Invalidate","description":"Clear all cache entries for a tenant (e.g. after FAQ update).","operationId":"cache_invalidate_internal_cache_invalidate__tenant_id__post","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"x-internal-key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CacheInvalidateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/integration-error":{"post":{"tags":["internal"],"summary":"Report Integration Error","description":"Receive integration failure report from voice engine.\n\nRecords the error and fires alerts for critical issues.","operationId":"report_integration_error_internal_integration_error_post","parameters":[{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationErrorReport"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/failover-activated":{"post":{"tags":["internal"],"summary":"Report Failover Activated","description":"Record a failover activation (incident + founder alerts + tenant email).\n\nIf a ``call_control_id`` is supplied, first attempt the Layer-B transfer to\nthe tenant's real phone and record the truthful ``forwarded`` result — so\nthe tenant email only ever claims a forward that actually connected.\n\nBest-effort for the voice engine: always returns received=True so the call\npath never retries into a loop. ``transferred`` is echoed back so the voice\nengine can fall back to speak-and-hangup only when the rescue truly failed.","operationId":"report_failover_activated_internal_failover_activated_post","parameters":[{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FailoverActivatedReport"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/transfer-duration":{"post":{"tags":["internal"],"summary":"Report Transfer Duration","description":"Store the bridged human-talk duration on the originating call.\n\nFires from the voice-engine's /transfer-status handler when a transfer\nbridge ends (DialCallStatus completed/answered). Must land BEFORE the\ncall-end billing PATCH (Twilio fires the <Dial> action callback while\nthe parent call is still live), so the billing calc can deduct it.\nIdempotent: retries keep the max reported duration. Best-effort for the\ncaller — a miss here means the tenant is billed the old (whole-call) way.","operationId":"report_transfer_duration_internal_transfer_duration_post","parameters":[{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferDurationReport"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/transfer-failed":{"post":{"tags":["internal"],"summary":"Report Transfer Failed","description":"Voice-engine reports that a transfer-to-human attempt ended without\na successful bridge. We:\n\n  1. Look up the originating Call → tenant\n  2. If tenant has owner_sms_phone + sms_on_missed_transfer → send SMS\n  3. Bump in-app notification (bell icon) so owner sees it on next login\n\nBest-effort; never fails the voice-engine path. Errors logged + return\n{received: True} regardless so the voice-engine doesn't retry-loop.","operationId":"report_transfer_failed_internal_transfer_failed_post","parameters":[{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferFailedReport"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/webhooks/deliver":{"post":{"tags":["internal"],"summary":"Deliver Webhook Retry","operationId":"deliver_webhook_retry_internal_webhooks_deliver_post","parameters":[{"name":"X-CloudTasks-TaskRetryCount","in":"header","required":false,"schema":{"type":"integer","default":0,"title":"X-Cloudtasks-Taskretrycount"}},{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliverBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/knowledge/upload":{"post":{"tags":["knowledge"],"summary":"Upload Document","description":"Upload a PDF/TXT/DOCX file for RAG. Chunks and embeds in background.\n\nReturns immediately with status=processing and text_preview of first 500 chars.\nPoll GET /documents until status=ready.","operationId":"upload_document_tenants__tenant_id__knowledge_upload_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_document_tenants__tenant_id__knowledge_upload_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/knowledge/documents/{document_id}/replace":{"put":{"tags":["knowledge"],"summary":"Replace Document","description":"Replace an existing document atomically.\n\nDeletes old chunks, re-processes new file under the same document ID.","operationId":"replace_document_tenants__tenant_id__knowledge_documents__document_id__replace_put","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_replace_document_tenants__tenant_id__knowledge_documents__document_id__replace_put"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/knowledge/documents/{document_id}/retry":{"post":{"tags":["knowledge"],"summary":"Retry Document","description":"Re-process a failed/stuck document from its stored text — no re-upload.\n\nUses the persisted full_text, so embedding (or FAQ extraction) is retried\nwithout the original file. Safe to call on a 'failed' or stuck 'processing'\ndocument.","operationId":"retry_document_tenants__tenant_id__knowledge_documents__document_id__retry_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/knowledge/documents/{document_id}/versions":{"get":{"tags":["knowledge"],"summary":"List Document Versions","description":"List prior versions of a document (snapshots taken on each replace).","operationId":"list_document_versions_tenants__tenant_id__knowledge_documents__document_id__versions_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DocumentVersionResponse"},"title":"Response List Document Versions Tenants  Tenant Id  Knowledge Documents  Document Id  Versions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/knowledge/documents/{document_id}/apply-faq":{"post":{"tags":["knowledge"],"summary":"Apply Extracted Faq","description":"Merge this document's extracted Q&A pairs into the tenant's FAQ.\n\nCalled by dashboard after user previews and confirms the extracted pairs.\nOnly merges pairs not already present (does not overwrite existing FAQ keys).\nAn optional `questions` list restricts the merge to the selected pairs\n(review-before-apply in the FAQ tab).","operationId":"apply_extracted_faq_tenants__tenant_id__knowledge_documents__document_id__apply_faq_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ApplyFaqRequest"},{"type":"null"}],"title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/knowledge/faq/extract-file":{"post":{"tags":["knowledge"],"summary":"Extract Faq From File","description":"Extract FAQ Q&A pairs from an uploaded file — no storage, no embedding.\n\nAvailable on every plan (Solo included). Runs the same text extraction and\nGemini FAQ extraction as /upload but never persists a document or embeds any\nchunk — it returns the pairs for owner review. Apply the selected pairs with\n/faq/apply-pairs (or via the settings FAQ save).","operationId":"extract_faq_from_file_tenants__tenant_id__knowledge_faq_extract_file_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_extract_faq_from_file_tenants__tenant_id__knowledge_faq_extract_file_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractFaqFromFileResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/knowledge/faq/apply-pairs":{"post":{"tags":["knowledge"],"summary":"Apply Faq Pairs","description":"Merge reviewed FAQ pairs into the tenant's inline FAQ (existing keys win).\n\nCompanion to /faq/extract-file for the file-import flow. Touches only\ntenant.faq — never documents or the vector corpus.","operationId":"apply_faq_pairs_tenants__tenant_id__knowledge_faq_apply_pairs_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplyFaqPairsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/knowledge/documents":{"get":{"tags":["knowledge"],"summary":"List Documents","description":"List all uploaded knowledge base documents for this tenant.","operationId":"list_documents_tenants__tenant_id__knowledge_documents_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DocumentResponse"},"title":"Response List Documents Tenants  Tenant Id  Knowledge Documents Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/knowledge/documents/{document_id}/ai-access":{"patch":{"tags":["knowledge"],"summary":"Set Document Ai Access","description":"Toggle whether the AI may quote this document to callers.\n\nOff = the document stays stored and versioned but knowledge_search skips\nits chunks entirely (filtered in SQL), so nothing from it can ever be\nspoken on a call or cited in chat. Added after the 2026-08-06 test call\nrecited an uploaded balance sheet to a caller.","operationId":"set_document_ai_access_tenants__tenant_id__knowledge_documents__document_id__ai_access_patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentAiAccessRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/knowledge/documents/{document_id}":{"delete":{"tags":["knowledge"],"summary":"Delete Document","description":"Delete a document and all its chunks/embeddings.","operationId":"delete_document_tenants__tenant_id__knowledge_documents__document_id__delete","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/knowledge/documents/{document_id}/department":{"patch":{"tags":["knowledge"],"summary":"Set Document Department","description":"Tag a document with one department (or clear the tag).\n\nTagged documents are searched only when the caller's question is routed\nto that department; general documents are always searched.","operationId":"set_document_department_tenants__tenant_id__knowledge_documents__document_id__department_patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"document_id","in":"path","required":true,"schema":{"type":"string","title":"Document Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentDepartmentRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/knowledge/query":{"post":{"tags":["knowledge"],"summary":"Query Knowledge","description":"Vector search for relevant knowledge chunks. Used by voice engine at call time.\n\nEmbeds the query, runs cosine similarity search via pgvector (~5ms).\nNo LLM invoked — pure database lookup. No rechunking.","operationId":"query_knowledge_tenants__tenant_id__knowledge_query_post","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/QueryResult"},"title":"Response Query Knowledge Tenants  Tenant Id  Knowledge Query Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/knowledge/limits":{"get":{"tags":["knowledge"],"summary":"Get Document Limits","description":"Return current usage vs plan limits for document storage.","operationId":"get_document_limits_tenants__tenant_id__knowledge_limits_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/knowledge/faq/export":{"get":{"tags":["knowledge"],"summary":"Export Faq","description":"Export the tenant FAQ as JSON or CSV.\n\nReturns all Q&A pairs from tenant.faq.\nAccessible to all plan tiers (FAQ is a core feature).","operationId":"export_faq_tenants__tenant_id__knowledge_faq_export_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"format","in":"query","required":false,"schema":{"type":"string","pattern":"^(json|csv)$","default":"json","title":"Format"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/brand":{"get":{"tags":["brand"],"summary":"Get Brand Config","description":"Get the brand configuration for this tenant.","operationId":"get_brand_config_tenants__tenant_id__brand_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["brand"],"summary":"Update Brand Config","description":"Create or update the brand configuration.","operationId":"update_brand_config_tenants__tenant_id__brand_put","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandConfigUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/brand/logo":{"post":{"tags":["brand"],"summary":"Upload Logo","description":"Upload a brand logo (PNG/JPG/SVG/WebP, max 2MB).\n\nStored as base64 data URI for MVP. Production will use GCS bucket.","operationId":"upload_logo_tenants__tenant_id__brand_logo_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_upload_logo_tenants__tenant_id__brand_logo_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["brand"],"summary":"Delete Logo","description":"Remove the brand logo.","operationId":"delete_logo_tenants__tenant_id__brand_logo_delete","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/waitlist/join":{"post":{"tags":["waitlist"],"summary":"Join Waitlist","operationId":"join_waitlist_waitlist_join_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaitlistJoinRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaitlistJoinResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/waitlist/position/{phone}":{"get":{"tags":["waitlist"],"summary":"Get Position","operationId":"get_position_waitlist_position__phone__get","parameters":[{"name":"phone","in":"path","required":true,"schema":{"type":"string","title":"Phone"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaitlistPositionResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/waitlist/email/{phone}":{"patch":{"tags":["waitlist"],"summary":"Add Email","operationId":"add_email_waitlist_email__phone__patch","parameters":[{"name":"phone","in":"path","required":true,"schema":{"type":"string","title":"Phone"}},{"name":"email","in":"query","required":true,"schema":{"type":"string","title":"Email"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/waitlist/demo-lead":{"post":{"tags":["waitlist"],"summary":"Demo Lead","description":"Soft email-only lead from the landing personalized-demo widget.\n\nUpserts into the SAME Brevo waitlist list (Brevo dedupes by email — no phone\nkey, so repeat plays never 409). Tagged so Martyna can tell demo leads from\nfull waitlist signups. The full waitlist (with phone) still uses /join.\n\nRODO: marketing contact requires consent. We only add to the marketing list and\nfire the automation when the user gave consent (the widget shows the consent line\n+ privacy-policy link). Consent + timestamp are recorded on the Brevo contact.","operationId":"demo_lead_waitlist_demo_lead_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemoLeadRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/waitlist/survey":{"post":{"tags":["waitlist"],"summary":"Submit Survey","description":"Store survey answers from Martyna's Google Form questionnaire.\n\nCalled by Google Forms webhook (via Apps Script) or directly from the\nwaitlist confirmation page. Enriches the lead record for Martyna's outreach.","operationId":"submit_survey_waitlist_survey_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaitlistSurveyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/waitlist/survey-by-email":{"post":{"tags":["waitlist"],"summary":"Submit Survey By Email","description":"Store survey answers matched by email.\n\nUsed by Google Forms Apps Script webhook. If the email is already on the waitlist,\nthe survey data is merged in. If not found, a new entry is created from the survey\ndata so Google Forms respondents always appear in the admin dashboard.","operationId":"submit_survey_by_email_waitlist_survey_by_email_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaitlistSurveyByEmailRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/waitlist/admin/stats":{"get":{"tags":["waitlist"],"summary":"Get Stats","description":"Public stats endpoint: returns total waitlist count for the landing page counter.","operationId":"get_stats_waitlist_admin_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/waitlist/nurture/process":{"post":{"tags":["waitlist"],"summary":"Process Nurture","description":"Triggered by Cloud Scheduler every hour. Sends due nurture emails.\n\nX-Internal-Key required (audit 2026-07-08 A6 — this was completely\nunauthenticated: anyone could trigger unlimited nurture email blasts).\nCloud Scheduler must send the header.","operationId":"process_nurture_waitlist_nurture_process_post","parameters":[{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/waitlist/entries":{"get":{"tags":["admin","waitlist"],"summary":"List Waitlist Entries","description":"Paginated waitlist entries with filters.","operationId":"list_waitlist_entries_admin_waitlist_entries_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"tier","in":"query","required":false,"schema":{"type":"string","default":"","title":"Tier"}},{"name":"city","in":"query","required":false,"schema":{"type":"string","default":"","title":"City"}},{"name":"business_type","in":"query","required":false,"schema":{"type":"string","default":"","title":"Business Type"}},{"name":"date_from","in":"query","required":false,"schema":{"type":"string","description":"ISO date string YYYY-MM-DD","default":"","title":"Date From"},"description":"ISO date string YYYY-MM-DD"},{"name":"date_to","in":"query","required":false,"schema":{"type":"string","description":"ISO date string YYYY-MM-DD","default":"","title":"Date To"},"description":"ISO date string YYYY-MM-DD"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaitlistEntriesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/waitlist/stats":{"get":{"tags":["admin","waitlist"],"summary":"Waitlist Stats","description":"Waitlist summary statistics.","operationId":"waitlist_stats_admin_waitlist_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WaitlistStatsResponse"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/waitlist/export":{"get":{"tags":["admin","waitlist"],"summary":"Export Waitlist","description":"Export all waitlist entries as CSV.","operationId":"export_waitlist_admin_waitlist_export_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/waitlist/entries/{entry_id}/notes":{"patch":{"tags":["admin","waitlist"],"summary":"Update Entry Notes","description":"Update admin notes on a waitlist entry.","operationId":"update_entry_notes_admin_waitlist_entries__entry_id__notes_patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"entry_id","in":"path","required":true,"schema":{"type":"string","title":"Entry Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotesUpdateRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/waitlist/notify/{entry_id}":{"post":{"tags":["admin","waitlist"],"summary":"Mark Notified","description":"Mark a waitlist entry as notified (manual outreach tracking).","operationId":"mark_notified_admin_waitlist_notify__entry_id__post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"entry_id","in":"path","required":true,"schema":{"type":"string","title":"Entry Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotifyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/waitlist/referral-leaderboard":{"get":{"tags":["admin","waitlist"],"summary":"Referral Leaderboard","description":"Top referrers by referral count.","operationId":"referral_leaderboard_admin_waitlist_referral_leaderboard_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReferralLeaderboardResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/billing/payments":{"get":{"tags":["admin"],"summary":"Payments Overview","description":"Money received, money at risk, and money due in the next week.","operationId":"payments_overview_admin_billing_payments_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":90,"minimum":1,"default":30,"title":"Days"}},{"name":"refresh","in":"query","required":false,"schema":{"type":"boolean","description":"Bypass the 60s cache","default":false,"title":"Refresh"},"description":"Bypass the 60s cache"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/billing/payments/{charge_id}/refund":{"post":{"tags":["admin"],"summary":"Refund Payment","description":"Refund a captured charge, in full or in part, with an audit entry.","operationId":"refund_payment_admin_billing_payments__charge_id__refund_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"charge_id","in":"path","required":true,"schema":{"type":"string","title":"Charge Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefundRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/contact":{"post":{"tags":["contact"],"summary":"Submit Contact","description":"Forward a contact form submission to hello@zvonai.ai + log it in admin.","operationId":"submit_contact_contact_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ContactRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/contact/callback":{"post":{"tags":["contact"],"summary":"Request Callback","description":"Landing-page callback card: visitor leaves a phone number, we call back.\n\nCreates a high-severity support ticket (category=\"callback\") so the request\nlands in the admin Open folder + fires an admin bell, and still emails the\nteam the \"call now\" card.","operationId":"request_callback_contact_callback_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallbackRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/setup-offer":{"get":{"tags":["setup"],"summary":"Get Setup Offer","description":"The three options and their prices, for the price page, the concierge, agents and llms.txt.","operationId":"get_setup_offer_setup_offer_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Setup Offer Setup Offer Get"}}}}}}},"/setup-requests":{"post":{"tags":["setup"],"summary":"Submit Setup Form","description":"The /uruchomienie form. No account needed; the team calls back within one working day.","operationId":"submit_setup_form_setup_requests_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupFormRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Submit Setup Form Setup Requests Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/setup-requests/drafts":{"post":{"tags":["setup"],"summary":"Save Setup Draft","description":"Save the form half-way and text a resume link. Needs a phone and consent to be contacted.","operationId":"save_setup_draft_setup_requests_drafts_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupDraftRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Save Setup Draft Setup Requests Drafts Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/setup-requests/drafts/{token}":{"get":{"tags":["setup"],"summary":"Get Setup Draft","operationId":"get_setup_draft_setup_requests_drafts__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Setup Draft Setup Requests Drafts  Token  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/setup-links/{token}":{"get":{"tags":["setup"],"summary":"Get Pay Link","operationId":"get_pay_link_setup_links__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Pay Link Setup Links  Token  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/setup-links/{token}/checkout":{"post":{"tags":["setup"],"summary":"Start Pay Link","description":"The owner sets a password, accepts the terms and pays the plan with the setup.","operationId":"start_pay_link_setup_links__token__checkout_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayLinkCheckoutRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Start Pay Link Setup Links  Token  Checkout Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/setup-service/confirm":{"post":{"tags":["setup"],"summary":"Confirm Setup Done","description":"The customer confirms the setup with us is done (\"Odebrałem uruchomienie\").","operationId":"confirm_setup_done_setup_service_confirm_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Confirm Setup Done Setup Service Confirm Post"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/setup-requests":{"get":{"tags":["setup"],"summary":"List Setup Requests","operationId":"list_setup_requests_admin_setup_requests_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Setup Requests Admin Setup Requests Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/setup-requests/{request_id}":{"get":{"tags":["setup"],"summary":"Get Setup Request","operationId":"get_setup_request_admin_setup_requests__request_id__get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","title":"Request Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Setup Request Admin Setup Requests  Request Id  Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["setup"],"summary":"Update Setup Request","operationId":"update_setup_request_admin_setup_requests__request_id__patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","title":"Request Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupRequestUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Setup Request Admin Setup Requests  Request Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/care-checkins":{"get":{"tags":["setup"],"summary":"List Care Checkins","operationId":"list_care_checkins_admin_care_checkins_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"scope","in":"query","required":false,"schema":{"enum":["due","week","done"],"type":"string","default":"due","title":"Scope"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response List Care Checkins Admin Care Checkins Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/care-checkins/{checkin_id}/sheet":{"get":{"tags":["setup"],"summary":"Get Care Sheet","operationId":"get_care_sheet_admin_care_checkins__checkin_id__sheet_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"checkin_id","in":"path","required":true,"schema":{"type":"string","title":"Checkin Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Care Sheet Admin Care Checkins  Checkin Id  Sheet Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/care-checkins/{checkin_id}/complete":{"post":{"tags":["setup"],"summary":"Complete Care Checkin","operationId":"complete_care_checkin_admin_care_checkins__checkin_id__complete_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"checkin_id","in":"path","required":true,"schema":{"type":"string","title":"Checkin Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckinDone"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Complete Care Checkin Admin Care Checkins  Checkin Id  Complete Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/care-checkins/backfill":{"post":{"tags":["setup"],"summary":"Backfill Care Checkins","description":"Customers who went live before the care calls existed get their schedule from their first real call.","operationId":"backfill_care_checkins_admin_care_checkins_backfill_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Backfill Care Checkins Admin Care Checkins Backfill Post"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/setup-requests/{request_id}/create-account":{"post":{"tags":["setup"],"summary":"Create Account For Request","operationId":"create_account_for_request_admin_setup_requests__request_id__create_account_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","title":"Request Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAccountBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Create Account For Request Admin Setup Requests  Request Id  Create Account Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/setup-requests/schedule-day":{"post":{"tags":["setup"],"summary":"Schedule Day","operationId":"schedule_day_admin_setup_requests_schedule_day_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleDayBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Schedule Day Admin Setup Requests Schedule Day Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/setup-requests/{request_id}/checklist":{"get":{"tags":["setup"],"summary":"Get Checklist","operationId":"get_checklist_admin_setup_requests__request_id__checklist_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","title":"Request Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Checklist Admin Setup Requests  Request Id  Checklist Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["setup"],"summary":"Update Checklist","operationId":"update_checklist_admin_setup_requests__request_id__checklist_patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","title":"Request Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChecklistBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Checklist Admin Setup Requests  Request Id  Checklist Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/setup-requests/{request_id}/partner-payout-paid":{"post":{"tags":["setup"],"summary":"Mark Partner Payout Paid","operationId":"mark_partner_payout_paid_admin_setup_requests__request_id__partner_payout_paid_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"request_id","in":"path","required":true,"schema":{"type":"string","title":"Request Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Mark Partner Payout Paid Admin Setup Requests  Request Id  Partner Payout Paid Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/setup-partners":{"get":{"tags":["setup"],"summary":"List Setup Partners","operationId":"list_setup_partners_admin_setup_partners_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response List Setup Partners Admin Setup Partners Get"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/setup-partners/{affiliate_id}":{"patch":{"tags":["setup"],"summary":"Update Setup Partner","operationId":"update_setup_partner_admin_setup_partners__affiliate_id__patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"affiliate_id","in":"path","required":true,"schema":{"type":"string","title":"Affiliate Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CertificationBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Update Setup Partner Admin Setup Partners  Affiliate Id  Patch"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/setup-stats":{"get":{"tags":["setup"],"summary":"Setup Stats","operationId":"setup_stats_admin_setup_stats_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Setup Stats Admin Setup Stats Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/consent/cookies":{"post":{"tags":["consent"],"summary":"Record Cookie Consent","description":"Store one consent decision. Returns 204 and never a body.\n\nFailures are swallowed on purpose. The visitor's choice is already applied\nin their browser before this call is made, so a database hiccup must never\nsurface as an error on a marketing page, and must never be a reason to\nre-ask a question they have already answered.","operationId":"record_cookie_consent_consent_cookies_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CookieConsentIn"}}},"required":true},"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/support/ticket":{"post":{"tags":["support"],"summary":"Create Ticket","description":"Create a support ticket with optional screenshot upload.","operationId":"create_ticket_support_ticket_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_create_ticket_support_ticket_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/support/my-tickets":{"get":{"tags":["support"],"summary":"List My Tickets","description":"List all tickets submitted by the current user.","operationId":"list_my_tickets_support_my_tickets_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/TicketOut"},"type":"array","title":"Response List My Tickets Support My Tickets Get"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/support/admin/tickets":{"get":{"tags":["support"],"summary":"Admin List Tickets","description":"List all support tickets (admin only).","operationId":"admin_list_tickets_support_admin_tickets_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"category","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TicketOut"},"title":"Response Admin List Tickets Support Admin Tickets Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/support/admin/translate":{"post":{"tags":["support"],"summary":"Admin Translate","description":"Translate ticket content for the admin queue, both directions.\n\nA Polish customer writes in Polish and the admin reads in English; a reply\ntyped in English has to reach them in Polish (owner ask 2026-09-03). This\nonly converts text: the admin sees the result and decides what to send.","operationId":"admin_translate_support_admin_translate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TranslateIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/support/admin/tickets/stats":{"get":{"tags":["support"],"summary":"Admin Ticket Stats","description":"Get ticket stats for admin dashboard.","operationId":"admin_ticket_stats_support_admin_tickets_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/support/admin/tickets/{ticket_id}":{"patch":{"tags":["support"],"summary":"Admin Update Ticket","description":"Update ticket status or add admin response.\n\nResolving a ticket stamps resolved_at=now (moves it to the Resolved folder);\nreopening (any non-resolved status) clears resolved_at so it returns to Open.\nEvery status change is audit-logged (admin mutation).","operationId":"admin_update_ticket_support_admin_tickets__ticket_id__patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"ticket_id","in":"path","required":true,"schema":{"type":"string","title":"Ticket Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminTicketUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["support"],"summary":"Admin Delete Ticket","description":"Hard-delete a single support ticket (spam / test). Admin-only, audit-logged.","operationId":"admin_delete_ticket_support_admin_tickets__ticket_id__delete","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"ticket_id","in":"path","required":true,"schema":{"type":"string","title":"Ticket Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/support/admin/tickets/bulk-delete":{"post":{"tags":["support"],"summary":"Admin Bulk Delete Tickets","description":"Hard-delete multiple tickets in one call (clean out spam/test rows).\n\nAdmin-only, audit-logged. Returns the count actually removed.","operationId":"admin_bulk_delete_tickets_support_admin_tickets_bulk_delete_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkDeleteRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/support/admin/tickets/{ticket_id}/attachment":{"get":{"tags":["support"],"summary":"Admin Get Attachment","description":"Download ticket attachment — image or PDF (admin only).\n\nAuth via `?token=` query param, NOT the Bearer header: this URL is used\ndirectly in <img src> / window.open, which cannot set Authorization headers.\nWe resolve + admin-check the token manually. (Previously this used\nDepends(require_admin), so the querystring token was ignored → every\nscreenshot/PDF view 401'd. Real E2E bug.)","operationId":"admin_get_attachment_support_admin_tickets__ticket_id__attachment_get","parameters":[{"name":"ticket_id","in":"path","required":true,"schema":{"type":"string","title":"Ticket Id"}},{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/sales-demo/calculate":{"post":{"tags":["sales-demo"],"summary":"Calculate Roi","description":"Calculate ROI for a prospect. Does not persist, call /save to store.","operationId":"calculate_roi_admin_sales_demo_calculate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SalesDemoInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ROIResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/sales-demo/save":{"post":{"tags":["sales-demo"],"summary":"Save Lead","description":"Calculate ROI and save the offer to the DB, attributed to its creator.","operationId":"save_lead_admin_sales_demo_save_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SalesDemoInput"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SalesDemoLeadOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/sales-demo/leads/{lead_id}":{"patch":{"tags":["sales-demo"],"summary":"Update Lead","description":"Edit an offer's inputs — ROI is recomputed server-side so the stored\nsnapshot always matches the inputs. Send again afterwards via /send.","operationId":"update_lead_admin_sales_demo_leads__lead_id__patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","title":"Lead Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SalesDemoInput"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SalesDemoLeadOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["sales-demo"],"summary":"Get Lead","description":"Full offer record: inputs + computed ROI snapshot + creator.","operationId":"get_lead_admin_sales_demo_leads__lead_id__get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","title":"Lead Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SalesDemoLeadOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/sales-demo/send":{"post":{"tags":["sales-demo"],"summary":"Send To Client","description":"Send the ROI presentation to the client's email as branded HTML + PDF attachment.","operationId":"send_to_client_admin_sales_demo_send_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendDemoRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/sales-demo/pdf/{lead_id}":{"get":{"tags":["sales-demo"],"summary":"Download Pdf","description":"Download the ROI one-pager as PDF.","operationId":"download_pdf_admin_sales_demo_pdf__lead_id__get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","title":"Lead Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/sales-demo/leads":{"get":{"tags":["sales-demo"],"summary":"List Leads","description":"List all generated offers, newest first, with creator attribution.","operationId":"list_leads_admin_sales_demo_leads_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"enum":["draft","sent"],"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/SalesDemoLeadOut"},"title":"Response List Leads Admin Sales Demo Leads Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/sales/today":{"get":{"tags":["sales-desk"],"summary":"Today","operationId":"today_admin_sales_today_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"vertical","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vertical"}},{"name":"voivodeship","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voivodeship"}},{"name":"seat_user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Seat User Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":5,"default":20,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/sales/leads":{"get":{"tags":["sales-desk"],"summary":"List Leads","description":"One page of leads plus the total, so the desk can page through them.\n\nReturned as an object rather than a bare list since 2026-09-07: without a\ntotal there is no page count, and the desk could only \"show more\" until\nshe lost her place (owner report: 20 leads, no next page, and the list\nrearranged itself on the way back from a call).","operationId":"list_leads_admin_sales_leads_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q"}},{"name":"stage","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stage"}},{"name":"vertical","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vertical"}},{"name":"voivodeship","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voivodeship"}},{"name":"owner","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"mine | unassigned | all | a seat's user id","title":"Owner"},"description":"mine | unassigned | all | a seat's user id"},{"name":"visit_zone","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"region | visit_days | outside | none","title":"Visit Zone"},"description":"region | visit_days | outside | none"},{"name":"visit_area","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Visit Area"}},{"name":"segment","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"business | agency | expat","title":"Segment"},"description":"business | agency | expat"},{"name":"city","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/sales/leads/{lead_id}":{"get":{"tags":["sales-desk"],"summary":"Get Lead","operationId":"get_lead_admin_sales_leads__lead_id__get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","title":"Lead Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["sales-desk"],"summary":"Patch Lead","operationId":"patch_lead_admin_sales_leads__lead_id__patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","title":"Lead Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LeadPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/sales/leads/{lead_id}/outcome":{"post":{"tags":["sales-desk"],"summary":"Post Outcome","operationId":"post_outcome_admin_sales_leads__lead_id__outcome_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","title":"Lead Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OutcomeIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/sales/leads/{lead_id}/consent":{"post":{"tags":["sales-desk"],"summary":"Post Consent","operationId":"post_consent_admin_sales_leads__lead_id__consent_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","title":"Lead Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConsentIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/sales/leads/{lead_id}/send/{step}":{"post":{"tags":["sales-desk"],"summary":"Send Step","operationId":"send_step_admin_sales_leads__lead_id__send__step__post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","title":"Lead Id"}},{"name":"step","in":"path","required":true,"schema":{"type":"string","title":"Step"}}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/SendStepIn"},{"type":"null"}],"title":"Payload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/sales/leads/{lead_id}/preview/{step}":{"get":{"tags":["sales-desk"],"summary":"Preview Step","operationId":"preview_step_admin_sales_leads__lead_id__preview__step__get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","title":"Lead Id"}},{"name":"step","in":"path","required":true,"schema":{"type":"string","title":"Step"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/sales/leads/{lead_id}/offer.pdf":{"get":{"tags":["sales-desk"],"summary":"Offer Pdf","operationId":"offer_pdf_admin_sales_leads__lead_id__offer_pdf_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","title":"Lead Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/sales/messages":{"get":{"tags":["sales-desk"],"summary":"List Messages","operationId":"list_messages_admin_sales_messages_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/sales/messages/{message_id}":{"get":{"tags":["sales-desk"],"summary":"Get Message","operationId":"get_message_admin_sales_messages__message_id__get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","title":"Message Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/sales/messages/{message_id}/send":{"post":{"tags":["sales-desk"],"summary":"Send Previewed Message","operationId":"send_previewed_message_admin_sales_messages__message_id__send_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"message_id","in":"path","required":true,"schema":{"type":"string","title":"Message Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/sales/objections":{"get":{"tags":["sales-desk"],"summary":"Objections","operationId":"objections_admin_sales_objections_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/sales/leads/{lead_id}/ask":{"post":{"tags":["sales-desk"],"summary":"Ask","operationId":"ask_admin_sales_leads__lead_id__ask_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","title":"Lead Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AskIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/sales/leads/{lead_id}/classify":{"post":{"tags":["sales-desk"],"summary":"Classify","operationId":"classify_admin_sales_leads__lead_id__classify_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","title":"Lead Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClassifyIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/sales/leads/{lead_id}/replied":{"post":{"tags":["sales-desk"],"summary":"Replied","operationId":"replied_admin_sales_leads__lead_id__replied_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","title":"Lead Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/sales/review":{"get":{"tags":["sales-desk"],"summary":"Latest Review","operationId":"latest_review_admin_sales_review_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/sales/demos":{"get":{"tags":["sales-desk"],"summary":"List Demos","operationId":"list_demos_admin_sales_demos_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"upcoming","in":"query","required":false,"schema":{"type":"boolean","default":true,"title":"Upcoming"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":200,"minimum":1,"default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/sales/leads/{lead_id}/demos":{"post":{"tags":["sales-desk"],"summary":"Create Demo","operationId":"create_demo_admin_sales_leads__lead_id__demos_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"lead_id","in":"path","required":true,"schema":{"type":"string","title":"Lead Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemoIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/sales/demos/{demo_id}":{"patch":{"tags":["sales-desk"],"summary":"Patch Demo","operationId":"patch_demo_admin_sales_demos__demo_id__patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"demo_id","in":"path","required":true,"schema":{"type":"string","title":"Demo Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemoPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/sales/funnel":{"get":{"tags":["sales-desk"],"summary":"Funnel","operationId":"funnel_admin_sales_funnel_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Days"}},{"name":"vertical","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vertical"}},{"name":"voivodeship","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voivodeship"}},{"name":"seat_user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Seat User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/sales/handbook/{lang}":{"get":{"tags":["sales-desk"],"summary":"Sales Handbook","description":"The Sales Desk handbook PDF (PL or EN), built from marketing-assets/sales-desk-handbook (TASKS 58.8).","operationId":"sales_handbook_admin_sales_handbook__lang__get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"lang","in":"path","required":true,"schema":{"type":"string","title":"Lang"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/sales/sms/test":{"post":{"tags":["sales-desk"],"summary":"Sales Sms Test","description":"Send one SMS from the configured Sales Desk sender to prove the number works (admin only).\nNot a marketing message: it goes to the admin's own phone, so no consent row is needed.","operationId":"sales_sms_test_admin_sales_sms_test_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmsTestBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/sales/sheet/status":{"get":{"tags":["sales-desk"],"summary":"Sheet Status","operationId":"sheet_status_admin_sales_sheet_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/sales/sheet/import":{"post":{"tags":["sales-desk"],"summary":"Sheet Import","operationId":"sheet_import_admin_sales_sheet_import_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/sales/team":{"get":{"tags":["sales-desk"],"summary":"Team","operationId":"team_admin_sales_team_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/sales/team/invite":{"post":{"tags":["sales-desk"],"summary":"Invite Member","description":"Create a `sales` user (Sales Desk only, no tenant) with a 7-day set-password\ncode, a seat with defaults, and the invitation email.","operationId":"invite_member_admin_sales_team_invite_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/sales/team/{seat_id}":{"patch":{"tags":["sales-desk"],"summary":"Patch Seat","operationId":"patch_seat_admin_sales_team__seat_id__patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"seat_id","in":"path","required":true,"schema":{"type":"string","title":"Seat Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SeatPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/sales/team/{seat_id}/assign":{"post":{"tags":["sales-desk"],"summary":"Assign To Seat","operationId":"assign_to_seat_admin_sales_team__seat_id__assign_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"seat_id","in":"path","required":true,"schema":{"type":"string","title":"Seat Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AssignIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/sales/team/me":{"post":{"tags":["sales-desk"],"summary":"Ensure My Seat","description":"An admin who calls gets a seat on first use (Martyna is admin today).","operationId":"ensure_my_seat_admin_sales_team_me_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/sales/areas":{"get":{"tags":["sales-desk"],"summary":"Lead Areas","description":"Counts per visit zone and area, per segment, and per owner, so leads can be arranged before assigning.","operationId":"lead_areas_admin_sales_areas_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/sales/leads/bulk":{"post":{"tags":["sales-desk"],"summary":"Bulk Leads","description":"Assign, return to the pool, or tag many leads at once. dry_run (the default) only counts.","operationId":"bulk_leads_admin_sales_leads_bulk_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkLeadsIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/sales/leads/recompute-places":{"post":{"tags":["sales-desk"],"summary":"Recompute Places","description":"Fill visit zone and area for every lead from its address postcode or town (after the town list changes).","operationId":"recompute_places_admin_sales_leads_recompute_places_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/public/sales/m/{code}":{"get":{"tags":["sales-desk-public"],"summary":"Personal Page","operationId":"personal_page_public_sales_m__code__get","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","title":"Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/public/sales/partner-prefill/{code}":{"get":{"tags":["sales-desk-public"],"summary":"Partner Prefill","description":"What the personal join link fills in on /partnerzy: the agency's name and\npublic e-mail, nothing else, and only for agency leads.","operationId":"partner_prefill_public_sales_partner_prefill__code__get","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","title":"Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/public/sales/demo/{token}":{"get":{"tags":["sales-desk-public"],"summary":"Public Demo","operationId":"public_demo_public_sales_demo__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/public/sales/demo/{token}/reschedule":{"post":{"tags":["sales-desk-public"],"summary":"Public Reschedule","operationId":"public_reschedule_public_sales_demo__token__reschedule_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicDemoAction"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/public/sales/demo/{token}/cancel":{"post":{"tags":["sales-desk-public"],"summary":"Public Cancel","operationId":"public_cancel_public_sales_demo__token__cancel_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/public/sales/unsubscribe/{token}":{"post":{"tags":["sales-desk-public"],"summary":"Public Unsubscribe","operationId":"public_unsubscribe_public_sales_unsubscribe__token__post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/webhooks/sheets/lead-edit":{"post":{"tags":["sales-desk-webhooks"],"summary":"Sheet Lead Edit","operationId":"sheet_lead_edit_webhooks_sheets_lead_edit_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/internal/sales/next-leads":{"get":{"tags":["sales-desk-internal"],"summary":"Internal Next Leads","operationId":"internal_next_leads_internal_sales_next_leads_get","parameters":[{"name":"vertical","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vertical"}},{"name":"voivodeship","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voivodeship"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":10,"title":"Limit"}},{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/sales/lead":{"get":{"tags":["sales-desk-internal"],"summary":"Internal Get Lead","operationId":"internal_get_lead_internal_sales_lead_get","parameters":[{"name":"lead_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lead Id"}},{"name":"phone","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"}},{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/sales/log-call":{"post":{"tags":["sales-desk-internal"],"summary":"Internal Log Call","operationId":"internal_log_call_internal_sales_log_call_post","parameters":[{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InternalOutcomeIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/sales/send-followup":{"post":{"tags":["sales-desk-internal"],"summary":"Internal Send Followup","operationId":"internal_send_followup_internal_sales_send_followup_post","parameters":[{"name":"lead_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lead Id"}},{"name":"phone","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"}},{"name":"step","in":"query","required":false,"schema":{"type":"string","default":"d0","title":"Step"}},{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/sales/book-demo":{"post":{"tags":["sales-desk-internal"],"summary":"Internal Book Demo","operationId":"internal_book_demo_internal_sales_book_demo_post","parameters":[{"name":"lead_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lead Id"}},{"name":"phone","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"}},{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemoIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/sales/funnel":{"get":{"tags":["sales-desk-internal"],"summary":"Internal Funnel","operationId":"internal_funnel_internal_sales_funnel_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Days"}},{"name":"vertical","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vertical"}},{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/public/appointment-requests/{token}":{"get":{"tags":["booking-requests"],"summary":"Get Request","operationId":"get_request_public_appointment_requests__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/public/appointment-requests/{token}/confirm":{"post":{"tags":["booking-requests"],"summary":"Confirm","operationId":"confirm_public_appointment_requests__token__confirm_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/public/appointment-requests/{token}/decline":{"post":{"tags":["booking-requests"],"summary":"Decline","operationId":"decline_public_appointment_requests__token__decline_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeclineIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/public/surveys/{token}":{"get":{"tags":["surveys"],"summary":"Survey Info","operationId":"survey_info_public_surveys__token__get","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["surveys"],"summary":"Survey Submit","operationId":"survey_submit_public_surveys__token__post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SurveyAnswers"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/public/surveys":{"get":{"tags":["surveys"],"summary":"Testimonials","description":"Published quotes for the site; consent and admin approval both required.","operationId":"testimonials_public_surveys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/surveys":{"get":{"tags":["surveys-admin"],"summary":"Admin List","operationId":"admin_list_admin_surveys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/surveys/{survey_id}":{"patch":{"tags":["surveys-admin"],"summary":"Admin Publish","operationId":"admin_publish_admin_surveys__survey_id__patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"survey_id","in":"path","required":true,"schema":{"type":"string","title":"Survey Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishBody"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/surveys/send/{tenant_id}":{"post":{"tags":["surveys-admin"],"summary":"Admin Send","operationId":"admin_send_admin_surveys_send__tenant_id__post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","default":"month_one","title":"Kind"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/demo/follow-up-email":{"post":{"tags":["internal-demo"],"summary":"Send Demo Followup Email","description":"Send a branded follow-up email to a demo caller who expressed interest.","operationId":"send_demo_followup_email_internal_demo_follow_up_email_post","parameters":[{"name":"x-internal-key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemoFollowUpRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Send Demo Followup Email Internal Demo Follow Up Email Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/demo/founding-status":{"get":{"tags":["internal-demo"],"summary":"Demo Founding Status","description":"Always inactive: the Founding month ended 2026-09-14.\n\nKept only so a voice revision still asking during a rollout gets a clean\n\"no\" (it then texts the plain 14-day test). Remove after the next voice release.","operationId":"demo_founding_status_internal_demo_founding_status_get","parameters":[{"name":"x-internal-key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Demo Founding Status Internal Demo Founding Status Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tenants/{tenant_id}/calendar/integrations":{"get":{"tags":["calendar"],"summary":"List Calendar Integrations","description":"List all calendar integrations for a tenant.","operationId":"list_calendar_integrations_api_v1_tenants__tenant_id__calendar_integrations_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CalendarIntegrationResponse"},"title":"Response List Calendar Integrations Api V1 Tenants  Tenant Id  Calendar Integrations Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tenants/{tenant_id}/calendar/connect/{provider}":{"get":{"tags":["calendar"],"summary":"Start Calendar Oauth","description":"Generate an OAuth authorization URL and store state in Redis.","operationId":"start_calendar_oauth_api_v1_tenants__tenant_id__calendar_connect__provider__get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthUrlResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/calendar/callback/{provider}":{"get":{"tags":["calendar"],"summary":"Calendar Oauth Callback","description":"Handle the OAuth redirect.  Exchanges code, stores tokens, redirects to dashboard.","operationId":"calendar_oauth_callback_api_v1_calendar_callback__provider__get","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}},{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},{"name":"error_description","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Description"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tenants/{tenant_id}/calendar/connect/apple":{"post":{"tags":["calendar"],"summary":"Connect Apple Calendar","description":"Connect an Apple iCloud calendar via app-specific password (CalDAV).","operationId":"connect_apple_calendar_api_v1_tenants__tenant_id__calendar_connect_apple_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppleConnectRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppleConnectResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tenants/{tenant_id}/calendar/{provider}/calendars":{"get":{"tags":["calendar"],"summary":"Get Available Calendars","description":"Fetch the user's current calendar list from the provider using stored tokens.","operationId":"get_available_calendars_api_v1_tenants__tenant_id__calendar__provider__calendars_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CalendarEntry"},"title":"Response Get Available Calendars Api V1 Tenants  Tenant Id  Calendar  Provider  Calendars Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tenants/{tenant_id}/calendar/{provider}/selected":{"patch":{"tags":["calendar"],"summary":"Update Selected Calendars","description":"Update which calendars to sync for a provider integration.","operationId":"update_selected_calendars_api_v1_tenants__tenant_id__calendar__provider__selected_patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SelectedCalendarsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tenants/{tenant_id}/calendar/{provider}/disconnect-preview":{"get":{"tags":["calendar"],"summary":"Disconnect Calendar Preview","description":"What disconnecting would cost, counted before anyone clicks it.\n\nA confirmation that says \"events will be removed\" is a guess the owner has\nto trust. This one says forty five, and how many of those are still ahead,\nbecause a calendar that is actively syncing is exactly the one where the\ndamage is invisible until a caller is refused a free slot.","operationId":"disconnect_calendar_preview_api_v1_tenants__tenant_id__calendar__provider__disconnect_preview_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tenants/{tenant_id}/calendar/{provider}":{"delete":{"tags":["calendar"],"summary":"Disconnect Calendar","description":"Disconnect: clear tokens, mark the integration dead, and drop its mirror.\n\nOwner report 2026-09-08: after disconnecting Google the events were still\non the week view. They were, and the visible clutter was the smaller half\nof it. Every event we imported lives in `appointments` as a mirror row, and\na mirror nobody syncs is worse than no mirror at all: those rows still fill\nthe calendar and still occupy the time, but no sync will ever correct them\nagain, so a meeting that moves or is cancelled in the external calendar\nkeeps its slot in ZvonAI for good, and the assistant refuses a caller a\ntime that is actually free.\n\nSo everything we imported goes. What WE booked stays, because the AI or the\nowner created it here and it is ours either way, but it loses the link to a\ncalendar we no longer read, so a later reconnect cannot try to update an\nevent by an id that may no longer mean anything.","operationId":"disconnect_calendar_api_v1_tenants__tenant_id__calendar__provider__delete","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tenants/{tenant_id}/calendar/google/watch":{"post":{"tags":["calendar"],"summary":"Register Google Webhook","description":"Register a Google Calendar push notification channel (expires in 7 days).","operationId":"register_google_webhook_api_v1_tenants__tenant_id__calendar_google_watch_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/tenants/{tenant_id}/calendar/outlook/subscribe":{"post":{"tags":["calendar"],"summary":"Register Outlook Subscription","description":"Create a Microsoft Graph change notification subscription (expires in 3 days).","operationId":"register_outlook_subscription_api_v1_tenants__tenant_id__calendar_outlook_subscribe_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/blocked-times":{"get":{"tags":["blocked-times"],"summary":"List Blocked Times","description":"List blocked time windows for a tenant, optionally filtered by date range.","operationId":"list_blocked_times_tenants__tenant_id__blocked_times_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"from_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"YYYY-MM-DD. Start of range (inclusive)","title":"From Date"},"description":"YYYY-MM-DD. Start of range (inclusive)"},{"name":"to_date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"YYYY-MM-DD. End of range (inclusive, end of day)","title":"To Date"},"description":"YYYY-MM-DD. End of range (inclusive, end of day)"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BlockedTimeResponse"},"title":"Response List Blocked Times Tenants  Tenant Id  Blocked Times Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["blocked-times"],"summary":"Create Blocked Time","description":"Create a blocked time window (one-off or recurring).","operationId":"create_blocked_time_tenants__tenant_id__blocked_times_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlockedTimeCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BlockedTimeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/blocked-times/{blocked_time_id}":{"delete":{"tags":["blocked-times"],"summary":"Delete Blocked Time","description":"Delete a blocked time window.","operationId":"delete_blocked_time_tenants__tenant_id__blocked_times__blocked_time_id__delete","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"blocked_time_id","in":"path","required":true,"schema":{"type":"string","title":"Blocked Time Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/missed-questions":{"get":{"tags":["missed-questions"],"summary":"List Missed Questions","description":"List missed questions for current user's tenant, sorted by occurrence_count desc.","operationId":"list_missed_questions_missed_questions_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"resolved","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Resolved"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/MissedQuestionOut"},"title":"Response List Missed Questions Missed Questions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["missed-questions"],"summary":"Create Missed Question","description":"Record a missed question (called by voice engine via internal API key).","operationId":"create_missed_question_missed_questions_post","parameters":[{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MissedQuestionCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MissedQuestionOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/missed-questions/preview":{"get":{"tags":["missed-questions"],"summary":"Preview Missed Questions","description":"The owner's own unanswered questions, on every plan.\n\nSolo used to see an upgrade wall with nothing in it, so the one thing that would\nmake the page worth opening (their callers' actual questions) was the thing behind\nthe wall. The list is short here; the full history and the grouping stay on Pro.","operationId":"preview_missed_questions_missed_questions_preview_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/missed-questions/{question_id}/resolve":{"patch":{"tags":["missed-questions"],"summary":"Resolve Missed Question","description":"Mark a missed question as resolved.","operationId":"resolve_missed_question_missed_questions__question_id__resolve_patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"question_id","in":"path","required":true,"schema":{"type":"string","title":"Question Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/missed-questions/{question_id}/apply-as-faq":{"post":{"tags":["missed-questions"],"summary":"Apply Missed Question As Faq","description":"Close the loop: add this missed question + the owner's answer to the tenant\nFAQ, AND mark the question resolved — atomically. After this, the voice agent\nanswers it from FAQ on the next call (no more \"I don't have that information\").\n\nAlso resolves any OTHER open missed questions with the same question_text so the\nlist stays clean.","operationId":"apply_missed_question_as_faq_missed_questions__question_id__apply_as_faq_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"question_id","in":"path","required":true,"schema":{"type":"string","title":"Question Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplyAsFaqRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/missed-questions/stats":{"get":{"tags":["missed-questions"],"summary":"Get Missed Questions Stats","description":"Summary stats: total unresolved, top 5 by frequency, this week count.","operationId":"get_missed_questions_stats_missed_questions_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MissedQuestionsStats"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/missed-questions/suggestions":{"get":{"tags":["missed-questions"],"summary":"Get Faq Suggestions","description":"Generate FAQ answer suggestions for the most frequent unresolved missed questions.","operationId":"get_faq_suggestions_missed_questions_suggestions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/FaqSuggestion"},"type":"array","title":"Response Get Faq Suggestions Missed Questions Suggestions Get"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/guidance":{"get":{"tags":["guidance"],"summary":"List Rules","operationId":"list_rules_guidance_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/GuidanceRuleOut"},"type":"array","title":"Response List Rules Guidance Get"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]},"post":{"tags":["guidance"],"summary":"Create Rule","operationId":"create_rule_guidance_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GuidanceRuleCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GuidanceRuleOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/guidance/{rule_id}":{"patch":{"tags":["guidance"],"summary":"Update Rule","operationId":"update_rule_guidance__rule_id__patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GuidanceRuleUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GuidanceRuleOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["guidance"],"summary":"Delete Rule","operationId":"delete_rule_guidance__rule_id__delete","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","title":"Rule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/scrape-faq":{"post":{"tags":["faq-scraper"],"summary":"Scrape Faq","description":"Scrape tenant's website and extract FAQ pairs for voice script seeding.","operationId":"scrape_faq_tenants__tenant_id__scrape_faq_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScrapeFAQRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScrapeFAQResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/voicemail-notification":{"post":{"tags":["voicemail"],"summary":"Voicemail Notification","description":"Record voicemail metadata and email the tenant.","operationId":"voicemail_notification_voicemail_notification_post","parameters":[{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoicemailNotification"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notifications":{"get":{"tags":["notifications"],"summary":"List Notifications","description":"List notifications visible to the current user, newest first.\n\nA user sees notifications for their own tenant. Admins ALSO see\nplatform-level notifications (is_admin=True, e.g. new support tickets),\neven if they have no tenant of their own.\n\nPass attention_only=true to return only notifications that need the owner\nto act — a caller left a message, asked for a callback, or a case was\nassigned (see _ATTENTION_TYPES). Default (absent/false) is unchanged.","operationId":"list_notifications_api_v1_notifications_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"skip","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Skip"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":20,"title":"Limit"}},{"name":"unread_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Unread Only"}},{"name":"attention_only","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Attention Only"}},{"name":"lang","in":"query","required":false,"schema":{"type":"string","default":"pl","title":"Lang"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notifications/{notification_id}/read":{"patch":{"tags":["notifications"],"summary":"Mark Notification Read","description":"Mark a single notification as read.","operationId":"mark_notification_read_api_v1_notifications__notification_id__read_patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"notification_id","in":"path","required":true,"schema":{"type":"string","title":"Notification Id"}},{"name":"lang","in":"query","required":false,"schema":{"type":"string","default":"pl","title":"Lang"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notifications/mark-all-read":{"post":{"tags":["notifications"],"summary":"Mark All Read","description":"Mark all visible notifications as read.","operationId":"mark_all_read_api_v1_notifications_mark_all_read_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/api/v1/notifications/{notification_id}":{"delete":{"tags":["notifications"],"summary":"Delete Notification","description":"Delete a single notification.","operationId":"delete_notification_api_v1_notifications__notification_id__delete","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"notification_id","in":"path","required":true,"schema":{"type":"string","title":"Notification Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/notifications/unsubscribe":{"get":{"tags":["notifications"],"summary":"Unsubscribe Email","description":"Public, HMAC-verified one-click unsubscribe from a transactional/digest email.","operationId":"unsubscribe_email_api_v1_notifications_unsubscribe_get","parameters":[{"name":"type","in":"query","required":true,"schema":{"type":"string","title":"Type"}},{"name":"tid","in":"query","required":true,"schema":{"type":"string","title":"Tid"}},{"name":"sig","in":"query","required":true,"schema":{"type":"string","title":"Sig"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/script-templates":{"get":{"tags":["script-templates"],"summary":"List Templates","operationId":"list_templates_script_templates_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ScriptTemplateOut"},"type":"array","title":"Response List Templates Script Templates Get"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]},"post":{"tags":["script-templates"],"summary":"Create Template","description":"Save current greeting+FAQ as a named template.","operationId":"create_template_script_templates_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScriptTemplateCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScriptTemplateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/script-templates/{template_id}/apply":{"post":{"tags":["script-templates"],"summary":"Apply Template","description":"Apply a saved template to the tenant's active configuration.","operationId":"apply_template_script_templates__template_id__apply_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Apply Template Script Templates  Template Id  Apply Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/script-templates/{template_id}":{"delete":{"tags":["script-templates"],"summary":"Delete Template","operationId":"delete_template_script_templates__template_id__delete","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"template_id","in":"path","required":true,"schema":{"type":"string","title":"Template Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/coupons":{"get":{"tags":["admin"],"summary":"List Coupons","description":"List all internal test coupons from Stripe.","operationId":"list_coupons_admin_coupons_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponListResponse"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]},"post":{"tags":["admin"],"summary":"Create Coupon","description":"Create a 100% off Stripe coupon + promo code for internal testing.","operationId":"create_coupon_admin_coupons_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCouponRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CouponResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/coupons/{coupon_id}":{"delete":{"tags":["admin"],"summary":"Revoke Coupon","description":"Permanently delete a coupon and deactivate all its promo codes.","operationId":"revoke_coupon_admin_coupons__coupon_id__delete","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"coupon_id","in":"path","required":true,"schema":{"type":"string","title":"Coupon Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/coupons/{coupon_id}/deactivate":{"patch":{"tags":["admin"],"summary":"Deactivate Coupon","description":"Deactivate promo codes without deleting the coupon (keeps audit record).","operationId":"deactivate_coupon_admin_coupons__coupon_id__deactivate_patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"coupon_id","in":"path","required":true,"schema":{"type":"string","title":"Coupon Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/coupons/{coupon_id}/redemptions":{"get":{"tags":["admin"],"summary":"Get Coupon Redemptions","description":"List customers who redeemed a specific coupon.","operationId":"get_coupon_redemptions_admin_coupons__coupon_id__redemptions_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"coupon_id","in":"path","required":true,"schema":{"type":"string","title":"Coupon Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RedemptionsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/follow-ups":{"get":{"tags":["follow-ups"],"summary":"List Follow Ups","description":"List the tenant's cases. `assigned_to` filters by owner:\n  \"me\"         → cases assigned to the caller (a staffer's own queue)\n  \"unassigned\" → cases nobody owns yet (the shared pool)\n  \"<user_id>\"  → a specific member's cases (manager/owner monitoring)\nOmitted → the whole team's cases (roster view).","operationId":"list_follow_ups_follow_ups_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"assigned_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned To"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/FollowUpOut"},"title":"Response List Follow Ups Follow Ups Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["follow-ups"],"summary":"Create Follow Up","operationId":"create_follow_up_follow_ups_post","parameters":[{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowUpCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowUpOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/follow-ups/{follow_up_id}":{"patch":{"tags":["follow-ups"],"summary":"Update Follow Up","operationId":"update_follow_up_follow_ups__follow_up_id__patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"follow_up_id","in":"path","required":true,"schema":{"type":"string","title":"Follow Up Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowUpUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowUpOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/follow-ups/stats":{"get":{"tags":["follow-ups"],"summary":"Get Follow Up Stats","operationId":"get_follow_up_stats_follow_ups_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FollowUpStats"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/tenants/{tenant_id}/dispatch-jobs":{"post":{"tags":["dispatch"],"summary":"Create Dispatch Job","description":"Voice engine → job. Returns the quote the caller hears (ETA window,\nsurcharge, price-from) and the on-duty contact, if any.","operationId":"create_dispatch_job_tenants__tenant_id__dispatch_jobs_post","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DispatchJobCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DispatchJobCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["dispatch"],"summary":"List Dispatch Jobs","operationId":"list_dispatch_jobs_tenants__tenant_id__dispatch_jobs_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/DispatchJobOut"},"title":"Response List Dispatch Jobs Tenants  Tenant Id  Dispatch Jobs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/dispatch-jobs/{job_id}":{"patch":{"tags":["dispatch"],"summary":"Update Dispatch Job","description":"Board transitions: new → accepted → en_route → done, or cancelled/unreachable.","operationId":"update_dispatch_job_tenants__tenant_id__dispatch_jobs__job_id__patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"job_id","in":"path","required":true,"schema":{"type":"string","title":"Job Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DispatchJobUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DispatchJobOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/orders":{"get":{"tags":["orders"],"summary":"List Orders","description":"The board and its search. `q` matches an order code, a phone number, a\ncaller name or the goods; `month` is YYYY-MM, or YYYY for a whole year.","operationId":"list_orders_tenants__tenant_id__orders_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Q"}},{"name":"month","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Month"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":100,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OrderOut"},"title":"Response List Orders Tenants  Tenant Id  Orders Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/orders/counts":{"get":{"tags":["orders"],"summary":"Counts","operationId":"counts_tenants__tenant_id__orders_counts_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/orders/{order_id}":{"patch":{"tags":["orders"],"summary":"Patch Order","description":"The board: mark it contacted, sent, delivered or cancelled.","operationId":"patch_order_tenants__tenant_id__orders__order_id__patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderPatch"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/orders/{order_id}/deposit":{"post":{"tags":["orders"],"summary":"Request Deposit","description":"Ask the caller for a zadatek by SMS link. Owner or manager: it is money.\n\nThe amount is the owner's, typed after they confirmed the price: the\nassistant never quotes one. Requires the tenant's Stripe Connect account to\nbe ready and a phone number to send the link to.","operationId":"request_deposit_tenants__tenant_id__orders__order_id__deposit_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}},{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderDepositIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/orders/{order_id}/events":{"get":{"tags":["orders"],"summary":"List Events","description":"The order's history, oldest first. Every team member sees it (59.4).","operationId":"list_events_tenants__tenant_id__orders__order_id__events_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}},{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OrderEventOut"},"title":"Response List Events Tenants  Tenant Id  Orders  Order Id  Events Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/orders/{order_id}/comments":{"post":{"tags":["orders"],"summary":"Add Comment","description":"Staff, managers and owners comment; comments never change the status (59.4).","operationId":"add_comment_tenants__tenant_id__orders__order_id__comments_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}},{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommentIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderEventOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/orders/export.csv":{"get":{"tags":["orders"],"summary":"Export Csv","description":"The month's orders as a CSV the owner can open in Excel (59.11): UTF-8\nwith BOM, semicolon-separated (Polish Excel), Polish headers.","operationId":"export_csv_tenants__tenant_id__orders_export_csv_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"month","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Month"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/orders":{"post":{"tags":["orders-internal"],"summary":"Create Internal","description":"Filed by the assistant during a call. Also sends the caller the code and\nwhere to finish the order, and tells the business at once.","operationId":"create_internal_internal_orders_post","parameters":[{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/orders/lookup":{"get":{"tags":["orders-internal"],"summary":"Lookup Internal","description":"\"I'm calling about my order\" — by code, or by the number they ring from.","operationId":"lookup_internal_internal_orders_lookup_get","parameters":[{"name":"tenant_id","in":"query","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},{"name":"caller_number","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caller Number"}},{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/internal/orders/attention":{"post":{"tags":["orders-internal"],"summary":"Attention Internal","description":"The caller rang back about an existing order. Recorded and flagged for the\nbusiness; the assistant is told what it may truthfully say.","operationId":"attention_internal_internal_orders_attention_post","parameters":[{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttentionIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/resources":{"get":{"tags":["resources"],"summary":"List Resources","operationId":"list_resources_tenants__tenant_id__resources_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ResourceOut"},"title":"Response List Resources Tenants  Tenant Id  Resources Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["resources"],"summary":"Create Resource","operationId":"create_resource_tenants__tenant_id__resources_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/resources/{resource_id}":{"patch":{"tags":["resources"],"summary":"Update Resource","operationId":"update_resource_tenants__tenant_id__resources__resource_id__patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","title":"Resource Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["resources"],"summary":"Delete Resource","operationId":"delete_resource_tenants__tenant_id__resources__resource_id__delete","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","title":"Resource Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/resources/{resource_id}/sync":{"post":{"tags":["resources"],"summary":"Sync Resource Now","operationId":"sync_resource_now_tenants__tenant_id__resources__resource_id__sync_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","title":"Resource Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResourceOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/resources/stays/availability":{"post":{"tags":["resources"],"summary":"Stay Availability","description":"Voice engine: free rooms for the stay, with total price from the room type's per-night price.","operationId":"stay_availability_tenants__tenant_id__resources_stays_availability_post","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StayAvailabilityQuery"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/StayOption"},"title":"Response Stay Availability Tenants  Tenant Id  Resources Stays Availability Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/resources/tables/availability":{"post":{"tags":["resources"],"summary":"Table Availability Internal","description":"Voice engine: when a party of this size gets a table on that day, and the\nnearest alternatives to the time the caller asked for.","operationId":"table_availability_internal_tenants__tenant_id__resources_tables_availability_post","parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"X-Internal-Key","in":"header","required":true,"schema":{"type":"string","title":"X-Internal-Key"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TableAvailabilityQuery"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TableAvailability"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["resources"],"summary":"Table Availability","description":"Dashboard and agents: the same table availability the assistant sees.","operationId":"table_availability_tenants__tenant_id__resources_tables_availability_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"date","in":"query","required":true,"schema":{"type":"string","format":"date","title":"Date"}},{"name":"party_size","in":"query","required":false,"schema":{"type":"integer","maximum":50,"minimum":1,"default":2,"title":"Party Size"}},{"name":"time","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":5},{"type":"null"}],"title":"Time"}},{"name":"zone","in":"query","required":false,"schema":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}],"title":"Zone"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TableAvailability"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/resources/{resource_id}/absences":{"post":{"tags":["resources"],"summary":"Add Absence","description":"Time off for one person: the rest of the team stays bookable.\n\nAn owner or manager writes it and it stands. An employee asks for their own, and it\nwaits for a yes unless this business approves automatically (migration 222).","operationId":"add_absence_tenants__tenant_id__resources__resource_id__absences_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","title":"Resource Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AbsenceIn"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["resources"],"summary":"List Absences","operationId":"list_absences_tenants__tenant_id__resources__resource_id__absences_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","title":"Resource Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/resources/time-off/requests":{"get":{"tags":["resources"],"summary":"List Time Off Requests","description":"What is waiting for an answer: everything for an approver, their own for an employee.","operationId":"list_time_off_requests_tenants__tenant_id__resources_time_off_requests_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/resources/time-off/{absence_id}/decision":{"post":{"tags":["resources"],"summary":"Decide Time Off","description":"Approve or decline one request. The second tab to answer is told it was decided.","operationId":"decide_time_off_tenants__tenant_id__resources_time_off__absence_id__decision_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"absence_id","in":"path","required":true,"schema":{"type":"string","title":"Absence Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DecisionIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/resources/{resource_id}/absences/preview":{"post":{"tags":["resources"],"summary":"Preview Absence","description":"What this holiday would hit, and who could take each visit instead.\n\nRead-only. Adding an absence hides the person from future picks but leaves\nthe visits already booked with them in place, which the owner used to find\nout about when the customer arrived. Nothing is moved here: the plan is\nshown, and the owner decides.","operationId":"preview_absence_tenants__tenant_id__resources__resource_id__absences_preview_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","title":"Resource Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AbsencePreviewIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/resources/{resource_id}/absences/apply-moves":{"post":{"tags":["resources"],"summary":"Apply Absence Moves","description":"Reassign the visits the owner chose to move. Never called by itself.\n\nEach move is checked again at the moment of writing: the plan may be a few\nminutes old and the colleague may have been booked in the meantime.","operationId":"apply_absence_moves_tenants__tenant_id__resources__resource_id__absences_apply_moves_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","title":"Resource Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AbsenceMoveIn"},"title":"Moves"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/resources/absences":{"get":{"tags":["resources"],"summary":"List Team Absences","description":"Every team absence touching these Warsaw days (last day included), for the calendar.","operationId":"list_team_absences_tenants__tenant_id__resources_absences_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"date_from","in":"query","required":true,"schema":{"type":"string","format":"date","title":"Date From"}},{"name":"date_to","in":"query","required":true,"schema":{"type":"string","format":"date","title":"Date To"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/resources/{resource_id}/absences/{absence_id}":{"delete":{"tags":["resources"],"summary":"Delete Absence","operationId":"delete_absence_tenants__tenant_id__resources__resource_id__absences__absence_id__delete","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","title":"Resource Id"}},{"name":"absence_id","in":"path","required":true,"schema":{"type":"string","title":"Absence Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/resources/languages/summary":{"get":{"tags":["resources"],"summary":"Languages Summary","description":"Who serves in which language, whether matching is on, and what can be ticked.","operationId":"languages_summary_tenants__tenant_id__resources_languages_summary_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/resources/languages/mine":{"patch":{"tags":["resources"],"summary":"Set My Languages","description":"A team member says which languages they serve clients in. Their own only.","operationId":"set_my_languages_tenants__tenant_id__resources_languages_mine_patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LanguagesIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LanguagesOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/resources/{resource_id}/languages":{"patch":{"tags":["resources"],"summary":"Set Person Languages","description":"Owner or manager sets them for anyone on the team.","operationId":"set_person_languages_tenants__tenant_id__resources__resource_id__languages_patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"resource_id","in":"path","required":true,"schema":{"type":"string","title":"Resource Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LanguagesIn"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LanguagesOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/team":{"get":{"tags":["team"],"summary":"List Team","description":"List everyone in the tenant. Any member can SEE the roster (they work\ntogether); only owner/manager can change it.","operationId":"list_team_team_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamListResponse"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/team/invite":{"post":{"tags":["team"],"summary":"Invite Member","description":"Invite a member by email. Manager+ only. A Manager cannot mint another\nManager (only the Owner can) — prevents privilege inflation.","operationId":"invite_member_team_invite_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InviteRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamMemberOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/team/{user_id}/resend":{"post":{"tags":["team"],"summary":"Resend Invite","operationId":"resend_invite_team__user_id__resend_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamMemberOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/team/access":{"get":{"tags":["team"],"summary":"Get Section Access","description":"What each role may do in this business, and what the owner may move.","operationId":"get_section_access_team_access_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]},"patch":{"tags":["team"],"summary":"Set Section Access","description":"Owner only: move a section to another role, or choose what an employee's calendar shows.","operationId":"set_section_access_team_access_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SectionAccessIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/team/{user_id}/invite":{"delete":{"tags":["team"],"summary":"Revoke Invite","description":"Revoke a PENDING invite. If the user row was created solely for the\ninvite (never accepted, no password), delete it; otherwise just detach.","operationId":"revoke_invite_team__user_id__invite_delete","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/team/accept":{"post":{"tags":["team"],"summary":"Accept Invite","description":"Accept an invite: verify token, set password if new, activate.\n\nNo auth required — the invite token IS the credential. Returns a hint so\nthe dashboard knows whether to send the user to login (existing account)\nor straight in.","operationId":"accept_invite_team_accept_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AcceptRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/team/{user_id}/role":{"patch":{"tags":["team"],"summary":"Change Role","description":"Change a member's role. Managers can only touch Staff; only the Owner\ncan create/demote Managers or touch other Managers. Nobody edits the Owner\nvia this endpoint (use transfer-ownership).","operationId":"change_role_team__user_id__role_patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RoleChangeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamMemberOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/team/{user_id}":{"delete":{"tags":["team"],"summary":"Remove Member","description":"Remove a member. Their sessions die immediately (permissions_changed_at).\nManagers can remove only Staff; the Owner can remove anyone but themselves.","operationId":"remove_member_team__user_id__delete","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/team/{user_id}/reactivate":{"post":{"tags":["team"],"summary":"Reactivate Member","description":"Reactivate a member suspended by a plan downgrade. Owner-only (this is\nthe 'choose who stays' decision). Fails if the plan has no free seat.","operationId":"reactivate_member_team__user_id__reactivate_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","title":"User Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamMemberOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/team/activity":{"get":{"tags":["team"],"summary":"Team Activity","description":"Owner's change log: who did what on this account (team changes, settings\nedits, billing actions). Same rows the platform audit trail stores, scoped\nto the tenant. Owner-only — it exposes other members' actions.","operationId":"team_activity_team_activity_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivityResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/team/transfer-ownership":{"post":{"tags":["team"],"summary":"Transfer Ownership","description":"Hand Owner to another member (they become Owner, you become Manager).\nRe-authenticates with the current owner's password.","operationId":"transfer_ownership_team_transfer_ownership_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TransferOwnershipRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TeamMemberOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/referrals/my-link":{"get":{"tags":["referrals"],"summary":"Get Or Create Referral Link","description":"Get or create the current user's referral link.","operationId":"get_or_create_referral_link_referrals_my_link_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReferralLinkResponse"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/referrals/my-referrals":{"get":{"tags":["referrals"],"summary":"Get My Referrals","description":"Get the user's referral link + list of people they've referred.","operationId":"get_my_referrals_referrals_my_referrals_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MyReferralsResponse"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/referrals/validate/{code}":{"get":{"tags":["referrals"],"summary":"Validate Referral Code","description":"Validate a referral code (public, called by landing page).","operationId":"validate_referral_code_referrals_validate__code__get","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","title":"Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateCodeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/referrals":{"get":{"tags":["admin"],"summary":"Admin List Referrals","description":"Admin view: all referrals with fraud flags.","operationId":"admin_list_referrals_admin_referrals_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminReferralListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/referrals/{referral_id}":{"patch":{"tags":["admin"],"summary":"Admin Update Referral","description":"Admin: manually update referral status or add note.","operationId":"admin_update_referral_admin_referrals__referral_id__patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"referral_id","in":"path","required":true,"schema":{"type":"string","title":"Referral Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminUpdateReferral"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/developer/api-keys":{"get":{"tags":["developer"],"summary":"List Api Keys","operationId":"list_api_keys_developer_api_keys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ApiKeyOut"},"type":"array","title":"Response List Api Keys Developer Api Keys Get"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]},"post":{"tags":["developer"],"summary":"Create Api Key","operationId":"create_api_key_developer_api_keys_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/developer/api-keys/{key_id}":{"delete":{"tags":["developer"],"summary":"Revoke Api Key","operationId":"revoke_api_key_developer_api_keys__key_id__delete","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/developer/scopes":{"get":{"tags":["developer"],"summary":"List Scopes","description":"The scopes a key may hold (for the settings UI).","operationId":"list_scopes_developer_scopes_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/admin/developer/api-keys":{"get":{"tags":["admin"],"summary":"Admin List Api Keys","operationId":"admin_list_api_keys_admin_developer_api_keys_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AdminApiKeyOut"},"title":"Response Admin List Api Keys Admin Developer Api Keys Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/developer/api-keys/{key_id}/revoke":{"post":{"tags":["admin"],"summary":"Admin Revoke Api Key","operationId":"admin_revoke_api_key_admin_developer_api_keys__key_id__revoke_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","title":"Key Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/developer/summary":{"get":{"tags":["admin"],"summary":"Admin Developer Summary","description":"Platform-wide developer stats for the admin overview strip.","operationId":"admin_developer_summary_admin_developer_summary_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/v1/calls":{"get":{"tags":["developer-api-v1"],"summary":"List Calls","description":"List the tenant's calls, newest first. Scope: calls:read.","operationId":"list_calls_v1_calls_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/calls/{call_id}":{"get":{"tags":["developer-api-v1"],"summary":"Get Call","description":"Fetch one call by id (tenant-scoped). Scope: calls:read.","operationId":"get_call_v1_calls__call_id__get","parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","title":"Call Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/appointments":{"get":{"tags":["developer-api-v1"],"summary":"List Appointments","description":"List the tenant's appointments, newest first. Scope: appointments:read.","operationId":"list_appointments_v1_appointments_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":50,"title":"Limit"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppointmentListOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v1/analytics":{"get":{"tags":["developer-api-v1"],"summary":"Analytics","description":"Aggregate call metrics for the last N days. Scope: analytics:read.","operationId":"analytics_v1_analytics_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/calls":{"get":{"tags":["v2","v2"],"summary":"List calls","description":"List the authenticated tenant's calls, newest first. Cursor-paginated; pass the returned `pagination.next_cursor` back as `?cursor=` for the next page. Filterable by status, outcome, direction, created_after/before, and had_error. Scope: `calls:read` (Business plan or higher).","operationId":"list_calls_v2_calls_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"outcome","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome"}},{"name":"direction","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Direction"}},{"name":"created_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created After"}},{"name":"created_before","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created Before"}},{"name":"had_error","in":"query","required":false,"schema":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Had Error"}},{"name":"sort","in":"query","required":false,"schema":{"enum":["created_at","-created_at"],"type":"string","default":"-created_at","title":"Sort"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallListV2"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/calls/{call_id}":{"get":{"tags":["v2","v2"],"summary":"Get a call","description":"Fetch a single call by id (tenant-scoped). Scope: `calls:read` (Business plan or higher).","operationId":"get_call_v2_calls__call_id__get","parameters":[{"name":"call_id","in":"path","required":true,"schema":{"type":"string","title":"Call Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CallV2"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/appointments":{"get":{"tags":["v2","v2"],"summary":"List appointments","description":"List the authenticated tenant's appointments, newest first. Cursor-paginated; pass the returned `pagination.next_cursor` back as `?cursor=` for the next page. Filterable by status, service_type, created_after/before, start_after/before. Scope: `appointments:read` (Business plan or higher).","operationId":"list_appointments_v2_appointments_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"service_type","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Service Type"}},{"name":"created_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created After"}},{"name":"created_before","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created Before"}},{"name":"start_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start After"}},{"name":"start_before","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start Before"}},{"name":"sort","in":"query","required":false,"schema":{"enum":["created_at","-created_at"],"type":"string","default":"-created_at","title":"Sort"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppointmentListV2"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["v2","v2"],"summary":"Create an appointment","description":"Book an appointment. Requires an `Idempotency-Key` header (a UUID you generate): a retry with the same key + body replays the original result instead of double-booking. Overlapping a scheduled appointment returns 409. Fires the `appointment.created` webhook. Scope: `appointments:write`.","operationId":"create_appointment_v2_appointments_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppointmentCreateV2"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppointmentV2"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/appointments/{appointment_id}":{"get":{"tags":["v2","v2"],"summary":"Get an appointment","description":"Fetch a single appointment by id (tenant-scoped). Scope: `appointments:read` (Business plan or higher).","operationId":"get_appointment_v2_appointments__appointment_id__get","parameters":[{"name":"appointment_id","in":"path","required":true,"schema":{"type":"string","title":"Appointment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppointmentV2"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["v2","v2"],"summary":"Update an appointment","description":"Reschedule or edit an appointment. Requires an `Idempotency-Key` header. If times change, the new slot is overlap-checked (409 on conflict). Fires `appointment.updated`. Scope: `appointments:write`.","operationId":"update_appointment_v2_appointments__appointment_id__patch","parameters":[{"name":"appointment_id","in":"path","required":true,"schema":{"type":"string","title":"Appointment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppointmentUpdateV2"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppointmentV2"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/appointments/{appointment_id}/cancel":{"post":{"tags":["v2","v2"],"summary":"Cancel an appointment","description":"Cancel an appointment (sets status=cancelled). Idempotent by resource state: cancelling an already-cancelled appointment is a no-op success. Fires `appointment.cancelled`. Scope: `appointments:write`.","operationId":"cancel_appointment_v2_appointments__appointment_id__cancel_post","parameters":[{"name":"appointment_id","in":"path","required":true,"schema":{"type":"string","title":"Appointment Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppointmentV2"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/orders":{"get":{"tags":["v2","v2"],"summary":"List phone orders","description":"List the authenticated tenant's phone orders, newest first. Cursor-paginated; pass `pagination.next_cursor` back as `?cursor=`. Filterable by status and created_after/before. Each order carries its latest deposit, if any. Scope: `orders:read`.","operationId":"list_orders_v2_orders_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"created_after","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created After"}},{"name":"created_before","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Created Before"}},{"name":"sort","in":"query","required":false,"schema":{"enum":["created_at","-created_at"],"type":"string","default":"-created_at","title":"Sort"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderListV2"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/orders/{order_id}":{"get":{"tags":["v2","v2"],"summary":"Get a phone order","description":"Fetch one order by id (tenant-scoped), with its latest deposit. Scope: `orders:read`.","operationId":"get_order_v2_orders__order_id__get","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderV2"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["v2","v2"],"summary":"Update a phone order","description":"Change the status and/or the note. Fires `order.updated`. Scope: `orders:write`.","operationId":"update_order_v2_orders__order_id__patch","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderUpdateV2"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderV2"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/orders/{order_id}/deposit":{"post":{"tags":["v2","v2"],"summary":"Request a deposit for an order","description":"Text the caller a Stripe payment link for a zadatek. The amount is yours: the assistant never quotes one. 409 until the tenant's Stripe Connect onboarding is complete or if the deposit is already paid; 422 when the order has no phone number. Fires `order.deposit_requested`; `deposit.paid` follows when the caller pays. Scope: `orders:write`.","operationId":"request_order_deposit_v2_orders__order_id__deposit_post","parameters":[{"name":"order_id","in":"path","required":true,"schema":{"type":"string","title":"Order Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderDepositRequestV2"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderV2"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/deposits":{"get":{"tags":["v2","v2"],"summary":"List deposits","description":"Newest first, cursor-paginated; filter by status. Scope: `deposits:read`.","operationId":"list_deposits_v2_deposits_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":100,"minimum":1,"default":25,"title":"Limit"}},{"name":"cursor","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cursor"}},{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}},{"name":"sort","in":"query","required":false,"schema":{"enum":["created_at","-created_at"],"type":"string","default":"-created_at","title":"Sort"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepositListV2"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/deposits/{deposit_id}":{"get":{"tags":["v2","v2"],"summary":"Get a deposit","description":"One deposit by id (tenant-scoped). Scope: `deposits:read`.","operationId":"get_deposit_v2_deposits__deposit_id__get","parameters":[{"name":"deposit_id","in":"path","required":true,"schema":{"type":"string","title":"Deposit Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepositV2"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/availability":{"get":{"tags":["v2","v2"],"summary":"Open appointment slots for a day","description":"Open slots for a date: business-hours slots minus scheduled appointments and blocked times. `date` is required (YYYY-MM-DD, treated as UTC). Scope: `appointments:read` (Business plan or higher).","operationId":"availability_v2_availability_get","parameters":[{"name":"date","in":"query","required":true,"schema":{"type":"string","description":"YYYY-MM-DD (UTC)","title":"Date"},"description":"YYYY-MM-DD (UTC)"},{"name":"duration_minutes","in":"query","required":false,"schema":{"type":"integer","maximum":480,"minimum":5,"default":30,"title":"Duration Minutes"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AvailabilityResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/analytics":{"get":{"tags":["v2","v2"],"summary":"Aggregate call metrics","description":"Aggregate call metrics for the last N days. Scope: `analytics:read` (Business plan or higher).","operationId":"analytics_v2_analytics_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AnalyticsV2"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/analytics/timeseries":{"get":{"tags":["v2","v2"],"summary":"Daily call counts","description":"Per-day call + booking counts for the last N days (UTC), oldest first, for charting. Scope: `analytics:read` (Business plan or higher).","operationId":"timeseries_v2_analytics_timeseries_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","maximum":365,"minimum":1,"default":30,"title":"Days"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TimeseriesV2"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/webhook-endpoints":{"get":{"tags":["v2","v2"],"summary":"List webhook endpoints","description":"List the tenant's webhook endpoints (secret masked). Scope: `webhooks:manage`.","operationId":"list_endpoints_v2_webhook_endpoints_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/WebhookEndpointOut"},"type":"array","title":"Response List Endpoints V2 Webhook Endpoints Get"}}}}}},"post":{"tags":["v2","v2"],"summary":"Register a webhook endpoint","description":"Register an https endpoint to receive events. Returns the signing `secret` **once**: store it. `events` empty = subscribe to all. Scope: `webhooks:manage`.","operationId":"create_endpoint_v2_webhook_endpoints_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/webhook-endpoints/{endpoint_id}":{"delete":{"tags":["v2","v2"],"summary":"Delete a webhook endpoint","description":"Delete a webhook endpoint. Scope: `webhooks:manage`.","operationId":"delete_endpoint_v2_webhook_endpoints__endpoint_id__delete","parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","title":"Endpoint Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/webhook-endpoints/{endpoint_id}/rotate-secret":{"post":{"tags":["v2","v2"],"summary":"Rotate a webhook endpoint's secret","description":"Generate a new signing secret (returned once). Scope: `webhooks:manage`.","operationId":"rotate_secret_v2_webhook_endpoints__endpoint_id__rotate_secret_post","parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","title":"Endpoint Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEndpointCreated"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/webhook-endpoints/{endpoint_id}/test":{"post":{"tags":["v2","v2"],"summary":"Send a test event","description":"Send a sample `webhook.test` event to the endpoint now. Scope: `webhooks:manage`.","operationId":"test_endpoint_v2_webhook_endpoints__endpoint_id__test_post","parameters":[{"name":"endpoint_id","in":"path","required":true,"schema":{"type":"string","title":"Endpoint Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestResult"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/faq":{"get":{"tags":["v2","v2"],"summary":"Get FAQ","description":"The tenant's FAQ maps (PL + EN). Scope: `faq:read` (Business plan or higher).","operationId":"get_faq_v2_faq_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FaqOut"}}}}}},"put":{"tags":["v2","v2"],"summary":"Replace FAQ","description":"Replace the FAQ map(s). Provide `faq` and/or `faq_en`; each replaces that language's map wholesale. Fires `faq.updated`. Scope: `faq:write`.","operationId":"replace_faq_v2_faq_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FaqReplace"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FaqOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/voice-config":{"get":{"tags":["v2","v2"],"summary":"Get voice config","description":"Greeting + voice for the tenant. Scope: `voice_config:read` (Business plan or higher).","operationId":"get_voice_config_v2_voice_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceConfigOut"}}}}}},"patch":{"tags":["v2","v2"],"summary":"Update voice","description":"Set the tenant's `voice_id` (validated against the supported voice list or the tenant's own cloned voice) and/or `voice_gender`. Fires `voice_config.updated`. Scope: `voice_config:write`.","operationId":"patch_voice_config_v2_voice_config_patch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceConfigPatch"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VoiceConfigOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/knowledge":{"get":{"tags":["v2","v2"],"summary":"List knowledge documents","description":"The tenant's knowledge documents. Scope: `knowledge:read` (Business plan or higher).","operationId":"list_documents_v2_knowledge_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeListV2"}}}}}},"post":{"tags":["v2","v2"],"summary":"Ingest a knowledge document from text","description":"Ingest a document from plain text; it is chunked + embedded in the background (poll `GET /v2/knowledge` until status=ready). Requires an `Idempotency-Key` header. Fires `knowledge.document.added`. Scope: `knowledge:write`.","operationId":"ingest_document_v2_knowledge_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/KnowledgeIngest"}}},"required":true},"responses":{"202":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DocumentV2"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/v2/tenant":{"get":{"tags":["v2","v2"],"summary":"Get tenant profile","description":"The authenticated tenant's profile + plan. Scope: `tenants:read` (Business plan or higher).","operationId":"get_tenant_v2_tenant_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TenantV2"}}}}}}},"/v2/billing/usage":{"get":{"tags":["v2","v2"],"summary":"Get usage this period","description":"Minutes + SMS used this billing period vs plan. Scope: `billing:read` (Business plan or higher).","operationId":"get_usage_v2_billing_usage_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingUsageV2"}}}}}}},"/affiliates/validate/{code}":{"get":{"tags":["affiliates"],"summary":"Validate Affiliate Code","description":"Public: called by the landing / register page to validate an influencer code.","operationId":"validate_affiliate_code_affiliates_validate__code__get","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","title":"Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateAffiliateResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/affiliates/apply":{"post":{"tags":["affiliates"],"summary":"Apply To Program","description":"Public — the /partnerzy landing form. Creates a PENDING affiliate for admin\nreview; NOT active until an admin activates it (payout gate). No code issued yet.\nRequires acceptance of the Regulamin Programu Partnerskiego — a cash-commission\nprogram needs a recorded, versioned agreement (KC art. 60/77²/384 + eIDAS).","operationId":"apply_to_program_affiliates_apply_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AffiliateApplyRequest"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/affiliates/portal/{token}":{"get":{"tags":["affiliates"],"summary":"Affiliate Portal","description":"Public, token-authed self-serve portal for an approved affiliate. The token\nis unguessable (secrets.token_urlsafe) and emailed on activation — affiliates\naren't Users, so this magic-link is how they see their code, share link,\nconversions and earnings without an account.","operationId":"affiliate_portal_affiliates_portal__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/PortalResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/affiliates/portal/{token}/accept-terms":{"post":{"tags":["affiliates"],"summary":"Portal Accept Terms","description":"Affiliate re-accepts the terms after an admin rate change cleared the\nprevious acceptance. Records timestamp + IP + the SERVER-side terms version\n(never client-supplied) and re-snapshots the accepted rate from the current\npayout fields — the snapshot is what commission computation trusts.","operationId":"portal_accept_terms_affiliates_portal__token__accept_terms_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/affiliates/portal/{token}/payout-details":{"post":{"tags":["affiliates"],"summary":"Portal Submit Payout Details","description":"Affiliate submits tax/payout identity (company, NIP, VAT status, IBAN) —\nthe precondition for any cash payout (golden rule #4: no cash without identity).\n\nToken-security hardening: setting or changing the IBAN is NOT applied\ndirectly — the portal token rides in URLs/logs and a leak must not be able\nto redirect payouts. The change is staged and only applied after the partner\nconfirms via a link sent to their REGISTERED email. Non-bank edits (same\nIBAN) apply immediately.","operationId":"portal_submit_payout_details_affiliates_portal__token__payout_details_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayoutDetailsRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/affiliates/portal/{token}/confirm-payout-change":{"post":{"tags":["affiliates"],"summary":"Portal Confirm Payout Change","description":"Applies a staged bank-details change after the partner clicked the\nconfirmation link from their registered email. Single-use, 24h TTL.","operationId":"portal_confirm_payout_change_affiliates_portal__token__confirm_payout_change_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmPayoutChangeRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/affiliates/portal/{token}/tickets":{"post":{"tags":["affiliates"],"summary":"Portal Create Ticket","description":"Partners are not users, so this is their one written channel to us: a\nticket in the admin panel (category partner) and a confirmation e-mail.","operationId":"portal_create_ticket_affiliates_portal__token__tickets_post","parameters":[{"name":"token","in":"path","required":true,"schema":{"type":"string","title":"Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalTicketRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/affiliates":{"get":{"tags":["admin"],"summary":"Admin List Affiliates","operationId":"admin_list_affiliates_admin_affiliates_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/AffiliateOut"},"title":"Response Admin List Affiliates Admin Affiliates Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["admin"],"summary":"Admin Create Affiliate","operationId":"admin_create_affiliate_admin_affiliates_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AffiliateCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AffiliateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/affiliates/{affiliate_id}/status":{"patch":{"tags":["admin"],"summary":"Admin Set Status","operationId":"admin_set_status_admin_affiliates__affiliate_id__status_patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"affiliate_id","in":"path","required":true,"schema":{"type":"string","title":"Affiliate Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusChange"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AffiliateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/affiliates/{affiliate_id}":{"patch":{"tags":["admin"],"summary":"Admin Edit Affiliate","operationId":"admin_edit_affiliate_admin_affiliates__affiliate_id__patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"affiliate_id","in":"path","required":true,"schema":{"type":"string","title":"Affiliate Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AffiliateEdit"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AffiliateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/affiliates/conversions":{"get":{"tags":["admin"],"summary":"Admin List Conversions","operationId":"admin_list_conversions_admin_affiliates_conversions_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"status","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ConversionOut"},"title":"Response Admin List Conversions Admin Affiliates Conversions Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/affiliates/reconciliation":{"get":{"tags":["admin"],"summary":"Admin Affiliate Reconciliation","description":"G8 safety net: find PAYING referred customers whose conversion is still\n`signed_up` — i.e. a qualification that was lost (webhook failure, deploy\ngap). Each row is a commission the partner earned but never accrued; fix by\nre-sending the invoice.paid event from the Stripe dashboard (idempotent) or\nhandling manually.","operationId":"admin_affiliate_reconciliation_admin_affiliates_reconciliation_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ReconciliationRow"},"type":"array","title":"Response Admin Affiliate Reconciliation Admin Affiliates Reconciliation Get"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/admin/affiliates/{affiliate_id}/rotate-token":{"post":{"tags":["admin"],"summary":"Admin Rotate Portal Token","description":"Token security: rotate (or revoke) a partner's portal magic-link token.\nThe old link stops resolving immediately; a rotation should be followed by\na resend so the partner gets the fresh link.","operationId":"admin_rotate_portal_token_admin_affiliates__affiliate_id__rotate_token_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"affiliate_id","in":"path","required":true,"schema":{"type":"string","title":"Affiliate Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RotateTokenRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AffiliateOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/affiliates/conversions/{conversion_id}/mark-paid":{"post":{"tags":["admin"],"summary":"Admin Mark Paid","operationId":"admin_mark_paid_admin_affiliates_conversions__conversion_id__mark_paid_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"conversion_id","in":"path","required":true,"schema":{"type":"string","title":"Conversion Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MarkPaidRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/affiliates/{affiliate_id}/resend-activation":{"post":{"tags":["admin"],"summary":"Admin Resend Activation","description":"Re-send the partner's email — for lost emails. ACTIVE partners get the\nactivation email (code + share link + portal); PENDING partners get the\ninvitation email again (portal + accept-Regulamin CTA + PDFs). Best-effort\nlike the original sends.","operationId":"admin_resend_activation_admin_affiliates__affiliate_id__resend_activation_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"affiliate_id","in":"path","required":true,"schema":{"type":"string","title":"Affiliate Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/affiliates/{affiliate_id}/payout-summary":{"get":{"tags":["admin"],"summary":"Admin Payout Summary","operationId":"admin_payout_summary_admin_affiliates__affiliate_id__payout_summary_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"affiliate_id","in":"path","required":true,"schema":{"type":"string","title":"Affiliate Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PayoutSummaryOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/admin/affiliates/{affiliate_id}/payout":{"post":{"tags":["admin"],"summary":"Admin Ledger Payout","description":"Settle every due ledger row of the partner in one transfer (min 50 zł),\nwith the same gates as before: terms accepted at the current rate, payout\ndetails on file.","operationId":"admin_ledger_payout_admin_affiliates__affiliate_id__payout_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"affiliate_id","in":"path","required":true,"schema":{"type":"string","title":"Affiliate Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LedgerPayoutRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/newsletter/subscribe":{"post":{"tags":["newsletter"],"summary":"Subscribe","operationId":"subscribe_newsletter_subscribe_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewsletterSubscribeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/preview/greeting":{"post":{"tags":["preview"],"summary":"Preview Greeting","description":"Generate TTS audio preview of a greeting message.\n\nReturns base64-encoded MP3 audio that can be played in the browser.\nResults are cached for 1 hour (same text + voice = same audio).","operationId":"preview_greeting_preview_greeting_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GreetingPreviewRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GreetingPreviewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/preview/conversation":{"post":{"tags":["preview"],"summary":"Preview Conversation","description":"Generate a simulated conversation preview.\n\nCreates a short scenario: AI greeting → caller asks question → AI answers.\nOnly the AI turns have audio (caller turns are text-only for display).","operationId":"preview_conversation_preview_conversation_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationPreviewRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationPreviewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/preview/greeting/{tenant_id}":{"post":{"tags":["preview"],"summary":"Preview Tenant Greeting","description":"Preview the tenant's current configured greeting.","operationId":"preview_tenant_greeting_preview_greeting__tenant_id__post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GreetingPreviewResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/preview/verticals":{"get":{"tags":["preview","public"],"summary":"List Demo Verticals","description":"Vertical ids the public demo supports (for the widget picker to stay in sync).","operationId":"list_demo_verticals_preview_verticals_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"items":{"type":"string"},"type":"array"},"type":"object","title":"Response List Demo Verticals Preview Verticals Get"}}}}}}},"/preview/public-greeting":{"post":{"tags":["preview","public"],"summary":"Public Greeting","description":"Synthesize a personalized Polish greeting for the landing-page demo widget.\n\nGreeting text is built server-side from a fixed per-vertical template — the\nclient only supplies a business name (sanitized) and a vertical id.","operationId":"public_greeting_preview_public_greeting_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicGreetingRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicGreetingResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/preview/greeting-audio":{"get":{"tags":["preview","public"],"summary":"Greeting Audio","description":"Stream the personalized greeting as an MP3 — used by the 'Posłuchaj ponownie'\nlink in the lead-confirmation email. No file is stored: the audio is regenerated\nserver-side from the same (name, vertical, voice) and served from cache. Nothing\nto retain or delete (RODO-friendly).","operationId":"greeting_audio_preview_greeting_audio_get","parameters":[{"name":"name","in":"query","required":true,"schema":{"type":"string","title":"Name"}},{"name":"vertical","in":"query","required":false,"schema":{"type":"string","default":"other","title":"Vertical"}},{"name":"voice","in":"query","required":false,"schema":{"type":"string","default":"female","title":"Voice"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/preview/demo-call":{"post":{"tags":["preview","public"],"summary":"Demo Call","description":"Place an anonymous outbound AI demo call to a landing-page visitor.\n\nPublic + spends money (Twilio) → gated: consent + PL-mobile-only + toll-fraud\nscreen + Turnstile + per-IP (slowapi) + per-phone (fail-open) + global\n(fail-safe) daily caps. The call reuses the DEMO persona via a signed zt:\nstream token — no tenant data touched. A consented hot lead is also recorded\nin admin (SupportTicket category=\"demo_call\" + bell + team email).","operationId":"demo_call_preview_demo_call_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemoCallRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemoCallResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/concierge/ask":{"post":{"tags":["concierge","public"],"summary":"Ask","description":"Marketing-only FAQ assistant grounded on the public corpus. No tools, no DB.","operationId":"ask_concierge_ask_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AskRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AskResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/concierge/support-ticket":{"post":{"tags":["concierge","public"],"summary":"Support Ticket","description":"Public support ticket → admin panel (Open folder) + admin bell + team email.\n\nHardened: EmailStr, length/enum caps, honeypot, Turnstile, dedup, per-IP +\nper-email + global daily caps. Free text is HTML-escaped into the admin email\n(record_intake). The ticket shows in /admin/tickets like any other.","operationId":"support_ticket_concierge_support_ticket_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SupportTicketRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConciergeOk"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/concierge/book-demo":{"post":{"tags":["concierge","public"],"summary":"Book Demo","description":"Book a team demo: real Sales-Demos calendar hold (best-effort) + ALWAYS an\nadmin-visible record (SupportTicket category=\"demo\" + bell + team email) + a\nconfirmation email to the prospect. Degrades to record-only if the calendar\nclient/SA is unavailable — never claims a slot it couldn't create.","operationId":"book_demo_concierge_book_demo_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BookDemoRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConciergeOk"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/concierge/demo-availability":{"get":{"tags":["concierge","public"],"summary":"Demo Availability","description":"Public: open demo slots from the Sales-Demos calendar's free/busy.\n\nDefault: the next few open business days. When `date=YYYY-MM-DD` is given\n(the widget's \"choose another day\" picker), returns just that day's open\nslots — so a visitor isn't limited to the days we surface by default.\n\nNo auth, no tenant data. Degrades to {days: [], degraded: true} on any calendar\nfailure so the widget can fall back to the free-text preference chips.","operationId":"demo_availability_concierge_demo_availability_get","parameters":[{"name":"days","in":"query","required":false,"schema":{"type":"integer","default":10,"title":"Days"}},{"name":"tz","in":"query","required":false,"schema":{"type":"string","default":"Europe/Warsaw","title":"Tz"}},{"name":"date","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Date"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DemoAvailabilityResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/changelog":{"get":{"tags":["changelog","public"],"summary":"Get Changelog","description":"Every shipped feature, newest-first, in the requested language.\n\nCustomers only. It used to be open to anyone, and it is a complete map of\nwhat we built, when, at what prices and with what plan limits: a gift to\nsomeone deciding what to probe next (owner, 2026-09-16, during the scanner\nincident). Cached per browser, not at the edge, now that it is personal.","operationId":"get_changelog_api_v1_changelog_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"lang","in":"query","required":false,"schema":{"type":"string","pattern":"^(pl|en)$","default":"pl","title":"Lang"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/help/setup-guide":{"get":{"tags":["help","public"],"summary":"Get Setup Guide","operationId":"get_setup_guide_api_v1_help_setup_guide_get","parameters":[{"name":"lang","in":"query","required":false,"schema":{"type":"string","pattern":"^(pl|en)$","default":"pl","title":"Lang"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/help/setup-guide/opened":{"post":{"tags":["help","public"],"summary":"Setup Guide Opened","description":"Measurement only: which chapters owners open, from where. Never fails the page.","operationId":"setup_guide_opened_api_v1_help_setup_guide_opened_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GuideOpened"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Setup Guide Opened Api V1 Help Setup Guide Opened Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/observability/client-error":{"post":{"tags":["observability"],"summary":"Report Client Error","description":"Capture a browser-side error and route it to the admin bell + email.","operationId":"report_client_error_observability_client_error_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientErrorReport"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/observability/support-ticket":{"post":{"tags":["observability"],"summary":"Support Ticket From Error","description":"One-tap \"Report a problem\" — creates a support ticket from an error state.\n\nLogged-in: one tap, prefilled from the session. Public callers must pass the\nhoneypot + Turnstile gate (mirrors the concierge public ticket lane).","operationId":"support_ticket_from_error_observability_support_ticket_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorSupportTicketRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/onboarding/auto-configure":{"post":{"tags":["onboarding"],"summary":"Auto Configure","description":"Auto-fill business configuration from Google Places + website.\n\nReturns pre-filled data that the user reviews and confirms.\nNothing is saved automatically — the user must explicitly apply.","operationId":"auto_configure_onboarding_auto_configure_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoConfigureRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoConfigureResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/agent/feedback":{"post":{"tags":["agent"],"summary":"Agent Feedback","description":"Rate one of Zvon's answers.\n\nZvon speaks first and drives owners through setup now, so a wrong answer is\nfollowed rather than ignored. One tap is the only feedback channel an owner\nmid-task will actually use.\n\nTapping again changes your mind rather than stacking a second vote — the\nunique index is on (user_id, message_id), and we UPDATE on conflict.","operationId":"agent_feedback_agent_feedback_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/agent/chat":{"post":{"tags":["agent"],"summary":"Agent Chat","description":"Conversational AI setup agent — streaming SSE responses.\n\nThe agent knows the tenant's full context (plan, config state, vertical)\nand can execute actions (add FAQ, update hours, auto-configure, etc.)","operationId":"agent_chat_agent_chat_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChatRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/agent/onboarding-chat":{"post":{"tags":["agent"],"summary":"Onboarding Chat","description":"Zvon help bubble inside the onboarding wizard (task #29).\n\nUnlike /chat this needs NO tenant (the user is mid-signup) and has NO\ntools — it is a scoped advisor that knows the wizard step + everything\nthe user typed so far. History is client-held (sessionStorage) because\nthere is no AgentConversation row yet; it survives refresh and steps.\nSame SSE wire format as /chat so the frontend reuses the parser.","operationId":"onboarding_chat_agent_onboarding_chat_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OnboardingChatRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/agent/history":{"get":{"tags":["agent"],"summary":"Get Agent History","description":"Get conversation history for the current tenant (for UI reload).","operationId":"get_agent_history_agent_history_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]},"delete":{"tags":["agent"],"summary":"Clear Agent History","description":"Clear conversation history for the current tenant.","operationId":"clear_agent_history_agent_history_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/auth/2fa/status":{"get":{"tags":["two-factor"],"summary":"Get 2Fa Status","description":"Check if 2FA is enabled for the current user.","operationId":"get_2fa_status_auth_2fa_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatusResponse"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/auth/2fa/setup":{"post":{"tags":["two-factor"],"summary":"Setup 2Fa","description":"Generate TOTP secret and QR code, or set up email-based 2FA. Does NOT enable until /verify.","operationId":"setup_2fa_auth_2fa_setup_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupRequest","default":{"method":"app"}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/auth/2fa/verify":{"post":{"tags":["two-factor"],"summary":"Verify And Enable 2Fa","description":"Confirm the first TOTP code to activate 2FA. Returns backup codes.","operationId":"verify_and_enable_2fa_auth_2fa_verify_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/auth/2fa/disable":{"post":{"tags":["two-factor"],"summary":"Disable 2Fa","description":"Disable 2FA. Requires a valid TOTP code or backup code.","operationId":"disable_2fa_auth_2fa_disable_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisableRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/auth/2fa/regenerate-backup-codes":{"post":{"tags":["two-factor"],"summary":"Regenerate Backup Codes","description":"Regenerate backup codes. Requires a valid TOTP code.","operationId":"regenerate_backup_codes_auth_2fa_regenerate_backup_codes_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VerifyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/tenants/{tenant_id}/deposits/status":{"get":{"tags":["deposits"],"summary":"Get Deposit Status","operationId":"get_deposit_status_tenants__tenant_id__deposits_status_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepositStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/deposits/onboarding":{"post":{"tags":["deposits"],"summary":"Start Onboarding","description":"Create the connected account (idempotent) + a fresh hosted-KYC link.","operationId":"start_onboarding_tenants__tenant_id__deposits_onboarding_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/deposits/config":{"patch":{"tags":["deposits"],"summary":"Update Deposit Config","operationId":"update_deposit_config_tenants__tenant_id__deposits_config_patch","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepositConfigUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepositStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/deposits":{"get":{"tags":["deposits"],"summary":"List Deposits","description":"Recent deposit records + live totals — feeds the dashboard payments view.\n\nAmounts reflect what actually settled on the TENANT'S Stripe account\n(status transitions come only from verified Connect webhooks).","operationId":"list_deposits_tenants__tenant_id__deposits_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DepositListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/deposits/overview":{"get":{"tags":["deposits"],"summary":"Get Payments Overview","description":"Full payments overview: collected, refunded, disputed, forfeited.","operationId":"get_payments_overview_tenants__tenant_id__deposits_overview_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PaymentsOverview"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/tenants/{tenant_id}/deposits/appointments/{appointment_id}/link":{"post":{"tags":["deposits"],"summary":"Send Deposit Link","description":"Text the patient their deposit link, creating the deposit if needed.","operationId":"send_deposit_link_tenants__tenant_id__deposits_appointments__appointment_id__link_post","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"tenant_id","in":"path","required":true,"schema":{"type":"string","title":"Tenant Id"}},{"name":"appointment_id","in":"path","required":true,"schema":{"type":"string","title":"Appointment Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendDepositLinkRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendDepositLinkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/p/{code}":{"get":{"tags":["deposits"],"summary":"Deposit Pay Redirect","description":"Send the patient to the Stripe-hosted payment page.","operationId":"deposit_pay_redirect_p__code__get","parameters":[{"name":"code","in":"path","required":true,"schema":{"type":"string","title":"Code"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/push/vapid-public-key":{"get":{"tags":["push"],"summary":"Vapid Public Key","operationId":"vapid_public_key_push_vapid_public_key_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VapidKeyResponse"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/push/subscribe":{"post":{"tags":["push"],"summary":"Subscribe","operationId":"subscribe_push_subscribe_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/src__routers__push__SubscribeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscribeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/push/unsubscribe":{"post":{"tags":["push"],"summary":"Unsubscribe","operationId":"unsubscribe_push_unsubscribe_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UnsubscribeRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubscribeResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/push/preferences":{"get":{"tags":["push"],"summary":"Get Preferences","operationId":"get_preferences_push_preferences_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreferencesResponse"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]},"put":{"tags":["push"],"summary":"Update Preferences","operationId":"update_preferences_push_preferences_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreferencesUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreferencesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/push/test":{"post":{"tags":["push"],"summary":"Send Test","operationId":"send_test_push_test_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TestPushResponse"}}}}},"security":[{"OAuth2PasswordBearerOrCookie":[]}]}},"/failover/twilio/voice":{"post":{"tags":["failover"],"summary":"Twilio Voice Fallback","description":"Twilio voiceFallbackUrl — fires when the voice-engine webhook errored.\n\nReturns TwiML that dials the tenant's real phone. Shared/demo lines can't\nresolve a tenant, so they dial the team phone or apologise (design §2.2).","operationId":"twilio_voice_fallback_failover_twilio_voice_post","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/failover/telnyx":{"post":{"tags":["failover"],"summary":"Telnyx Failover Webhook","description":"Telnyx Call Control failover webhook — events land here when the\nvoice-engine (primary webhook) is unreachable. For a new inbound call we\nissue a transfer to the tenant's real phone. If Call Control itself is the\ndegraded part, the transfer fails and the number-level on-failure\nforwarding (layer A) catches the call instead.","operationId":"telnyx_failover_webhook_failover_telnyx_post","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/failover/vonage":{"get":{"tags":["failover"],"summary":"Vonage Answer Fallback","description":"Vonage application fallback_answer_url — Vonage fetches this NCCO when\nthe primary answer_url (voice-engine /vonage/answer) errored or timed out.\n\nTwin of the Twilio voiceFallbackUrl handler: dial the tenant's real phone,\nrecord the incident + a source=\"failover\" call row (never billed), and no\nmatter what breaks internally return a valid NCCO — never an error tone.\nVonage sends the answer payload as JSON on POST or query params on GET,\nwith MSISDNs lacking the leading '+'.","operationId":"vonage_answer_fallback_failover_vonage_get","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["failover"],"summary":"Vonage Answer Fallback","description":"Vonage application fallback_answer_url — Vonage fetches this NCCO when\nthe primary answer_url (voice-engine /vonage/answer) errored or timed out.\n\nTwin of the Twilio voiceFallbackUrl handler: dial the tenant's real phone,\nrecord the incident + a source=\"failover\" call row (never billed), and no\nmatter what breaks internally return a valid NCCO — never an error tone.\nVonage sends the answer payload as JSON on POST or query params on GET,\nwith MSISDNs lacking the leading '+'.","operationId":"vonage_answer_fallback_failover_vonage_get","parameters":[{"name":"token","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Token"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/insights/daily":{"get":{"tags":["insights"],"summary":"Daily Insight","description":"Return the tenant's personalized daily insight for the dashboard home card.","operationId":"daily_insight_insights_daily_get","security":[{"OAuth2PasswordBearerOrCookie":[]}],"parameters":[{"name":"locale","in":"query","required":false,"schema":{"type":"string","pattern":"^(pl|en)$","default":"pl","title":"Locale"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/DailyInsight"},{"type":"null"}],"title":"Response Daily Insight Insights Daily Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"AIActRegister":{"properties":{"system_name":{"type":"string","title":"System Name"},"provider":{"type":"string","title":"Provider"},"version":{"type":"string","title":"Version"},"risk_level":{"type":"string","title":"Risk Level"},"risk_classification_article":{"type":"string","title":"Risk Classification Article"},"intended_use":{"type":"string","title":"Intended Use"},"data_processed":{"items":{"type":"string"},"type":"array","title":"Data Processed"},"human_oversight_measures":{"items":{"type":"string"},"type":"array","title":"Human Oversight Measures"},"transparency_obligations":{"items":{"type":"string"},"type":"array","title":"Transparency Obligations"},"art52_disclosure_text_pl":{"type":"string","title":"Art52 Disclosure Text Pl"},"art52_disclosure_text_en":{"type":"string","title":"Art52 Disclosure Text En"},"art50_disclosure_text_pl":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Art50 Disclosure Text Pl"},"art50_disclosure_text_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Art50 Disclosure Text En"},"registration_date":{"type":"string","title":"Registration Date"},"last_updated":{"type":"string","title":"Last Updated"},"transparency_obligations_apply_from":{"type":"string","title":"Transparency Obligations Apply From","default":"2026-08-02"}},"type":"object","required":["system_name","provider","version","risk_level","risk_classification_article","intended_use","data_processed","human_oversight_measures","transparency_obligations","art52_disclosure_text_pl","art52_disclosure_text_en","registration_date","last_updated"],"title":"AIActRegister"},"AbsenceIn":{"properties":{"start_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date"},"end_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date"},"start_time":{"anyOf":[{"type":"string","pattern":"^\\d{2}:\\d{2}$"},{"type":"null"}],"title":"Start Time"},"end_time":{"anyOf":[{"type":"string","pattern":"^\\d{2}:\\d{2}$"},{"type":"null"}],"title":"End Time"},"start_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start At"},"end_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End At"},"note":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Note"},"kind":{"anyOf":[{"type":"string","maxLength":12},{"type":"null"}],"title":"Kind"}},"type":"object","title":"AbsenceIn"},"AbsenceMoveIn":{"properties":{"appointment_id":{"type":"string","title":"Appointment Id"},"to_resource_id":{"type":"string","title":"To Resource Id"}},"type":"object","required":["appointment_id","to_resource_id"],"title":"AbsenceMoveIn","description":"One decision from the plan the owner just looked at."},"AbsencePreviewIn":{"properties":{"start_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Start Date"},"end_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"End Date"},"start_time":{"anyOf":[{"type":"string","pattern":"^\\d{2}:\\d{2}$"},{"type":"null"}],"title":"Start Time"},"end_time":{"anyOf":[{"type":"string","pattern":"^\\d{2}:\\d{2}$"},{"type":"null"}],"title":"End Time"},"start_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start At"},"end_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End At"}},"type":"object","title":"AbsencePreviewIn"},"AcceptRequest":{"properties":{"token":{"type":"string","title":"Token"},"password":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Password"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"}},"type":"object","required":["token"],"title":"AcceptRequest"},"ActivityEntry":{"properties":{"id":{"type":"string","title":"Id"},"created_at":{"type":"string","title":"Created At"},"action":{"type":"string","title":"Action"},"actor_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Id"},"actor_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Name"},"actor_role":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Actor Role"},"resource_type":{"type":"string","title":"Resource Type"},"resource_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resource Id"},"details":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Details"}},"type":"object","required":["id","created_at","action","actor_id","actor_name","actor_role","resource_type","resource_id","details"],"title":"ActivityEntry"},"ActivityResponse":{"properties":{"entries":{"items":{"$ref":"#/components/schemas/ActivityEntry"},"type":"array","title":"Entries"}},"type":"object","required":["entries"],"title":"ActivityResponse"},"AdminApiKeyOut":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"tenant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Name"},"name":{"type":"string","title":"Name"},"key_prefix":{"type":"string","title":"Key Prefix"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"last_used_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Used At"},"revoked":{"type":"boolean","title":"Revoked"},"created_at":{"type":"string","title":"Created At"},"livemode":{"type":"boolean","title":"Livemode"}},"type":"object","required":["id","tenant_id","tenant_name","name","key_prefix","scopes","last_used_at","revoked","created_at","livemode"],"title":"AdminApiKeyOut"},"AdminCallContentResponse":{"properties":{"call_id":{"type":"string","title":"Call Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"tenant_name":{"type":"string","title":"Tenant Name"},"started_at":{"type":"string","title":"Started At"},"duration_seconds":{"type":"integer","title":"Duration Seconds"},"direction":{"type":"string","title":"Direction"},"caller_masked":{"type":"string","title":"Caller Masked"},"outcome":{"type":"string","title":"Outcome"},"ai_summary":{"type":"string","title":"Ai Summary"},"transcript_available":{"type":"boolean","title":"Transcript Available"}},"type":"object","required":["call_id","tenant_id","tenant_name","started_at","duration_seconds","direction","caller_masked","outcome","ai_summary","transcript_available"],"title":"AdminCallContentResponse"},"AdminCallEntry":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"tenant_name":{"type":"string","title":"Tenant Name"},"caller_number":{"type":"string","title":"Caller Number"},"called_number":{"type":"string","title":"Called Number"},"started_at":{"type":"string","format":"date-time","title":"Started At"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"},"status":{"type":"string","title":"Status"},"outcome":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome"},"sentiment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sentiment"},"latency_avg_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Latency Avg Ms"},"cost_cents":{"type":"integer","title":"Cost Cents"},"call_kind":{"type":"string","title":"Call Kind"}},"type":"object","required":["id","tenant_id","tenant_name","caller_number","called_number","started_at","duration_seconds","status","outcome","sentiment","latency_avg_ms","cost_cents","call_kind"],"title":"AdminCallEntry"},"AdminCallsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AdminCallEntry"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"},"kind_counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Kind Counts"}},"type":"object","required":["items","total","limit","offset","kind_counts"],"title":"AdminCallsResponse"},"AdminDataSourceCreate":{"properties":{"name":{"type":"string","title":"Name"},"purpose":{"type":"string","title":"Purpose"},"sheet_id":{"type":"string","title":"Sheet Id"},"sheet_name":{"type":"string","title":"Sheet Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"ai_access":{"type":"boolean","title":"Ai Access","default":true},"department_scope":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Department Scope"},"cross_reference_allowed":{"type":"boolean","title":"Cross Reference Allowed","default":true}},"type":"object","required":["name","purpose","sheet_id","sheet_name"],"title":"AdminDataSourceCreate"},"AdminOverviewResponse":{"properties":{"total_tenants":{"type":"integer","title":"Total Tenants"},"active_tenants":{"type":"integer","title":"Active Tenants"},"total_calls_today":{"type":"integer","title":"Total Calls Today"},"total_calls_this_month":{"type":"integer","title":"Total Calls This Month"},"system_health":{"$ref":"#/components/schemas/SystemHealth"},"revenue_this_month_pln":{"type":"integer","title":"Revenue This Month Pln"},"top_tenants_by_calls":{"items":{"$ref":"#/components/schemas/TopTenantEntry"},"type":"array","title":"Top Tenants By Calls"}},"type":"object","required":["total_tenants","active_tenants","total_calls_today","total_calls_this_month","system_health","revenue_this_month_pln","top_tenants_by_calls"],"title":"AdminOverviewResponse"},"AdminPolishInvoiceItem":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"tenant_name":{"type":"string","title":"Tenant Name"},"stripe_invoice_id":{"type":"string","title":"Stripe Invoice Id"},"ifirma_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ifirma Id"},"ifirma_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ifirma Number"},"invoice_kind":{"type":"string","title":"Invoice Kind"},"amount_grosze":{"type":"integer","title":"Amount Grosze"},"issued_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Issued At"},"email_sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Email Sent At"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"ksef_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ksef Number"}},"type":"object","required":["id","tenant_id","tenant_name","stripe_invoice_id","ifirma_id","ifirma_number","invoice_kind","amount_grosze","issued_at","email_sent_at","error_message","created_at"],"title":"AdminPolishInvoiceItem"},"AdminPolishInvoicesResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AdminPolishInvoiceItem"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"AdminPolishInvoicesResponse"},"AdminReferralItem":{"properties":{"id":{"type":"string","title":"Id"},"referrer_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Referrer Email"},"invitee_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invitee Email"},"referral_code":{"type":"string","title":"Referral Code"},"status":{"type":"string","title":"Status"},"fraud_score":{"type":"integer","title":"Fraud Score"},"fraud_flags":{"items":{},"type":"array","title":"Fraud Flags"},"reward_amount_pln":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Reward Amount Pln"},"created_at":{"type":"string","title":"Created At"},"qualified_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Qualified At"},"rewarded_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rewarded At"},"admin_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Admin Note"}},"type":"object","required":["id","referrer_email","invitee_email","referral_code","status","fraud_score","fraud_flags","reward_amount_pln","created_at","qualified_at","rewarded_at","admin_note"],"title":"AdminReferralItem"},"AdminReferralListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AdminReferralItem"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"stats":{"additionalProperties":true,"type":"object","title":"Stats"}},"type":"object","required":["items","total","stats"],"title":"AdminReferralListResponse"},"AdminTicketUpdate":{"properties":{"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"admin_response":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Admin Response"}},"type":"object","title":"AdminTicketUpdate"},"AdminUpdateReferral":{"properties":{"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"admin_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Admin Note"}},"type":"object","title":"AdminUpdateReferral"},"AdminUpdateUserRequest":{"properties":{"is_verified":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Verified"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"AdminUpdateUserRequest"},"AdminUserItem":{"properties":{"id":{"type":"string","title":"Id"},"email":{"type":"string","title":"Email"},"full_name":{"type":"string","title":"Full Name"},"role":{"type":"string","title":"Role"},"is_active":{"type":"boolean","title":"Is Active"},"is_verified":{"type":"boolean","title":"Is Verified"},"auth_method":{"type":"string","title":"Auth Method"},"has_tenant":{"type":"boolean","title":"Has Tenant"},"tenant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Name"},"subscription_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Tier"},"subscription_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Status"},"signup_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Signup Source"},"utm_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Utm Source"},"utm_campaign":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Utm Campaign"},"last_login_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Login At"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","email","full_name","role","is_active","is_verified","auth_method","has_tenant","tenant_name","subscription_tier","subscription_status","signup_source","utm_source","utm_campaign","last_login_at","created_at"],"title":"AdminUserItem"},"AdminUsersResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AdminUserItem"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"AdminUsersResponse"},"AffiliateApplyRequest":{"properties":{"display_name":{"type":"string","title":"Display Name"},"email":{"type":"string","format":"email","title":"Email"},"channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel"},"channel_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel Url"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"audience":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Audience"},"business_form":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Form"},"nip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nip"},"company_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Name"},"accept_terms":{"type":"boolean","title":"Accept Terms","default":false},"terms_version":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Terms Version"},"lead_code":{"anyOf":[{"type":"string","maxLength":16},{"type":"null"}],"title":"Lead Code"}},"type":"object","required":["display_name","email"],"title":"AffiliateApplyRequest"},"AffiliateCreate":{"properties":{"display_name":{"type":"string","title":"Display Name"},"email":{"type":"string","format":"email","title":"Email"},"channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel"},"code":{"type":"string","title":"Code"},"discount_desc":{"type":"string","title":"Discount Desc","default":"pierwszy miesiąc gratis"},"stripe_promotion_code_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Promotion Code Id"},"payout_type":{"type":"string","title":"Payout Type","default":"percent"},"payout_value":{"type":"integer","title":"Payout Value","default":20},"payout_months":{"type":"integer","title":"Payout Months","default":12},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","required":["display_name","email","code"],"title":"AffiliateCreate"},"AffiliateEdit":{"properties":{"code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"},"display_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Display Name"},"channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel"},"discount_desc":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Discount Desc"},"stripe_promotion_code_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Promotion Code Id"},"payout_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payout Type"},"payout_value":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Payout Value"},"payout_months":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Payout Months"},"model":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Model"},"resell_discount_percent":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Resell Discount Percent"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"}},"type":"object","title":"AffiliateEdit","description":"Editable fields for an existing affiliate — lets an admin promote a pending\napplied record (code \"PENDING-<email>\") to a real, shareable code and set\npayout terms, closing the apply→activate gap (previously the applicant record\ncouldn't be cleanly activated and admins had to create a duplicate)."},"AffiliateOut":{"properties":{"id":{"type":"string","title":"Id"},"code":{"type":"string","title":"Code"},"display_name":{"type":"string","title":"Display Name"},"email":{"type":"string","title":"Email"},"channel":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel"},"status":{"type":"string","title":"Status"},"discount_desc":{"type":"string","title":"Discount Desc"},"payout_type":{"type":"string","title":"Payout Type"},"payout_value":{"type":"integer","title":"Payout Value"},"signups":{"type":"integer","title":"Signups"},"qualified":{"type":"integer","title":"Qualified"},"paid_out":{"type":"integer","title":"Paid Out"},"owed_grosze":{"type":"integer","title":"Owed Grosze"},"payout_months":{"type":"integer","title":"Payout Months","default":0},"model":{"type":"string","title":"Model","default":"refer"},"resell_discount_percent":{"type":"integer","title":"Resell Discount Percent","default":25},"created_at":{"type":"string","title":"Created At"},"last_email_sent_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Email Sent At"},"portal_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Portal Token"},"stripe_promotion_code_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Promotion Code Id"},"terms_accepted_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Terms Accepted At"},"payout_details_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payout Details At"},"business_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Status"},"company_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Name"},"tax_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Id"},"iban":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Iban"},"tax_country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Country"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"business_form":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Form"},"channel_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Channel Url"},"vat_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vat Status"},"nip_valid":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Nip Valid"}},"type":"object","required":["id","code","display_name","email","channel","status","discount_desc","payout_type","payout_value","signups","qualified","paid_out","owed_grosze","created_at"],"title":"AffiliateOut"},"AnalyticsOut":{"properties":{"period_days":{"type":"integer","title":"Period Days"},"total_calls":{"type":"integer","title":"Total Calls"},"completed_calls":{"type":"integer","title":"Completed Calls"},"booked_appointments":{"type":"integer","title":"Booked Appointments"},"transferred_calls":{"type":"integer","title":"Transferred Calls"},"avg_duration_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Duration Seconds"}},"type":"object","required":["period_days","total_calls","completed_calls","booked_appointments","transferred_calls","avg_duration_seconds"],"title":"AnalyticsOut"},"AnalyticsV2":{"properties":{"period_days":{"type":"integer","title":"Period Days"},"total_calls":{"type":"integer","title":"Total Calls"},"completed_calls":{"type":"integer","title":"Completed Calls"},"booked_appointments":{"type":"integer","title":"Booked Appointments"},"transferred_calls":{"type":"integer","title":"Transferred Calls"},"avg_duration_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Duration Seconds"}},"type":"object","required":["period_days","total_calls","completed_calls","booked_appointments","transferred_calls","avg_duration_seconds"],"title":"AnalyticsV2"},"AnnounceFeatureRequest":{"properties":{"key":{"type":"string","title":"Key"},"send_email":{"type":"boolean","title":"Send Email","default":true},"target":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Target"},"dry_run":{"type":"boolean","title":"Dry Run","default":false},"confirm_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Confirm Count"}},"type":"object","required":["key"],"title":"AnnounceFeatureRequest"},"AnnounceFeatureResponse":{"properties":{"key":{"type":"string","title":"Key"},"target":{"type":"string","title":"Target"},"sent_in_app":{"type":"integer","title":"Sent In App"},"sent_email":{"type":"integer","title":"Sent Email"},"skipped_duplicate":{"type":"integer","title":"Skipped Duplicate"},"would_notify":{"type":"integer","title":"Would Notify"},"admins_notified":{"type":"boolean","title":"Admins Notified"},"dry_run":{"type":"boolean","title":"Dry Run"}},"type":"object","required":["key","target","sent_in_app","sent_email","skipped_duplicate","would_notify","admins_notified","dry_run"],"title":"AnnounceFeatureResponse"},"AnnouncementOverrideRequest":{"properties":{"title_pl":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Title Pl"},"title_en":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Title En"},"message_pl":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Message Pl"},"message_en":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Message En"},"action_label_pl":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Action Label Pl"},"action_label_en":{"anyOf":[{"type":"string","maxLength":50},{"type":"null"}],"title":"Action Label En"}},"type":"object","title":"AnnouncementOverrideRequest","description":"Full override state for one catalog entry — the admin edit form sends\nall six fields. Blank/omitted = use the code-seeded catalog default.\nLength caps mirror the Notification columns (title 200, action_label 50)\nso an edited announcement can never fail the in-app insert at send time."},"AnomalyEntry":{"properties":{"id":{"type":"string","title":"Id"},"anomaly":{"type":"string","title":"Anomaly"},"value":{"title":"Value"},"detected_at":{"type":"string","title":"Detected At"}},"type":"object","required":["id","anomaly","value","detected_at"],"title":"AnomalyEntry"},"ApiKeyCreate":{"properties":{"name":{"type":"string","title":"Name"},"scopes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Scopes"},"mode":{"type":"string","enum":["live","test"],"title":"Mode","default":"live"}},"type":"object","required":["name"],"title":"ApiKeyCreate"},"ApiKeyCreated":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"key_prefix":{"type":"string","title":"Key Prefix"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"created_at":{"type":"string","title":"Created At"},"last_used_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Used At"},"revoked":{"type":"boolean","title":"Revoked"},"livemode":{"type":"boolean","title":"Livemode"},"key":{"type":"string","title":"Key"}},"type":"object","required":["id","name","key_prefix","scopes","created_at","last_used_at","revoked","livemode","key"],"title":"ApiKeyCreated"},"ApiKeyOut":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"key_prefix":{"type":"string","title":"Key Prefix"},"scopes":{"items":{"type":"string"},"type":"array","title":"Scopes"},"created_at":{"type":"string","title":"Created At"},"last_used_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Used At"},"revoked":{"type":"boolean","title":"Revoked"},"livemode":{"type":"boolean","title":"Livemode"}},"type":"object","required":["id","name","key_prefix","scopes","created_at","last_used_at","revoked","livemode"],"title":"ApiKeyOut"},"AppleConnectIn":{"properties":{"apple_id":{"type":"string","maxLength":255,"minLength":3,"title":"Apple Id"},"app_password":{"type":"string","maxLength":64,"minLength":8,"title":"App Password"}},"type":"object","required":["apple_id","app_password"],"title":"AppleConnectIn"},"AppleConnectRequest":{"properties":{"apple_id":{"type":"string","title":"Apple Id"},"app_password":{"type":"string","title":"App Password"}},"type":"object","required":["apple_id","app_password"],"title":"AppleConnectRequest"},"AppleConnectResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"calendars":{"items":{"$ref":"#/components/schemas/CalendarEntry"},"type":"array","title":"Calendars"}},"type":"object","required":["success","calendars"],"title":"AppleConnectResponse"},"ApplyAsFaqRequest":{"properties":{"answer":{"type":"string","title":"Answer"},"send_caller_sms":{"type":"boolean","title":"Send Caller Sms","default":false}},"type":"object","required":["answer"],"title":"ApplyAsFaqRequest"},"ApplyFaqPairsRequest":{"properties":{"pairs":{"additionalProperties":{"type":"string"},"type":"object","title":"Pairs"}},"type":"object","required":["pairs"],"title":"ApplyFaqPairsRequest","description":"Reviewed Q&A pairs to merge into the tenant's inline FAQ."},"ApplyFaqRequest":{"properties":{"questions":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Questions"}},"type":"object","title":"ApplyFaqRequest","description":"Optional selection filter for apply-faq. No body (or null questions)\nkeeps the original behavior: apply every extracted pair."},"AppointmentCreate":{"properties":{"patient_name":{"type":"string","title":"Patient Name"},"patient_phone":{"type":"string","title":"Patient Phone"},"patient_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Patient Email"},"service_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Service Type"},"start_time":{"type":"string","title":"Start Time"},"end_time":{"type":"string","title":"End Time"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"department_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Department Id"},"assigned_to_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned To User Id"}},"type":"object","required":["patient_name","patient_phone","start_time","end_time"],"title":"AppointmentCreate"},"AppointmentCreateV2":{"properties":{"patient_name":{"type":"string","maxLength":255,"minLength":1,"title":"Patient Name"},"patient_phone":{"type":"string","maxLength":30,"minLength":1,"title":"Patient Phone"},"start_time":{"type":"string","format":"date-time","title":"Start Time","description":"ISO-8601 start (UTC assumed if no offset)"},"end_time":{"type":"string","format":"date-time","title":"End Time","description":"ISO-8601 end (UTC assumed if no offset)"},"patient_email":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Patient Email"},"service_type":{"anyOf":[{"type":"string","maxLength":150},{"type":"null"}],"title":"Service Type"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"department_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Department Id"}},"type":"object","required":["patient_name","patient_phone","start_time","end_time"],"title":"AppointmentCreateV2"},"AppointmentListOut":{"properties":{"data":{"items":{"$ref":"#/components/schemas/AppointmentOut"},"type":"array","title":"Data"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["data","limit","offset","has_more"],"title":"AppointmentListOut"},"AppointmentListV2":{"properties":{"data":{"items":{"$ref":"#/components/schemas/AppointmentV2"},"type":"array","title":"Data"},"pagination":{"$ref":"#/components/schemas/src__routers__v2__appointments__PaginationMeta"}},"type":"object","required":["data","pagination"],"title":"AppointmentListV2"},"AppointmentOut":{"properties":{"id":{"type":"string","title":"Id"},"created_at":{"type":"string","title":"Created At"},"start_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Time"},"status":{"type":"string","title":"Status"},"service_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Service Type"},"patient_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Patient Name"}},"type":"object","required":["id","created_at","start_time","status","service_type","patient_name"],"title":"AppointmentOut"},"AppointmentResponse":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"patient_name":{"type":"string","title":"Patient Name"},"patient_phone":{"type":"string","title":"Patient Phone"},"patient_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Patient Email"},"service_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Service Type"},"start_time":{"type":"string","title":"Start Time"},"end_time":{"type":"string","title":"End Time"},"status":{"type":"string","title":"Status"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"department_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Department Id"},"external_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Id"},"external_calendar":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"External Calendar"},"booked_via":{"type":"string","title":"Booked Via"},"assigned_to_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned To User Id"},"resource_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resource Id"},"resource_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resource Name"},"created_at":{"type":"string","title":"Created At"},"updated_at":{"type":"string","title":"Updated At"},"reschedule_count":{"type":"integer","title":"Reschedule Count","default":0},"deposit":{"anyOf":[{"$ref":"#/components/schemas/DepositBadge"},{"type":"null"}]},"deposit_refund":{"anyOf":[{"$ref":"#/components/schemas/DepositRefundOutcome"},{"type":"null"}]},"booking_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Booking Code"}},"type":"object","required":["id","tenant_id","patient_name","patient_phone","patient_email","service_type","start_time","end_time","status","notes","department_id","external_id","external_calendar","booked_via","created_at","updated_at"],"title":"AppointmentResponse"},"AppointmentUpdate":{"properties":{"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"start_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Time"},"end_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Time"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"assigned_to_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned To User Id"}},"type":"object","title":"AppointmentUpdate"},"AppointmentUpdateV2":{"properties":{"start_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start Time"},"end_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End Time"},"status":{"anyOf":[{"type":"string","enum":["scheduled","completed","cancelled","no_show"]},{"type":"null"}],"title":"Status"},"service_type":{"anyOf":[{"type":"string","maxLength":150},{"type":"null"}],"title":"Service Type"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"patient_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Patient Name"},"patient_phone":{"anyOf":[{"type":"string","maxLength":30},{"type":"null"}],"title":"Patient Phone"},"patient_email":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Patient Email"}},"type":"object","title":"AppointmentUpdateV2"},"AppointmentV2":{"properties":{"id":{"type":"string","title":"Id"},"created_at":{"type":"string","title":"Created At","description":"ISO-8601 UTC timestamp"},"start_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Time","description":"ISO-8601 UTC start"},"end_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"End Time","description":"ISO-8601 UTC end"},"patient_name":{"type":"string","title":"Patient Name"},"patient_phone":{"type":"string","title":"Patient Phone"},"patient_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Patient Email"},"service_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Service Type"},"status":{"type":"string","title":"Status","description":"scheduled | completed | cancelled | no_show"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"department_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Department Id"},"booked_via":{"type":"string","title":"Booked Via","description":"ai | external | manual"}},"type":"object","required":["id","created_at","start_time","end_time","patient_name","patient_phone","patient_email","service_type","status","notes","department_id","booked_via"],"title":"AppointmentV2"},"ArchiveNotificationsRequest":{"properties":{"ids":{"items":{"type":"string"},"type":"array","maxItems":500,"minItems":1,"title":"Ids"},"archived":{"type":"boolean","title":"Archived","default":true}},"type":"object","required":["ids"],"title":"ArchiveNotificationsRequest"},"AskIn":{"properties":{"question":{"type":"string","maxLength":500,"minLength":2,"title":"Question"}},"type":"object","required":["question"],"title":"AskIn"},"AskMessage":{"properties":{"role":{"type":"string","enum":["user","assistant"],"title":"Role"},"content":{"type":"string","maxLength":2000,"title":"Content","default":""}},"type":"object","required":["role"],"title":"AskMessage"},"AskRequest":{"properties":{"message":{"type":"string","maxLength":2000,"minLength":1,"title":"Message"},"history":{"items":{"$ref":"#/components/schemas/AskMessage"},"type":"array","title":"History"},"locale":{"type":"string","pattern":"^(pl|en)$","title":"Locale","default":"pl"},"session":{"anyOf":[{"type":"string","maxLength":96},{"type":"null"}],"title":"Session"},"session_id":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Session Id"},"turnstile_token":{"anyOf":[{"type":"string","maxLength":4096},{"type":"null"}],"title":"Turnstile Token"}},"type":"object","required":["message"],"title":"AskRequest"},"AskResponse":{"properties":{"text":{"type":"string","title":"Text"},"quick_replies":{"items":{"type":"string"},"type":"array","title":"Quick Replies"},"deep_link":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deep Link"},"source":{"type":"string","title":"Source","default":"ai"},"session":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session"}},"type":"object","required":["text"],"title":"AskResponse"},"AssignIn":{"properties":{"count":{"type":"integer","maximum":500.0,"minimum":1.0,"title":"Count","default":20},"vertical":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vertical"},"voivodeship":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voivodeship"},"priority_max":{"type":"integer","maximum":3.0,"minimum":1.0,"title":"Priority Max","default":3},"visit_zone":{"anyOf":[{"type":"string","pattern":"^(region|visit_days|outside|none)$"},{"type":"null"}],"title":"Visit Zone"},"visit_area":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Visit Area"},"segment":{"anyOf":[{"type":"string","pattern":"^(business|agency|expat)$"},{"type":"null"}],"title":"Segment"},"city":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"City"}},"type":"object","title":"AssignIn"},"AssignNumberRequest":{"properties":{"phone_number":{"type":"string","title":"Phone Number"},"twilio_sid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Twilio Sid"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"label":{"type":"string","title":"Label","default":"Główna linia"},"replace_shared":{"type":"boolean","title":"Replace Shared","default":true},"force_reassign":{"type":"boolean","title":"Force Reassign","default":false}},"type":"object","required":["phone_number"],"title":"AssignNumberRequest"},"AtRiskSubscription":{"properties":{"tenant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"},"business_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"subscription_id":{"type":"string","title":"Subscription Id"},"status":{"type":"string","title":"Status"},"amount_grosze":{"type":"integer","title":"Amount Grosze"},"since":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Since"},"next_attempt":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Attempt"},"needs_action":{"type":"boolean","title":"Needs Action"}},"type":"object","required":["tenant_id","business_name","email","subscription_id","status","amount_grosze","since","next_attempt","needs_action"],"title":"AtRiskSubscription"},"AttentionIn":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"code":{"type":"string","maxLength":12,"title":"Code"},"kind":{"type":"string","pattern":"^(cancel|add|complaint|question)$","title":"Kind"},"note":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Note"}},"type":"object","required":["tenant_id","code","kind"],"title":"AttentionIn"},"AuditLogEntry":{"properties":{"id":{"type":"string","title":"Id"},"admin_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Admin Id"},"action":{"type":"string","title":"Action"},"resource_type":{"type":"string","title":"Resource Type"},"resource_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Resource Id"},"details":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Details"},"ip_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ip Address"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","admin_id","action","resource_type","resource_id","details","ip_address","created_at"],"title":"AuditLogEntry"},"AuditLogResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/AuditLogEntry"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"AuditLogResponse"},"AuthUrlResponse":{"properties":{"auth_url":{"type":"string","title":"Auth Url"}},"type":"object","required":["auth_url"],"title":"AuthUrlResponse"},"AutoConfigureRequest":{"properties":{"business_name":{"type":"string","title":"Business Name"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City"},"website_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Website Url"},"nip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nip"}},"type":"object","required":["business_name"],"title":"AutoConfigureRequest"},"AutoConfigureResponse":{"properties":{"business_name":{"type":"string","title":"Business Name"},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"website":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Website"},"vertical":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vertical"},"business_hours":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Business Hours"},"greeting_suggestion":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Greeting Suggestion"},"faq_suggestions":{"items":{"$ref":"#/components/schemas/SuggestedFAQ"},"type":"array","title":"Faq Suggestions","default":[]},"voice_recommendation":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voice Recommendation"},"google_maps_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Google Maps Url"},"rating":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Rating"},"reviews_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Reviews Count"},"confidence":{"type":"number","title":"Confidence","default":0.0},"source":{"type":"string","title":"Source","default":"manual"}},"type":"object","required":["business_name"],"title":"AutoConfigureResponse"},"AutopayNotification":{"properties":{"transactionId":{"type":"string","title":"Transactionid"},"orderId":{"type":"string","title":"Orderid"},"amount":{"type":"integer","title":"Amount"},"currency":{"type":"string","title":"Currency"},"status":{"type":"string","title":"Status"},"paymentMethod":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paymentmethod"},"signature":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Signature"}},"type":"object","required":["transactionId","orderId","amount","currency","status"],"title":"AutopayNotification","description":"Autopay payment notification."},"AvailabilityResponse":{"properties":{"date":{"type":"string","title":"Date"},"duration_minutes":{"type":"integer","title":"Duration Minutes"},"slots":{"items":{"$ref":"#/components/schemas/AvailabilitySlot"},"type":"array","title":"Slots"}},"type":"object","required":["date","duration_minutes","slots"],"title":"AvailabilityResponse"},"AvailabilitySlot":{"properties":{"start":{"type":"string","title":"Start","description":"ISO-8601 UTC start"},"end":{"type":"string","title":"End","description":"ISO-8601 UTC end"}},"type":"object","required":["start","end"],"title":"AvailabilitySlot"},"AvailableSlot":{"properties":{"start":{"type":"string","title":"Start"},"end":{"type":"string","title":"End"},"available":{"type":"boolean","title":"Available","default":true}},"type":"object","required":["start","end"],"title":"AvailableSlot"},"BillingManagementResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_name":{"type":"string","title":"Business Name"},"billing_managed_manually":{"type":"boolean","title":"Billing Managed Manually"},"billing_managed_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Billing Managed Reason"}},"type":"object","required":["id","business_name","billing_managed_manually","billing_managed_reason"],"title":"BillingManagementResponse"},"BillingManagementUpdate":{"properties":{"billing_managed_manually":{"type":"boolean","title":"Billing Managed Manually"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["billing_managed_manually"],"title":"BillingManagementUpdate"},"BillingUsageV2":{"properties":{"subscription_tier":{"type":"string","title":"Subscription Tier"},"subscription_status":{"type":"string","title":"Subscription Status"},"minutes_used_this_month":{"type":"integer","title":"Minutes Used This Month"},"sms_used_this_month":{"type":"integer","title":"Sms Used This Month"},"period_start":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period Start"},"period_end":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period End"}},"type":"object","required":["subscription_tier","subscription_status","minutes_used_this_month","sms_used_this_month","period_start","period_end"],"title":"BillingUsageV2"},"BlockedTimeCreate":{"properties":{"title":{"type":"string","title":"Title"},"start_time":{"type":"string","title":"Start Time"},"end_time":{"type":"string","title":"End Time"},"recurrence":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recurrence","default":"none"},"recurrence_end_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recurrence End Date"}},"type":"object","required":["title","start_time","end_time"],"title":"BlockedTimeCreate"},"BlockedTimeResponse":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","title":"Title"},"source":{"type":"string","title":"Source","default":"owner"},"editable":{"type":"boolean","title":"Editable","default":true},"start_time":{"type":"string","format":"date-time","title":"Start Time"},"end_time":{"type":"string","format":"date-time","title":"End Time"},"recurrence":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recurrence"},"recurrence_end_date":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Recurrence End Date"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","title","start_time","end_time","recurrence","recurrence_end_date","created_at"],"title":"BlockedTimeResponse"},"Body_clone_voice_voices_clone_post":{"properties":{"voice_name":{"type":"string","title":"Voice Name"},"audio_file":{"type":"string","contentMediaType":"application/octet-stream","title":"Audio File"}},"type":"object","required":["voice_name","audio_file"],"title":"Body_clone_voice_voices_clone_post"},"Body_create_ticket_support_ticket_post":{"properties":{"category":{"type":"string","title":"Category"},"severity":{"type":"string","title":"Severity"},"subject":{"type":"string","title":"Subject"},"description":{"type":"string","title":"Description"},"email":{"type":"string","title":"Email","default":""},"tenant_id":{"type":"string","title":"Tenant Id","default":""},"screenshot":{"anyOf":[{"type":"string","contentMediaType":"application/octet-stream"},{"type":"null"}],"title":"Screenshot"}},"type":"object","required":["category","severity","subject","description"],"title":"Body_create_ticket_support_ticket_post"},"Body_extract_faq_from_file_tenants__tenant_id__knowledge_faq_extract_file_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_extract_faq_from_file_tenants__tenant_id__knowledge_faq_extract_file_post"},"Body_import_excel_tenants__tenant_id__data_sources_import_excel_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_import_excel_tenants__tenant_id__data_sources_import_excel_post"},"Body_login_auth_login_post":{"properties":{"remember":{"type":"boolean","title":"Remember","default":false},"grant_type":{"anyOf":[{"type":"string","pattern":"^password$"},{"type":"null"}],"title":"Grant Type"},"username":{"type":"string","title":"Username"},"password":{"type":"string","format":"password","title":"Password"},"scope":{"type":"string","title":"Scope","default":""},"client_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Id"},"client_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"format":"password","title":"Client Secret"}},"type":"object","required":["username","password"],"title":"Body_login_auth_login_post"},"Body_replace_document_tenants__tenant_id__knowledge_documents__document_id__replace_put":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_replace_document_tenants__tenant_id__knowledge_documents__document_id__replace_put"},"Body_stop_or_resume_blocking_tenants__tenant_id__people__resource_id__calendars__provider__blocking_patch":{"properties":{"blocking":{"type":"boolean","title":"Blocking"}},"type":"object","required":["blocking"],"title":"Body_stop_or_resume_blocking_tenants__tenant_id__people__resource_id__calendars__provider__blocking_patch"},"Body_upload_avatar_auth_me_avatar_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_avatar_auth_me_avatar_post"},"Body_upload_document_tenants__tenant_id__knowledge_upload_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_document_tenants__tenant_id__knowledge_upload_post"},"Body_upload_logo_tenants__tenant_id__brand_logo_post":{"properties":{"file":{"type":"string","contentMediaType":"application/octet-stream","title":"File"}},"type":"object","required":["file"],"title":"Body_upload_logo_tenants__tenant_id__brand_logo_post"},"BookDemoRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"name":{"type":"string","maxLength":120,"title":"Name","default":""},"slot":{"type":"string","maxLength":120,"title":"Slot","default":""},"slot_iso":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Slot Iso"},"phone":{"type":"string","maxLength":24,"title":"Phone","default":""},"vertical":{"type":"string","maxLength":40,"title":"Vertical","default":""},"note":{"type":"string","maxLength":1000,"title":"Note","default":""},"locale":{"type":"string","pattern":"^(pl|en)$","title":"Locale","default":"pl"},"turnstile_token":{"anyOf":[{"type":"string","maxLength":4096},{"type":"null"}],"title":"Turnstile Token"},"company_website":{"type":"string","maxLength":200,"title":"Company Website","default":""}},"type":"object","required":["email"],"title":"BookDemoRequest"},"BookingRequestConfirm":{"properties":{"start_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Time"}},"type":"object","title":"BookingRequestConfirm"},"BookingRequestDecline":{"properties":{"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"type":"object","title":"BookingRequestDecline"},"BrandConfigResponse":{"properties":{"logo_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Logo Url"},"primary_color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Primary Color"},"secondary_color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Secondary Color"},"brand_voice_tone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Brand Voice Tone"},"communication_guidelines":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Communication Guidelines"},"greeting_style":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Greeting Style"},"forbidden_phrases":{"items":{"type":"string"},"type":"array","title":"Forbidden Phrases","default":[]},"preferred_phrases":{"items":{"type":"string"},"type":"array","title":"Preferred Phrases","default":[]}},"type":"object","title":"BrandConfigResponse"},"BrandConfigUpdate":{"properties":{"primary_color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Primary Color"},"secondary_color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Secondary Color"},"brand_voice_tone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Brand Voice Tone"},"communication_guidelines":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Communication Guidelines"},"greeting_style":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Greeting Style"},"forbidden_phrases":{"items":{"type":"string"},"type":"array","title":"Forbidden Phrases","default":[]},"preferred_phrases":{"items":{"type":"string"},"type":"array","title":"Preferred Phrases","default":[]}},"type":"object","title":"BrandConfigUpdate"},"BroadcastNotificationRequest":{"properties":{"type":{"type":"string","title":"Type","default":"admin"},"title":{"type":"string","title":"Title"},"message":{"type":"string","title":"Message"},"action_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Url"},"action_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Label"},"send_email":{"type":"boolean","title":"Send Email","default":false},"target":{"type":"string","title":"Target","default":"all"},"tenant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"},"confirm_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Confirm Count"}},"type":"object","required":["title","message"],"title":"BroadcastNotificationRequest"},"BroadcastNotificationResponse":{"properties":{"sent_in_app":{"type":"integer","title":"Sent In App"},"sent_email":{"type":"integer","title":"Sent Email"},"skipped":{"type":"integer","title":"Skipped"}},"type":"object","required":["sent_in_app","sent_email","skipped"],"title":"BroadcastNotificationResponse"},"BulkDeleteRequest":{"properties":{"ticket_ids":{"items":{"type":"string"},"type":"array","title":"Ticket Ids"}},"type":"object","required":["ticket_ids"],"title":"BulkDeleteRequest"},"BulkLeadsIn":{"properties":{"action":{"type":"string","pattern":"^(assign|unassign|segment)$","title":"Action"},"lead_ids":{"items":{"type":"string"},"type":"array","maxItems":2000,"title":"Lead Ids"},"owner":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner"},"vertical":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vertical"},"voivodeship":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voivodeship"},"visit_zone":{"anyOf":[{"type":"string","pattern":"^(region|visit_days|outside|none)$"},{"type":"null"}],"title":"Visit Zone"},"visit_area":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Visit Area"},"segment_filter":{"anyOf":[{"type":"string","pattern":"^(business|agency|expat)$"},{"type":"null"}],"title":"Segment Filter"},"city":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"City"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"segment":{"anyOf":[{"type":"string","pattern":"^(business|agency|expat)$"},{"type":"null"}],"title":"Segment"},"only_untouched":{"type":"boolean","title":"Only Untouched","default":true},"dry_run":{"type":"boolean","title":"Dry Run","default":true}},"type":"object","required":["action"],"title":"BulkLeadsIn"},"BusinessInfo":{"properties":{"hours":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hours"},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"services":{"items":{"type":"string"},"type":"array","title":"Services","default":[]}},"type":"object","title":"BusinessInfo"},"ByCallerWipeRequest":{"properties":{"caller_number":{"type":"string","title":"Caller Number"}},"type":"object","required":["caller_number"],"title":"ByCallerWipeRequest"},"ByCallerWipeResponse":{"properties":{"wiped_calls":{"type":"integer","title":"Wiped Calls"},"caller_number":{"type":"string","title":"Caller Number"}},"type":"object","required":["wiped_calls","caller_number"],"title":"ByCallerWipeResponse"},"CacheInvalidateResponse":{"properties":{"deleted":{"type":"integer","title":"Deleted"}},"type":"object","required":["deleted"],"title":"CacheInvalidateResponse"},"CacheLookupRequest":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"question":{"type":"string","title":"Question"}},"type":"object","required":["tenant_id","question"],"title":"CacheLookupRequest"},"CacheLookupResponse":{"properties":{"hit":{"type":"boolean","title":"Hit"},"answer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Answer"},"cache_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cache Id"}},"type":"object","required":["hit"],"title":"CacheLookupResponse"},"CacheStoreRequest":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"question":{"type":"string","title":"Question"},"answer":{"type":"string","title":"Answer"}},"type":"object","required":["tenant_id","question","answer"],"title":"CacheStoreRequest"},"CacheStoreResponse":{"properties":{"id":{"type":"string","title":"Id"}},"type":"object","required":["id"],"title":"CacheStoreResponse"},"CalendarConfigResponse":{"properties":{"provider":{"type":"string","title":"Provider"},"config":{"additionalProperties":true,"type":"object","title":"Config"}},"type":"object","required":["provider","config"],"title":"CalendarConfigResponse"},"CalendarEntry":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"color":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Color"},"primary":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Primary"}},"type":"object","required":["id","name"],"title":"CalendarEntry"},"CalendarIntegrationResponse":{"properties":{"id":{"type":"string","title":"Id"},"provider":{"type":"string","title":"Provider"},"calendar_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Calendar Email"},"calendar_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Calendar Name"},"status":{"type":"string","title":"Status"},"selected_calendar_ids":{"items":{},"type":"array","title":"Selected Calendar Ids"},"auto_sync":{"type":"boolean","title":"Auto Sync"},"is_primary":{"type":"boolean","title":"Is Primary"},"last_synced_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Synced At"}},"type":"object","required":["id","provider","calendar_email","calendar_name","status","selected_calendar_ids","auto_sync","is_primary","last_synced_at"],"title":"CalendarIntegrationResponse"},"CallCreate":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"twilio_call_sid":{"type":"string","title":"Twilio Call Sid"},"twilio_stream_sid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Twilio Stream Sid"},"caller_number":{"type":"string","title":"Caller Number"},"called_number":{"type":"string","title":"Called Number"},"started_at":{"type":"string","format":"date-time","title":"Started At"},"is_demo":{"type":"boolean","title":"Is Demo","default":false},"is_test":{"type":"boolean","title":"Is Test","default":false},"source":{"type":"string","title":"Source","default":"voice"}},"type":"object","required":["tenant_id","twilio_call_sid","caller_number","called_number","started_at"],"title":"CallCreate","description":"Called by voice engine when a call starts."},"CallDataDeleteResponse":{"properties":{"status":{"type":"string","title":"Status"},"call_id":{"type":"string","title":"Call Id"},"deleted_at":{"type":"string","title":"Deleted At"},"retained":{"items":{"type":"string"},"type":"array","title":"Retained","default":["duration","outcome","timestamps"]}},"type":"object","required":["status","call_id","deleted_at"],"title":"CallDataDeleteResponse"},"CallDetailResponse":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"twilio_call_sid":{"type":"string","title":"Twilio Call Sid"},"caller_number":{"type":"string","title":"Caller Number"},"called_number":{"type":"string","title":"Called Number"},"started_at":{"type":"string","format":"date-time","title":"Started At"},"ended_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ended At"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"},"transfer_duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Transfer Duration Seconds"},"billing_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Billing Minutes"},"status":{"type":"string","title":"Status"},"outcome":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome"},"transferred_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transferred To"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"summary_pl":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary Pl"},"sentiment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sentiment"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"callback_requested":{"type":"boolean","title":"Callback Requested","default":false},"callback_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Callback Message"},"callback_resolved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Callback Resolved At"},"message_left":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message Left"},"recording_available":{"type":"boolean","title":"Recording Available","default":false},"recording_duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Recording Duration Seconds"},"had_error":{"type":"boolean","title":"Had Error","default":false},"detected_language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detected Language"},"language_requested":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language Requested"},"consent_answer_language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Consent Answer Language"},"latency_avg_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Latency Avg Ms"},"latency_p95_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Latency P95 Ms"},"interruptions_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Interruptions Count"},"tool_calls_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tool Calls Count"},"tool_error_count":{"type":"integer","title":"Tool Error Count","default":0},"failed_promises":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Failed Promises"},"stt_cost_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Stt Cost Cents"},"llm_cost_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Llm Cost Cents"},"tts_cost_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tts Cost Cents"},"twilio_cost_cents":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Twilio Cost Cents"},"transcript_turns":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Transcript Turns"},"transcript_state":{"type":"string","title":"Transcript State","default":"none"},"review_allowance":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Review Allowance"},"team_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Team Note"},"recording_sid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recording Sid"}},"type":"object","required":["id","tenant_id","twilio_call_sid","caller_number","called_number","started_at","ended_at","duration_seconds","status","outcome","transferred_to","summary","sentiment","tags","transcript_turns"],"title":"CallDetailResponse"},"CallFlagRequest":{"properties":{"reason":{"type":"string","title":"Reason","default":""}},"type":"object","title":"CallFlagRequest"},"CallFlagResponse":{"properties":{"call_id":{"type":"string","title":"Call Id"},"flagged":{"type":"boolean","title":"Flagged"}},"type":"object","required":["call_id","flagged"],"title":"CallFlagResponse"},"CallFunnel":{"properties":{"range_label":{"type":"string","title":"Range Label"},"range_start":{"type":"string","format":"date-time","title":"Range Start"},"total_calls":{"type":"integer","title":"Total Calls"},"booked":{"type":"integer","title":"Booked"},"faq_resolved":{"type":"integer","title":"Faq Resolved"},"escalated":{"type":"integer","title":"Escalated"},"failed":{"type":"integer","title":"Failed"},"other":{"type":"integer","title":"Other"},"estimated_revenue_grosze":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Estimated Revenue Grosze"},"avg_appointment_value_grosze":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Avg Appointment Value Grosze"}},"type":"object","required":["range_label","range_start","total_calls","booked","faq_resolved","escalated","failed","other","estimated_revenue_grosze","avg_appointment_value_grosze"],"title":"CallFunnel"},"CallListOut":{"properties":{"data":{"items":{"$ref":"#/components/schemas/CallOut"},"type":"array","title":"Data"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"},"has_more":{"type":"boolean","title":"Has More"}},"type":"object","required":["data","limit","offset","has_more"],"title":"CallListOut"},"CallListResponse":{"properties":{"calls":{"items":{"$ref":"#/components/schemas/CallResponse"},"type":"array","title":"Calls"},"total":{"type":"integer","title":"Total"},"review_allowance":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Review Allowance"}},"type":"object","required":["calls","total"],"title":"CallListResponse"},"CallListV2":{"properties":{"data":{"items":{"$ref":"#/components/schemas/CallV2"},"type":"array","title":"Data"},"pagination":{"$ref":"#/components/schemas/src__routers__v2__calls__PaginationMeta"}},"type":"object","required":["data","pagination"],"title":"CallListV2"},"CallOut":{"properties":{"id":{"type":"string","title":"Id"},"created_at":{"type":"string","title":"Created At"},"caller_number":{"type":"string","title":"Caller Number"},"direction":{"type":"string","title":"Direction"},"status":{"type":"string","title":"Status"},"outcome":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"},"sentiment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sentiment"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"had_error":{"type":"boolean","title":"Had Error"}},"type":"object","required":["id","created_at","caller_number","direction","status","outcome","duration_seconds","sentiment","summary","had_error"],"title":"CallOut"},"CallResponse":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"twilio_call_sid":{"type":"string","title":"Twilio Call Sid"},"caller_number":{"type":"string","title":"Caller Number"},"called_number":{"type":"string","title":"Called Number"},"started_at":{"type":"string","format":"date-time","title":"Started At"},"ended_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ended At"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"},"transfer_duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Transfer Duration Seconds"},"billing_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Billing Minutes"},"status":{"type":"string","title":"Status"},"outcome":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome"},"transferred_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transferred To"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"summary_pl":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary Pl"},"sentiment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sentiment"},"tags":{"items":{"type":"string"},"type":"array","title":"Tags"},"callback_requested":{"type":"boolean","title":"Callback Requested","default":false},"callback_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Callback Message"},"callback_resolved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Callback Resolved At"},"message_left":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message Left"},"recording_available":{"type":"boolean","title":"Recording Available","default":false},"recording_duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Recording Duration Seconds"},"had_error":{"type":"boolean","title":"Had Error","default":false},"detected_language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detected Language"},"language_requested":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language Requested"},"consent_answer_language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Consent Answer Language"}},"type":"object","required":["id","tenant_id","twilio_call_sid","caller_number","called_number","started_at","ended_at","duration_seconds","status","outcome","transferred_to","summary","sentiment","tags"],"title":"CallResponse"},"CallStats":{"properties":{"total_calls":{"type":"integer","title":"Total Calls"},"total_minutes":{"type":"integer","title":"Total Minutes"},"avg_duration_seconds":{"type":"number","title":"Avg Duration Seconds"},"completed_calls":{"type":"integer","title":"Completed Calls"},"transferred_calls":{"type":"integer","title":"Transferred Calls"},"failed_calls":{"type":"integer","title":"Failed Calls"},"top_outcomes":{"additionalProperties":{"type":"integer"},"type":"object","title":"Top Outcomes"},"sentiment_breakdown":{"additionalProperties":{"type":"integer"},"type":"object","title":"Sentiment Breakdown"},"booked_appointments":{"type":"integer","title":"Booked Appointments","default":0},"questions_resolved":{"type":"integer","title":"Questions Resolved","default":0},"handed_to_you":{"type":"integer","title":"Handed To You","default":0}},"type":"object","required":["total_calls","total_minutes","avg_duration_seconds","completed_calls","transferred_calls","failed_calls","top_outcomes","sentiment_breakdown"],"title":"CallStats"},"CallUpdate":{"properties":{"ended_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ended At"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"outcome":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome"},"transferred_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transferred To"},"latency_avg_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Latency Avg Ms"},"latency_p95_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Latency P95 Ms"},"interruptions_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Interruptions Count"},"tool_calls_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tool Calls Count"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"summary_pl":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary Pl"},"sentiment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sentiment"},"tags":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Tags"},"callback_requested":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Callback Requested"},"callback_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Callback Message"},"message_left":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message Left"},"had_error":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Had Error"},"tool_error_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tool Error Count"},"failed_promises":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Failed Promises"},"language_requested":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language Requested"},"detected_language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detected Language"},"consent_answer_language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Consent Answer Language"},"recording_consent":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Recording Consent"},"recording_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recording Url"},"recording_sid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recording Sid"},"recording_available":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Recording Available"},"recording_duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Recording Duration Seconds"}},"type":"object","title":"CallUpdate","description":"Called by voice engine when a call ends or consent is logged."},"CallUsageCreate":{"properties":{"stt_duration_seconds":{"type":"integer","title":"Stt Duration Seconds","default":0},"llm_input_tokens":{"type":"integer","title":"Llm Input Tokens","default":0},"llm_output_tokens":{"type":"integer","title":"Llm Output Tokens","default":0},"tts_chars":{"type":"integer","title":"Tts Chars","default":0},"twilio_duration_seconds":{"type":"integer","title":"Twilio Duration Seconds","default":0},"elevenlabs_chars":{"type":"integer","title":"Elevenlabs Chars","default":0},"deepgram_seconds":{"type":"integer","title":"Deepgram Seconds","default":0},"gemini_tokens":{"type":"integer","title":"Gemini Tokens","default":0},"twilio_minutes":{"type":"number","title":"Twilio Minutes","default":0.0}},"type":"object","title":"CallUsageCreate"},"CallUsageResponse":{"properties":{"call_id":{"type":"string","title":"Call Id"},"stt_duration_seconds":{"type":"integer","title":"Stt Duration Seconds"},"stt_cost_cents":{"type":"integer","title":"Stt Cost Cents"},"llm_input_tokens":{"type":"integer","title":"Llm Input Tokens"},"llm_output_tokens":{"type":"integer","title":"Llm Output Tokens"},"llm_cost_cents":{"type":"integer","title":"Llm Cost Cents"},"tts_chars":{"type":"integer","title":"Tts Chars"},"tts_cost_cents":{"type":"integer","title":"Tts Cost Cents"},"twilio_duration_seconds":{"type":"integer","title":"Twilio Duration Seconds"},"twilio_cost_cents":{"type":"integer","title":"Twilio Cost Cents"},"total_cost_cents":{"type":"integer","title":"Total Cost Cents"}},"type":"object","required":["call_id","stt_duration_seconds","stt_cost_cents","llm_input_tokens","llm_output_tokens","llm_cost_cents","tts_chars","tts_cost_cents","twilio_duration_seconds","twilio_cost_cents","total_cost_cents"],"title":"CallUsageResponse"},"CallV2":{"properties":{"id":{"type":"string","title":"Id"},"created_at":{"type":"string","title":"Created At","description":"ISO-8601 UTC timestamp"},"caller_number":{"type":"string","title":"Caller Number"},"direction":{"type":"string","title":"Direction"},"status":{"type":"string","title":"Status"},"outcome":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"},"sentiment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sentiment"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"had_error":{"type":"boolean","title":"Had Error"}},"type":"object","required":["id","created_at","caller_number","direction","status","outcome","duration_seconds","sentiment","summary","had_error"],"title":"CallV2"},"CallbackRequest":{"properties":{"phone":{"type":"string","maxLength":20,"minLength":9,"pattern":"^[+\\d][\\d\\s\\-()]{8,19}$","title":"Phone"},"name":{"type":"string","maxLength":120,"title":"Name","default":""},"language":{"type":"string","title":"Language","default":"pl"},"best_time":{"type":"string","maxLength":80,"title":"Best Time","default":""},"source":{"type":"string","enum":["landing","uruchomienie","onboarding"],"title":"Source","default":"landing"}},"type":"object","required":["phone"],"title":"CallbackRequest"},"CallbackResolveResponse":{"properties":{"call_id":{"type":"string","title":"Call Id"},"resolved_at":{"type":"string","format":"date-time","title":"Resolved At"}},"type":"object","required":["call_id","resolved_at"],"title":"CallbackResolveResponse"},"CallerConsentDetailResponse":{"properties":{"consent_id":{"type":"string","title":"Consent Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"consent_type":{"type":"string","title":"Consent Type"},"logged_at":{"type":"string","title":"Logged At"}},"type":"object","required":["consent_id","tenant_id","consent_type","logged_at"],"title":"CallerConsentDetailResponse"},"CallerConsentRequest":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"caller_phone_hash":{"type":"string","title":"Caller Phone Hash"},"consent_type":{"type":"string","title":"Consent Type"}},"type":"object","required":["tenant_id","caller_phone_hash","consent_type"],"title":"CallerConsentRequest"},"CallerConsentResponse":{"properties":{"consent_id":{"type":"string","title":"Consent Id"},"logged_at":{"type":"string","title":"Logged At"}},"type":"object","required":["consent_id","logged_at"],"title":"CallerConsentResponse"},"CallerNameRequest":{"properties":{"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number"},"phone_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Hash"},"name":{"type":"string","title":"Name"}},"type":"object","required":["name"],"title":"CallerNameRequest"},"CallerNoteRequest":{"properties":{"phone_number":{"type":"string","title":"Phone Number"},"note":{"type":"string","title":"Note"}},"type":"object","required":["phone_number","note"],"title":"CallerNoteRequest"},"CancelBody":{"properties":{"reason":{"type":"string","title":"Reason"},"feedback":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Feedback"},"wants_call":{"type":"boolean","title":"Wants Call","default":false}},"type":"object","required":["reason"],"title":"CancelBody"},"CancellationRequest":{"properties":{"reason":{"type":"string","title":"Reason"},"requested_at_period_end":{"type":"boolean","title":"Requested At Period End","default":true},"early_termination":{"type":"boolean","title":"Early Termination","default":false}},"type":"object","required":["reason"],"title":"CancellationRequest"},"CancellationTier":{"properties":{"hours_before":{"type":"integer","maximum":8760.0,"minimum":0.0,"title":"Hours Before"},"refund_percent":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Refund Percent"}},"type":"object","required":["hours_before","refund_percent"],"title":"CancellationTier","description":"One refund step. Stored untyped as JSON, so the shape is enforced here —\na string \"48\" from a form would crash sorted() in get_active_policy, which\nruns while a deposit is created and would take booking down with it."},"CertificationBody":{"properties":{"items":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Items"}},"type":"object","title":"CertificationBody"},"ChatRequest":{"properties":{"message":{"type":"string","title":"Message"},"locale":{"type":"string","title":"Locale","default":"pl"}},"type":"object","required":["message"],"title":"ChatRequest"},"CheckinDone":{"properties":{"status":{"type":"string","enum":["done","skipped"],"title":"Status","default":"done"},"notes":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Notes"}},"type":"object","title":"CheckinDone"},"ChecklistBody":{"properties":{"items":{"additionalProperties":{"additionalProperties":true,"type":"object"},"type":"object","title":"Items"}},"type":"object","title":"ChecklistBody"},"CheckoutResponse":{"properties":{"checkout_url":{"type":"string","title":"Checkout Url"},"session_id":{"type":"string","title":"Session Id"}},"type":"object","required":["checkout_url","session_id"],"title":"CheckoutResponse"},"CiDeployEventBody":{"properties":{"service":{"type":"string","title":"Service"},"deploy_sha":{"type":"string","title":"Deploy Sha"},"revision":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Revision"}},"type":"object","required":["service","deploy_sha"],"title":"CiDeployEventBody"},"CiIncidentBody":{"properties":{"title":{"type":"string","title":"Title"},"severity":{"type":"string","title":"Severity","default":"major_outage"},"affected_components":{"items":{"type":"string"},"type":"array","title":"Affected Components"},"message_pl":{"type":"string","title":"Message Pl"},"message_en":{"type":"string","title":"Message En"},"deploy_sha":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deploy Sha"},"auto_opened":{"type":"boolean","title":"Auto Opened","default":true}},"type":"object","required":["title","affected_components","message_pl","message_en"],"title":"CiIncidentBody"},"CiResolveBody":{"properties":{"component":{"type":"string","title":"Component"},"message_pl":{"type":"string","title":"Message Pl","default":"Incydent rozwiązany. Wszystkie systemy działają normalnie."},"message_en":{"type":"string","title":"Message En","default":"Incident resolved. All systems operating normally."}},"type":"object","required":["component"],"title":"CiResolveBody"},"ClassifyIn":{"properties":{"text":{"type":"string","maxLength":2000,"minLength":1,"title":"Text"}},"type":"object","required":["text"],"title":"ClassifyIn"},"ClientErrorReport":{"properties":{"message":{"type":"string","maxLength":2000,"minLength":1,"title":"Message"},"stack":{"type":"string","maxLength":8000,"title":"Stack","default":""},"route":{"type":"string","maxLength":500,"title":"Route","default":""},"request_id":{"type":"string","maxLength":100,"title":"Request Id","default":""},"severity":{"type":"string","enum":["info","warning","error","critical"],"title":"Severity","default":"error"},"source":{"type":"string","enum":["boundary","unhandled","promise","fetch","client"],"title":"Source","default":"client"},"sentry_event_id":{"type":"string","maxLength":64,"title":"Sentry Event Id","default":""},"user_agent":{"type":"string","maxLength":500,"title":"User Agent","default":""},"context":{"additionalProperties":true,"type":"object","title":"Context"}},"type":"object","required":["message"],"title":"ClientErrorReport"},"CloneVoiceResponse":{"properties":{"voice_id":{"type":"string","title":"Voice Id"},"status":{"type":"string","title":"Status"},"name":{"type":"string","title":"Name"}},"type":"object","required":["voice_id","status","name"],"title":"CloneVoiceResponse"},"CommentIn":{"properties":{"body":{"type":"string","maxLength":2000,"minLength":1,"title":"Body"}},"type":"object","required":["body"],"title":"CommentIn"},"CompMinutesRequest":{"properties":{"minutes":{"type":"integer","title":"Minutes"},"reason":{"type":"string","title":"Reason"},"period":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period"},"notify":{"type":"boolean","title":"Notify","default":true}},"type":"object","required":["minutes","reason"],"title":"CompMinutesRequest"},"CompMinutesResponse":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"minutes_granted":{"type":"integer","title":"Minutes Granted"},"minutes_purchased_before":{"type":"integer","title":"Minutes Purchased Before"},"minutes_purchased_after":{"type":"integer","title":"Minutes Purchased After"},"minutes_limit":{"type":"integer","title":"Minutes Limit"},"period":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Period"},"already_granted":{"type":"boolean","title":"Already Granted"},"notified_in_app":{"type":"boolean","title":"Notified In App"},"notified_email":{"type":"boolean","title":"Notified Email"}},"type":"object","required":["tenant_id","minutes_granted","minutes_purchased_before","minutes_purchased_after","minutes_limit","period","already_granted","notified_in_app","notified_email"],"title":"CompMinutesResponse"},"ComplianceSignal":{"properties":{"key":{"type":"string","title":"Key"},"label":{"type":"string","title":"Label"},"status":{"type":"string","title":"Status"},"detail":{"type":"string","title":"Detail"},"params":{"additionalProperties":true,"type":"object","title":"Params","default":{}}},"type":"object","required":["key","label","status","detail"],"title":"ComplianceSignal"},"ComplianceSummary":{"properties":{"generated_at":{"type":"string","title":"Generated At"},"ai_act_applies_from":{"type":"string","title":"Ai Act Applies From","default":"2026-08-02"},"signals":{"items":{"$ref":"#/components/schemas/ComplianceSignal"},"type":"array","title":"Signals"},"consent_total":{"type":"integer","title":"Consent Total"},"dsar_open":{"type":"integer","title":"Dsar Open"},"dsar_oldest_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Dsar Oldest Days"},"sub_processor_count":{"type":"integer","title":"Sub Processor Count"},"retention_last_run":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Retention Last Run"}},"type":"object","required":["generated_at","signals","consent_total","dsar_open","dsar_oldest_days","sub_processor_count","retention_last_run"],"title":"ComplianceSummary"},"ComponentHealthResponse":{"properties":{"name":{"type":"string","title":"Name"},"status":{"type":"string","title":"Status"},"latency_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Latency Ms"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["name","status"],"title":"ComponentHealthResponse"},"ComponentUptimeDTO":{"properties":{"component":{"type":"string","title":"Component"},"days":{"items":{"$ref":"#/components/schemas/UptimeDayDTO"},"type":"array","title":"Days"}},"type":"object","required":["component","days"],"title":"ComponentUptimeDTO"},"ConciergeOk":{"properties":{"ok":{"type":"boolean","title":"Ok"},"message":{"type":"string","title":"Message"}},"type":"object","required":["ok","message"],"title":"ConciergeOk"},"ConfirmIn":{"properties":{"start_time":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Start Time"}},"type":"object","title":"ConfirmIn"},"ConfirmPayoutChangeRequest":{"properties":{"code":{"type":"string","title":"Code"}},"type":"object","required":["code"],"title":"ConfirmPayoutChangeRequest"},"ConnectionSettingsIn":{"properties":{"selected_calendar_ids":{"anyOf":[{"items":{"type":"string"},"type":"array","maxItems":30},{"type":"null"}],"title":"Selected Calendar Ids"},"write_calendar_id":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Write Calendar Id"},"blocks_time":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Blocks Time"},"writes_visits":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Writes Visits"}},"type":"object","title":"ConnectionSettingsIn"},"ConsentIn":{"properties":{"channel":{"type":"string","title":"Channel"},"address":{"type":"string","maxLength":255,"title":"Address"}},"type":"object","required":["channel","address"],"title":"ConsentIn"},"ConsentRecord":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"tenant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Name"},"consent_type":{"type":"string","title":"Consent Type"},"granted":{"type":"boolean","title":"Granted"},"granted_at":{"type":"string","format":"date-time","title":"Granted At"},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Revoked At"},"ip_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ip Address"}},"type":"object","required":["id","tenant_id","tenant_name","consent_type","granted","granted_at","revoked_at","ip_address"],"title":"ConsentRecord"},"ConsentRequest":{"properties":{"legal_basis_code":{"type":"string","title":"Legal Basis Code"},"sensitive_columns_detected":{"items":{"type":"string"},"type":"array","title":"Sensitive Columns Detected"},"locale":{"type":"string","title":"Locale","default":"pl"}},"type":"object","required":["legal_basis_code","sensitive_columns_detected"],"title":"ConsentRequest"},"ConsentResponse":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"consent_type":{"type":"string","title":"Consent Type"},"granted":{"type":"boolean","title":"Granted"},"granted_at":{"type":"string","title":"Granted At"},"revoked_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Revoked At"},"consent_method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Consent Method"}},"type":"object","required":["id","tenant_id","consent_type","granted","granted_at","revoked_at","consent_method"],"title":"ConsentResponse","description":"Consent record response."},"ConsentStatusResponse":{"properties":{"call_recording":{"type":"boolean","title":"Call Recording"},"analytics":{"type":"boolean","title":"Analytics"},"marketing":{"type":"boolean","title":"Marketing"},"sms_notifications":{"type":"boolean","title":"Sms Notifications"}},"type":"object","required":["call_recording","analytics","marketing","sms_notifications"],"title":"ConsentStatusResponse","description":"Current consent status for all types."},"ConsentsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ConsentRecord"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"type_counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Type Counts"}},"type":"object","required":["items","total","type_counts"],"title":"ConsentsResponse"},"ContactRequest":{"properties":{"name":{"type":"string","title":"Name"},"email":{"type":"string","format":"email","title":"Email"},"reason":{"type":"string","title":"Reason"},"message":{"type":"string","title":"Message"},"language":{"type":"string","title":"Language","default":"pl"}},"type":"object","required":["name","email","reason","message"],"title":"ContactRequest"},"ConversationPreviewRequest":{"properties":{"greeting":{"type":"string","title":"Greeting"},"faq_question":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Faq Question"},"faq_answer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Faq Answer"},"voice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voice Id"}},"type":"object","required":["greeting"],"title":"ConversationPreviewRequest"},"ConversationPreviewResponse":{"properties":{"turns":{"items":{"$ref":"#/components/schemas/ConversationTurn"},"type":"array","title":"Turns"},"total_duration_estimate_ms":{"type":"integer","title":"Total Duration Estimate Ms"}},"type":"object","required":["turns","total_duration_estimate_ms"],"title":"ConversationPreviewResponse"},"ConversationTurn":{"properties":{"role":{"type":"string","title":"Role"},"text":{"type":"string","title":"Text"},"audio_base64":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Audio Base64"}},"type":"object","required":["role","text"],"title":"ConversationTurn"},"ConversionOut":{"properties":{"id":{"type":"string","title":"Id"},"affiliate_code":{"type":"string","title":"Affiliate Code"},"invitee_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invitee Email"},"status":{"type":"string","title":"Status"},"commission_grosze":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Commission Grosze"},"eligible_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Eligible At"},"paid_out_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paid Out At"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","affiliate_code","invitee_email","status","commission_grosze","eligible_at","paid_out_at","created_at"],"title":"ConversionOut"},"CookieConsentIn":{"properties":{"consent_id":{"type":"string","maxLength":64,"minLength":8,"title":"Consent Id"},"policy_version":{"type":"string","maxLength":20,"title":"Policy Version"},"action":{"type":"string","maxLength":20,"title":"Action"},"analytics":{"type":"boolean","title":"Analytics","default":false},"marketing":{"type":"boolean","title":"Marketing","default":false},"page_url":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Page Url"}},"type":"object","required":["consent_id","policy_version","action"],"title":"CookieConsentIn"},"CostBreakdown":{"properties":{"stt_cost_cents":{"type":"integer","title":"Stt Cost Cents"},"llm_cost_cents":{"type":"integer","title":"Llm Cost Cents"},"tts_cost_cents":{"type":"integer","title":"Tts Cost Cents"},"twilio_cost_cents":{"type":"integer","title":"Twilio Cost Cents"},"total_cost_cents":{"type":"integer","title":"Total Cost Cents"}},"type":"object","required":["stt_cost_cents","llm_cost_cents","tts_cost_cents","twilio_cost_cents","total_cost_cents"],"title":"CostBreakdown"},"CostSummaryResponse":{"properties":{"today":{"$ref":"#/components/schemas/CostBreakdown"},"this_month":{"$ref":"#/components/schemas/CostBreakdown"},"revenue_this_month_grosze":{"type":"integer","title":"Revenue This Month Grosze"},"margin_pct":{"type":"number","title":"Margin Pct"},"calls_today":{"type":"integer","title":"Calls Today"},"calls_this_month":{"type":"integer","title":"Calls This Month"},"avg_cost_per_call_cents":{"type":"number","title":"Avg Cost Per Call Cents"},"top_cost_tenants":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Top Cost Tenants"}},"type":"object","required":["today","this_month","revenue_this_month_grosze","margin_pct","calls_today","calls_this_month","avg_cost_per_call_cents","top_cost_tenants"],"title":"CostSummaryResponse"},"CouponListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/CouponResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"CouponListResponse"},"CouponResponse":{"properties":{"id":{"type":"string","title":"Id"},"promo_code":{"type":"string","title":"Promo Code"},"plan":{"type":"string","title":"Plan"},"percent_off":{"type":"integer","title":"Percent Off"},"duration_months":{"type":"integer","title":"Duration Months"},"max_redemptions":{"type":"integer","title":"Max Redemptions"},"times_redeemed":{"type":"integer","title":"Times Redeemed"},"active":{"type":"boolean","title":"Active"},"created_at":{"type":"string","title":"Created At"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"coupon_type":{"type":"string","title":"Coupon Type","default":"one_time"}},"type":"object","required":["id","promo_code","plan","percent_off","duration_months","max_redemptions","times_redeemed","active","created_at"],"title":"CouponResponse"},"CreateAccountBody":{"properties":{"plan":{"type":"string","enum":["solo","starter","business"],"title":"Plan","default":"starter"},"billing_cycle":{"type":"string","enum":["monthly","annual"],"title":"Billing Cycle","default":"annual"},"option":{"type":"string","enum":["self","phone","onsite"],"title":"Option","default":"phone"}},"type":"object","title":"CreateAccountBody"},"CreateCheckoutRequest":{"properties":{"resource_type":{"type":"string","title":"Resource Type"},"quantity":{"type":"integer","title":"Quantity"},"success_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Success Url"},"cancel_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cancel Url"}},"type":"object","required":["resource_type","quantity"],"title":"CreateCheckoutRequest"},"CreateCouponRequest":{"properties":{"plan":{"type":"string","title":"Plan"},"duration_months":{"type":"integer","title":"Duration Months","default":1},"max_redemptions":{"type":"integer","title":"Max Redemptions","default":1},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"coupon_type":{"type":"string","title":"Coupon Type","default":"one_time"}},"type":"object","required":["plan"],"title":"CreateCouponRequest"},"CriticalSignal":{"properties":{"key":{"type":"string","title":"Key"},"severity":{"type":"string","title":"Severity"},"label":{"type":"string","title":"Label"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail"},"href":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Href"},"count":{"type":"integer","title":"Count","default":0},"params":{"additionalProperties":true,"type":"object","title":"Params","default":{}}},"type":"object","required":["key","severity","label"],"title":"CriticalSignal","description":"One operator-actionable signal. Severity drives row color on the\noverview triage panel: critical=red, warning=amber, info=gray, ok=emerald."},"CriticalSignalsResponse":{"properties":{"signals":{"items":{"$ref":"#/components/schemas/CriticalSignal"},"type":"array","title":"Signals"},"fetched_at":{"type":"string","format":"date-time","title":"Fetched At"}},"type":"object","required":["signals","fetched_at"],"title":"CriticalSignalsResponse"},"CrmConfigRequest":{"properties":{"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"api_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Key"},"api_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Url"}},"type":"object","title":"CrmConfigRequest"},"DPAResponse":{"properties":{"text":{"type":"string","title":"Text"},"tenant_name":{"type":"string","title":"Tenant Name"},"generated_at":{"type":"string","title":"Generated At"},"sub_processors":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Sub Processors"}},"type":"object","required":["text","tenant_name","generated_at","sub_processors"],"title":"DPAResponse"},"DailyInsight":{"properties":{"type":{"type":"string","title":"Type"},"greeting":{"type":"string","title":"Greeting"},"headline":{"type":"string","title":"Headline"},"body":{"type":"string","title":"Body"},"metric":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Metric"},"cta":{"anyOf":[{"$ref":"#/components/schemas/InsightCta"},{"type":"null"}]}},"type":"object","required":["type","greeting","headline","body"],"title":"DailyInsight"},"DataExportResponse":{"properties":{"tenant":{"additionalProperties":true,"type":"object","title":"Tenant"},"phone_numbers":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Phone Numbers"},"departments":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Departments"},"calls":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Calls"},"calls_pagination":{"additionalProperties":true,"type":"object","title":"Calls Pagination"},"appointments":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Appointments"},"caller_profiles":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Caller Profiles"},"consents":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Consents"},"caller_consents":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Caller Consents"},"usage_summary":{"additionalProperties":true,"type":"object","title":"Usage Summary"},"exported_at":{"type":"string","title":"Exported At"}},"type":"object","required":["tenant","phone_numbers","departments","calls","calls_pagination","appointments","caller_profiles","consents","caller_consents","usage_summary","exported_at"],"title":"DataExportResponse","description":"GDPR Art. 20 - Data portability response."},"DataSourceCreate":{"properties":{"name":{"type":"string","title":"Name"},"purpose":{"type":"string","title":"Purpose"},"type":{"type":"string","title":"Type","default":"google_sheets"},"sheet_id":{"type":"string","title":"Sheet Id","default":""},"sheet_name":{"type":"string","title":"Sheet Name","default":"Sheet1"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"ai_access":{"type":"boolean","title":"Ai Access","default":true},"department_scope":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Department Scope"},"cross_reference_allowed":{"type":"boolean","title":"Cross Reference Allowed","default":true},"import_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Import Id"},"auth_mode":{"type":"string","title":"Auth Mode","default":"service_account"}},"type":"object","required":["name","purpose"],"title":"DataSourceCreate"},"DataSourceResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"purpose":{"type":"string","title":"Purpose"},"type":{"type":"string","title":"Type"},"sheet_id":{"type":"string","title":"Sheet Id"},"sheet_name":{"type":"string","title":"Sheet Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"ai_access":{"type":"boolean","title":"Ai Access"},"is_active":{"type":"boolean","title":"Is Active"},"department_scope":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Department Scope"},"cross_reference_allowed":{"type":"boolean","title":"Cross Reference Allowed"},"auth_mode":{"type":"string","title":"Auth Mode","default":"service_account"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","name","purpose","type","sheet_id","sheet_name","description","ai_access","is_active","department_scope","cross_reference_allowed","created_at"],"title":"DataSourceResponse"},"DataSourceUpdate":{"properties":{"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"purpose":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Purpose"},"sheet_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sheet Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"ai_access":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Ai Access"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"},"department_scope":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Department Scope"},"cross_reference_allowed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Cross Reference Allowed"}},"type":"object","title":"DataSourceUpdate"},"DataSubjectRequestPayload":{"properties":{"tenant_id":{"anyOf":[{"type":"string","maxLength":64,"minLength":8},{"type":"null"}],"title":"Tenant Id"},"called_number":{"anyOf":[{"type":"string","maxLength":20,"minLength":6},{"type":"null"}],"title":"Called Number"},"phone":{"type":"string","maxLength":20,"minLength":4,"title":"Phone"},"request_type":{"type":"string","enum":["access","rectification","erasure","restriction","objection"],"title":"Request Type"},"description":{"type":"string","maxLength":2000,"title":"Description","default":""},"contact_email":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Contact Email"}},"type":"object","required":["phone","request_type"],"title":"DataSubjectRequestPayload"},"DataSubjectRequestResponse":{"properties":{"ticket_id":{"type":"string","title":"Ticket Id"},"status":{"type":"string","title":"Status"},"message_pl":{"type":"string","title":"Message Pl"},"message_en":{"type":"string","title":"Message En"},"request_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Request Id"}},"type":"object","required":["ticket_id","status","message_pl","message_en"],"title":"DataSubjectRequestResponse"},"DataSubjectVerifyPayload":{"properties":{"request_id":{"type":"string","maxLength":64,"minLength":8,"title":"Request Id"},"code":{"type":"string","maxLength":6,"minLength":6,"pattern":"^\\d{6}$","title":"Code"}},"type":"object","required":["request_id","code"],"title":"DataSubjectVerifyPayload"},"DataSubjectVerifyResponse":{"properties":{"request_id":{"type":"string","title":"Request Id"},"status":{"type":"string","title":"Status"},"message_pl":{"type":"string","title":"Message Pl"},"message_en":{"type":"string","title":"Message En"}},"type":"object","required":["request_id","status","message_pl","message_en"],"title":"DataSubjectVerifyResponse"},"DecisionIn":{"properties":{"approve":{"type":"boolean","title":"Approve"},"note":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Note"}},"type":"object","required":["approve"],"title":"DecisionIn"},"DeclineIn":{"properties":{"note":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Note"}},"type":"object","title":"DeclineIn"},"DeleteAccountRequest":{"properties":{"confirm":{"type":"boolean","title":"Confirm"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["confirm"],"title":"DeleteAccountRequest","description":"Confirmation required for account deletion."},"DeleteMyAccountRequest":{"properties":{"password":{"type":"string","title":"Password"},"confirm":{"type":"boolean","title":"Confirm","default":false}},"type":"object","required":["password"],"title":"DeleteMyAccountRequest"},"DemoAvailabilityResponse":{"properties":{"tz":{"type":"string","title":"Tz"},"days":{"items":{"$ref":"#/components/schemas/DemoDay"},"type":"array","title":"Days"},"degraded":{"type":"boolean","title":"Degraded","default":false}},"type":"object","required":["tz"],"title":"DemoAvailabilityResponse"},"DemoCallDetail":{"properties":{"id":{"type":"string","title":"Id"},"caller_number":{"type":"string","title":"Caller Number"},"started_at":{"type":"string","format":"date-time","title":"Started At"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"},"status":{"type":"string","title":"Status"},"outcome":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome"},"sentiment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sentiment"},"summary_pl":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary Pl"},"callback_requested":{"type":"boolean","title":"Callback Requested"},"follow_up_needed":{"type":"boolean","title":"Follow Up Needed"},"had_error":{"type":"boolean","title":"Had Error"},"call_kind":{"type":"string","title":"Call Kind"},"transcript_turns":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Transcript Turns"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary"},"demo_survey":{"anyOf":[{"$ref":"#/components/schemas/DemoSurvey"},{"type":"null"}]}},"type":"object","required":["id","caller_number","started_at","duration_seconds","status","outcome","sentiment","summary_pl","callback_requested","follow_up_needed","had_error","call_kind","transcript_turns","summary"],"title":"DemoCallDetail"},"DemoCallEntry":{"properties":{"id":{"type":"string","title":"Id"},"caller_number":{"type":"string","title":"Caller Number"},"started_at":{"type":"string","format":"date-time","title":"Started At"},"duration_seconds":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Seconds"},"status":{"type":"string","title":"Status"},"outcome":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome"},"sentiment":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sentiment"},"summary_pl":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Summary Pl"},"callback_requested":{"type":"boolean","title":"Callback Requested"},"follow_up_needed":{"type":"boolean","title":"Follow Up Needed"},"had_error":{"type":"boolean","title":"Had Error"},"call_kind":{"type":"string","title":"Call Kind"}},"type":"object","required":["id","caller_number","started_at","duration_seconds","status","outcome","sentiment","summary_pl","callback_requested","follow_up_needed","had_error","call_kind"],"title":"DemoCallEntry"},"DemoCallRequest":{"properties":{"phone":{"type":"string","maxLength":24,"minLength":6,"title":"Phone"},"vertical":{"type":"string","maxLength":40,"minLength":1,"title":"Vertical"},"business_name":{"type":"string","maxLength":80,"minLength":1,"title":"Business Name"},"consent":{"type":"boolean","title":"Consent","default":false},"turnstile_token":{"anyOf":[{"type":"string","maxLength":4096},{"type":"null"}],"title":"Turnstile Token"},"locale":{"type":"string","pattern":"^(pl|en)$","title":"Locale","default":"pl"}},"type":"object","required":["phone","vertical","business_name"],"title":"DemoCallRequest"},"DemoCallResponse":{"properties":{"success":{"type":"boolean","title":"Success"},"message":{"type":"string","title":"Message"}},"type":"object","required":["success","message"],"title":"DemoCallResponse"},"DemoCallsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DemoCallEntry"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"},"kind_counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Kind Counts"}},"type":"object","required":["items","total","limit","offset","kind_counts"],"title":"DemoCallsResponse"},"DemoDay":{"properties":{"date":{"type":"string","title":"Date"},"weekday":{"type":"string","title":"Weekday"},"slots":{"items":{"$ref":"#/components/schemas/DemoSlot"},"type":"array","title":"Slots"}},"type":"object","required":["date","weekday","slots"],"title":"DemoDay"},"DemoFollowUpRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"name":{"type":"string","title":"Name","default":""},"caller_number":{"type":"string","title":"Caller Number","default":""}},"type":"object","required":["email"],"title":"DemoFollowUpRequest"},"DemoIn":{"properties":{"slot_start":{"type":"string","format":"date-time","title":"Slot Start"},"mode":{"type":"string","title":"Mode","default":"online"}},"type":"object","required":["slot_start"],"title":"DemoIn"},"DemoLeadRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"business_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Name"},"business_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Type"},"voice":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voice","default":"female"},"utm_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Utm Source","default":"web_demo"},"consent":{"type":"boolean","title":"Consent","default":false}},"type":"object","required":["email"],"title":"DemoLeadRequest"},"DemoPatch":{"properties":{"slot_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Slot Start"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"outcome":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outcome"},"outcome_note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Outcome Note"}},"type":"object","title":"DemoPatch"},"DemoSlot":{"properties":{"iso":{"type":"string","title":"Iso"},"time":{"type":"string","title":"Time"}},"type":"object","required":["iso","time"],"title":"DemoSlot"},"DemoSurvey":{"properties":{"business_type":{"type":"string","title":"Business Type","default":""},"calls_per_week":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Calls Per Week"},"pain_point":{"type":"string","title":"Pain Point","default":""},"recommended_plan":{"type":"string","title":"Recommended Plan","default":"unknown"},"interest_level":{"type":"string","title":"Interest Level","default":"unknown"},"objections_raised":{"items":{"type":"string"},"type":"array","title":"Objections Raised","default":[]},"sms_sent":{"type":"boolean","title":"Sms Sent","default":false},"email_sent":{"type":"boolean","title":"Email Sent","default":false},"language":{"type":"string","title":"Language","default":"pl"}},"type":"object","title":"DemoSurvey"},"DepartmentCreate":{"properties":{"name":{"type":"string","title":"Name"},"phone":{"type":"string","title":"Phone"},"keywords":{"items":{"type":"string"},"type":"array","title":"Keywords","default":[]},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"priority":{"type":"integer","title":"Priority","default":0},"is_default":{"type":"boolean","title":"Is Default","default":false},"business_hours":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Business Hours"},"voicemail_enabled":{"type":"boolean","title":"Voicemail Enabled","default":false},"voicemail_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voicemail Message"},"calendar_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Calendar Id"}},"type":"object","required":["name","phone"],"title":"DepartmentCreate"},"DepartmentResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"phone":{"type":"string","title":"Phone"},"keywords":{"items":{"type":"string"},"type":"array","title":"Keywords"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"business_hours":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Business Hours"},"voicemail_enabled":{"type":"boolean","title":"Voicemail Enabled"},"voicemail_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voicemail Message"},"priority":{"type":"integer","title":"Priority"},"is_default":{"type":"boolean","title":"Is Default"},"calendar_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Calendar Id"},"is_active":{"type":"boolean","title":"Is Active","default":true}},"type":"object","required":["id","name","phone","keywords","description","business_hours","voicemail_enabled","voicemail_message","priority","is_default"],"title":"DepartmentResponse"},"DepositBadge":{"properties":{"status":{"type":"string","title":"Status"},"amount_pln":{"type":"number","title":"Amount Pln"},"paid_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paid At"}},"type":"object","required":["status","amount_pln"],"title":"DepositBadge"},"DepositConfigUpdate":{"properties":{"require_deposit":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Require Deposit"},"deposit_amount_grosze":{"anyOf":[{"type":"integer","maximum":200000.0,"minimum":200.0},{"type":"null"}],"title":"Deposit Amount Grosze"},"hold_minutes":{"anyOf":[{"type":"integer","maximum":1440.0,"minimum":30.0},{"type":"null"}],"title":"Hold Minutes"}},"type":"object","title":"DepositConfigUpdate"},"DepositListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/DepositRecord"},"type":"array","title":"Items"},"total_paid_grosze":{"type":"integer","title":"Total Paid Grosze"},"total_pending_grosze":{"type":"integer","title":"Total Pending Grosze"},"paid_count":{"type":"integer","title":"Paid Count"},"expired_count":{"type":"integer","title":"Expired Count"}},"type":"object","required":["items","total_paid_grosze","total_pending_grosze","paid_count","expired_count"],"title":"DepositListResponse"},"DepositListV2":{"properties":{"data":{"items":{"$ref":"#/components/schemas/DepositV2"},"type":"array","title":"Data"},"pagination":{"$ref":"#/components/schemas/src__routers__v2__deposits__PaginationMeta"}},"type":"object","required":["data","pagination"],"title":"DepositListV2"},"DepositRecord":{"properties":{"id":{"type":"string","title":"Id"},"appointment_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Appointment Id"},"order_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Order Id"},"amount_grosze":{"type":"integer","title":"Amount Grosze"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","title":"Created At"},"paid_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paid At"},"expires_at":{"type":"string","title":"Expires At"}},"type":"object","required":["id","amount_grosze","status","created_at","paid_at","expires_at"],"title":"DepositRecord"},"DepositRefundOutcome":{"properties":{"refunded":{"type":"boolean","title":"Refunded","default":false},"forfeited":{"type":"boolean","title":"Forfeited","default":false},"amount_pln":{"type":"number","title":"Amount Pln","default":0.0},"percent":{"type":"integer","title":"Percent","default":0}},"type":"object","title":"DepositRefundOutcome","description":"What the cancellation policy did with the deposit."},"DepositStatusResponse":{"properties":{"feature_available":{"type":"boolean","title":"Feature Available"},"enabled":{"type":"boolean","title":"Enabled"},"require_deposit":{"type":"boolean","title":"Require Deposit"},"deposit_amount_grosze":{"type":"integer","title":"Deposit Amount Grosze"},"hold_minutes":{"type":"integer","title":"Hold Minutes"},"onboarding_status":{"type":"string","title":"Onboarding Status"},"requirements":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Requirements","default":[]},"requirements_deadline":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Requirements Deadline"},"disabled_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Disabled Reason"},"charges_enabled":{"type":"boolean","title":"Charges Enabled"},"payouts_enabled":{"type":"boolean","title":"Payouts Enabled"},"ready":{"type":"boolean","title":"Ready"}},"type":"object","required":["feature_available","enabled","require_deposit","deposit_amount_grosze","hold_minutes","onboarding_status","charges_enabled","payouts_enabled","ready"],"title":"DepositStatusResponse"},"DepositV2":{"properties":{"id":{"type":"string","title":"Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"subject_type":{"type":"string","title":"Subject Type","description":"appointment | order"},"appointment_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Appointment Id"},"order_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Order Id"},"amount_grosze":{"type":"integer","title":"Amount Grosze"},"currency":{"type":"string","title":"Currency"},"status":{"type":"string","title":"Status","description":"pending | paid | expired | refunded | disputed"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"paid_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Paid At"},"refunded_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Refunded At"}},"type":"object","required":["id","created_at","subject_type","appointment_id","order_id","amount_grosze","currency","status","expires_at","paid_at","refunded_at"],"title":"DepositV2"},"DisableRequest":{"properties":{"code":{"type":"string","title":"Code"}},"type":"object","required":["code"],"title":"DisableRequest"},"DispatchJobCreate":{"properties":{"problem":{"type":"string","maxLength":500,"minLength":1,"title":"Problem"},"urgency":{"type":"string","title":"Urgency","default":"now"},"service_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Service Name"},"location":{"additionalProperties":true,"type":"object","title":"Location"},"caller_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caller Number"},"caller_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caller Name"},"call_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Id"}},"type":"object","required":["problem"],"title":"DispatchJobCreate"},"DispatchJobCreated":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"call_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Id"},"status":{"type":"string","title":"Status"},"urgency":{"type":"string","title":"Urgency"},"problem":{"type":"string","title":"Problem"},"service_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Service Name"},"location":{"additionalProperties":true,"type":"object","title":"Location"},"caller_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caller Number"},"caller_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caller Name"},"eta_min_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Eta Min Minutes"},"eta_max_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Eta Max Minutes"},"price_from_grosze":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Price From Grosze"},"surcharge_percent":{"type":"integer","title":"Surcharge Percent"},"assigned_contact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned Contact"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"accepted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Accepted At"},"en_route_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"En Route At"},"done_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Done At"},"callback_minutes":{"type":"integer","title":"Callback Minutes"},"accept_minutes":{"type":"integer","title":"Accept Minutes"},"contact_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Phone"},"emergency_first":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Emergency First"}},"type":"object","required":["id","tenant_id","call_id","status","urgency","problem","service_name","location","caller_number","caller_name","eta_min_minutes","eta_max_minutes","price_from_grosze","surcharge_percent","assigned_contact","created_at","accepted_at","en_route_at","done_at","callback_minutes","accept_minutes","contact_phone","emergency_first"],"title":"DispatchJobCreated"},"DispatchJobOut":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"call_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Id"},"status":{"type":"string","title":"Status"},"urgency":{"type":"string","title":"Urgency"},"problem":{"type":"string","title":"Problem"},"service_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Service Name"},"location":{"additionalProperties":true,"type":"object","title":"Location"},"caller_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caller Number"},"caller_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caller Name"},"eta_min_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Eta Min Minutes"},"eta_max_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Eta Max Minutes"},"price_from_grosze":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Price From Grosze"},"surcharge_percent":{"type":"integer","title":"Surcharge Percent"},"assigned_contact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned Contact"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"accepted_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Accepted At"},"en_route_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"En Route At"},"done_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Done At"}},"type":"object","required":["id","tenant_id","call_id","status","urgency","problem","service_name","location","caller_number","caller_name","eta_min_minutes","eta_max_minutes","price_from_grosze","surcharge_percent","assigned_contact","created_at","accepted_at","en_route_at","done_at"],"title":"DispatchJobOut"},"DispatchJobUpdate":{"properties":{"status":{"type":"string","title":"Status"},"assigned_contact":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned Contact"}},"type":"object","required":["status"],"title":"DispatchJobUpdate"},"DisputeRecord":{"properties":{"id":{"type":"string","title":"Id"},"appointment_id":{"type":"string","title":"Appointment Id"},"amount_grosze":{"type":"integer","title":"Amount Grosze"},"patient_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Patient Name"},"service_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Service Type"},"created_at":{"type":"string","title":"Created At"},"appointment_date":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Appointment Date"}},"type":"object","required":["id","appointment_id","amount_grosze","created_at"],"title":"DisputeRecord"},"DocumentAiAccessRequest":{"properties":{"ai_access":{"type":"boolean","title":"Ai Access"}},"type":"object","required":["ai_access"],"title":"DocumentAiAccessRequest"},"DocumentDepartmentRequest":{"properties":{"department_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Department Id"}},"type":"object","title":"DocumentDepartmentRequest"},"DocumentResponse":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"file_type":{"type":"string","title":"File Type"},"file_size_bytes":{"type":"integer","title":"File Size Bytes"},"chunk_count":{"type":"integer","title":"Chunk Count"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","title":"Created At"},"text_preview":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text Preview"},"extracted_faq":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Extracted Faq"},"error_detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Detail"},"version":{"type":"integer","title":"Version","default":1},"ai_access":{"type":"boolean","title":"Ai Access","default":true},"department_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Department Id"}},"type":"object","required":["id","name","file_type","file_size_bytes","chunk_count","status","created_at"],"title":"DocumentResponse"},"DocumentV2":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"status":{"type":"string","title":"Status"},"chunk_count":{"type":"integer","title":"Chunk Count"},"created_at":{"type":"string","title":"Created At"},"text_preview":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text Preview"}},"type":"object","required":["id","name","status","chunk_count","created_at","text_preview"],"title":"DocumentV2"},"DocumentVersionResponse":{"properties":{"version":{"type":"integer","title":"Version"},"name":{"type":"string","title":"Name"},"file_type":{"type":"string","title":"File Type"},"file_size_bytes":{"type":"integer","title":"File Size Bytes"},"chunk_count":{"type":"integer","title":"Chunk Count"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["version","name","file_type","file_size_bytes","chunk_count","created_at"],"title":"DocumentVersionResponse"},"EmailChangeConfirm":{"properties":{"code":{"type":"string","maxLength":6,"minLength":6,"title":"Code"}},"type":"object","required":["code"],"title":"EmailChangeConfirm"},"EmailChangeRequest":{"properties":{"new_email":{"type":"string","format":"email","title":"New Email"},"password":{"type":"string","title":"Password"}},"type":"object","required":["new_email","password"],"title":"EmailChangeRequest"},"ErrorSupportTicketRequest":{"properties":{"message":{"type":"string","maxLength":2000,"title":"Message","default":""},"route":{"type":"string","maxLength":500,"title":"Route","default":""},"request_id":{"type":"string","maxLength":100,"title":"Request Id","default":""},"severity":{"type":"string","enum":["info","warning","error","critical"],"title":"Severity","default":"error"},"sentry_event_id":{"type":"string","maxLength":64,"title":"Sentry Event Id","default":""},"user_agent":{"type":"string","maxLength":500,"title":"User Agent","default":""},"note":{"type":"string","maxLength":2000,"title":"Note","default":""},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email"},"locale":{"type":"string","enum":["pl","en"],"title":"Locale","default":"pl"},"turnstile_token":{"anyOf":[{"type":"string","maxLength":4096},{"type":"null"}],"title":"Turnstile Token"},"company_website":{"type":"string","maxLength":200,"title":"Company Website","default":""}},"type":"object","title":"ErrorSupportTicketRequest"},"ExtractFaqFromFileResponse":{"properties":{"pairs":{"additionalProperties":{"type":"string"},"type":"object","title":"Pairs"},"total_found":{"type":"integer","title":"Total Found","default":0},"truncated":{"type":"boolean","title":"Truncated","default":false}},"type":"object","required":["pairs"],"title":"ExtractFaqFromFileResponse","description":"Stateless FAQ extraction result — pairs only, no stored document.\n\ntotal_found > len(pairs) means the plan cap trimmed the list (Solo/Trial\nkeep the first 5) — the dashboard shows a Pro upsell for the rest."},"FAQItem":{"properties":{"question":{"type":"string","title":"Question"},"answer":{"type":"string","title":"Answer"},"source_url":{"type":"string","title":"Source Url"}},"type":"object","required":["question","answer","source_url"],"title":"FAQItem"},"FailoverActivatedReport":{"properties":{"line_number":{"type":"string","maxLength":25,"minLength":1,"title":"Line Number"},"provider":{"type":"string","maxLength":20,"title":"Provider","default":"voice-engine"},"reason":{"type":"string","maxLength":100,"minLength":1,"title":"Reason"},"tenant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"},"call_control_id":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Call Control Id"}},"type":"object","required":["line_number","reason"],"title":"FailoverActivatedReport","description":"Voice-engine reports that it could not run the AI pipeline for an\ninbound call (answer/streaming command failed) — the carrier-level\nfailover layer is what the caller experiences instead.\n\nWhen ``call_control_id`` is present (Telnyx), the API can still rescue the\ncaller: it resolves the tenant's failover target and issues the Call Control\n``transfer`` itself, then records the REAL outcome. That keeps the transfer\nlogic in one place (failover_service) instead of duplicating carrier calls\nin the voice engine."},"FailoverIncidentEntry":{"properties":{"id":{"type":"string","title":"Id"},"line_number":{"type":"string","title":"Line Number"},"provider":{"type":"string","title":"Provider"},"tenant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"},"tenant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Name"},"reason":{"type":"string","title":"Reason"},"started_at":{"type":"string","format":"date-time","title":"Started At"},"last_activation_at":{"type":"string","format":"date-time","title":"Last Activation At"},"activation_count":{"type":"integer","title":"Activation Count"},"recovered_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Recovered At"}},"type":"object","required":["id","line_number","provider","tenant_id","tenant_name","reason","started_at","last_activation_at","activation_count","recovered_at"],"title":"FailoverIncidentEntry"},"FailoverIncidentsResponse":{"properties":{"incidents":{"items":{"$ref":"#/components/schemas/FailoverIncidentEntry"},"type":"array","title":"Incidents"},"active_count":{"type":"integer","title":"Active Count"}},"type":"object","required":["incidents","active_count"],"title":"FailoverIncidentsResponse"},"FaqOut":{"properties":{"faq":{"additionalProperties":{"type":"string"},"type":"object","title":"Faq","description":"Polish Q→A"},"faq_en":{"additionalProperties":{"type":"string"},"type":"object","title":"Faq En","description":"English Q→A"}},"type":"object","title":"FaqOut"},"FaqReplace":{"properties":{"faq":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Faq"},"faq_en":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Faq En"}},"type":"object","title":"FaqReplace"},"FaqSuggestion":{"properties":{"question":{"type":"string","title":"Question"},"suggested_answer":{"type":"string","title":"Suggested Answer"},"occurrence_count":{"type":"integer","title":"Occurrence Count"},"missed_question_id":{"type":"string","title":"Missed Question Id"},"confidence":{"type":"number","title":"Confidence"}},"type":"object","required":["question","suggested_answer","occurrence_count","missed_question_id","confidence"],"title":"FaqSuggestion"},"FeedbackRequest":{"properties":{"message_id":{"type":"string","maxLength":64,"title":"Message Id"},"rating":{"type":"string","title":"Rating"},"reason":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Reason"},"comment":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Comment"},"message_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message Text"},"user_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Message"},"page":{"anyOf":[{"type":"string","maxLength":128},{"type":"null"}],"title":"Page"},"locale":{"type":"string","title":"Locale","default":"pl"}},"type":"object","required":["message_id","rating"],"title":"FeedbackRequest","description":"One tap on a Zvon answer.\n\nmessage_text and user_message are sent by the client rather than looked up:\nconversations are trimmed, so by the time anyone reads the report the\nmessage may be gone. A rating without the answer it refers to is useless."},"FollowUpCreate":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"call_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Id"},"title":{"type":"string","title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"priority":{"type":"string","title":"Priority","default":"normal"}},"type":"object","required":["tenant_id","title"],"title":"FollowUpCreate"},"FollowUpOut":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"call_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Id"},"title":{"type":"string","title":"Title"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"status":{"type":"string","title":"Status"},"priority":{"type":"string","title":"Priority"},"due_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Due Date"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"assigned_to_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned To User Id"},"assigned_to_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned To Name"}},"type":"object","required":["id","tenant_id","call_id","title","description","status","priority","due_date","created_at","completed_at"],"title":"FollowUpOut"},"FollowUpStats":{"properties":{"total_open":{"type":"integer","title":"Total Open"},"high_priority":{"type":"integer","title":"High Priority"}},"type":"object","required":["total_open","high_priority"],"title":"FollowUpStats"},"FollowUpUpdate":{"properties":{"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"priority":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Priority"},"due_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Due Date"},"assigned_to_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assigned To User Id"}},"type":"object","title":"FollowUpUpdate"},"ForgotPasswordRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"}},"type":"object","required":["email"],"title":"ForgotPasswordRequest"},"GoogleAuthUrlResponse":{"properties":{"auth_url":{"type":"string","title":"Auth Url"}},"type":"object","required":["auth_url"],"title":"GoogleAuthUrlResponse"},"GoogleOAuthRequest":{"properties":{"code":{"type":"string","title":"Code"},"redirect_uri":{"type":"string","title":"Redirect Uri"},"referral_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Referral Code"},"affiliate_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Affiliate Code"},"state":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},"type":"object","required":["code","redirect_uri"],"title":"GoogleOAuthRequest"},"GrantConsentRequest":{"properties":{"consent_type":{"type":"string","title":"Consent Type"},"consent_text":{"type":"string","title":"Consent Text"},"consent_method":{"type":"string","title":"Consent Method","default":"web_form"}},"type":"object","required":["consent_type","consent_text"],"title":"GrantConsentRequest","description":"Request to grant consent."},"GreetingPreviewRequest":{"properties":{"text":{"type":"string","title":"Text"},"voice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voice Id"}},"type":"object","required":["text"],"title":"GreetingPreviewRequest"},"GreetingPreviewResponse":{"properties":{"audio_base64":{"type":"string","title":"Audio Base64"},"voice_id":{"type":"string","title":"Voice Id"},"duration_estimate_ms":{"type":"integer","title":"Duration Estimate Ms"},"cached":{"type":"boolean","title":"Cached"}},"type":"object","required":["audio_base64","voice_id","duration_estimate_ms","cached"],"title":"GreetingPreviewResponse"},"GuidanceRuleCreate":{"properties":{"category":{"type":"string","title":"Category"},"rule_text":{"type":"string","title":"Rule Text"},"is_active":{"type":"boolean","title":"Is Active","default":true},"priority":{"type":"integer","title":"Priority","default":0}},"type":"object","required":["category","rule_text"],"title":"GuidanceRuleCreate"},"GuidanceRuleOut":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"category":{"type":"string","title":"Category"},"rule_text":{"type":"string","title":"Rule Text"},"is_active":{"type":"boolean","title":"Is Active"},"priority":{"type":"integer","title":"Priority"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","tenant_id","category","rule_text","is_active","priority","created_at"],"title":"GuidanceRuleOut"},"GuidanceRuleUpdate":{"properties":{"category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Category"},"rule_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rule Text"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"},"priority":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Priority"}},"type":"object","title":"GuidanceRuleUpdate"},"GuideOpened":{"properties":{"chapter":{"type":"string","title":"Chapter"},"lang":{"type":"string","title":"Lang","default":"pl"},"source":{"type":"string","title":"Source","default":"guide"}},"type":"object","required":["chapter"],"title":"GuideOpened"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HandoffRequest":{"properties":{"department_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Department Id"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"}},"type":"object","title":"HandoffRequest"},"IncidentCreateBody":{"properties":{"title":{"type":"string","title":"Title"},"severity":{"type":"string","title":"Severity"},"affected_components":{"items":{"type":"string"},"type":"array","title":"Affected Components"},"message_pl":{"type":"string","title":"Message Pl"},"message_en":{"type":"string","title":"Message En"}},"type":"object","required":["title","severity","affected_components","message_pl","message_en"],"title":"IncidentCreateBody"},"IncidentDTO":{"properties":{"id":{"type":"string","title":"Id"},"title":{"type":"string","title":"Title"},"severity":{"type":"string","title":"Severity"},"status":{"type":"string","title":"Status"},"affected_components":{"items":{"type":"string"},"type":"array","title":"Affected Components"},"started_at":{"type":"string","format":"date-time","title":"Started At"},"resolved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Resolved At"},"auto_opened":{"type":"boolean","title":"Auto Opened"},"deploy_sha":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deploy Sha"},"updates":{"items":{"$ref":"#/components/schemas/IncidentUpdateDTO"},"type":"array","title":"Updates"}},"type":"object","required":["id","title","severity","status","affected_components","started_at","resolved_at","auto_opened","deploy_sha","updates"],"title":"IncidentDTO"},"IncidentUpdateBody":{"properties":{"status":{"type":"string","title":"Status"},"message_pl":{"type":"string","title":"Message Pl"},"message_en":{"type":"string","title":"Message En"}},"type":"object","required":["status","message_pl","message_en"],"title":"IncidentUpdateBody"},"IncidentUpdateDTO":{"properties":{"id":{"type":"string","title":"Id"},"status":{"type":"string","title":"Status"},"message_pl":{"type":"string","title":"Message Pl"},"message_en":{"type":"string","title":"Message En"},"posted_by":{"type":"string","title":"Posted By"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","status","message_pl","message_en","posted_by","created_at"],"title":"IncidentUpdateDTO"},"InsightCta":{"properties":{"label":{"type":"string","title":"Label"},"href":{"type":"string","title":"Href"}},"type":"object","required":["label","href"],"title":"InsightCta"},"IntegrationErrorReport":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"integration":{"type":"string","title":"Integration"},"error":{"type":"string","title":"Error"},"level":{"type":"string","title":"Level","default":"error"},"call_sid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Sid"}},"type":"object","required":["tenant_id","integration","error"],"title":"IntegrationErrorReport"},"InternalOutcomeIn":{"properties":{"outcome":{"type":"string","title":"Outcome","description":"Sheet label or code, e.g. 'Zgoda: e-mail' or consent_email"},"outcomes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Outcomes"},"kontekst":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Kontekst"},"note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Note"},"followup_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Followup At"},"lost_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lost Reason"},"objections":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Objections"},"consent_email_address":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Consent Email Address"},"email_subject_override":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}],"title":"Email Subject Override"},"email_body_override":{"anyOf":[{"type":"string","maxLength":8000},{"type":"null"}],"title":"Email Body Override"},"consent_sms":{"type":"boolean","title":"Consent Sms","default":false},"demo_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Demo At"},"demo_mode":{"type":"string","title":"Demo Mode","default":"online"},"lead_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lead Id"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"}},"type":"object","required":["outcome"],"title":"InternalOutcomeIn"},"InviteIn":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"full_name":{"type":"string","maxLength":120,"minLength":2,"title":"Full Name"},"from_name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"From Name"},"focus_vertical":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Focus Vertical"},"focus_voivodeship":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}],"title":"Focus Voivodeship"}},"type":"object","required":["email","full_name"],"title":"InviteIn"},"InviteRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"role":{"type":"string","title":"Role","default":"staff"},"resource_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Resource Id"}},"type":"object","required":["email"],"title":"InviteRequest"},"InvoiceAddress":{"properties":{"nip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nip"},"street":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Street"},"postal_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Postal Code"},"city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"City"}},"type":"object","title":"InvoiceAddress"},"KindInfo":{"properties":{"kind":{"type":"string","title":"Kind"},"tier":{"type":"integer","title":"Tier"},"default_on":{"type":"boolean","title":"Default On"},"bypass_quiet_hours":{"type":"boolean","title":"Bypass Quiet Hours"},"admin_only":{"type":"boolean","title":"Admin Only"},"enabled":{"type":"boolean","title":"Enabled"}},"type":"object","required":["kind","tier","default_on","bypass_quiet_hours","admin_only","enabled"],"title":"KindInfo"},"KnowledgeIngest":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"text":{"type":"string","minLength":1,"title":"Text"}},"type":"object","required":["name","text"],"title":"KnowledgeIngest"},"KnowledgeListV2":{"properties":{"data":{"items":{"$ref":"#/components/schemas/DocumentV2"},"type":"array","title":"Data"}},"type":"object","required":["data"],"title":"KnowledgeListV2"},"KnowledgeScoreAction":{"properties":{"key":{"type":"string","title":"Key"},"href":{"type":"string","title":"Href"},"count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Count"}},"type":"object","required":["key","href"],"title":"KnowledgeScoreAction"},"KnowledgeScoreResponse":{"properties":{"score":{"type":"integer","title":"Score"},"answer_count":{"type":"integer","title":"Answer Count"},"open_missed_questions":{"type":"integer","title":"Open Missed Questions"},"components":{"additionalProperties":{"additionalProperties":true,"type":"object"},"type":"object","title":"Components"},"next_best_actions":{"items":{"$ref":"#/components/schemas/KnowledgeScoreAction"},"type":"array","title":"Next Best Actions"}},"type":"object","required":["score","answer_count","open_missed_questions","components","next_best_actions"],"title":"KnowledgeScoreResponse"},"LanguagesIn":{"properties":{"languages":{"items":{"type":"string"},"type":"array","maxItems":12,"title":"Languages"}},"type":"object","title":"LanguagesIn"},"LanguagesOut":{"properties":{"resource_id":{"type":"string","title":"Resource Id"},"name":{"type":"string","title":"Name"},"languages":{"items":{"type":"string"},"type":"array","title":"Languages"}},"type":"object","required":["resource_id","name","languages"],"title":"LanguagesOut"},"LatencyDataPoint":{"properties":{"hour":{"type":"string","title":"Hour"},"p50_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"P50 Ms"},"p95_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"P95 Ms"},"p99_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"P99 Ms"},"call_count":{"type":"integer","title":"Call Count"}},"type":"object","required":["hour","p50_ms","p95_ms","p99_ms","call_count"],"title":"LatencyDataPoint"},"LeadPatch":{"properties":{"email_kontakt":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email Kontakt"},"owner_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner User Id"},"owner_name":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Owner Name"},"contact_name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Contact Name"},"contact_gender":{"anyOf":[{"type":"string","pattern":"^[fm]$"},{"type":"null"}],"title":"Contact Gender"},"followup_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Followup At"},"clear_followup":{"type":"boolean","title":"Clear Followup","default":false},"note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Note"},"segment":{"anyOf":[{"type":"string","pattern":"^(business|agency|expat)$"},{"type":"null"}],"title":"Segment"}},"type":"object","title":"LeadPatch"},"LedgerPayoutRequest":{"properties":{"reference":{"type":"string","title":"Reference"}},"type":"object","required":["reference"],"title":"LedgerPayoutRequest"},"LegalManifestDoc":{"properties":{"key":{"type":"string","title":"Key"},"title":{"type":"string","title":"Title"},"url":{"type":"string","title":"Url"},"source":{"type":"string","title":"Source"},"content_sha":{"type":"string","title":"Content Sha"},"last_change":{"additionalProperties":true,"type":"object","title":"Last Change"},"pdf":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Pdf"}},"type":"object","required":["key","title","url","source","content_sha","last_change"],"title":"LegalManifestDoc"},"LegalManifestResponse":{"properties":{"manifest_sha":{"type":"string","title":"Manifest Sha"},"corpus":{"additionalProperties":true,"type":"object","title":"Corpus"},"docs":{"items":{"$ref":"#/components/schemas/LegalManifestDoc"},"type":"array","title":"Docs"}},"type":"object","required":["manifest_sha","corpus","docs"],"title":"LegalManifestResponse"},"MarkPaidRequest":{"properties":{"payout_reference":{"type":"string","title":"Payout Reference"}},"type":"object","required":["payout_reference"],"title":"MarkPaidRequest"},"MeUpdate":{"properties":{"full_name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Full Name"},"phone":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Phone"}},"type":"object","title":"MeUpdate","description":"What a signed-in person may change about themselves: the name the team\nsees and the phone that receives the SMS when a booking lands on them\n(team calendars, 58.13). A member could not set either before, so the\nassignment SMS had nowhere to go (owner audit 2026-09-03)."},"MessageDraftIn":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"title":{"type":"string","title":"Title"},"message":{"type":"string","title":"Message"},"sender":{"type":"string","title":"Sender","default":"team"},"action_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Url"},"action_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Label"},"send_email":{"type":"boolean","title":"Send Email","default":true},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"type":"object","required":["tenant_id","title","message"],"title":"MessageDraftIn"},"MessageDraftOut":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"title":{"type":"string","title":"Title"},"message":{"type":"string","title":"Message"},"sender":{"type":"string","title":"Sender","default":"team"},"action_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Url"},"action_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Label"},"send_email":{"type":"boolean","title":"Send Email","default":true},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"},"id":{"type":"string","title":"Id"},"tenant_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Name"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Sent At"}},"type":"object","required":["tenant_id","title","message","id","created_at"],"title":"MessageDraftOut"},"MissedQuestionCreate":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"call_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Id"},"question_text":{"type":"string","title":"Question Text"},"context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Context"},"reason":{"type":"string","title":"Reason"}},"type":"object","required":["tenant_id","question_text","reason"],"title":"MissedQuestionCreate"},"MissedQuestionOut":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"call_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Id"},"question_text":{"type":"string","title":"Question Text"},"context":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Context"},"reason":{"type":"string","title":"Reason"},"occurrence_count":{"type":"integer","title":"Occurrence Count"},"resolved":{"type":"boolean","title":"Resolved"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","tenant_id","call_id","question_text","context","reason","occurrence_count","resolved","created_at"],"title":"MissedQuestionOut"},"MissedQuestionsStats":{"properties":{"total_unresolved":{"type":"integer","title":"Total Unresolved"},"this_week_count":{"type":"integer","title":"This Week Count"},"top_questions":{"items":{"$ref":"#/components/schemas/MissedQuestionOut"},"type":"array","title":"Top Questions"}},"type":"object","required":["total_unresolved","this_week_count","top_questions"],"title":"MissedQuestionsStats"},"MonthlyCallStats":{"properties":{"month":{"type":"string","title":"Month"},"total_calls":{"type":"integer","title":"Total Calls"},"total_minutes":{"type":"integer","title":"Total Minutes"},"callbacks_pending":{"type":"integer","title":"Callbacks Pending"},"callbacks_resolved":{"type":"integer","title":"Callbacks Resolved"},"top_outcomes":{"additionalProperties":{"type":"integer"},"type":"object","title":"Top Outcomes"},"comparison_last_month_percent":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Comparison Last Month Percent"}},"type":"object","required":["month","total_calls","total_minutes","callbacks_pending","callbacks_resolved","top_outcomes","comparison_last_month_percent"],"title":"MonthlyCallStats"},"MyReferralItem":{"properties":{"invitee_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invitee Email"},"status":{"type":"string","title":"Status"},"signed_up_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Signed Up At"},"rewarded_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Rewarded At"},"reward_amount_pln":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Reward Amount Pln"}},"type":"object","required":["invitee_email","status","signed_up_at","rewarded_at","reward_amount_pln"],"title":"MyReferralItem"},"MyReferralsResponse":{"properties":{"referral_code":{"type":"string","title":"Referral Code"},"referral_url":{"type":"string","title":"Referral Url"},"stats":{"$ref":"#/components/schemas/ReferralLinkResponse"},"referrals":{"items":{"$ref":"#/components/schemas/MyReferralItem"},"type":"array","title":"Referrals"}},"type":"object","required":["referral_code","referral_url","stats","referrals"],"title":"MyReferralsResponse"},"NewsletterSubscribeRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"source":{"type":"string","title":"Source","default":"samuelikem.com"}},"type":"object","required":["email"],"title":"NewsletterSubscribeRequest"},"NipLookupResponse":{"properties":{"nip":{"type":"string","title":"Nip"},"regon":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Regon"},"krs":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Krs"},"business_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Name"},"legal_form":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Legal Form"},"registered_address":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Registered Address"},"pkd_main_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pkd Main Code"}},"type":"object","required":["nip","regon","krs","business_name","legal_form","registered_address","pkd_main_code"],"title":"NipLookupResponse"},"NotesUpdateRequest":{"properties":{"notes":{"type":"string","title":"Notes"}},"type":"object","required":["notes"],"title":"NotesUpdateRequest"},"NotificationListResponse":{"properties":{"notifications":{"items":{"$ref":"#/components/schemas/NotificationResponse"},"type":"array","title":"Notifications"},"total":{"type":"integer","title":"Total"},"unread_count":{"type":"integer","title":"Unread Count"}},"type":"object","required":["notifications","total","unread_count"],"title":"NotificationListResponse"},"NotificationResponse":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"type":{"type":"string","title":"Type"},"title":{"type":"string","title":"Title"},"message":{"type":"string","title":"Message"},"read":{"type":"boolean","title":"Read"},"action_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Url"},"action_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Action Label"},"metadata_json":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Metadata Json"}},"type":"object","required":["id","created_at","type","title","message","read"],"title":"NotificationResponse"},"NotifyResponse":{"properties":{"id":{"type":"string","title":"Id"},"is_notified":{"type":"boolean","title":"Is Notified"},"notified_at":{"type":"string","title":"Notified At"}},"type":"object","required":["id","is_notified","notified_at"],"title":"NotifyResponse"},"OnboardingChatRequest":{"properties":{"message":{"type":"string","title":"Message"},"locale":{"type":"string","title":"Locale","default":"pl"},"step":{"type":"integer","title":"Step","default":1},"step_name":{"type":"string","title":"Step Name","default":""},"form_data":{"additionalProperties":true,"type":"object","title":"Form Data","default":{}},"history":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"History","default":[]}},"type":"object","required":["message"],"title":"OnboardingChatRequest"},"OnboardingCreate":{"properties":{"business_name":{"type":"string","title":"Business Name"},"vertical":{"type":"string","title":"Vertical"},"greeting":{"type":"string","title":"Greeting"},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"agent_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Name"},"voice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voice Id"},"faq":{"additionalProperties":{"type":"string"},"type":"object","title":"Faq","default":{}},"business_hours":{"additionalProperties":{"type":"string"},"type":"object","title":"Business Hours","default":{}},"nip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nip"},"plan":{"type":"string","title":"Plan","default":"trial"},"billing_cycle":{"type":"string","title":"Billing Cycle","default":"annual"},"language":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Language"},"heard_about":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Heard About"},"heard_about_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Heard About Note"},"promo_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Promo Code"},"setup_option":{"type":"string","enum":["self","phone","onsite"],"title":"Setup Option","default":"self"},"setup_postcode":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}],"title":"Setup Postcode"},"setup_start_early_consent":{"type":"boolean","title":"Setup Start Early Consent","default":false},"minute_overage_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Minute Overage Enabled"},"caller_verification_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Caller Verification Enabled"},"invoice_street":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Street"},"invoice_postal_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Postal Code"},"invoice_city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice City"},"invoice_country_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Country Code"},"accountant_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accountant Email"}},"type":"object","required":["business_name","vertical","greeting"],"title":"OnboardingCreate","description":"Data collected during onboarding wizard."},"OnboardingResponse":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"business_name":{"type":"string","title":"Business Name"},"message":{"type":"string","title":"Message"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number"},"plan":{"type":"string","title":"Plan"},"checkout_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checkout Url"},"is_trial":{"type":"boolean","title":"Is Trial","default":false},"number_is_shared":{"type":"boolean","title":"Number Is Shared","default":false},"checkout_failed":{"type":"boolean","title":"Checkout Failed","default":false},"promo_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Promo Status"},"setup_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Setup Status"},"setup_amount_grosze":{"type":"integer","title":"Setup Amount Grosze","default":0}},"type":"object","required":["tenant_id","business_name","message","plan"],"title":"OnboardingResponse"},"OnboardingScrapeItem":{"properties":{"question":{"type":"string","title":"Question"},"answer":{"type":"string","title":"Answer"},"answer_missing":{"type":"boolean","title":"Answer Missing","default":false}},"type":"object","required":["question","answer"],"title":"OnboardingScrapeItem"},"OnboardingScrapeRequest":{"properties":{"url":{"type":"string","title":"Url"}},"type":"object","required":["url"],"title":"OnboardingScrapeRequest"},"OnboardingScrapeResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/OnboardingScrapeItem"},"type":"array","title":"Items"},"questions_only":{"type":"boolean","title":"Questions Only","default":false},"question_count":{"type":"integer","title":"Question Count","default":0},"enough":{"type":"boolean","title":"Enough","default":false}},"type":"object","required":["items"],"title":"OnboardingScrapeResponse"},"OrderDeposit":{"properties":{"status":{"type":"string","title":"Status"},"amount_grosze":{"type":"integer","title":"Amount Grosze"},"paid_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Paid At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"}},"type":"object","required":["status","amount_grosze","paid_at","expires_at"],"title":"OrderDeposit"},"OrderDepositIn":{"properties":{"amount_grosze":{"type":"integer","maximum":5000000.0,"minimum":100.0,"title":"Amount Grosze"},"hold_hours":{"anyOf":[{"type":"integer","maximum":168.0,"minimum":1.0},{"type":"null"}],"title":"Hold Hours"}},"type":"object","required":["amount_grosze"],"title":"OrderDepositIn"},"OrderDepositRequestV2":{"properties":{"amount_grosze":{"type":"integer","maximum":5000000.0,"minimum":100.0,"title":"Amount Grosze","description":"Deposit in grosze, e.g. 15000 = 150 zł"},"hold_hours":{"anyOf":[{"type":"integer","maximum":168.0,"minimum":1.0},{"type":"null"}],"title":"Hold Hours","description":"How long the link stays valid (default 24)"}},"type":"object","required":["amount_grosze"],"title":"OrderDepositRequestV2"},"OrderDepositV2":{"properties":{"status":{"type":"string","title":"Status","description":"pending | paid | expired | refunded | disputed"},"amount_grosze":{"type":"integer","title":"Amount Grosze"},"paid_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Paid At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"}},"type":"object","required":["status","amount_grosze","paid_at","expires_at"],"title":"OrderDepositV2"},"OrderEventOut":{"properties":{"id":{"type":"string","title":"Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"kind":{"type":"string","title":"Kind"},"body":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body"},"author_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Author Name"},"author_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Author User Id"},"meta":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Meta"}},"type":"object","required":["id","created_at","kind","body","author_name","author_user_id"],"title":"OrderEventOut"},"OrderIn":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"items_text":{"type":"string","maxLength":4000,"title":"Items Text"},"caller_number":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Caller Number"},"caller_name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Caller Name"},"quantity_note":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Quantity Note"},"delivery_method":{"type":"string","pattern":"^(delivery|pickup|unknown)$","title":"Delivery Method","default":"unknown"},"delivery_address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Delivery Address"},"notes":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Notes"},"caller_email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Caller Email"},"call_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Id"},"wanted_by_text":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Wanted By Text"}},"type":"object","required":["tenant_id","items_text"],"title":"OrderIn"},"OrderListV2":{"properties":{"data":{"items":{"$ref":"#/components/schemas/OrderV2"},"type":"array","title":"Data"},"pagination":{"$ref":"#/components/schemas/src__routers__v2__orders__PaginationMeta"}},"type":"object","required":["data","pagination"],"title":"OrderListV2"},"OrderOut":{"properties":{"id":{"type":"string","title":"Id"},"code":{"type":"string","title":"Code"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"items_text":{"type":"string","title":"Items Text"},"quantity_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quantity Note"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"caller_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caller Number"},"caller_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caller Name"},"caller_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caller Email"},"delivery_method":{"type":"string","title":"Delivery Method"},"delivery_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Delivery Address"},"status":{"type":"string","title":"Status"},"status_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status Note"},"handled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Handled At"},"invoice_sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Invoice Sent At"},"shop_email_given":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shop Email Given"},"shop_url_given":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Shop Url Given"},"attention_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Attention Kind"},"attention_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Attention Note"},"deposit":{"anyOf":[{"$ref":"#/components/schemas/OrderDeposit"},{"type":"null"}]},"wanted_by_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wanted By Text"},"promised_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Promised At"},"assignee_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignee User Id"},"assignee_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignee Name"},"call_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Id"},"attention_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Attention At"}},"type":"object","required":["id","code","created_at","items_text","quantity_note","notes","caller_number","caller_name","caller_email","delivery_method","delivery_address","status","status_note","handled_at","invoice_sent_at","shop_email_given","shop_url_given","attention_kind","attention_note","attention_at"],"title":"OrderOut"},"OrderPatch":{"properties":{"status":{"anyOf":[{"type":"string","pattern":"^(new|contacted|sent|delivered|cancelled)$"},{"type":"null"}],"title":"Status"},"clear_attention":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Clear Attention"},"status_note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Status Note"},"promised_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Promised At"},"assignee_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignee User Id"},"wanted_by_text":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Wanted By Text"},"invoice_sent":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Invoice Sent"},"delivery_address":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Delivery Address"},"caller_email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Caller Email"}},"type":"object","title":"OrderPatch"},"OrderUpdateV2":{"properties":{"status":{"anyOf":[{"type":"string","enum":["new","contacted","sent","delivered","cancelled"]},{"type":"null"}],"title":"Status"},"status_note":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Status Note"},"promised_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Promised At"},"assignee_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignee User Id","description":"A team member's user id; null clears"},"wanted_by_text":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Wanted By Text"}},"type":"object","title":"OrderUpdateV2"},"OrderV2":{"properties":{"id":{"type":"string","title":"Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"code":{"type":"string","title":"Code"},"status":{"type":"string","title":"Status","description":"new | contacted | sent | delivered | cancelled"},"items_text":{"type":"string","title":"Items Text"},"quantity_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quantity Note"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"caller_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caller Name"},"caller_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caller Phone"},"caller_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caller Email"},"delivery_method":{"type":"string","title":"Delivery Method"},"delivery_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Delivery Address"},"status_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status Note"},"handled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Handled At"},"invoice_sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Invoice Sent At"},"call_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Id"},"wanted_by_text":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Wanted By Text"},"promised_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Promised At"},"assignee_user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignee User Id"},"assignee_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Assignee Name"},"deposit":{"anyOf":[{"$ref":"#/components/schemas/OrderDepositV2"},{"type":"null"}]}},"type":"object","required":["id","created_at","updated_at","code","status","items_text","quantity_note","notes","caller_name","caller_phone","caller_email","delivery_method","delivery_address","status_note","handled_at","invoice_sent_at","call_id"],"title":"OrderV2"},"OutcomeIn":{"properties":{"outcome":{"type":"string","title":"Outcome","description":"Sheet label or code, e.g. 'Zgoda: e-mail' or consent_email"},"outcomes":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Outcomes"},"kontekst":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Kontekst"},"note":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}],"title":"Note"},"followup_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Followup At"},"lost_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Lost Reason"},"objections":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Objections"},"consent_email_address":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Consent Email Address"},"email_subject_override":{"anyOf":[{"type":"string","maxLength":300},{"type":"null"}],"title":"Email Subject Override"},"email_body_override":{"anyOf":[{"type":"string","maxLength":8000},{"type":"null"}],"title":"Email Body Override"},"consent_sms":{"type":"boolean","title":"Consent Sms","default":false},"demo_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Demo At"},"demo_mode":{"type":"string","title":"Demo Mode","default":"online"}},"type":"object","required":["outcome"],"title":"OutcomeIn"},"OverageRecordRequest":{"properties":{"minutes":{"type":"integer","title":"Minutes"}},"type":"object","required":["minutes"],"title":"OverageRecordRequest"},"PasswordChange":{"properties":{"current_password":{"type":"string","title":"Current Password"},"new_password":{"type":"string","title":"New Password"}},"type":"object","required":["current_password","new_password"],"title":"PasswordChange"},"PasswordSet":{"properties":{"new_password":{"type":"string","title":"New Password"}},"type":"object","required":["new_password"],"title":"PasswordSet","description":"First password for an account that signed up with Google."},"PayLinkCheckoutRequest":{"properties":{"password":{"type":"string","maxLength":200,"minLength":1,"title":"Password"},"terms_accepted":{"type":"boolean","title":"Terms Accepted","default":false},"start_early_consent":{"type":"boolean","title":"Start Early Consent","default":false}},"type":"object","required":["password"],"title":"PayLinkCheckoutRequest"},"Payment":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"},"business_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"amount_grosze":{"type":"integer","title":"Amount Grosze"},"currency":{"type":"string","title":"Currency"},"status":{"type":"string","title":"Status"},"created":{"type":"string","format":"date-time","title":"Created"},"invoice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Id"},"failure_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Failure Reason"},"refunded_grosze":{"type":"integer","title":"Refunded Grosze","default":0},"refundable":{"type":"boolean","title":"Refundable","default":false}},"type":"object","required":["id","tenant_id","business_name","email","amount_grosze","currency","status","created","invoice_id"],"title":"Payment"},"PaymentConfigResponse":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"config":{"additionalProperties":true,"type":"object","title":"Config"},"require_deposit":{"type":"boolean","title":"Require Deposit"},"deposit_amount_grosze":{"type":"integer","title":"Deposit Amount Grosze"},"payment_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Url"},"hold_minutes":{"type":"integer","title":"Hold Minutes","default":30},"refund_policy_summary":{"additionalProperties":{"type":"string"},"type":"object","title":"Refund Policy Summary","default":{}}},"type":"object","required":["enabled","provider","config","require_deposit","deposit_amount_grosze"],"title":"PaymentConfigResponse"},"PaymentConfigUpdate":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Provider"},"require_deposit":{"type":"boolean","title":"Require Deposit","default":false},"deposit_amount_pln":{"type":"number","title":"Deposit Amount Pln","default":0.0},"payment_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Payment Url"},"hold_minutes":{"type":"integer","title":"Hold Minutes","default":30},"config":{"additionalProperties":true,"type":"object","title":"Config","default":{}}},"type":"object","required":["enabled"],"title":"PaymentConfigUpdate"},"PaymentMethodItem":{"properties":{"id":{"type":"string","title":"Id"},"brand":{"type":"string","title":"Brand"},"last4":{"type":"string","title":"Last4"},"exp_month":{"type":"integer","title":"Exp Month"},"exp_year":{"type":"integer","title":"Exp Year"},"is_default":{"type":"boolean","title":"Is Default"}},"type":"object","required":["id","brand","last4","exp_month","exp_year","is_default"],"title":"PaymentMethodItem"},"PaymentMethodsResponse":{"properties":{"payment_methods":{"items":{"$ref":"#/components/schemas/PaymentMethodItem"},"type":"array","title":"Payment Methods"},"default_payment_method_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Payment Method Id"}},"type":"object","required":["payment_methods","default_payment_method_id"],"title":"PaymentMethodsResponse"},"PaymentsOverview":{"properties":{"total_collected_grosze":{"type":"integer","title":"Total Collected Grosze"},"total_refunded_grosze":{"type":"integer","title":"Total Refunded Grosze"},"total_disputed_grosze":{"type":"integer","title":"Total Disputed Grosze"},"total_forfeited_grosze":{"type":"integer","title":"Total Forfeited Grosze"},"refund_count":{"type":"integer","title":"Refund Count"},"dispute_count":{"type":"integer","title":"Dispute Count"},"forfeited_count":{"type":"integer","title":"Forfeited Count"},"recent_refunds":{"items":{"$ref":"#/components/schemas/RefundRecord"},"type":"array","title":"Recent Refunds"},"active_disputes":{"items":{"$ref":"#/components/schemas/DisputeRecord"},"type":"array","title":"Active Disputes"}},"type":"object","required":["total_collected_grosze","total_refunded_grosze","total_disputed_grosze","total_forfeited_grosze","refund_count","dispute_count","forfeited_count","recent_refunds","active_disputes"],"title":"PaymentsOverview"},"PaymentsResponse":{"properties":{"received_grosze":{"type":"integer","title":"Received Grosze"},"received_count":{"type":"integer","title":"Received Count"},"period_days":{"type":"integer","title":"Period Days"},"payments":{"items":{"$ref":"#/components/schemas/Payment"},"type":"array","title":"Payments"},"at_risk":{"items":{"$ref":"#/components/schemas/AtRiskSubscription"},"type":"array","title":"At Risk"},"upcoming":{"items":{"$ref":"#/components/schemas/UpcomingRenewal"},"type":"array","title":"Upcoming"},"stripe_mode":{"type":"string","title":"Stripe Mode"},"generated_at":{"type":"string","format":"date-time","title":"Generated At"},"stale":{"type":"boolean","title":"Stale","default":false}},"type":"object","required":["received_grosze","received_count","period_days","payments","at_risk","upcoming","stripe_mode","generated_at"],"title":"PaymentsResponse"},"PayoutDetailsRequest":{"properties":{"business_status":{"type":"string","title":"Business Status","default":"company"},"company_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Name"},"tax_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Id"},"vat_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vat Status"},"iban":{"type":"string","title":"Iban"},"tax_country":{"type":"string","title":"Tax Country","default":"PL"}},"type":"object","required":["iban"],"title":"PayoutDetailsRequest"},"PayoutSummaryOut":{"properties":{"eligible_pln":{"type":"number","title":"Eligible Pln"},"eligible_rows":{"type":"integer","title":"Eligible Rows"},"held_pln":{"type":"number","title":"Held Pln"},"held_rows":{"type":"integer","title":"Held Rows"},"paid_pln":{"type":"number","title":"Paid Pln"},"paid_rows":{"type":"integer","title":"Paid Rows"},"payable":{"type":"boolean","title":"Payable"},"min_payout_pln":{"type":"number","title":"Min Payout Pln"},"next_due_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Due At"},"paying_clients":{"type":"integer","title":"Paying Clients"},"model":{"type":"string","title":"Model"},"resell_discount_percent":{"type":"integer","title":"Resell Discount Percent"}},"type":"object","required":["eligible_pln","eligible_rows","held_pln","held_rows","paid_pln","paid_rows","payable","min_payout_pln","next_due_at","paying_clients","model","resell_discount_percent"],"title":"PayoutSummaryOut"},"PhoneInventoryEntry":{"properties":{"id":{"type":"string","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"business_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Name"},"phone_number":{"type":"string","title":"Phone Number"},"provider":{"type":"string","title":"Provider"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"is_active":{"type":"boolean","title":"Is Active"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","tenant_id","business_name","phone_number","provider","label","is_active","created_at"],"title":"PhoneInventoryEntry"},"PhoneInventoryResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/PhoneInventoryEntry"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["items","total"],"title":"PhoneInventoryResponse"},"PhoneNumberAssign":{"properties":{"phone_number":{"type":"string","title":"Phone Number"},"twilio_sid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Twilio Sid"},"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"}},"type":"object","required":["phone_number"],"title":"PhoneNumberAssign"},"PhoneNumberRequest":{"properties":{"country":{"type":"string","title":"Country","default":"PL"},"area_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Area Code"}},"type":"object","title":"PhoneNumberRequest","description":"Request to provision an additional phone number."},"PhoneNumberRequestBody":{"properties":{"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"preferred_area_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Preferred Area Code"}},"type":"object","title":"PhoneNumberRequestBody"},"PhoneNumberUpdate":{"properties":{"label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Label"},"is_active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Is Active"}},"type":"object","title":"PhoneNumberUpdate"},"PhonePoolResponse":{"properties":{"configured":{"type":"boolean","title":"Configured"},"owned":{"type":"integer","title":"Owned"},"free":{"type":"integer","title":"Free"},"assigned":{"type":"integer","title":"Assigned"},"in_use":{"type":"integer","title":"In Use"},"orphaned":{"items":{"type":"string"},"type":"array","title":"Orphaned"},"stale_rows":{"items":{"type":"string"},"type":"array","title":"Stale Rows"},"free_numbers":{"items":{"type":"string"},"type":"array","title":"Free Numbers"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["configured","owned","free","assigned","in_use","orphaned","stale_rows","free_numbers"],"title":"PhonePoolResponse","description":"How many Polish numbers we can still hand out."},"PodRestartRequest":{"properties":{"service_name":{"type":"string","title":"Service Name"}},"type":"object","required":["service_name"],"title":"PodRestartRequest"},"PolicyAnswerRow":{"properties":{"id":{"type":"string","title":"Id"},"surface":{"type":"string","title":"Surface"},"tenant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"},"locale":{"type":"string","title":"Locale"},"question":{"type":"string","title":"Question"},"answer":{"type":"string","title":"Answer"},"topics":{"type":"string","title":"Topics"},"manifest_sha":{"type":"string","title":"Manifest Sha"},"corpus_sha":{"type":"string","title":"Corpus Sha"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","surface","tenant_id","locale","question","answer","topics","manifest_sha","corpus_sha","created_at"],"title":"PolicyAnswerRow"},"PolicyAnswersResponse":{"properties":{"total":{"type":"integer","title":"Total"},"current_manifest_sha":{"type":"string","title":"Current Manifest Sha"},"items":{"items":{"$ref":"#/components/schemas/PolicyAnswerRow"},"type":"array","title":"Items"}},"type":"object","required":["total","current_manifest_sha","items"],"title":"PolicyAnswersResponse"},"PolicyConfigResponse":{"properties":{"cancellation_allowed":{"type":"boolean","title":"Cancellation Allowed"},"cancellation_min_hours":{"type":"integer","title":"Cancellation Min Hours"},"cancellation_fee":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cancellation Fee"},"cancellation_blocked_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cancellation Blocked Message"},"cancellation_policy_tiers":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Cancellation Policy Tiers"},"reschedule_allowed":{"type":"boolean","title":"Reschedule Allowed"},"reschedule_min_hours":{"type":"integer","title":"Reschedule Min Hours"},"max_reschedules":{"type":"integer","title":"Max Reschedules"},"reschedule_blocked_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reschedule Blocked Message"},"require_change_verification":{"type":"boolean","title":"Require Change Verification","default":true},"default_appointment_duration":{"type":"integer","title":"Default Appointment Duration"},"appointment_capacity":{"type":"integer","title":"Appointment Capacity","default":1},"table_settings":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Table Settings"}},"type":"object","required":["cancellation_allowed","cancellation_min_hours","cancellation_fee","cancellation_blocked_message","reschedule_allowed","reschedule_min_hours","max_reschedules","reschedule_blocked_message","default_appointment_duration"],"title":"PolicyConfigResponse"},"PolishInvoiceItem":{"properties":{"id":{"type":"string","title":"Id"},"stripe_invoice_id":{"type":"string","title":"Stripe Invoice Id"},"ifirma_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ifirma Id"},"ifirma_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ifirma Number"},"invoice_kind":{"type":"string","title":"Invoice Kind"},"amount_pln":{"type":"string","title":"Amount Pln"},"issued_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Issued At"},"email_sent_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email Sent At"},"error_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Message"},"has_pdf":{"type":"boolean","title":"Has Pdf"},"ksef_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ksef Number"}},"type":"object","required":["id","stripe_invoice_id","ifirma_id","ifirma_number","invoice_kind","amount_pln","issued_at","email_sent_at","error_message","has_pdf"],"title":"PolishInvoiceItem"},"PolishInvoiceListResponse":{"properties":{"invoices":{"items":{"$ref":"#/components/schemas/PolishInvoiceItem"},"type":"array","title":"Invoices"}},"type":"object","required":["invoices"],"title":"PolishInvoiceListResponse"},"PolishInvoiceRetryResponse":{"properties":{"invoice_id":{"type":"string","title":"Invoice Id"},"status":{"type":"string","title":"Status"},"message":{"type":"string","title":"Message"}},"type":"object","required":["invoice_id","status","message"],"title":"PolishInvoiceRetryResponse"},"PortalClient":{"properties":{"business_name":{"type":"string","title":"Business Name"},"status":{"type":"string","title":"Status"},"since":{"type":"string","title":"Since"},"last_period":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Period"},"earned_pln":{"type":"number","title":"Earned Pln"},"plan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Plan"}},"type":"object","required":["business_name","status","since","last_period","earned_pln","plan"],"title":"PortalClient"},"PortalCommissionRow":{"properties":{"period":{"type":"string","title":"Period"},"client":{"type":"string","title":"Client"},"base_pln":{"type":"number","title":"Base Pln"},"rate_percent":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Rate Percent"},"commission_pln":{"type":"number","title":"Commission Pln"},"status":{"type":"string","title":"Status"},"eligible_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Eligible At"},"paid_out_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Paid Out At"}},"type":"object","required":["period","client","base_pln","rate_percent","commission_pln","status","eligible_at","paid_out_at"],"title":"PortalCommissionRow"},"PortalConversion":{"properties":{"status":{"type":"string","title":"Status"},"commission_pln":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Commission Pln"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["status","commission_pln","created_at"],"title":"PortalConversion"},"PortalLedger":{"properties":{"rows":{"items":{"$ref":"#/components/schemas/PortalCommissionRow"},"type":"array","title":"Rows"},"held_pln":{"type":"number","title":"Held Pln"},"eligible_pln":{"type":"number","title":"Eligible Pln"},"paid_pln":{"type":"number","title":"Paid Pln"},"next_due_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Due At"},"paying_clients":{"type":"integer","title":"Paying Clients"},"tier2_at":{"type":"integer","title":"Tier2 At"},"min_payout_pln":{"type":"number","title":"Min Payout Pln"},"model":{"type":"string","title":"Model"},"resell_discount_percent":{"type":"integer","title":"Resell Discount Percent"}},"type":"object","required":["rows","held_pln","eligible_pln","paid_pln","next_due_at","paying_clients","tier2_at","min_payout_pln","model","resell_discount_percent"],"title":"PortalLedger"},"PortalPayoutDetails":{"properties":{"business_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Status"},"company_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Company Name"},"tax_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Id"},"vat_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vat Status"},"iban":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Iban"},"tax_country":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tax Country"}},"type":"object","title":"PortalPayoutDetails"},"PortalRequest":{"properties":{"return_url":{"type":"string","title":"Return Url"}},"type":"object","required":["return_url"],"title":"PortalRequest"},"PortalResponse":{"properties":{"display_name":{"type":"string","title":"Display Name"},"code":{"type":"string","title":"Code"},"status":{"type":"string","title":"Status"},"discount_desc":{"type":"string","title":"Discount Desc"},"commission_desc":{"type":"string","title":"Commission Desc"},"share_url":{"type":"string","title":"Share Url"},"signups":{"type":"integer","title":"Signups"},"qualified":{"type":"integer","title":"Qualified"},"paid_out":{"type":"integer","title":"Paid Out"},"earned_pln":{"type":"number","title":"Earned Pln"},"pending_pln":{"type":"number","title":"Pending Pln"},"conversions":{"items":{"$ref":"#/components/schemas/PortalConversion"},"type":"array","title":"Conversions"},"ledger":{"anyOf":[{"$ref":"#/components/schemas/PortalLedger"},{"type":"null"}]},"clients":{"items":{"$ref":"#/components/schemas/PortalClient"},"type":"array","title":"Clients","default":[]},"terms_accepted":{"type":"boolean","title":"Terms Accepted","default":true},"payout_details_submitted":{"type":"boolean","title":"Payout Details Submitted","default":false},"payout_details":{"anyOf":[{"$ref":"#/components/schemas/PortalPayoutDetails"},{"type":"null"}]}},"type":"object","required":["display_name","code","status","discount_desc","commission_desc","share_url","signups","qualified","paid_out","earned_pln","pending_pln","conversions"],"title":"PortalResponse"},"PortalTicketRequest":{"properties":{"topic":{"type":"string","title":"Topic"},"message":{"type":"string","title":"Message"},"client_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Client Name"}},"type":"object","required":["topic","message"],"title":"PortalTicketRequest"},"PreferencesResponse":{"properties":{"push_enabled":{"type":"boolean","title":"Push Enabled"},"is_admin":{"type":"boolean","title":"Is Admin"},"kinds":{"items":{"$ref":"#/components/schemas/KindInfo"},"type":"array","title":"Kinds"}},"type":"object","required":["push_enabled","is_admin","kinds"],"title":"PreferencesResponse"},"PreferencesUpdate":{"properties":{"prefs":{"additionalProperties":{"type":"boolean"},"type":"object","title":"Prefs"}},"type":"object","required":["prefs"],"title":"PreferencesUpdate"},"PrivacyNoticeResponse":{"properties":{"lang":{"type":"string","title":"Lang"},"text":{"type":"string","title":"Text"},"tenant_name":{"type":"string","title":"Tenant Name"},"generated_at":{"type":"string","title":"Generated At"}},"type":"object","required":["lang","text","tenant_name","generated_at"],"title":"PrivacyNoticeResponse"},"PrivacyTemplate":{"properties":{"tenant_business_name":{"type":"string","title":"Tenant Business Name"},"tenant_contact_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Contact Email"},"template_pl":{"type":"string","title":"Template Pl"},"template_en":{"type":"string","title":"Template En"},"transcript_retention_days":{"type":"integer","title":"Transcript Retention Days"},"audio_retention_days":{"type":"integer","title":"Audio Retention Days"}},"type":"object","required":["tenant_business_name","tenant_contact_email","template_pl","template_en","transcript_retention_days","audio_retention_days"],"title":"PrivacyTemplate"},"ProviderQuota":{"properties":{"provider":{"type":"string","title":"Provider"},"label":{"type":"string","title":"Label"},"severity":{"type":"string","title":"Severity"},"used":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Used"},"total":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Total"},"remaining":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Remaining"},"unit":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unit"},"pct_used":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Pct Used"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail"},"last_checked":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Checked"}},"type":"object","required":["provider","label","severity"],"title":"ProviderQuota"},"ProviderQuotasResponse":{"properties":{"providers":{"items":{"$ref":"#/components/schemas/ProviderQuota"},"type":"array","title":"Providers"},"fetched_at":{"type":"string","format":"date-time","title":"Fetched At"}},"type":"object","required":["providers","fetched_at"],"title":"ProviderQuotasResponse"},"ProviderStatus":{"properties":{"name":{"type":"string","title":"Name"},"status":{"type":"string","title":"Status"},"latency_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Latency Ms"}},"type":"object","required":["name","status","latency_ms"],"title":"ProviderStatus"},"PublicDemoAction":{"properties":{"slot_start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Slot Start"}},"type":"object","title":"PublicDemoAction"},"PublicGreetingRequest":{"properties":{"business_name":{"type":"string","maxLength":80,"minLength":1,"title":"Business Name"},"vertical":{"type":"string","maxLength":40,"minLength":1,"title":"Vertical"},"voice":{"type":"string","pattern":"^(female|male)$","title":"Voice","default":"female"}},"type":"object","required":["business_name","vertical"],"title":"PublicGreetingRequest"},"PublicGreetingResponse":{"properties":{"audio_base64":{"type":"string","title":"Audio Base64"},"greeting_text":{"type":"string","title":"Greeting Text"},"vertical":{"type":"string","title":"Vertical"},"duration_estimate_ms":{"type":"integer","title":"Duration Estimate Ms"},"cached":{"type":"boolean","title":"Cached"}},"type":"object","required":["audio_base64","greeting_text","vertical","duration_estimate_ms","cached"],"title":"PublicGreetingResponse"},"PublishBody":{"properties":{"published":{"type":"boolean","title":"Published"}},"type":"object","required":["published"],"title":"PublishBody"},"QueryRequest":{"properties":{"query":{"type":"string","title":"Query"},"top_k":{"type":"integer","title":"Top K","default":3},"department_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Department Id"},"department":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Department"}},"type":"object","required":["query"],"title":"QueryRequest"},"QueryResult":{"properties":{"chunk_text":{"type":"string","title":"Chunk Text"},"similarity":{"type":"number","title":"Similarity"},"document_name":{"type":"string","title":"Document Name"}},"type":"object","required":["chunk_text","similarity","document_name"],"title":"QueryResult"},"QuotaResponse":{"properties":{"allowed":{"type":"boolean","title":"Allowed"},"minutes_remaining":{"type":"integer","title":"Minutes Remaining"},"sms_remaining":{"type":"integer","title":"Sms Remaining"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"},"calls_active":{"type":"integer","title":"Calls Active","default":0},"concurrent_limit":{"type":"integer","title":"Concurrent Limit","default":1}},"type":"object","required":["allowed","minutes_remaining","sms_remaining"],"title":"QuotaResponse"},"ROIResult":{"properties":{"missed_calls_per_month":{"type":"integer","title":"Missed Calls Per Month"},"total_calls_per_month":{"type":"integer","title":"Total Calls Per Month"},"callback_rate_percent":{"type":"integer","title":"Callback Rate Percent"},"conversion_percent":{"type":"integer","title":"Conversion Percent"},"recovered_jobs_per_month":{"type":"number","title":"Recovered Jobs Per Month"},"recovered_revenue_per_month_pln":{"type":"number","title":"Recovered Revenue Per Month Pln"},"hours_returned_per_month":{"type":"number","title":"Hours Returned Per Month"},"time_value_per_month_pln":{"type":"number","title":"Time Value Per Month Pln"},"zvonai_cost_per_month_pln":{"type":"number","title":"Zvonai Cost Per Month Pln"},"net_gain_per_month_pln":{"type":"number","title":"Net Gain Per Month Pln"},"net_gain_per_year_pln":{"type":"number","title":"Net Gain Per Year Pln"},"months_covered_by_one_client":{"type":"number","title":"Months Covered By One Client"},"calls_recovered_percent":{"type":"integer","title":"Calls Recovered Percent"},"recommended_plan":{"type":"string","title":"Recommended Plan"},"recommended_plan_name":{"type":"string","title":"Recommended Plan Name"},"pain_headline":{"type":"string","title":"Pain Headline"},"pain_stat":{"type":"string","title":"Pain Stat"},"industry_name":{"type":"string","title":"Industry Name"},"story_scenario":{"type":"string","title":"Story Scenario"},"story_lost":{"type":"string","title":"Story Lost"},"story_after":{"type":"string","title":"Story After"},"story_insight":{"type":"string","title":"Story Insight"}},"type":"object","required":["missed_calls_per_month","total_calls_per_month","callback_rate_percent","conversion_percent","recovered_jobs_per_month","recovered_revenue_per_month_pln","hours_returned_per_month","time_value_per_month_pln","zvonai_cost_per_month_pln","net_gain_per_month_pln","net_gain_per_year_pln","months_covered_by_one_client","calls_recovered_percent","recommended_plan","recommended_plan_name","pain_headline","pain_stat","industry_name","story_scenario","story_lost","story_after","story_insight"],"title":"ROIResult"},"ReconcileSubscriptionResponse":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"business_name":{"type":"string","title":"Business Name"},"reconciled":{"type":"boolean","title":"Reconciled"},"subscription_tier":{"type":"string","title":"Subscription Tier"},"subscription_status":{"type":"string","title":"Subscription Status"},"stripe_customer_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Customer Id"},"stripe_subscription_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stripe Subscription Id"},"detail":{"type":"string","title":"Detail"}},"type":"object","required":["tenant_id","business_name","reconciled","subscription_tier","subscription_status","stripe_customer_id","stripe_subscription_id","detail"],"title":"ReconcileSubscriptionResponse"},"ReconciliationRow":{"properties":{"conversion_id":{"type":"string","title":"Conversion Id"},"affiliate_code":{"type":"string","title":"Affiliate Code"},"invitee_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invitee Email"},"tenant_id":{"type":"string","title":"Tenant Id"},"subscription_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Status"},"subscription_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Tier"},"signed_up_at":{"type":"string","title":"Signed Up At"},"age_days":{"type":"integer","title":"Age Days"}},"type":"object","required":["conversion_id","affiliate_code","invitee_email","tenant_id","subscription_status","subscription_tier","signed_up_at","age_days"],"title":"ReconciliationRow"},"RedemptionItem":{"properties":{"customer_id":{"type":"string","title":"Customer Id"},"customer_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Email"},"customer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Customer Name"},"redeemed_at":{"type":"string","title":"Redeemed At"},"subscription_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Id"}},"type":"object","required":["customer_id","customer_email","customer_name","redeemed_at","subscription_id"],"title":"RedemptionItem"},"RedemptionsResponse":{"properties":{"coupon_id":{"type":"string","title":"Coupon Id"},"items":{"items":{"$ref":"#/components/schemas/RedemptionItem"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"}},"type":"object","required":["coupon_id","items","total"],"title":"RedemptionsResponse"},"ReferralLeaderboardEntry":{"properties":{"id":{"type":"string","title":"Id"},"phone":{"type":"string","title":"Phone"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"business_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Name"},"referral_code":{"type":"string","title":"Referral Code"},"referral_count":{"type":"integer","title":"Referral Count"},"tier":{"type":"string","title":"Tier"},"position":{"type":"integer","title":"Position"}},"type":"object","required":["id","phone","email","business_name","referral_code","referral_count","tier","position"],"title":"ReferralLeaderboardEntry"},"ReferralLeaderboardResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/ReferralLeaderboardEntry"},"type":"array","title":"Items"}},"type":"object","required":["items"],"title":"ReferralLeaderboardResponse"},"ReferralLinkResponse":{"properties":{"referral_code":{"type":"string","title":"Referral Code"},"referral_url":{"type":"string","title":"Referral Url"},"total_referrals":{"type":"integer","title":"Total Referrals"},"successful_referrals":{"type":"integer","title":"Successful Referrals"},"total_rewards_earned_pln":{"type":"number","title":"Total Rewards Earned Pln"},"max_referrals":{"type":"integer","title":"Max Referrals"},"is_active":{"type":"boolean","title":"Is Active"}},"type":"object","required":["referral_code","referral_url","total_referrals","successful_referrals","total_rewards_earned_pln","max_referrals","is_active"],"title":"ReferralLinkResponse"},"RefundRecord":{"properties":{"id":{"type":"string","title":"Id"},"appointment_id":{"type":"string","title":"Appointment Id"},"amount_grosze":{"type":"integer","title":"Amount Grosze"},"refund_amount_grosze":{"type":"integer","title":"Refund Amount Grosze"},"refund_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refund Reason"},"refunded_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Refunded At"},"patient_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Patient Name"},"service_type":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Service Type"}},"type":"object","required":["id","appointment_id","amount_grosze","refund_amount_grosze"],"title":"RefundRecord"},"RefundRequest":{"properties":{"amount_grosze":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Amount Grosze"},"reason":{"type":"string","title":"Reason","default":"requested_by_customer"},"note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Note"}},"type":"object","title":"RefundRequest"},"ReminderConfigResponse":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"channels":{"items":{"type":"string"},"type":"array","title":"Channels"},"timing":{"items":{"type":"integer"},"type":"array","title":"Timing"},"booking_confirmation":{"type":"boolean","title":"Booking Confirmation"},"cancellation_notice":{"type":"boolean","title":"Cancellation Notice"},"custom_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custom Message"}},"type":"object","required":["enabled","channels","timing","booking_confirmation","cancellation_notice","custom_message"],"title":"ReminderConfigResponse"},"ReminderConfigUpdate":{"properties":{"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"},"channels":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Channels"},"timing":{"anyOf":[{"items":{"type":"integer"},"type":"array"},{"type":"null"}],"title":"Timing"},"booking_confirmation":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Booking Confirmation"},"cancellation_notice":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Cancellation Notice"},"custom_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custom Message"}},"type":"object","title":"ReminderConfigUpdate"},"ReprovisionRequest":{"properties":{"force":{"type":"boolean","title":"Force","default":false}},"type":"object","title":"ReprovisionRequest"},"ResendVerificationByEmailRequest":{"properties":{"email":{"type":"string","title":"Email"}},"type":"object","required":["email"],"title":"ResendVerificationByEmailRequest"},"ResetPasswordRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"token":{"type":"string","title":"Token"},"new_password":{"type":"string","title":"New Password"}},"type":"object","required":["email","token","new_password"],"title":"ResetPasswordRequest"},"ResourceIn":{"properties":{"kind":{"type":"string","title":"Kind","default":"room"},"name":{"type":"string","maxLength":80,"minLength":1,"title":"Name"},"type_label":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Type Label"},"capacity_guests":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Capacity Guests","default":2},"ical_import_url":{"anyOf":[{"type":"string","maxLength":1000},{"type":"null"}],"title":"Ical Import Url"},"is_active":{"type":"boolean","title":"Is Active","default":true},"user_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"User Id"},"service_keys":{"items":{"type":"string"},"type":"array","maxItems":50,"title":"Service Keys"},"sort_order":{"type":"integer","maximum":999.0,"minimum":0.0,"title":"Sort Order","default":0},"quantity":{"type":"integer","maximum":200.0,"minimum":1.0,"title":"Quantity","default":1},"zone":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}],"title":"Zone"},"bed_setup":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Bed Setup"},"max_adults":{"anyOf":[{"type":"integer","maximum":50.0,"minimum":1.0},{"type":"null"}],"title":"Max Adults"},"max_children":{"anyOf":[{"type":"integer","maximum":50.0,"minimum":0.0},{"type":"null"}],"title":"Max Children"},"extra_bed":{"type":"boolean","title":"Extra Bed","default":false},"cot":{"type":"boolean","title":"Cot","default":false},"features":{"items":{"type":"string"},"type":"array","maxItems":20,"title":"Features"},"languages":{"items":{"type":"string"},"type":"array","maxItems":12,"title":"Languages"}},"type":"object","required":["name"],"title":"ResourceIn"},"ResourceOut":{"properties":{"id":{"type":"string","title":"Id"},"kind":{"type":"string","title":"Kind"},"name":{"type":"string","title":"Name"},"type_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type Label"},"capacity_guests":{"type":"integer","title":"Capacity Guests"},"is_active":{"type":"boolean","title":"Is Active"},"ical_import_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ical Import Url"},"ical_export_path":{"type":"string","title":"Ical Export Path"},"ical_last_synced_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Ical Last Synced At"},"ical_last_error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ical Last Error"},"user_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Id"},"service_keys":{"items":{"type":"string"},"type":"array","title":"Service Keys","default":[]},"sort_order":{"type":"integer","title":"Sort Order","default":0},"quantity":{"type":"integer","title":"Quantity","default":1},"zone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Zone"},"bed_setup":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bed Setup"},"max_adults":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Adults"},"max_children":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Children"},"extra_bed":{"type":"boolean","title":"Extra Bed","default":false},"cot":{"type":"boolean","title":"Cot","default":false},"features":{"items":{"type":"string"},"type":"array","title":"Features","default":[]},"languages":{"items":{"type":"string"},"type":"array","title":"Languages","default":[]}},"type":"object","required":["id","kind","name","type_label","capacity_guests","is_active","ical_import_url","ical_export_path","ical_last_synced_at","ical_last_error"],"title":"ResourceOut"},"RoleChangeRequest":{"properties":{"role":{"type":"string","title":"Role"}},"type":"object","required":["role"],"title":"RoleChangeRequest"},"RotateTokenRequest":{"properties":{"revoke":{"type":"boolean","title":"Revoke","default":false}},"type":"object","title":"RotateTokenRequest"},"RoutingConfigResponse":{"properties":{"departments":{"items":{"$ref":"#/components/schemas/DepartmentResponse"},"type":"array","title":"Departments"},"default_department_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Default Department Id"},"transfer_message_template":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transfer Message Template"},"busy_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Busy Message"},"outside_hours_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outside Hours Message"},"enable_voicemail":{"type":"boolean","title":"Enable Voicemail"},"max_transfer_attempts":{"type":"integer","title":"Max Transfer Attempts"},"transfer_timeout_seconds":{"type":"integer","title":"Transfer Timeout Seconds"}},"type":"object","required":["departments","default_department_id","transfer_message_template","busy_message","outside_hours_message","enable_voicemail","max_transfer_attempts","transfer_timeout_seconds"],"title":"RoutingConfigResponse"},"SMSConfigResponse":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"provider":{"type":"string","title":"Provider"},"config":{"additionalProperties":true,"type":"object","title":"Config"},"send_booking_confirmation":{"type":"boolean","title":"Send Booking Confirmation"},"send_cancellation_notice":{"type":"boolean","title":"Send Cancellation Notice"}},"type":"object","required":["enabled","provider","config","send_booking_confirmation","send_cancellation_notice"],"title":"SMSConfigResponse"},"SMSTopUpRequest":{"properties":{"success_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Success Url"},"cancel_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cancel Url"}},"type":"object","title":"SMSTopUpRequest"},"SMSUsageIncrement":{"properties":{"count":{"type":"integer","title":"Count","default":1}},"type":"object","title":"SMSUsageIncrement"},"SalesDemoInput":{"properties":{"company_name":{"type":"string","title":"Company Name"},"contact_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Name"},"contact_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Email"},"industry":{"type":"string","enum":["dental","medical","legal","beauty","aesthetic","physio","veterinary","psychology","realestate","auto","fitness","solar","hospitality","restaurant","towing","locksmith","driving_school","funeral","pharmacy","accounting","trades","other"],"title":"Industry"},"employees_on_phones":{"type":"integer","title":"Employees On Phones"},"hourly_labor_cost_pln":{"type":"number","title":"Hourly Labor Cost Pln"},"missed_calls_per_week":{"type":"integer","title":"Missed Calls Per Week"},"total_calls_per_week":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Calls Per Week"},"avg_call_value_pln":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Call Value Pln"},"callback_rate":{"anyOf":[{"type":"number","maximum":0.9,"minimum":0.0},{"type":"null"}],"title":"Callback Rate"},"conversion_rate":{"anyOf":[{"type":"number","maximum":1.0,"exclusiveMinimum":0.0},{"type":"null"}],"title":"Conversion Rate"},"promo_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Promo Code"},"promo_valid_until":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Promo Valid Until"},"offer_language":{"type":"string","title":"Offer Language","default":"pl"}},"type":"object","required":["company_name","industry","employees_on_phones","hourly_labor_cost_pln","missed_calls_per_week"],"title":"SalesDemoInput"},"SalesDemoLeadOut":{"properties":{"id":{"type":"string","title":"Id"},"company_name":{"type":"string","title":"Company Name"},"contact_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Email"},"contact_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Contact Name"},"industry":{"type":"string","title":"Industry"},"input_data":{"additionalProperties":true,"type":"object","title":"Input Data"},"roi_result":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Roi Result"},"recommended_plan":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Recommended Plan"},"promo_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Promo Code"},"promo_valid_until":{"anyOf":[{"type":"string","format":"date"},{"type":"null"}],"title":"Promo Valid Until"},"pdf_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pdf Url"},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Sent At"},"status":{"type":"string","title":"Status"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"},"created_by_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By Email"},"created_by_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Created By Name"}},"type":"object","required":["id","company_name","contact_email","contact_name","industry","input_data","roi_result","recommended_plan","pdf_url","sent_at","status","created_at"],"title":"SalesDemoLeadOut"},"SaveDraftRequest":{"properties":{"step":{"type":"integer","title":"Step"},"data":{"additionalProperties":true,"type":"object","title":"Data"}},"type":"object","required":["step","data"],"title":"SaveDraftRequest"},"ScheduleDayBody":{"properties":{"ids":{"items":{"type":"string"},"type":"array","maxItems":20,"minItems":1,"title":"Ids"},"scheduled_at":{"type":"string","format":"date-time","title":"Scheduled At"},"delivered_by":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Delivered By"},"notify":{"type":"boolean","title":"Notify","default":true}},"type":"object","required":["ids","scheduled_at"],"title":"ScheduleDayBody"},"SchedulerJobInfo":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"next_run_time":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Next Run Time"},"trigger":{"type":"string","title":"Trigger"},"pending":{"type":"boolean","title":"Pending"},"coalesce":{"type":"boolean","title":"Coalesce"},"misfire_grace_time":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Misfire Grace Time"}},"type":"object","required":["id","name","next_run_time","trigger","pending","coalesce","misfire_grace_time"],"title":"SchedulerJobInfo"},"SchedulerStatusResponse":{"properties":{"running":{"type":"boolean","title":"Running"},"timezone":{"type":"string","title":"Timezone"},"job_count":{"type":"integer","title":"Job Count"},"jobs":{"items":{"$ref":"#/components/schemas/SchedulerJobInfo"},"type":"array","title":"Jobs"}},"type":"object","required":["running","timezone","job_count","jobs"],"title":"SchedulerStatusResponse"},"ScrapeFAQRequest":{"properties":{"url":{"type":"string","maxLength":2083,"minLength":1,"format":"uri","title":"Url"}},"type":"object","required":["url"],"title":"ScrapeFAQRequest"},"ScrapeFAQResponse":{"properties":{"questions":{"items":{"$ref":"#/components/schemas/FAQItem"},"type":"array","title":"Questions"},"business_info":{"$ref":"#/components/schemas/BusinessInfo"},"question_count":{"type":"integer","title":"Question Count","default":0},"enough":{"type":"boolean","title":"Enough","default":false},"questions_only":{"type":"boolean","title":"Questions Only","default":false},"total_found":{"type":"integer","title":"Total Found","default":0},"tier_limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Tier Limit"}},"type":"object","required":["questions","business_info"],"title":"ScrapeFAQResponse"},"ScriptTemplateCreate":{"properties":{"name":{"type":"string","maxLength":120,"minLength":1,"title":"Name"},"greeting":{"type":"string","minLength":1,"title":"Greeting"},"greeting_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Greeting En"},"faq":{"additionalProperties":true,"type":"object","title":"Faq"},"faq_en":{"additionalProperties":true,"type":"object","title":"Faq En"}},"type":"object","required":["name","greeting"],"title":"ScriptTemplateCreate"},"ScriptTemplateOut":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"greeting":{"type":"string","title":"Greeting"},"greeting_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Greeting En"},"faq":{"additionalProperties":true,"type":"object","title":"Faq"},"faq_en":{"additionalProperties":true,"type":"object","title":"Faq En"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","name","greeting","greeting_en","faq","faq_en","created_at","updated_at"],"title":"ScriptTemplateOut"},"SeatPatch":{"properties":{"display_name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Display Name"},"from_email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"From Email"},"from_name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"From Name"},"reply_to":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Reply To"},"cc":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Cc"},"bcc":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Bcc"},"focus_vertical":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Focus Vertical"},"focus_voivodeship":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}],"title":"Focus Voivodeship"},"daily_dials_target":{"anyOf":[{"type":"integer","maximum":500.0,"minimum":0.0},{"type":"null"}],"title":"Daily Dials Target"},"weekly_demos_target":{"anyOf":[{"type":"integer","maximum":200.0,"minimum":0.0},{"type":"null"}],"title":"Weekly Demos Target"},"active":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Active"}},"type":"object","title":"SeatPatch"},"SectionAccessIn":{"properties":{"sections":{"anyOf":[{"additionalProperties":{"additionalProperties":{"type":"string"},"type":"object"},"type":"object"},{"type":"null"}],"title":"Sections"},"employee_calendar_scope":{"anyOf":[{"type":"string","maxLength":8},{"type":"null"}],"title":"Employee Calendar Scope"},"match_by_language":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Match By Language"}},"type":"object","title":"SectionAccessIn","description":"What the owner chose: {\"calls\": {\"read\": \"manager\"}, ...} plus the employee calendar scope."},"SecurityEventCreate":{"properties":{"event_type":{"type":"string","title":"Event Type"},"severity":{"type":"string","title":"Severity"},"reason":{"type":"string","title":"Reason"},"confidence":{"type":"number","title":"Confidence"},"caller_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Caller Number"},"text_sample":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Text Sample"}},"type":"object","required":["event_type","severity","reason","confidence"],"title":"SecurityEventCreate"},"SelectedCalendarsRequest":{"properties":{"selected_calendar_ids":{"items":{"type":"string"},"type":"array","title":"Selected Calendar Ids"}},"type":"object","required":["selected_calendar_ids"],"title":"SelectedCalendarsRequest"},"SendDemoRequest":{"properties":{"lead_id":{"type":"string","title":"Lead Id"},"contact_email":{"type":"string","title":"Contact Email"}},"type":"object","required":["lead_id","contact_email"],"title":"SendDemoRequest"},"SendDepositLinkRequest":{"properties":{"amount_grosze":{"anyOf":[{"type":"integer","maximum":200000.0,"minimum":200.0},{"type":"null"}],"title":"Amount Grosze"}},"type":"object","title":"SendDepositLinkRequest","description":"`amount_grosze` overrides the service and tenant-wide amounts.\n\nOnly honoured when creating; resending an existing deposit must not\nsilently change what the patient was already asked to pay."},"SendDepositLinkResponse":{"properties":{"sent":{"type":"boolean","title":"Sent"},"resent":{"type":"boolean","title":"Resent"},"amount_grosze":{"type":"integer","title":"Amount Grosze"},"status":{"type":"string","title":"Status"},"expires_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Expires At"}},"type":"object","required":["sent","resent","amount_grosze","status","expires_at"],"title":"SendDepositLinkResponse"},"SendLinkIn":{"properties":{"email":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Email"},"phone":{"anyOf":[{"type":"string","maxLength":32},{"type":"null"}],"title":"Phone"}},"type":"object","title":"SendLinkIn"},"SendStepIn":{"properties":{"resend":{"type":"boolean","title":"Resend","default":false},"subject_override":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subject Override"},"body_override":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Body Override"}},"type":"object","title":"SendStepIn","description":"Send again only when the desk says so, and with her wording if she edited it."},"SendWelcomeResponse":{"properties":{"sent_email":{"type":"boolean","title":"Sent Email"},"sent_in_app":{"type":"boolean","title":"Sent In App"},"phone_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone Number"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"}},"type":"object","required":["sent_email","sent_in_app","phone_number","email"],"title":"SendWelcomeResponse"},"SetupDraftRequest":{"properties":{"token":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Token"},"business_name":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Business Name"},"nip":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Nip"},"industry":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Industry"},"contact_name":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}],"title":"Contact Name"},"phone":{"type":"string","maxLength":20,"minLength":9,"pattern":"^[+\\d][\\d\\s\\-()]{8,19}$","title":"Phone"},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email"},"best_time":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Best Time"},"postcode":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}],"title":"Postcode"},"town":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Town"},"option":{"type":"string","enum":["self","phone","onsite","unsure"],"title":"Option","default":"unsure"},"plan":{"anyOf":[{"type":"string","enum":["solo","starter","business","unsure"]},{"type":"null"}],"title":"Plan"},"answers":{"additionalProperties":{"type":"string"},"type":"object","title":"Answers"},"language":{"type":"string","enum":["pl","en"],"title":"Language","default":"pl"},"consent_contact":{"type":"boolean","title":"Consent Contact","default":false},"send_link":{"type":"boolean","title":"Send Link","default":true},"website":{"type":"string","maxLength":200,"title":"Website","default":""}},"type":"object","required":["phone"],"title":"SetupDraftRequest"},"SetupFormRequest":{"properties":{"business_name":{"type":"string","maxLength":200,"minLength":2,"title":"Business Name"},"nip":{"anyOf":[{"type":"string","maxLength":20},{"type":"null"}],"title":"Nip"},"industry":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Industry"},"contact_name":{"type":"string","maxLength":120,"minLength":2,"title":"Contact Name"},"phone":{"type":"string","maxLength":20,"minLength":9,"pattern":"^[+\\d][\\d\\s\\-()]{8,19}$","title":"Phone"},"email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Email"},"best_time":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Best Time"},"postcode":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}],"title":"Postcode"},"town":{"anyOf":[{"type":"string","maxLength":80},{"type":"null"}],"title":"Town"},"option":{"type":"string","enum":["self","phone","onsite","unsure"],"title":"Option","default":"unsure"},"plan":{"anyOf":[{"type":"string","enum":["solo","starter","business","unsure"]},{"type":"null"}],"title":"Plan"},"answers":{"additionalProperties":{"type":"string"},"type":"object","title":"Answers"},"language":{"type":"string","enum":["pl","en"],"title":"Language","default":"pl"},"consent_contact":{"type":"boolean","title":"Consent Contact","default":false},"website":{"type":"string","maxLength":200,"title":"Website","default":""},"fill_ms":{"anyOf":[{"type":"integer","minimum":0.0},{"type":"null"}],"title":"Fill Ms"},"draft_token":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Draft Token"}},"type":"object","required":["business_name","contact_name","phone"],"title":"SetupFormRequest"},"SetupRequest":{"properties":{"method":{"type":"string","title":"Method","default":"app"}},"type":"object","title":"SetupRequest"},"SetupRequestUpdate":{"properties":{"status":{"anyOf":[{"type":"string","enum":["new","contacted","scheduled","prepared","live","care","closed"]},{"type":"null"}],"title":"Status"},"scheduled_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Scheduled At"},"delivered_by":{"anyOf":[{"type":"string","maxLength":40},{"type":"null"}],"title":"Delivered By"},"blocked_step":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}],"title":"Blocked Step"},"notes":{"anyOf":[{"type":"string","maxLength":4000},{"type":"null"}],"title":"Notes"},"partner_affiliate_id":{"anyOf":[{"type":"string","maxLength":36},{"type":"null"}],"title":"Partner Affiliate Id"}},"type":"object","title":"SetupRequestUpdate"},"SetupResponse":{"properties":{"secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Secret"},"qr_code_base64":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Qr Code Base64"},"otpauth_uri":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Otpauth Uri"},"method":{"type":"string","title":"Method"}},"type":"object","required":["method"],"title":"SetupResponse"},"SetupServiceCheckoutRequest":{"properties":{"option":{"type":"string","enum":["phone","onsite"],"title":"Option","default":"phone"},"postcode":{"anyOf":[{"type":"string","maxLength":10},{"type":"null"}],"title":"Postcode"},"start_early_consent":{"type":"boolean","title":"Start Early Consent","default":false},"success_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Success Url"},"cancel_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cancel Url"}},"type":"object","title":"SetupServiceCheckoutRequest"},"SetupServiceOrderResponse":{"properties":{"checkout_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Checkout Url"},"session_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Session Id"},"included":{"type":"boolean","title":"Included","default":false},"setup_request_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Setup Request Id"}},"type":"object","title":"SetupServiceOrderResponse"},"SetupServiceState":{"properties":{"included":{"type":"boolean","title":"Included"},"purchased":{"type":"boolean","title":"Purchased"},"price_grosze":{"type":"integer","title":"Price Grosze"},"onsite_price_grosze":{"type":"integer","title":"Onsite Price Grosze"},"booking_url":{"type":"string","title":"Booking Url"},"option":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Option"},"status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Status"},"confirmed":{"type":"boolean","title":"Confirmed","default":false}},"type":"object","required":["included","purchased","price_grosze","onsite_price_grosze","booking_url"],"title":"SetupServiceState"},"SignupSourceBreakdown":{"properties":{"source":{"type":"string","title":"Source"},"count":{"type":"integer","title":"Count"},"percentage":{"type":"number","title":"Percentage"}},"type":"object","required":["source","count","percentage"],"title":"SignupSourceBreakdown"},"SmsTestBody":{"properties":{"to":{"type":"string","title":"To"}},"type":"object","required":["to"],"title":"SmsTestBody"},"StatusChange":{"properties":{"status":{"type":"string","title":"Status"}},"type":"object","required":["status"],"title":"StatusChange"},"StatusComponentDTO":{"properties":{"name":{"type":"string","title":"Name"},"label_pl":{"type":"string","title":"Label Pl"},"label_en":{"type":"string","title":"Label En"},"status":{"type":"string","title":"Status"},"latency_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Latency Ms"}},"type":"object","required":["name","label_pl","label_en","status"],"title":"StatusComponentDTO"},"StatusGroupDTO":{"properties":{"key":{"type":"string","title":"Key"},"label_pl":{"type":"string","title":"Label Pl"},"label_en":{"type":"string","title":"Label En"},"status":{"type":"string","title":"Status"},"components":{"items":{"$ref":"#/components/schemas/StatusComponentDTO"},"type":"array","title":"Components"}},"type":"object","required":["key","label_pl","label_en","status","components"],"title":"StatusGroupDTO"},"StatusPageResponse":{"properties":{"overall_status":{"type":"string","title":"Overall Status"},"timestamp":{"type":"string","format":"date-time","title":"Timestamp"},"groups":{"items":{"$ref":"#/components/schemas/StatusGroupDTO"},"type":"array","title":"Groups"},"active_incidents":{"items":{"$ref":"#/components/schemas/IncidentDTO"},"type":"array","title":"Active Incidents"},"recent_incidents":{"items":{"$ref":"#/components/schemas/IncidentDTO"},"type":"array","title":"Recent Incidents"},"uptime_90d":{"items":{"$ref":"#/components/schemas/ComponentUptimeDTO"},"type":"array","title":"Uptime 90D"}},"type":"object","required":["overall_status","timestamp","groups","active_incidents","recent_incidents","uptime_90d"],"title":"StatusPageResponse"},"StatusResponse":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Method"},"has_backup_codes":{"type":"boolean","title":"Has Backup Codes"}},"type":"object","required":["enabled","has_backup_codes"],"title":"StatusResponse"},"StayAvailabilityQuery":{"properties":{"check_in":{"type":"string","format":"date","title":"Check In"},"check_out":{"type":"string","format":"date","title":"Check Out"},"guests":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Guests","default":2},"type_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type Label"},"adults":{"anyOf":[{"type":"integer","maximum":50.0,"minimum":1.0},{"type":"null"}],"title":"Adults"},"children_ages":{"items":{"type":"integer"},"type":"array","maxItems":20,"title":"Children Ages"}},"type":"object","required":["check_in","check_out"],"title":"StayAvailabilityQuery"},"StayOption":{"properties":{"resource_id":{"type":"string","title":"Resource Id"},"name":{"type":"string","title":"Name"},"type_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Type Label"},"capacity_guests":{"type":"integer","title":"Capacity Guests"},"nights":{"type":"integer","title":"Nights"},"total_price_grosze":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Price Grosze"},"deposit_grosze":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Deposit Grosze"},"bed_setup":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bed Setup"},"bed_setup_label":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Bed Setup Label"},"extra_bed_needed":{"type":"boolean","title":"Extra Bed Needed","default":false},"cot":{"type":"boolean","title":"Cot","default":false},"features":{"items":{"type":"string"},"type":"array","title":"Features","default":[]}},"type":"object","required":["resource_id","name","type_label","capacity_guests","nights","total_price_grosze"],"title":"StayOption"},"StripeEventItem":{"properties":{"id":{"type":"string","title":"Id"},"event_id":{"type":"string","title":"Event Id"},"event_type":{"type":"string","title":"Event Type"},"processed_at":{"type":"string","format":"date-time","title":"Processed At"}},"type":"object","required":["id","event_id","event_type","processed_at"],"title":"StripeEventItem"},"StripeEventsResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/StripeEventItem"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"type_counts":{"additionalProperties":{"type":"integer"},"type":"object","title":"Type Counts"}},"type":"object","required":["items","total","type_counts"],"title":"StripeEventsResponse"},"SttModeResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_name":{"type":"string","title":"Business Name"},"stt_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stt Mode"},"supported_languages":{"items":{"type":"string"},"type":"array","title":"Supported Languages"}},"type":"object","required":["id","business_name","stt_mode","supported_languages"],"title":"SttModeResponse"},"SttModeUpdate":{"properties":{"stt_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stt Mode"}},"type":"object","title":"SttModeUpdate"},"SubProcessorListResponse":{"properties":{"sub_processors":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Sub Processors"},"last_updated":{"type":"string","title":"Last Updated"}},"type":"object","required":["sub_processors","last_updated"],"title":"SubProcessorListResponse"},"SubscribeBody":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"locale":{"type":"string","title":"Locale","default":"pl"}},"type":"object","required":["email"],"title":"SubscribeBody"},"SubscribeResponse":{"properties":{"status":{"type":"string","title":"Status"},"subscription_count":{"type":"integer","title":"Subscription Count"}},"type":"object","required":["status","subscription_count"],"title":"SubscribeResponse"},"SubscriptionKeys":{"properties":{"p256dh":{"type":"string","maxLength":255,"minLength":1,"title":"P256Dh"},"auth":{"type":"string","maxLength":255,"minLength":1,"title":"Auth"}},"type":"object","required":["p256dh","auth"],"title":"SubscriptionKeys"},"SubscriptionResponse":{"properties":{"tier":{"type":"string","title":"Tier"},"status":{"type":"string","title":"Status"},"has_stripe_billing":{"type":"boolean","title":"Has Stripe Billing","default":true},"has_active_subscription":{"type":"boolean","title":"Has Active Subscription","default":false},"pending_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pending Tier"},"trial_ends_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Trial Ends At"},"period_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Period End"},"cancel_at_period_end":{"type":"boolean","title":"Cancel At Period End"},"next_invoice_amount_pln":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Invoice Amount Pln"},"retention_offer_used":{"type":"boolean","title":"Retention Offer Used","default":false},"number_release_date":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Number Release Date"},"billing_cycle":{"type":"string","title":"Billing Cycle","default":"monthly"},"commitment_type":{"type":"string","title":"Commitment Type","default":"monthly"},"commitment_end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Commitment End"},"past_due_since":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Past Due Since"},"suspended_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Suspended At"}},"type":"object","required":["tier","status","trial_ends_at","period_end","cancel_at_period_end","next_invoice_amount_pln"],"title":"SubscriptionResponse"},"SuggestedFAQ":{"properties":{"question":{"type":"string","title":"Question"},"answer":{"type":"string","title":"Answer"}},"type":"object","required":["question","answer"],"title":"SuggestedFAQ"},"SupportTicketRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"subject":{"type":"string","maxLength":200,"minLength":3,"title":"Subject"},"description":{"type":"string","maxLength":4000,"minLength":3,"title":"Description"},"category":{"type":"string","enum":["question","bug","billing","feature","demo"],"title":"Category","default":"question"},"severity":{"type":"string","enum":["low","medium","high"],"title":"Severity","default":"medium"},"name":{"type":"string","maxLength":120,"title":"Name","default":""},"locale":{"type":"string","pattern":"^(pl|en)$","title":"Locale","default":"pl"},"turnstile_token":{"anyOf":[{"type":"string","maxLength":4096},{"type":"null"}],"title":"Turnstile Token"},"company_website":{"type":"string","maxLength":200,"title":"Company Website","default":""}},"type":"object","required":["email","subject","description"],"title":"SupportTicketRequest"},"SurveyAnswers":{"properties":{"nps":{"anyOf":[{"type":"integer","maximum":10.0,"minimum":0.0},{"type":"null"}],"title":"Nps"},"going_well":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Going Well"},"improve":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Improve"},"feature_request":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Feature Request"},"quote":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Quote"},"publish_consent":{"type":"boolean","title":"Publish Consent","default":false},"publish_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Publish Name"}},"type":"object","title":"SurveyAnswers"},"SystemHealth":{"properties":{"api":{"type":"string","title":"Api"},"voice_engine":{"type":"string","title":"Voice Engine"},"db":{"type":"string","title":"Db"}},"type":"object","required":["api","voice_engine","db"],"title":"SystemHealth"},"SystemHealthResponse":{"properties":{"status":{"type":"string","title":"Status"},"components":{"items":{"$ref":"#/components/schemas/ComponentHealthResponse"},"type":"array","title":"Components"},"timestamp":{"type":"string","format":"date-time","title":"Timestamp"}},"type":"object","required":["status","components","timestamp"],"title":"SystemHealthResponse"},"TableAvailability":{"properties":{"available":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Available"},"times":{"items":{"type":"string"},"type":"array","title":"Times"},"alternatives":{"items":{"type":"string"},"type":"array","title":"Alternatives","default":[]},"turn_minutes":{"type":"integer","title":"Turn Minutes"},"zones":{"items":{"type":"string"},"type":"array","title":"Zones","default":[]},"tables":{"type":"integer","title":"Tables"},"hold_minutes":{"type":"integer","title":"Hold Minutes"}},"type":"object","required":["times","turn_minutes","tables","hold_minutes"],"title":"TableAvailability"},"TableAvailabilityQuery":{"properties":{"date":{"type":"string","format":"date","title":"Date"},"party_size":{"type":"integer","maximum":50.0,"minimum":1.0,"title":"Party Size","default":2},"time":{"anyOf":[{"type":"string","maxLength":5},{"type":"null"}],"title":"Time","description":"HH:MM the caller asked for"},"zone":{"anyOf":[{"type":"string","maxLength":60},{"type":"null"}],"title":"Zone"}},"type":"object","required":["date"],"title":"TableAvailabilityQuery"},"TeamListResponse":{"properties":{"members":{"items":{"$ref":"#/components/schemas/TeamMemberOut"},"type":"array","title":"Members"},"seat_limit":{"type":"integer","title":"Seat Limit"},"seats_used":{"type":"integer","title":"Seats Used"},"can_invite":{"type":"boolean","title":"Can Invite"}},"type":"object","required":["members","seat_limit","seats_used","can_invite"],"title":"TeamListResponse"},"TeamMemberOut":{"properties":{"id":{"type":"string","title":"Id"},"email":{"type":"string","title":"Email"},"full_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Full Name"},"role":{"type":"string","title":"Role"},"status":{"type":"string","title":"Status"},"last_login_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Login At"},"is_self":{"type":"boolean","title":"Is Self","default":false}},"type":"object","required":["id","email","full_name","role","status","last_login_at"],"title":"TeamMemberOut"},"TeamNoteResponse":{"properties":{"call_id":{"type":"string","title":"Call Id"},"team_note":{"type":"string","title":"Team Note"}},"type":"object","required":["call_id","team_note"],"title":"TeamNoteResponse"},"TeamNoteUpdate":{"properties":{"note":{"type":"string","title":"Note"}},"type":"object","required":["note"],"title":"TeamNoteUpdate"},"TeamSeatsRequest":{"properties":{"extra_seats":{"type":"integer","maximum":100.0,"minimum":0.0,"title":"Extra Seats"}},"type":"object","required":["extra_seats"],"title":"TeamSeatsRequest"},"TenantActiveUpdate":{"properties":{"is_active":{"type":"boolean","title":"Is Active"},"reason":{"anyOf":[{"type":"string","maxLength":200},{"type":"null"}],"title":"Reason"}},"type":"object","required":["is_active"],"title":"TenantActiveUpdate"},"TenantConfigResponse":{"properties":{"arrival_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Arrival Note"},"orders_enabled":{"type":"boolean","title":"Orders Enabled","default":false},"orders_callbacks_enabled":{"type":"boolean","title":"Orders Callbacks Enabled","default":false},"orders_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Orders Email"},"orders_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Orders Url"},"orders_goods_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Orders Goods Kind"},"orders_status_sms":{"type":"boolean","title":"Orders Status Sms","default":false},"id":{"type":"string","title":"Id"},"business_name":{"type":"string","title":"Business Name"},"vertical":{"type":"string","title":"Vertical"},"is_live":{"type":"boolean","title":"Is Live","default":false},"language":{"type":"string","title":"Language"},"timezone":{"type":"string","title":"Timezone","default":"Europe/Warsaw"},"supported_languages":{"items":{"type":"string"},"type":"array","title":"Supported Languages"},"solo_language_choice_enabled":{"type":"boolean","title":"Solo Language Choice Enabled","default":false},"stt_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stt Mode"},"greeting":{"type":"string","title":"Greeting"},"greeting_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Greeting En"},"call_disclaimer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Disclaimer"},"system_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"System Prompt"},"voice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voice Id"},"voice_gender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voice Gender"},"voice_config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Voice Config"},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"website":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Website"},"faq":{"additionalProperties":true,"type":"object","title":"Faq"},"faq_en":{"additionalProperties":true,"type":"object","title":"Faq En"},"faq_departments":{"additionalProperties":true,"type":"object","title":"Faq Departments","default":{}},"business_hours":{"additionalProperties":true,"type":"object","title":"Business Hours"},"transfer_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transfer Number"},"failover_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Failover Phone"},"transfer_on_frustration":{"type":"boolean","title":"Transfer On Frustration","default":true},"answering_mode":{"type":"string","title":"Answering Mode","default":"ai_first"},"response_pace":{"type":"string","title":"Response Pace","default":"normal"},"proactive_human_offer":{"type":"boolean","title":"Proactive Human Offer","default":false},"unknown_answer_action":{"type":"string","title":"Unknown Answer Action","default":"ask"},"transfer_unavailable_takes_message":{"type":"boolean","title":"Transfer Unavailable Takes Message","default":true},"hold_branding_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Hold Branding Enabled"},"hold_branding_effective":{"type":"boolean","title":"Hold Branding Effective","default":true},"ai_enabled":{"type":"boolean","title":"Ai Enabled","default":true},"rings_before_ai":{"type":"integer","title":"Rings Before Ai","default":5},"after_hours_mode":{"type":"string","title":"After Hours Mode","default":"ai"},"spoken_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Spoken Name"},"agent_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Name"},"allowed_transfer_numbers":{"items":{"type":"string"},"type":"array","title":"Allowed Transfer Numbers","default":[]},"team_contacts":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Team Contacts","default":[]},"team_absences":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Team Absences","default":[]},"match_by_language":{"type":"boolean","title":"Match By Language","default":false},"people_languages":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"People Languages","default":[]},"vacation_mode":{"type":"boolean","title":"Vacation Mode"},"vacation_from":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vacation From"},"vacation_until":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vacation Until"},"vacation_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vacation Message"},"vacation_allow_faq":{"type":"boolean","title":"Vacation Allow Faq","default":true},"vacation_allow_booking_after":{"type":"boolean","title":"Vacation Allow Booking After","default":true},"vacation_forward_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vacation Forward Number"},"booking_mode":{"type":"string","title":"Booking Mode","default":"direct"},"takes_bookings":{"type":"boolean","title":"Takes Bookings","default":false},"industry_pack":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Industry Pack"},"calendar":{"$ref":"#/components/schemas/CalendarConfigResponse"},"payment":{"$ref":"#/components/schemas/PaymentConfigResponse"},"sms":{"$ref":"#/components/schemas/SMSConfigResponse"},"routing":{"$ref":"#/components/schemas/RoutingConfigResponse"},"policy":{"$ref":"#/components/schemas/PolicyConfigResponse"},"subscription_tier":{"type":"string","title":"Subscription Tier","default":"trialing"},"subscription_status":{"type":"string","title":"Subscription Status","default":"active"},"branding_opt_out":{"type":"boolean","title":"Branding Opt Out","default":false},"recording_consent_required":{"type":"boolean","title":"Recording Consent Required","default":true},"owner_sms_alerts_enabled":{"type":"boolean","title":"Owner Sms Alerts Enabled","default":false},"owner_sms_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner Sms Phone"},"sms_on_missed_transfer":{"type":"boolean","title":"Sms On Missed Transfer","default":true},"sms_on_after_hours":{"type":"boolean","title":"Sms On After Hours","default":true},"sms_on_unanswered":{"type":"boolean","title":"Sms On Unanswered","default":true},"sms_on_cancellation":{"type":"boolean","title":"Sms On Cancellation","default":false},"sms_on_booking":{"type":"boolean","title":"Sms On Booking","default":false},"sms_on_urgent_message":{"type":"boolean","title":"Sms On Urgent Message","default":true},"sms_on_message_left":{"type":"boolean","title":"Sms On Message Left","default":true},"email_on_message_left":{"type":"boolean","title":"Email On Message Left","default":true},"confirm_message_to_caller":{"type":"boolean","title":"Confirm Message To Caller","default":true},"transfer_sms_on_answered":{"type":"boolean","title":"Transfer Sms On Answered","default":false},"invoice_street":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Street"},"invoice_postal_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Postal Code"},"invoice_city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice City"},"invoice_country_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Country Code","default":"PL"},"accountant_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accountant Email"},"nip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nip"},"regon":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Regon"},"krs":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Krs"},"legal_form":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Legal Form"},"avg_appointment_value_grosze":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Avg Appointment Value Grosze"},"services":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Services","default":[]},"calendar_colors":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Calendar Colors"},"data_sources":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Data Sources","default":[]},"crm_config":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Crm Config"},"entitlements":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Entitlements"}},"type":"object","required":["id","business_name","vertical","language","supported_languages","greeting","greeting_en","system_prompt","voice_id","voice_config","address","phone","email","website","faq","faq_en","business_hours","transfer_number","vacation_mode","vacation_from","vacation_until","vacation_message","calendar","payment","sms","routing","policy"],"title":"TenantConfigResponse","description":"Full tenant config for voice engine."},"TenantCreate":{"properties":{"business_name":{"type":"string","title":"Business Name"},"vertical":{"type":"string","title":"Vertical"},"greeting":{"type":"string","title":"Greeting"},"language":{"type":"string","title":"Language","default":"pl"},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"faq":{"additionalProperties":true,"type":"object","title":"Faq","default":{}},"business_hours":{"additionalProperties":true,"type":"object","title":"Business Hours","default":{}}},"type":"object","required":["business_name","vertical","greeting"],"title":"TenantCreate"},"TenantDetailResponse":{"properties":{"signup_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Signup Source"},"id":{"type":"string","title":"Id"},"business_name":{"type":"string","title":"Business Name"},"vertical":{"type":"string","title":"Vertical"},"subscription_tier":{"type":"string","title":"Subscription Tier"},"subscription_status":{"type":"string","title":"Subscription Status"},"is_active":{"type":"boolean","title":"Is Active"},"is_internal":{"type":"boolean","title":"Is Internal"},"billing_managed_manually":{"type":"boolean","title":"Billing Managed Manually"},"billing_managed_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Billing Managed Reason"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"trial_ends_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Trial Ends At"},"nip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nip"},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"invoice_street":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Street"},"invoice_postal_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Postal Code"},"invoice_city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice City"},"invoice_country_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Country Code"},"accountant_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accountant Email"},"minutes_limit":{"type":"integer","title":"Minutes Limit"},"minutes_purchased":{"type":"integer","title":"Minutes Purchased"},"minutes_used_this_month":{"type":"integer","title":"Minutes Used This Month"},"plan_minutes_limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Plan Minutes Limit"},"trial_capped":{"type":"boolean","title":"Trial Capped","default":false},"sms_limit":{"type":"integer","title":"Sms Limit"},"sms_purchased":{"type":"integer","title":"Sms Purchased"},"sms_used_this_month":{"type":"integer","title":"Sms Used This Month"},"trial_minutes_override":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Trial Minutes Override"},"trial_sms_override":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Trial Sms Override"},"stt_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Stt Mode"},"supported_languages":{"items":{"type":"string"},"type":"array","title":"Supported Languages","default":[]},"health":{"$ref":"#/components/schemas/TenantHealthResponse"}},"type":"object","required":["id","business_name","vertical","subscription_tier","subscription_status","is_active","is_internal","billing_managed_manually","billing_managed_reason","created_at","trial_ends_at","nip","address","phone","email","invoice_street","invoice_postal_code","invoice_city","invoice_country_code","accountant_email","minutes_limit","minutes_purchased","minutes_used_this_month","sms_limit","sms_purchased","sms_used_this_month","health"],"title":"TenantDetailResponse","description":"Full tenant detail for admin drill-in (P2). Reuses TenantHealthResponse\nfields but adds the contact + billing fields the operator needs to debug."},"TenantForwardingAdminUpdate":{"properties":{"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"transfer_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transfer Number"},"rings_before_ai":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Rings Before Ai"},"answering_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Answering Mode"}},"type":"object","title":"TenantForwardingAdminUpdate","description":"The four fields a founder needs to prepare a test tenant (owner, 2026-09-11:\n\"do that\" for the Ogród staging tenant, and PATCH /tenants needs a signed-in\nuser while the internal key gets 401)."},"TenantHealthResponse":{"properties":{"calls_today":{"type":"integer","title":"Calls Today"},"errors_today":{"type":"integer","title":"Errors Today"},"avg_latency_ms":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Latency Ms"},"minutes_remaining":{"type":"integer","title":"Minutes Remaining"},"last_call_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Call At"},"active_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Active Number"}},"type":"object","required":["calls_today","errors_today","avg_latency_ms","minutes_remaining","last_call_at","active_number"],"title":"TenantHealthResponse"},"TenantInternalResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_name":{"type":"string","title":"Business Name"},"is_internal":{"type":"boolean","title":"Is Internal"}},"type":"object","required":["id","business_name","is_internal"],"title":"TenantInternalResponse"},"TenantInternalUpdate":{"properties":{"is_internal":{"type":"boolean","title":"Is Internal"}},"type":"object","required":["is_internal"],"title":"TenantInternalUpdate"},"TenantListItem":{"properties":{"id":{"type":"string","title":"Id"},"business_name":{"type":"string","title":"Business Name"},"vertical":{"type":"string","title":"Vertical"},"subscription_tier":{"type":"string","title":"Subscription Tier"},"subscription_status":{"type":"string","title":"Subscription Status"},"subscription_cancel_at_period_end":{"type":"boolean","title":"Subscription Cancel At Period End","default":false},"cancellation_reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cancellation Reason"},"on_local_trial":{"type":"boolean","title":"On Local Trial","default":false},"is_active":{"type":"boolean","title":"Is Active"},"calls_today":{"type":"integer","title":"Calls Today"},"minutes_used":{"type":"integer","title":"Minutes Used"},"minutes_limit":{"type":"integer","title":"Minutes Limit"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"signup_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Signup Source"},"knowledge_score":{"type":"integer","title":"Knowledge Score","default":0},"embedding_score":{"type":"integer","title":"Embedding Score","default":0},"embedding_active":{"items":{"type":"string"},"type":"array","title":"Embedding Active","default":[]},"embedding_missing":{"items":{"type":"string"},"type":"array","title":"Embedding Missing","default":[]}},"type":"object","required":["id","business_name","vertical","subscription_tier","subscription_status","is_active","calls_today","minutes_used","minutes_limit","created_at"],"title":"TenantListItem"},"TenantOverageResponse":{"properties":{"tenants":{"items":{"$ref":"#/components/schemas/TenantOverageRow"},"type":"array","title":"Tenants"},"total_overage_minutes":{"type":"integer","title":"Total Overage Minutes"},"total_overage_pln":{"type":"number","title":"Total Overage Pln"}},"type":"object","required":["tenants","total_overage_minutes","total_overage_pln"],"title":"TenantOverageResponse"},"TenantOverageRow":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"business_name":{"type":"string","title":"Business Name"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"subscription_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Tier"},"minutes_limit":{"type":"integer","title":"Minutes Limit"},"minutes_purchased":{"type":"integer","title":"Minutes Purchased"},"minutes_used_this_month":{"type":"integer","title":"Minutes Used This Month"},"usage_pct":{"type":"number","title":"Usage Pct"},"overage_minutes":{"type":"integer","title":"Overage Minutes"},"overage_cost_pln":{"type":"number","title":"Overage Cost Pln"},"minute_overage_enabled":{"type":"boolean","title":"Minute Overage Enabled"},"minute_overage_consent_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Minute Overage Consent At"},"minute_overage_consent_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Minute Overage Consent Source"},"minute_overage_opted_out_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Minute Overage Opted Out At"}},"type":"object","required":["tenant_id","business_name","email","subscription_tier","minutes_limit","minutes_purchased","minutes_used_this_month","usage_pct","overage_minutes","overage_cost_pln","minute_overage_enabled","minute_overage_consent_at","minute_overage_consent_source","minute_overage_opted_out_at"],"title":"TenantOverageRow"},"TenantSettingsResponse":{"properties":{"time_off_auto_approve":{"type":"boolean","title":"Time Off Auto Approve","default":false},"time_off_managers_approve":{"type":"boolean","title":"Time Off Managers Approve","default":true},"auto_topup_enabled":{"type":"boolean","title":"Auto Topup Enabled"},"require_team_2fa":{"type":"boolean","title":"Require Team 2Fa","default":false},"auto_topup_threshold_minutes":{"type":"integer","title":"Auto Topup Threshold Minutes"},"overage_enabled":{"type":"boolean","title":"Overage Enabled"},"minute_overage_enabled":{"type":"boolean","title":"Minute Overage Enabled","default":false},"minute_overage_consent_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Minute Overage Consent At"},"minute_overage_consent_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Minute Overage Consent Source"},"call_disclaimer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Disclaimer"},"audio_retention_days":{"type":"integer","title":"Audio Retention Days"},"transcript_retention_days":{"type":"integer","title":"Transcript Retention Days"},"digest_frequency":{"type":"string","title":"Digest Frequency"},"callback_alerts_enabled":{"type":"boolean","title":"Callback Alerts Enabled"},"daily_digest_enabled":{"type":"boolean","title":"Daily Digest Enabled"},"notification_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notification Email"},"subscription_tier":{"type":"string","title":"Subscription Tier"},"branding_opt_out":{"type":"boolean","title":"Branding Opt Out"},"owner_sms_alerts_enabled":{"type":"boolean","title":"Owner Sms Alerts Enabled"},"owner_sms_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner Sms Phone"},"sms_on_missed_transfer":{"type":"boolean","title":"Sms On Missed Transfer"},"sms_on_after_hours":{"type":"boolean","title":"Sms On After Hours"},"sms_on_unanswered":{"type":"boolean","title":"Sms On Unanswered"},"sms_on_cancellation":{"type":"boolean","title":"Sms On Cancellation"},"sms_on_booking":{"type":"boolean","title":"Sms On Booking"},"sms_on_urgent_message":{"type":"boolean","title":"Sms On Urgent Message"},"sms_on_message_left":{"type":"boolean","title":"Sms On Message Left"},"email_on_message_left":{"type":"boolean","title":"Email On Message Left"},"confirm_message_to_caller":{"type":"boolean","title":"Confirm Message To Caller","default":true},"transfer_sms_on_answered":{"type":"boolean","title":"Transfer Sms On Answered","default":false}},"type":"object","required":["auto_topup_enabled","auto_topup_threshold_minutes","overage_enabled","audio_retention_days","transcript_retention_days","digest_frequency","callback_alerts_enabled","daily_digest_enabled","subscription_tier","branding_opt_out","owner_sms_alerts_enabled","sms_on_missed_transfer","sms_on_after_hours","sms_on_unanswered","sms_on_cancellation","sms_on_booking","sms_on_urgent_message","sms_on_message_left","email_on_message_left"],"title":"TenantSettingsResponse"},"TenantSettingsUpdate":{"properties":{"auto_topup_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Auto Topup Enabled"},"auto_topup_threshold_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Auto Topup Threshold Minutes"},"overage_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Overage Enabled"},"minute_overage_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Minute Overage Enabled"},"call_disclaimer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Disclaimer"},"audio_retention_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Audio Retention Days"},"transcript_retention_days":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Transcript Retention Days"},"digest_frequency":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Digest Frequency"},"callback_alerts_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Callback Alerts Enabled"},"daily_digest_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Daily Digest Enabled"},"notification_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notification Email"},"branding_opt_out":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Branding Opt Out"},"owner_sms_alerts_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Owner Sms Alerts Enabled"},"time_off_auto_approve":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Time Off Auto Approve"},"time_off_managers_approve":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Time Off Managers Approve"},"owner_sms_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Owner Sms Phone"},"sms_on_missed_transfer":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Sms On Missed Transfer"},"sms_on_after_hours":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Sms On After Hours"},"sms_on_unanswered":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Sms On Unanswered"},"sms_on_cancellation":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Sms On Cancellation"},"sms_on_booking":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Sms On Booking"},"require_team_2fa":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Require Team 2Fa"},"sms_on_urgent_message":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Sms On Urgent Message"},"sms_on_message_left":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Sms On Message Left"},"email_on_message_left":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Email On Message Left"},"confirm_message_to_caller":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Confirm Message To Caller"},"transfer_sms_on_answered":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Transfer Sms On Answered"}},"type":"object","title":"TenantSettingsUpdate","description":"Partial settings update: billing/quota, retention, notification, and SMS alert fields."},"TenantTierResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_name":{"type":"string","title":"Business Name"},"subscription_tier":{"type":"string","title":"Subscription Tier"}},"type":"object","required":["id","business_name","subscription_tier"],"title":"TenantTierResponse"},"TenantTierUpdate":{"properties":{"subscription_tier":{"type":"string","title":"Subscription Tier"}},"type":"object","required":["subscription_tier"],"title":"TenantTierUpdate"},"TenantUpdate":{"properties":{"orders_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Orders Enabled"},"orders_email":{"anyOf":[{"type":"string","format":"email"},{"type":"null"}],"title":"Orders Email"},"orders_url":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}],"title":"Orders Url"},"orders_goods_kind":{"anyOf":[{"type":"string","pattern":"^(standard|custom|perishable)$"},{"type":"null"}],"title":"Orders Goods Kind"},"orders_status_sms":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Orders Status Sms"},"business_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Name"},"vertical":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vertical"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"},"greeting":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Greeting"},"greeting_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Greeting En"},"call_disclaimer":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Disclaimer"},"system_prompt":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"System Prompt"},"voice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voice Id"},"address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Address"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"website":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Website"},"faq":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Faq"},"faq_en":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Faq En"},"faq_departments":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Faq Departments"},"business_hours":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Business Hours"},"transfer_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transfer Number"},"failover_phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Failover Phone"},"supported_languages":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Supported Languages"},"vacation_mode":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Vacation Mode"},"vacation_from":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vacation From"},"vacation_until":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vacation Until"},"vacation_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vacation Message"},"vacation_allow_faq":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Vacation Allow Faq"},"vacation_allow_booking_after":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Vacation Allow Booking After"},"vacation_forward_number":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vacation Forward Number"},"booking_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Booking Mode"},"takes_bookings":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Takes Bookings"},"cancellation_allowed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Cancellation Allowed"},"cancellation_min_hours":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Cancellation Min Hours"},"cancellation_fee":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cancellation Fee"},"cancellation_blocked_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cancellation Blocked Message"},"cancellation_policy_tiers":{"anyOf":[{"items":{"$ref":"#/components/schemas/CancellationTier"},"type":"array"},{"type":"null"}],"title":"Cancellation Policy Tiers"},"reschedule_allowed":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Reschedule Allowed"},"reschedule_min_hours":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Reschedule Min Hours"},"max_reschedules":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Max Reschedules"},"reschedule_blocked_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reschedule Blocked Message"},"require_change_verification":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Require Change Verification"},"appointment_capacity":{"anyOf":[{"type":"integer","maximum":50.0,"minimum":1.0},{"type":"null"}],"title":"Appointment Capacity"},"table_settings":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Table Settings"},"services":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Services"},"calendar_colors":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Calendar Colors"},"transfer_message_template":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Transfer Message Template"},"busy_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Busy Message"},"outside_hours_message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Outside Hours Message"},"transfer_on_frustration":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Transfer On Frustration"},"answering_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Answering Mode"},"response_pace":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Response Pace"},"proactive_human_offer":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Proactive Human Offer"},"unknown_answer_action":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unknown Answer Action"},"transfer_unavailable_takes_message":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Transfer Unavailable Takes Message"},"hold_branding_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Hold Branding Enabled"},"ai_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Ai Enabled"},"rings_before_ai":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Rings Before Ai"},"after_hours_mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"After Hours Mode"},"spoken_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Spoken Name"},"agent_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Agent Name"},"allowed_transfer_numbers":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Allowed Transfer Numbers"},"call_review_roles":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Call Review Roles"},"team_contacts":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Team Contacts"},"auto_topup_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Auto Topup Enabled"},"auto_topup_threshold_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Auto Topup Threshold Minutes"},"subscription_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Status"},"nip":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Nip"},"regon":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Regon"},"krs":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Krs"},"legal_form":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Legal Form"},"registered_address":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Registered Address"},"pkd_main_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pkd Main Code"},"invoice_street":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Street"},"invoice_postal_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Postal Code"},"invoice_city":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice City"},"invoice_country_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Invoice Country Code"},"accountant_email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Accountant Email"},"avg_appointment_value_grosze":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Avg Appointment Value Grosze"},"arrival_note":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Arrival Note"}},"type":"object","title":"TenantUpdate"},"TenantV2":{"properties":{"id":{"type":"string","title":"Id"},"business_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Name"},"timezone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Timezone"},"subscription_tier":{"type":"string","title":"Subscription Tier"},"subscription_status":{"type":"string","title":"Subscription Status"},"created_at":{"type":"string","title":"Created At"}},"type":"object","required":["id","business_name","timezone","subscription_tier","subscription_status","created_at"],"title":"TenantV2"},"TestAlertRequest":{"properties":{"type":{"type":"string","title":"Type","default":"anomaly"},"severity":{"type":"string","title":"Severity","default":"warning"},"title":{"type":"string","title":"Title","default":"Test alert"},"message":{"type":"string","title":"Message","default":"This is a test alert from the admin panel"},"tenant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"}},"type":"object","title":"TestAlertRequest"},"TestCallRequest":{"properties":{"phone_number":{"type":"string","title":"Phone Number"}},"type":"object","required":["phone_number"],"title":"TestCallRequest"},"TestCallResponse":{"properties":{"status":{"type":"string","title":"Status"},"message":{"type":"string","title":"Message"},"call_sid":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Call Sid"}},"type":"object","required":["status","message"],"title":"TestCallResponse"},"TestGreetingRequest":{"properties":{"voice_id":{"type":"string","title":"Voice Id"}},"type":"object","required":["voice_id"],"title":"TestGreetingRequest"},"TestPushResponse":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"delivered_devices":{"type":"integer","title":"Delivered Devices"}},"type":"object","required":["enabled","delivered_devices"],"title":"TestPushResponse"},"TestResult":{"properties":{"delivered":{"type":"boolean","title":"Delivered"},"status":{"type":"string","title":"Status"}},"type":"object","required":["delivered","status"],"title":"TestResult"},"TicketOut":{"properties":{"id":{"type":"string","title":"Id"},"category":{"type":"string","title":"Category"},"severity":{"type":"string","title":"Severity"},"subject":{"type":"string","title":"Subject"},"description":{"type":"string","title":"Description"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"tenant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"},"status":{"type":"string","title":"Status"},"has_attachment":{"type":"boolean","title":"Has Attachment"},"attachment_mime":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Attachment Mime"},"admin_response":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Admin Response"},"resolved_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Resolved At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"customer_replies":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Customer Replies","default":[]}},"type":"object","required":["id","category","severity","subject","description","email","tenant_id","status","has_attachment","attachment_mime","admin_response","resolved_at","created_at"],"title":"TicketOut"},"TimeseriesPoint":{"properties":{"date":{"type":"string","title":"Date","description":"ISO date (UTC), e.g. 2026-07-25"},"total_calls":{"type":"integer","title":"Total Calls"},"booked_appointments":{"type":"integer","title":"Booked Appointments"}},"type":"object","required":["date","total_calls","booked_appointments"],"title":"TimeseriesPoint"},"TimeseriesV2":{"properties":{"period_days":{"type":"integer","title":"Period Days"},"points":{"items":{"$ref":"#/components/schemas/TimeseriesPoint"},"type":"array","title":"Points"}},"type":"object","required":["period_days","points"],"title":"TimeseriesV2"},"Token":{"properties":{"access_token":{"type":"string","title":"Access Token"},"token_type":{"type":"string","title":"Token Type","default":"bearer"},"requires_2fa":{"type":"boolean","title":"Requires 2Fa","default":false},"two_factor_method":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Two Factor Method"},"temp_token":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Temp Token"},"needs_2fa_setup":{"type":"boolean","title":"Needs 2Fa Setup","default":false}},"type":"object","required":["access_token"],"title":"Token"},"TopTenantEntry":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"name":{"type":"string","title":"Name"},"calls_today":{"type":"integer","title":"Calls Today"}},"type":"object","required":["tenant_id","name","calls_today"],"title":"TopTenantEntry"},"TopUpPackRequest":{"properties":{"pack_id":{"type":"string","title":"Pack Id"},"success_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Success Url"},"cancel_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cancel Url"}},"type":"object","required":["pack_id"],"title":"TopUpPackRequest"},"TranscriptCreate":{"properties":{"turns":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Turns"},"audio_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Audio Url"}},"type":"object","required":["turns"],"title":"TranscriptCreate"},"TranscriptUnlockResponse":{"properties":{"transcript_turns":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Transcript Turns"},"transcript_state":{"type":"string","title":"Transcript State"},"review_allowance":{"additionalProperties":true,"type":"object","title":"Review Allowance"}},"type":"object","required":["transcript_turns","transcript_state","review_allowance"],"title":"TranscriptUnlockResponse"},"TransferDurationReport":{"properties":{"call_sid":{"type":"string","title":"Call Sid"},"duration_seconds":{"type":"integer","maximum":86400.0,"minimum":0.0,"title":"Duration Seconds"}},"type":"object","required":["call_sid","duration_seconds"],"title":"TransferDurationReport","description":"Voice-engine reports how long a caller was bridged to a real team\nmember (Twilio DialCallDuration). That human-talk time is deducted from\nthe tenant's billable AI minutes in the call-end billing calc."},"TransferFailedReport":{"properties":{"call_sid":{"type":"string","title":"Call Sid"},"dial_status":{"type":"string","title":"Dial Status"},"dialed_to":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Dialed To"},"owner_line":{"type":"boolean","title":"Owner Line","default":false}},"type":"object","required":["call_sid","dial_status"],"title":"TransferFailedReport","description":"Voice-engine reports a transfer-to-human bridge ended without\nconnecting (no-answer / busy / failed / canceled). We use this to\nSMS the owner so they know they missed a customer in real time."},"TransferOwnershipRequest":{"properties":{"new_owner_user_id":{"type":"string","title":"New Owner User Id"},"password":{"type":"string","title":"Password"}},"type":"object","required":["new_owner_user_id","password"],"title":"TransferOwnershipRequest"},"TranslateIn":{"properties":{"text":{"type":"string","maxLength":6000,"title":"Text"},"target":{"type":"string","pattern":"^(pl|en|uk|ru|de)$","title":"Target","default":"en"},"source":{"anyOf":[{"type":"string","pattern":"^(pl|en|uk|ru|de)$"},{"type":"null"}],"title":"Source"}},"type":"object","required":["text"],"title":"TranslateIn"},"TrialAllowanceResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_name":{"type":"string","title":"Business Name"},"trial_minutes_override":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Trial Minutes Override"},"trial_sms_override":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Trial Sms Override"},"effective_trial_minutes":{"type":"integer","title":"Effective Trial Minutes"},"effective_trial_sms":{"type":"integer","title":"Effective Trial Sms"}},"type":"object","required":["id","business_name","trial_minutes_override","trial_sms_override","effective_trial_minutes","effective_trial_sms"],"title":"TrialAllowanceResponse"},"TrialAllowanceUpdate":{"properties":{"trial_minutes_override":{"anyOf":[{"type":"integer","maximum":100000.0,"minimum":0.0},{"type":"null"}],"title":"Trial Minutes Override"},"trial_sms_override":{"anyOf":[{"type":"integer","maximum":100000.0,"minimum":0.0},{"type":"null"}],"title":"Trial Sms Override"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","title":"TrialAllowanceUpdate"},"TrialExtensionRequest":{"properties":{"days":{"type":"integer","title":"Days"},"reason":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Reason"}},"type":"object","required":["days"],"title":"TrialExtensionRequest"},"TrialExtensionResponse":{"properties":{"tenant_id":{"type":"string","title":"Tenant Id"},"new_trial_ends_at":{"type":"string","title":"New Trial Ends At"},"days_added":{"type":"integer","title":"Days Added"}},"type":"object","required":["tenant_id","new_trial_ends_at","days_added"],"title":"TrialExtensionResponse"},"TwoFactorChallengeRequest":{"properties":{"temp_token":{"type":"string","title":"Temp Token"},"code":{"type":"string","title":"Code"}},"type":"object","required":["temp_token","code"],"title":"TwoFactorChallengeRequest"},"TwoFactorResendRequest":{"properties":{"temp_token":{"type":"string","title":"Temp Token"}},"type":"object","required":["temp_token"],"title":"TwoFactorResendRequest"},"UnsubscribeRequest":{"properties":{"endpoint":{"type":"string","maxLength":2048,"minLength":1,"title":"Endpoint"}},"type":"object","required":["endpoint"],"title":"UnsubscribeRequest"},"UpcomingRenewal":{"properties":{"tenant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"},"business_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Name"},"subscription_id":{"type":"string","title":"Subscription Id"},"amount_grosze":{"type":"integer","title":"Amount Grosze"},"renews_at":{"type":"string","format":"date-time","title":"Renews At"},"has_payment_method":{"type":"boolean","title":"Has Payment Method"}},"type":"object","required":["tenant_id","business_name","subscription_id","amount_grosze","renews_at","has_payment_method"],"title":"UpcomingRenewal"},"UpgradeRequest":{"properties":{"plan":{"type":"string","title":"Plan"},"billing_cycle":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Billing Cycle"}},"type":"object","required":["plan"],"title":"UpgradeRequest"},"UpgradeResponse":{"properties":{"status":{"type":"string","title":"Status"},"message":{"type":"string","title":"Message"},"effective":{"type":"string","title":"Effective"},"documents_locked":{"type":"boolean","title":"Documents Locked","default":false}},"type":"object","required":["status","message","effective"],"title":"UpgradeResponse"},"UptimeDayDTO":{"properties":{"date":{"type":"string","title":"Date"},"status":{"type":"string","title":"Status"},"uptime_percent":{"type":"number","title":"Uptime Percent"},"incident_count":{"type":"integer","title":"Incident Count"}},"type":"object","required":["date","status","uptime_percent","incident_count"],"title":"UptimeDayDTO"},"UptimeResponse":{"properties":{"checked_at":{"type":"string","format":"date-time","title":"Checked At"},"providers":{"items":{"$ref":"#/components/schemas/ProviderStatus"},"type":"array","title":"Providers"},"all_operational":{"type":"boolean","title":"All Operational"}},"type":"object","required":["checked_at","providers","all_operational"],"title":"UptimeResponse"},"UsageResponse":{"properties":{"minutes_used":{"type":"integer","title":"Minutes Used"},"minutes_limit":{"type":"integer","title":"Minutes Limit"},"minutes_purchased":{"type":"integer","title":"Minutes Purchased"},"minutes_remaining":{"type":"integer","title":"Minutes Remaining"},"minutes_pct":{"type":"number","title":"Minutes Pct"},"overage_minutes":{"type":"integer","title":"Overage Minutes","default":0},"overage_rate_pln":{"type":"number","title":"Overage Rate Pln","default":4.0},"sms_used":{"type":"integer","title":"Sms Used"},"sms_limit":{"type":"integer","title":"Sms Limit"},"sms_purchased":{"type":"integer","title":"Sms Purchased"},"sms_remaining":{"type":"integer","title":"Sms Remaining"},"sms_pct":{"type":"number","title":"Sms Pct"},"concurrent_calls_limit":{"type":"integer","title":"Concurrent Calls Limit"},"supported_languages":{"items":{"type":"string"},"type":"array","title":"Supported Languages"},"subscription_tier":{"type":"string","title":"Subscription Tier"},"subscription_status":{"type":"string","title":"Subscription Status"},"warning_level":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Warning Level"},"warning_metric":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Warning Metric"},"vertical":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Vertical"}},"type":"object","required":["minutes_used","minutes_limit","minutes_purchased","minutes_remaining","minutes_pct","sms_used","sms_limit","sms_purchased","sms_remaining","sms_pct","concurrent_calls_limit","supported_languages","subscription_tier","subscription_status","warning_level"],"title":"UsageResponse","description":"Full usage stats for dashboard display.\n\noverage_minutes is exposed so the dashboard meter matches what Stripe\nbills at month-end. Previously only minutes_used appeared in this\nresponse, so a tenant who used 800 minutes on a 600-minute plan saw\n\"133% used\" without knowing the 200 overage minutes would be billed\nseparately."},"UserRegister":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","title":"Password"},"full_name":{"type":"string","title":"Full Name"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"referral_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Referral Code"},"affiliate_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Affiliate Code"},"signup_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Signup Source"},"utm_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Utm Source"},"utm_medium":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Utm Medium"},"utm_campaign":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Utm Campaign"},"terms_accepted":{"type":"boolean","title":"Terms Accepted"},"turnstile_token":{"anyOf":[{"type":"string","maxLength":4096},{"type":"null"}],"title":"Turnstile Token"}},"type":"object","required":["email","password","full_name","terms_accepted"],"title":"UserRegister"},"UserResponse":{"properties":{"id":{"type":"string","title":"Id"},"email":{"type":"string","title":"Email"},"full_name":{"type":"string","title":"Full Name"},"phone":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Phone"},"role":{"type":"string","title":"Role"},"tenant_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Tenant Id"},"is_verified":{"type":"boolean","title":"Is Verified"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"has_password":{"type":"boolean","title":"Has Password","default":true},"subscription_tier":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Tier"},"subscription_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Status"},"subscription_canceled_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Subscription Canceled At"},"industry_pack_archetype":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Industry Pack Archetype"},"orders_enabled":{"type":"boolean","title":"Orders Enabled","default":false},"suggest_two_factor":{"type":"boolean","title":"Suggest Two Factor","default":false},"industry_pack_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Industry Pack Id"}},"type":"object","required":["id","email","full_name","phone","role","tenant_id","is_verified"],"title":"UserResponse"},"ValidateAffiliateResponse":{"properties":{"valid":{"type":"boolean","title":"Valid"},"partner_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Partner Name"},"discount_desc":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Discount Desc"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["valid"],"title":"ValidateAffiliateResponse"},"ValidateCodeResponse":{"properties":{"valid":{"type":"boolean","title":"Valid"},"referrer_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Referrer Name"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","required":["valid"],"title":"ValidateCodeResponse"},"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"},"VapidKeyResponse":{"properties":{"enabled":{"type":"boolean","title":"Enabled"},"public_key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Public Key"}},"type":"object","required":["enabled"],"title":"VapidKeyResponse"},"VerificationConfigResponse":{"properties":{"mode":{"type":"string","title":"Mode"},"phone_match_required":{"type":"boolean","title":"Phone Match Required"},"pin_enabled":{"type":"boolean","title":"Pin Enabled"},"pin_field_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pin Field Name"},"custom_question":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custom Question"},"sensitive_data_topics":{"items":{"type":"string"},"type":"array","title":"Sensitive Data Topics"},"allow_third_party_booking":{"type":"boolean","title":"Allow Third Party Booking"},"failed_attempts_limit":{"type":"integer","title":"Failed Attempts Limit"},"lockout_minutes":{"type":"integer","title":"Lockout Minutes"}},"type":"object","required":["mode","phone_match_required","pin_enabled","pin_field_name","custom_question","sensitive_data_topics","allow_third_party_booking","failed_attempts_limit","lockout_minutes"],"title":"VerificationConfigResponse"},"VerificationConfigUpdate":{"properties":{"mode":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Mode"},"phone_match_required":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Phone Match Required"},"pin_enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Pin Enabled"},"pin_field_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Pin Field Name"},"custom_question":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Custom Question"},"sensitive_data_topics":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Sensitive Data Topics"},"allow_third_party_booking":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Allow Third Party Booking"},"failed_attempts_limit":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Failed Attempts Limit"},"lockout_minutes":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Lockout Minutes"}},"type":"object","title":"VerificationConfigUpdate"},"VerifyEmailCodeRequest":{"properties":{"email":{"type":"string","title":"Email"},"code":{"type":"string","title":"Code"}},"type":"object","required":["email","code"],"title":"VerifyEmailCodeRequest"},"VerifyEmailRequest":{"properties":{"token":{"type":"string","title":"Token"}},"type":"object","required":["token"],"title":"VerifyEmailRequest"},"VerifyForwardingRequest":{"properties":{"phone_number":{"type":"string","title":"Phone Number"}},"type":"object","required":["phone_number"],"title":"VerifyForwardingRequest","description":"Request to verify call forwarding works."},"VerifyPasswordRequest":{"properties":{"password":{"type":"string","title":"Password"}},"type":"object","required":["password"],"title":"VerifyPasswordRequest"},"VerifyRequest":{"properties":{"code":{"type":"string","title":"Code"}},"type":"object","required":["code"],"title":"VerifyRequest"},"VerifyResponse":{"properties":{"backup_codes":{"items":{"type":"string"},"type":"array","title":"Backup Codes"}},"type":"object","required":["backup_codes"],"title":"VerifyResponse"},"VoiceCloningConsentDetailResponse":{"properties":{"consent_id":{"type":"string","title":"Consent Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"consented_by_email":{"type":"string","title":"Consented By Email"},"consented_at":{"type":"string","title":"Consented At"}},"type":"object","required":["consent_id","tenant_id","consented_by_email","consented_at"],"title":"VoiceCloningConsentDetailResponse"},"VoiceCloningConsentRequest":{"properties":{"consented_by_email":{"type":"string","format":"email","title":"Consented By Email"},"ip_address":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ip Address"},"user_agent":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"User Agent"}},"type":"object","required":["consented_by_email"],"title":"VoiceCloningConsentRequest"},"VoiceCloningConsentResponse":{"properties":{"consent_id":{"type":"string","title":"Consent Id"},"consented_at":{"type":"string","title":"Consented At"}},"type":"object","required":["consent_id","consented_at"],"title":"VoiceCloningConsentResponse"},"VoiceConfigOut":{"properties":{"voice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voice Id"},"voice_gender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voice Gender","description":"female | male | null"},"greeting":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Greeting","description":"Polish greeting (read-only here)"},"greeting_en":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Greeting En","description":"English greeting (read-only here)"}},"type":"object","required":["voice_id","voice_gender","greeting","greeting_en"],"title":"VoiceConfigOut"},"VoiceConfigPatch":{"properties":{"voice_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voice Id"},"voice_gender":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Voice Gender","description":"female | male"}},"type":"object","title":"VoiceConfigPatch"},"VoiceEngineStats":{"properties":{"active_calls_total":{"type":"integer","title":"Active Calls Total"},"failed_calls_last_hour":{"type":"integer","title":"Failed Calls Last Hour"},"total_calls_last_hour":{"type":"integer","title":"Total Calls Last Hour"},"success_rate_percent":{"type":"number","title":"Success Rate Percent"},"avg_duration_seconds":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Avg Duration Seconds"}},"type":"object","required":["active_calls_total","failed_calls_last_hour","total_calls_last_hour","success_rate_percent","avg_duration_seconds"],"title":"VoiceEngineStats"},"VoiceOption":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"gender":{"type":"string","title":"Gender"},"style":{"type":"string","title":"Style"},"preview_url":{"type":"string","title":"Preview Url"},"language":{"type":"string","title":"Language","default":"pl"},"languages":{"items":{"type":"string"},"type":"array","title":"Languages","default":["pl"]}},"type":"object","required":["id","name","gender","style","preview_url"],"title":"VoiceOption"},"VoicePreviewRequest":{"properties":{"voice_id":{"type":"string","title":"Voice Id"},"text":{"type":"string","maxLength":200,"title":"Text","default":"Dzień dobry, tu asystent AI. W czym mogę pomóc?"}},"type":"object","required":["voice_id"],"title":"VoicePreviewRequest"},"VoicePreviewResponse":{"properties":{"audio_b64":{"type":"string","title":"Audio B64"},"content_type":{"type":"string","title":"Content Type","default":"audio/mpeg"}},"type":"object","required":["audio_b64"],"title":"VoicePreviewResponse"},"VoiceSelect":{"properties":{"voice_id":{"type":"string","title":"Voice Id"}},"type":"object","required":["voice_id"],"title":"VoiceSelect"},"VoicemailNotification":{"properties":{"call_sid":{"type":"string","title":"Call Sid"},"recording_url":{"type":"string","title":"Recording Url"},"recording_sid":{"type":"string","title":"Recording Sid"},"duration":{"type":"integer","title":"Duration"}},"type":"object","required":["call_sid","recording_url","recording_sid","duration"],"title":"VoicemailNotification"},"WaitlistEntriesResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/WaitlistEntryResponse"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"WaitlistEntriesResponse"},"WaitlistEntryResponse":{"properties":{"id":{"type":"string","title":"Id"},"phone":{"type":"string","title":"Phone"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"business_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Name"},"business_type":{"type":"string","title":"Business Type"},"city":{"type":"string","title":"City"},"missed_calls_per_week":{"type":"string","title":"Missed Calls Per Week"},"position":{"type":"integer","title":"Position"},"referral_code":{"type":"string","title":"Referral Code"},"referred_by":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Referred By"},"referral_count":{"type":"integer","title":"Referral Count"},"tier":{"type":"string","title":"Tier"},"opt_in_product_updates":{"type":"boolean","title":"Opt In Product Updates"},"opt_in_marketing":{"type":"boolean","title":"Opt In Marketing"},"is_notified":{"type":"boolean","title":"Is Notified"},"email_status":{"type":"string","title":"Email Status"},"brevo_contact_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Brevo Contact Id"},"utm_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Utm Source"},"utm_medium":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Utm Medium"},"utm_campaign":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Utm Campaign"},"notes":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Notes"},"converted_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Converted At"},"last_email_sent_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Email Sent At"},"email_opens":{"type":"integer","title":"Email Opens"},"email_clicks":{"type":"integer","title":"Email Clicks"},"created_at":{"type":"string","title":"Created At"},"survey_industry":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Survey Industry"},"survey_unanswered_calls":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Survey Unanswered Calls"},"survey_hardest_hours":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Survey Hardest Hours"},"survey_key_feature":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Survey Key Feature"},"survey_ai_concern":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Survey Ai Concern"},"survey_completed_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Survey Completed At"}},"type":"object","required":["id","phone","email","business_name","business_type","city","missed_calls_per_week","position","referral_code","referred_by","referral_count","tier","opt_in_product_updates","opt_in_marketing","is_notified","email_status","brevo_contact_id","utm_source","utm_medium","utm_campaign","notes","converted_at","last_email_sent_at","email_opens","email_clicks","created_at","survey_industry","survey_unanswered_calls","survey_hardest_hours","survey_key_feature","survey_ai_concern","survey_completed_at"],"title":"WaitlistEntryResponse"},"WaitlistJoinRequest":{"properties":{"phone":{"type":"string","title":"Phone"},"business_type":{"type":"string","title":"Business Type"},"city":{"type":"string","title":"City"},"missed_calls_per_week":{"type":"string","title":"Missed Calls Per Week"},"referral_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Referral Code"},"opt_in_product_updates":{"type":"boolean","title":"Opt In Product Updates","default":true},"opt_in_marketing":{"type":"boolean","title":"Opt In Marketing","default":false},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"business_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Business Name"},"utm_source":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Utm Source"},"utm_medium":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Utm Medium"},"utm_campaign":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Utm Campaign"}},"type":"object","required":["phone","business_type","city","missed_calls_per_week"],"title":"WaitlistJoinRequest"},"WaitlistJoinResponse":{"properties":{"position":{"type":"integer","title":"Position"},"referral_code":{"type":"string","title":"Referral Code"},"tier":{"type":"string","title":"Tier"},"total_waitlist":{"type":"integer","title":"Total Waitlist"}},"type":"object","required":["position","referral_code","tier","total_waitlist"],"title":"WaitlistJoinResponse"},"WaitlistPositionResponse":{"properties":{"position":{"type":"integer","title":"Position"},"referral_code":{"type":"string","title":"Referral Code"},"referral_count":{"type":"integer","title":"Referral Count"},"tier":{"type":"string","title":"Tier"},"total_waitlist":{"type":"integer","title":"Total Waitlist"}},"type":"object","required":["position","referral_code","referral_count","tier","total_waitlist"],"title":"WaitlistPositionResponse"},"WaitlistStatsResponse":{"properties":{"total":{"type":"integer","title":"Total"},"by_tier":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Tier"},"by_city":{"additionalProperties":{"type":"integer"},"type":"object","title":"By City"},"by_business_type":{"additionalProperties":{"type":"integer"},"type":"object","title":"By Business Type"},"conversion_rate":{"type":"number","title":"Conversion Rate"},"avg_referrals":{"type":"number","title":"Avg Referrals"},"total_notified":{"type":"integer","title":"Total Notified"},"total_with_email":{"type":"integer","title":"Total With Email"}},"type":"object","required":["total","by_tier","by_city","by_business_type","conversion_rate","avg_referrals","total_notified","total_with_email"],"title":"WaitlistStatsResponse"},"WaitlistSurveyByEmailRequest":{"properties":{"email":{"type":"string","title":"Email"},"industry":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Industry"},"unanswered_calls":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unanswered Calls"},"hardest_hours":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hardest Hours"},"key_feature":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key Feature"},"ai_concern":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ai Concern"}},"type":"object","required":["email"],"title":"WaitlistSurveyByEmailRequest"},"WaitlistSurveyRequest":{"properties":{"phone":{"type":"string","title":"Phone"},"industry":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Industry"},"unanswered_calls":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Unanswered Calls"},"hardest_hours":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hardest Hours"},"key_feature":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key Feature"},"ai_concern":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Ai Concern"}},"type":"object","required":["phone"],"title":"WaitlistSurveyRequest"},"WebhookDeliverBody":{"properties":{"endpoint_id":{"type":"string","maxLength":64,"minLength":1,"title":"Endpoint Id"},"tenant_id":{"type":"string","maxLength":64,"minLength":1,"title":"Tenant Id"},"event":{"type":"string","maxLength":100,"minLength":1,"title":"Event"},"data":{"additionalProperties":true,"type":"object","title":"Data"}},"type":"object","required":["endpoint_id","tenant_id","event"],"title":"WebhookDeliverBody"},"WebhookEndpointCreate":{"properties":{"url":{"type":"string","maxLength":2048,"title":"Url"},"events":{"items":{"type":"string"},"type":"array","title":"Events","description":"Subscribed events; empty = all"},"description":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"Description"}},"type":"object","required":["url"],"title":"WebhookEndpointCreate"},"WebhookEndpointCreated":{"properties":{"id":{"type":"string","title":"Id"},"url":{"type":"string","title":"Url"},"events":{"items":{"type":"string"},"type":"array","title":"Events"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"active":{"type":"boolean","title":"Active"},"created_at":{"type":"string","title":"Created At"},"last_delivery_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Delivery At"},"last_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Status"},"secret_masked":{"type":"string","title":"Secret Masked"},"secret":{"type":"string","title":"Secret","description":"Full signing secret. Shown once. Store it now."}},"type":"object","required":["id","url","events","description","active","created_at","last_delivery_at","last_status","secret_masked","secret"],"title":"WebhookEndpointCreated"},"WebhookEndpointOut":{"properties":{"id":{"type":"string","title":"Id"},"url":{"type":"string","title":"Url"},"events":{"items":{"type":"string"},"type":"array","title":"Events"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"active":{"type":"boolean","title":"Active"},"created_at":{"type":"string","title":"Created At"},"last_delivery_at":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Delivery At"},"last_status":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Last Status"},"secret_masked":{"type":"string","title":"Secret Masked"}},"type":"object","required":["id","url","events","description","active","created_at","last_delivery_at","last_status","secret_masked"],"title":"WebhookEndpointOut"},"WebhookHealthResponse":{"properties":{"signals":{"items":{"$ref":"#/components/schemas/WebhookHealthSignal"},"type":"array","title":"Signals"},"fetched_at":{"type":"string","format":"date-time","title":"Fetched At"}},"type":"object","required":["signals","fetched_at"],"title":"WebhookHealthResponse"},"WebhookHealthSignal":{"properties":{"provider":{"type":"string","title":"Provider"},"severity":{"type":"string","title":"Severity"},"label":{"type":"string","title":"Label"},"detail":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Detail"},"delivered_24h":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Delivered 24H"},"errors_24h":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Errors 24H"},"last_seen":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Seen"}},"type":"object","required":["provider","severity","label"],"title":"WebhookHealthSignal"},"src__routers__admin__TenantListResponse":{"properties":{"items":{"items":{"$ref":"#/components/schemas/TenantListItem"},"type":"array","title":"Items"},"total":{"type":"integer","title":"Total"},"limit":{"type":"integer","title":"Limit"},"offset":{"type":"integer","title":"Offset"}},"type":"object","required":["items","total","limit","offset"],"title":"TenantListResponse"},"src__routers__billing__SubscribeRequest":{"properties":{"plan":{"type":"string","title":"Plan"},"billing_cycle":{"type":"string","title":"Billing Cycle","default":"monthly"},"success_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Success Url"},"cancel_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Cancel Url"},"promo_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Promo Code"}},"type":"object","required":["plan"],"title":"SubscribeRequest"},"src__routers__push__SubscribeRequest":{"properties":{"endpoint":{"type":"string","maxLength":2048,"minLength":1,"title":"Endpoint"},"keys":{"$ref":"#/components/schemas/SubscriptionKeys"},"user_agent":{"anyOf":[{"type":"string","maxLength":255},{"type":"null"}],"title":"User Agent"}},"type":"object","required":["endpoint","keys"],"title":"SubscribeRequest"},"src__routers__tenants__TenantListResponse":{"properties":{"id":{"type":"string","title":"Id"},"business_name":{"type":"string","title":"Business Name"},"vertical":{"type":"string","title":"Vertical"},"is_active":{"type":"boolean","title":"Is Active"},"subscription_tier":{"type":"string","title":"Subscription Tier"},"minutes_used_this_month":{"type":"integer","title":"Minutes Used This Month"},"phone_numbers":{"items":{"type":"string"},"type":"array","title":"Phone Numbers"}},"type":"object","required":["id","business_name","vertical","is_active","subscription_tier","minutes_used_this_month","phone_numbers"],"title":"TenantListResponse"},"src__routers__v2__appointments__PaginationMeta":{"properties":{"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Opaque cursor for the next page; null when done."},"has_more":{"type":"boolean","title":"Has More"},"limit":{"type":"integer","title":"Limit"}},"type":"object","required":["next_cursor","has_more","limit"],"title":"PaginationMeta"},"src__routers__v2__calls__PaginationMeta":{"properties":{"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor","description":"Opaque cursor for the next page; null when done."},"has_more":{"type":"boolean","title":"Has More"},"limit":{"type":"integer","title":"Limit"}},"type":"object","required":["next_cursor","has_more","limit"],"title":"PaginationMeta"},"src__routers__v2__deposits__PaginationMeta":{"properties":{"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"has_more":{"type":"boolean","title":"Has More"},"limit":{"type":"integer","title":"Limit"}},"type":"object","required":["next_cursor","has_more","limit"],"title":"PaginationMeta"},"src__routers__v2__orders__PaginationMeta":{"properties":{"next_cursor":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Next Cursor"},"has_more":{"type":"boolean","title":"Has More"},"limit":{"type":"integer","title":"Limit"}},"type":"object","required":["next_cursor","has_more","limit"],"title":"PaginationMeta"}},"securitySchemes":{"OAuth2PasswordBearerOrCookie":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"/auth/login"}}},"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"zv_live_<token> | zv_test_<token>","description":"ZvonAI API key. Create one in the dashboard under Developer. `zv_test_` sandbox keys simulate all writes (livemode=false)."}}},"servers":[{"url":"https://api-prod-o5szrvwcla-lm.a.run.app","description":"Production"},{"url":"https://mcp.zvonai.ai","description":"MCP host (POST /v2/mcp)"}],"security":[{"bearerAuth":[]}]}