{"components":{"parameters":{"AppIDPath":{"description":"whisp-go runtime app id or imported onboarding source_app_id.","in":"path","name":"app_id","required":true,"schema":{"type":"string"}},"ConfigVersionIDPath":{"description":"Runtime config version id.","in":"path","name":"config_version_id","required":true,"schema":{"type":"string"}},"DeliveryTemplateIDPath":{"description":"Email template id.","in":"path","name":"template_id","required":true,"schema":{"type":"string"}},"DeliveryTemplateVersionIDPath":{"description":"Email template version id.","in":"path","name":"version_id","required":true,"schema":{"type":"string"}},"ExternalUserIDPath":{"description":"Customer-project user id.","in":"path","name":"external_id","required":true,"schema":{"type":"string"}},"WebhookTokenPath":{"description":"High-entropy webhook URL token.","in":"path","name":"token","required":true,"schema":{"type":"string"}}},"responses":{"BadRequest":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Invalid request."},"NotFound":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Requested resource was not found."},"SchemaMigrationsPending":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The database schema is behind the running binary."},"Unauthorized":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Missing or invalid API key."}},"schemas":{"CompileDeliveryEmailTemplateRequest":{"properties":{"source":{"$ref":"#/components/schemas/DeliveryEmailTemplateDocument"}},"required":["source"],"type":"object"},"CreateDashboardAPIKeyRequest":{"additionalProperties":false,"properties":{"name":{"minLength":1,"type":"string"}},"required":["name"],"type":"object"},"CreateDashboardAPIKeyResponse":{"properties":{"api_key":{"$ref":"#/components/schemas/DashboardAPIKey"},"raw_key":{"description":"Raw API key secret, returned only when created.","type":"string"}},"required":["api_key","raw_key"],"type":"object"},"CreateDeliveryEmailTemplateRequest":{"properties":{"name":{"maxLength":120,"type":"string"},"purpose":{"maxLength":120,"type":"string"}},"required":["name","purpose"],"type":"object"},"DashboardAPIKey":{"properties":{"app_id":{"type":"string"},"created_at":{"format":"date-time","type":"string"},"environment":{"enum":["production","staging","development"],"type":"string"},"id":{"type":"string"},"key_prefix":{"type":"string"},"last_used_at":{"format":"date-time","nullable":true,"type":"string"},"name":{"type":"string"}},"required":["id","app_id","key_prefix","name","environment","created_at"],"type":"object"},"DashboardAPIKeysResponse":{"properties":{"api_keys":{"items":{"$ref":"#/components/schemas/DashboardAPIKey"},"type":"array"}},"required":["api_keys"],"type":"object"},"DashboardApp":{"properties":{"environment":{"type":"string"},"id":{"description":"whisp-go runtime app id.","type":"string"},"messaging_ready":{"type":"boolean"},"name":{"type":"string"},"onboarding_session_id":{"type":"string"},"organization_id":{"type":"string"},"organization_name":{"type":"string"},"organization_slug":{"type":"string"},"role":{"type":"string"},"runtime_config_activated_at":{"format":"date-time","type":"string"},"runtime_config_status":{"type":"string"},"runtime_config_version":{"type":"integer"},"runtime_config_version_id":{"type":"string"},"slug":{"type":"string"},"source_app_id":{"description":"Imported onboarding app id, when available.","type":"string"}},"required":["id","organization_id","organization_name","organization_slug","name","slug","environment","role","messaging_ready"],"type":"object"},"DashboardEventsCatalogEvent":{"properties":{"code":{"type":"string"},"description":{"nullable":true,"type":"string"},"id":{"type":"string"},"is_active":{"type":"boolean"},"label":{"type":"string"},"rationale":{"nullable":true,"type":"string"},"suggested_wireable_on":{"items":{"enum":["frontend","backend"],"type":"string"},"type":"array"},"variant_links":{"items":{"$ref":"#/components/schemas/DashboardVariantEventLink"},"type":"array"}},"required":["id","code","label","is_active","suggested_wireable_on","variant_links"],"type":"object"},"DashboardEventsCatalogResponse":{"properties":{"config_version":{"nullable":true,"type":"integer"},"events":{"items":{"$ref":"#/components/schemas/DashboardEventsCatalogEvent"},"type":"array"}},"required":["events"],"type":"object"},"DashboardIntegrationsResponse":{"properties":{"app":{"additionalProperties":true,"type":"object"},"channel_settings":{"additionalProperties":true,"type":"object"},"event_source_snapshot":{"additionalProperties":true,"type":"object"},"event_sources":{"items":{"additionalProperties":true,"type":"object"},"type":"array"}},"required":["app","event_sources"],"type":"object"},"DashboardInterventionsGenerationStatus":{"properties":{"can_retry":{"type":"boolean"},"failure_reason":{"nullable":true,"type":"string"},"max_retries":{"type":"integer"},"retry_count":{"type":"integer"},"state":{"enum":["not_started","generating","ready","failed"],"type":"string"},"updated_at":{"format":"date-time","nullable":true,"type":"string"}},"required":["state","retry_count","max_retries","can_retry"],"type":"object"},"DashboardInterventionsResponse":{"properties":{"app":{"additionalProperties":true,"type":"object"},"sub_variants":{"items":{"$ref":"#/components/schemas/DashboardSubVariant"},"type":"array"}},"required":["app","sub_variants"],"type":"object"},"DashboardKnowledgeBrandVoice":{"properties":{"captured_at":{"type":"string"},"forbidden":{"items":{"type":"string"},"type":"array"},"sample_sentence":{"type":"string"},"tone":{"items":{"type":"string"},"type":"array"}},"required":["tone","forbidden","sample_sentence","captured_at"],"type":"object"},"DashboardKnowledgeBusinessProfile":{"properties":{"captured_at":{"type":"string"},"industry":{"type":"string"},"name":{"type":"string"},"pricing_model":{"type":"string"},"product_category":{"type":"string"},"sub_industry":{"type":"string"}},"required":["name","industry","sub_industry","product_category","pricing_model","captured_at"],"type":"object"},"DashboardKnowledgeCustomerProfile":{"properties":{"activation_criterion":{"type":"string"},"anti_icp":{"items":{"type":"string"},"type":"array"},"captured_at":{"type":"string"},"churn_signals":{"items":{"type":"string"},"type":"array"},"modifiers":{"items":{"additionalProperties":true,"type":"object"},"type":"array"},"primary_icp":{"additionalProperties":true,"type":"object"}},"required":["primary_icp","modifiers","activation_criterion","churn_signals","anti_icp","captured_at"],"type":"object"},"DashboardKnowledgeEventContext":{"properties":{"app":{"additionalProperties":true,"type":"object"},"event_sources":{"items":{"additionalProperties":true,"type":"object"},"type":"array"},"import":{"additionalProperties":true,"type":"object"},"selected_interventions":{"items":{"additionalProperties":true,"type":"object"},"type":"array"},"taxonomy":{"items":{"additionalProperties":true,"type":"object"},"type":"array"}},"required":["app","taxonomy","selected_interventions","event_sources"],"type":"object"},"DashboardKnowledgeRuntimeDetail":{"properties":{"app":{"additionalProperties":true,"type":"object"},"business_context":{"additionalProperties":true,"type":"object"},"channel_settings":{"additionalProperties":true,"type":"object"},"config_version":{"nullable":true,"type":"integer"},"delivery_policy":{"additionalProperties":true,"type":"object"},"event_source_snapshot":{"additionalProperties":true,"type":"object"},"generation_units":{"items":{"additionalProperties":true,"type":"object"},"type":"array"},"runtime":{"additionalProperties":true,"type":"object"}},"required":["app","runtime","generation_units","delivery_policy"],"type":"object"},"DashboardPolicyGenerationResponse":{"properties":{"configVersionId":{"type":"string"},"jobId":{"type":"string"},"mode":{"enum":["first_policy","regeneration"],"type":"string"},"status":{"enum":["pending","running"],"type":"string"}},"required":["status","jobId","configVersionId","mode"],"type":"object"},"DashboardSessionResponse":{"properties":{"active_app":{"$ref":"#/components/schemas/DashboardApp"},"apps":{"items":{"$ref":"#/components/schemas/DashboardApp"},"type":"array"},"user":{"$ref":"#/components/schemas/DashboardUser"}},"required":["user","apps"],"type":"object"},"DashboardStatusRequest":{"additionalProperties":false,"properties":{"reason":{"type":"string"},"status":{"enum":["active","paused"],"type":"string"}},"required":["status"],"type":"object"},"DashboardSubVariant":{"properties":{"code":{"type":"string"},"fired_count_7d":{"type":"integer"},"label":{"type":"string"},"last_fired_at":{"format":"date-time","nullable":true,"type":"string"},"parent_label":{"type":"string"},"parent_strategy":{"type":"string"},"paused_at":{"format":"date-time","nullable":true,"type":"string"},"paused_reason":{"nullable":true,"type":"string"},"status":{"enum":["active","paused","blocked","declined"],"type":"string"},"trigger_event":{"nullable":true,"type":"string"}},"required":["code","parent_strategy","status","fired_count_7d"],"type":"object"},"DashboardUser":{"properties":{"auth_id":{"type":"string"},"email":{"type":"string"},"session_id":{"type":"string"}},"required":["auth_id"],"type":"object"},"DashboardVariantEventLink":{"properties":{"event_code":{"type":"string"},"parent_code":{"type":"string"},"rationale":{"nullable":true,"type":"string"},"role":{"enum":["required","optional","outcome"],"type":"string"},"source":{"type":"string"},"source_ref":{"nullable":true,"type":"string"},"variant_code":{"type":"string"}},"required":["event_code","parent_code","variant_code","role","source"],"type":"object"},"DeliveryEmailActivityMessage":{"allOf":[{"$ref":"#/components/schemas/DeliveryOutboundMessage"},{"properties":{"events":{"items":{"$ref":"#/components/schemas/DeliveryMessageEvent"},"type":"array"}},"required":["events"],"type":"object"}]},"DeliveryEmailActivityResponse":{"properties":{"messages":{"items":{"$ref":"#/components/schemas/DeliveryEmailActivityMessage"},"type":"array"}},"required":["messages"],"type":"object"},"DeliveryEmailServer":{"properties":{"created_at":{"format":"date-time","type":"string"},"id":{"description":"Whisperr provider account id.","type":"string"},"outbound_stream_id":{"type":"string"},"provider_account_id":{"description":"Postmark server id.","type":"string"},"status":{"enum":["pending","active","error","disabled"],"type":"string"},"updated_at":{"format":"date-time","type":"string"},"webhook_registered_at":{"format":"date-time","nullable":true,"type":"string"}},"required":["id","provider_account_id","outbound_stream_id","status","created_at","updated_at"],"type":"object"},"DeliveryEmailServerResponse":{"properties":{"server":{"$ref":"#/components/schemas/DeliveryEmailServer"}},"required":["server"],"type":"object"},"DeliveryEmailSettings":{"properties":{"from_address":{"description":"Default From email address. Empty string when unset.","type":"string"},"from_name":{"description":"Default From display name. Empty string when unset.","type":"string"}},"required":["from_name","from_address"],"type":"object"},"DeliveryEmailSettingsResponse":{"properties":{"settings":{"$ref":"#/components/schemas/DeliveryEmailSettings"}},"required":["settings"],"type":"object"},"DeliveryEmailTemplate":{"properties":{"active_version_id":{"description":"Present after a reviewed version has been published and activated.","type":"string"},"created_at":{"format":"date-time","type":"string"},"id":{"type":"string"},"latest_version":{"$ref":"#/components/schemas/DeliveryEmailTemplateVersion"},"name":{"maxLength":120,"type":"string"},"purpose":{"maxLength":120,"type":"string"},"status":{"$ref":"#/components/schemas/DeliveryEmailTemplateStatus"},"updated_at":{"format":"date-time","type":"string"},"versions":{"items":{"$ref":"#/components/schemas/DeliveryEmailTemplateVersion"},"type":"array"}},"required":["id","name","purpose","status","created_at","updated_at"],"type":"object"},"DeliveryEmailTemplateBlock":{"additionalProperties":false,"properties":{"alt":{"description":"Required for image blocks.","type":"string"},"level":{"description":"Heading level for heading blocks.","maximum":3,"minimum":1,"type":"integer"},"text":{"description":"Required for heading, paragraph, and button blocks.","type":"string"},"type":{"enum":["heading","paragraph","button","image","divider"],"type":"string"},"url":{"description":"Required for button and image blocks. Image URLs must use https.","type":"string"}},"required":["type"],"type":"object"},"DeliveryEmailTemplateDocument":{"properties":{"blocks":{"items":{"$ref":"#/components/schemas/DeliveryEmailTemplateBlock"},"maxItems":50,"minItems":1,"type":"array"},"preheader":{"maxLength":300,"type":"string"},"subject":{"maxLength":180,"type":"string"}},"required":["subject","blocks"],"type":"object"},"DeliveryEmailTemplatePreview":{"properties":{"compiled_html":{"type":"string"},"compiled_text":{"type":"string"},"content":{"type":"string"},"mode":{"enum":["desktop","text"],"type":"string"},"preheader":{"type":"string"},"subject":{"type":"string"},"variable_names":{"items":{"type":"string"},"type":"array"}},"required":["mode","content","subject","preheader"],"type":"object"},"DeliveryEmailTemplatePreviewResponse":{"properties":{"preview":{"$ref":"#/components/schemas/DeliveryEmailTemplatePreview"}},"required":["preview"],"type":"object"},"DeliveryEmailTemplateResponse":{"properties":{"template":{"$ref":"#/components/schemas/DeliveryEmailTemplate"}},"required":["template"],"type":"object"},"DeliveryEmailTemplateStatus":{"enum":["draft","generated","reviewed","published","active"],"type":"string"},"DeliveryEmailTemplateVersion":{"properties":{"compiled_html":{"type":"string"},"compiled_text":{"type":"string"},"created_at":{"format":"date-time","type":"string"},"id":{"type":"string"},"postmark_template_alias":{"type":"string"},"postmark_template_id":{"type":"string"},"preheader":{"type":"string"},"source_json":{"additionalProperties":true,"type":"object"},"subject":{"type":"string"},"template_id":{"type":"string"},"version":{"minimum":1,"type":"integer"}},"required":["id","template_id","version","source_json","compiled_html","compiled_text","subject","preheader","created_at"],"type":"object"},"DeliveryEmailTemplateVersionResponse":{"properties":{"version":{"$ref":"#/components/schemas/DeliveryEmailTemplateVersion"}},"required":["version"],"type":"object"},"DeliveryEmailTemplatesResponse":{"properties":{"templates":{"items":{"$ref":"#/components/schemas/DeliveryEmailTemplate"},"type":"array"}},"required":["templates"],"type":"object"},"DeliveryMessageEvent":{"properties":{"created_at":{"format":"date-time","type":"string"},"details":{"additionalProperties":true,"type":"object"},"event_at":{"format":"date-time","type":"string"},"event_type":{"$ref":"#/components/schemas/DeliveryMessageEventType"},"id":{"type":"string"},"metadata":{"additionalProperties":true,"type":"object"},"provider":{"enum":["postmark"],"type":"string"},"provider_message_id":{"type":"string"},"recipient":{"type":"string"},"summary":{"type":"string"}},"required":["id","event_type","provider","provider_message_id","recipient","event_at","summary","details","metadata","created_at"],"type":"object"},"DeliveryMessageEventType":{"enum":["delivered","opened","clicked","bounced","spam_complained","subscription_changed"],"type":"string"},"DeliveryOutboundMessage":{"properties":{"channel":{"enum":["email"],"type":"string"},"created_at":{"format":"date-time","type":"string"},"failed_at":{"format":"date-time","type":"string"},"from_address":{"type":"string"},"from_name":{"type":"string"},"id":{"type":"string"},"idempotency_key":{"type":"string"},"provider":{"enum":["postmark"],"type":"string"},"provider_account_id":{"type":"string"},"provider_error_code":{"type":"string"},"provider_error_message":{"type":"string"},"provider_message_id":{"type":"string"},"sent_at":{"format":"date-time","type":"string"},"status":{"$ref":"#/components/schemas/DeliveryOutboundMessageStatus"},"submitted_at":{"format":"date-time","type":"string"},"template_alias":{"type":"string"},"template_id":{"type":"string"},"template_model":{"additionalProperties":true,"type":"object"},"template_version_id":{"type":"string"},"to_address":{"type":"string"},"updated_at":{"format":"date-time","type":"string"}},"required":["id","provider_account_id","template_id","template_version_id","channel","provider","to_address","from_address","from_name","template_alias","template_model","status","created_at","updated_at"],"type":"object"},"DeliveryOutboundMessageResponse":{"properties":{"message":{"$ref":"#/components/schemas/DeliveryOutboundMessage"}},"required":["message"],"type":"object"},"DeliveryOutboundMessageStatus":{"enum":["pending","sending","sent","failed"],"type":"string"},"ErrorResponse":{"properties":{"error":{"properties":{"code":{"type":"string"},"message":{"type":"string"},"request_id":{"type":"string"}},"required":["code","message"],"type":"object"}},"required":["error"],"type":"object"},"GenerateDeliveryEmailTemplateRequest":{"properties":{"additional_context":{"maxLength":2000,"type":"string"},"audience":{"maxLength":200,"type":"string"},"brief":{"maxLength":2000,"type":"string"},"business_name":{"maxLength":200,"type":"string"},"call_to_action_label":{"maxLength":200,"type":"string"},"call_to_action_url":{"description":"Absolute http or https URL. Required when call_to_action_label is present.","maxLength":2000,"type":"string"},"goal":{"maxLength":200,"type":"string"},"image_url":{"description":"Absolute https URL for an optional image block.","maxLength":2000,"type":"string"},"product_name":{"maxLength":200,"type":"string"},"purpose":{"description":"Defaults to the template purpose when omitted.","maxLength":200,"type":"string"},"tone":{"maxLength":200,"type":"string"}},"required":["business_name"],"type":"object"},"GetUserResponse":{"properties":{"user":{"properties":{"external_id":{"type":"string"},"id":{"type":"string"}},"required":["id","external_id"],"type":"object"}},"required":["user"],"type":"object"},"GetUserStateResponse":{"properties":{"state":{"properties":{"churn_risk_v0":{"type":"number"},"engagement_score":{"type":"number"},"intervention_score":{"type":"number"},"lifecycle_stage":{"type":"string"}},"required":["lifecycle_stage","engagement_score","churn_risk_v0","intervention_score"],"type":"object"}},"required":["state"],"type":"object"},"HealthResponse":{"properties":{"build_provenance":{"type":"string"},"db":{"type":"string"},"redis":{"type":"string"},"runtime_mode":{"type":"string"},"status":{"enum":["ok","error"],"type":"string"},"version":{"type":"string"},"wizard_anthropic_gateway_configured":{"description":"Whether the wizard Anthropic gateway has usable server-side configuration.","type":"boolean"},"wizard_openai_gateway_configured":{"description":"Whether the wizard OpenAI gateway has usable server-side configuration.","type":"boolean"}},"required":["status","db","redis","runtime_mode","wizard_anthropic_gateway_configured","wizard_openai_gateway_configured"],"type":"object"},"IdentifyRequest":{"additionalProperties":false,"properties":{"channels":{"items":{"$ref":"#/components/schemas/IngestedUserChannel"},"maxItems":10,"type":"array"},"external_user_id":{"type":"string"},"preferred_channel":{"enum":["email","sms","push"],"type":"string"},"traits":{"additionalProperties":true,"description":"Arbitrary identity traits (e.g. email, name, plan). Merged on each call. Max 50KB.","type":"object"}},"required":["external_user_id"],"type":"object"},"IdentifyResponse":{"properties":{"user":{"properties":{"created":{"description":"True when this call created the user, false when it updated an existing one.","type":"boolean"},"external_id":{"type":"string"},"id":{"type":"string"}},"required":["id","external_id","created"],"type":"object"}},"required":["user"],"type":"object"},"ImportOnboardingSessionRequest":{"additionalProperties":false,"properties":{"force_new_version":{"default":false,"type":"boolean"},"session_id":{"minLength":1,"type":"string"}},"required":["session_id"],"type":"object"},"ImportOnboardingSessionResponse":{"properties":{"app_id":{"nullable":true,"type":"string"},"config_version_id":{"nullable":true,"type":"string"},"generation_job_id":{"nullable":true,"type":"string"},"import_id":{"nullable":true,"type":"string"},"status":{"example":"pending_generation","type":"string"}},"required":["status"],"type":"object"},"IngestedUserChannel":{"additionalProperties":false,"properties":{"address":{"type":"string"},"channel":{"enum":["email","sms","push"],"type":"string"},"opted_in":{"default":true,"type":"boolean"},"verified":{"default":false,"type":"boolean"}},"required":["channel","address"],"type":"object"},"IngestedUserPatch":{"additionalProperties":false,"properties":{"channels":{"items":{"$ref":"#/components/schemas/IngestedUserChannel"},"maxItems":10,"type":"array"},"preferred_channel":{"enum":["email","sms","push"],"type":"string"}},"type":"object"},"PreviewDecisionRequest":{"additionalProperties":false,"properties":{"external_user_id":{"type":"string"}},"required":["external_user_id"],"type":"object"},"PreviewDecisionResponse":{"properties":{"evaluated_at":{"format":"date-time","type":"string"},"interventions":{"items":{"properties":{"gate_open":{"type":"boolean"},"intervention_code":{"type":"string"},"non_fire_reason":{"enum":["below_threshold","gate_closed","open_episode"],"nullable":true,"type":"string"},"score":{"type":"number"},"threshold":{"type":"number"},"would_fire":{"type":"boolean"}},"required":["intervention_code","score","threshold","gate_open","would_fire"],"type":"object"},"type":"array"},"policy_version_id":{"type":"string"}},"required":["policy_version_id","evaluated_at","interventions"],"type":"object"},"SendDeliveryEmailTemplateRequest":{"properties":{"idempotency_key":{"description":"Optional caller retry key. Reusing it returns the existing message and does not send again.","maxLength":200,"type":"string"},"template_model":{"additionalProperties":true,"description":"Template variables passed to Postmark. Empty object when omitted.","type":"object"},"to":{"description":"Recipient email address.","maxLength":254,"type":"string"}},"required":["to"],"type":"object"},"TrackEventBatchRequest":{"additionalProperties":false,"properties":{"events":{"items":{"$ref":"#/components/schemas/TrackEventRequest"},"type":"array"}},"required":["events"],"type":"object"},"TrackEventBatchResponse":{"properties":{"accepted":{"type":"integer"},"rejected":{"type":"integer"}},"required":["accepted","rejected"],"type":"object"},"TrackEventRequest":{"additionalProperties":false,"properties":{"context":{"additionalProperties":true,"type":"object"},"event_type":{"description":"Project event code. Runtime mapping is app-scoped.","example":"checkout_completed","type":"string"},"external_user_id":{"type":"string"},"occurred_at":{"description":"Optional event timestamp. When omitted, whisp-go uses the receive time.","format":"date-time","type":"string"},"properties":{"additionalProperties":true,"type":"object"},"user":{"$ref":"#/components/schemas/IngestedUserPatch"}},"required":["external_user_id","event_type"],"type":"object"},"TrackEventResponse":{"properties":{"event":{"properties":{"canonical_event_type":{"type":"string"},"id":{"type":"string"},"mapping_status":{"enum":["mapped","unmapped"],"type":"string"}},"required":["id","mapping_status"],"type":"object"},"job":{"properties":{"type":{"example":"evaluate_user","type":"string"}},"required":["type"],"type":"object"},"user":{"properties":{"external_id":{"type":"string"},"id":{"type":"string"}},"required":["id","external_id"],"type":"object"}},"required":["event","user","job"],"type":"object"},"UpdateDeliveryEmailSettingsRequest":{"description":"Partial update of the email sender identity. Provide at least one of from_name or from_address. An omitted field is left unchanged; an explicit empty string clears it.","properties":{"from_address":{"description":"A syntactically valid email address, or empty to clear.","maxLength":254,"type":"string"},"from_name":{"maxLength":200,"type":"string"}},"type":"object"},"UpdateDeliveryEmailTemplateRequest":{"description":"Partial metadata update. Dashboard callers can mark a generated template reviewed; provider publish and active transitions use the version publish endpoint.","properties":{"name":{"maxLength":120,"type":"string"},"purpose":{"maxLength":120,"type":"string"},"status":{"$ref":"#/components/schemas/DeliveryEmailTemplateStatus"}},"type":"object"}},"securitySchemes":{"APIKey":{"description":"Use `Authorization: Bearer \u003capi_key\u003e`.","in":"header","name":"Authorization","type":"apiKey"},"DashboardBearer":{"bearerFormat":"Supabase JWT","description":"Use `Authorization: Bearer \u003csupabase_access_token\u003e` from Supabase Auth.","scheme":"bearer","type":"http"},"OnboardingImportSecret":{"in":"header","name":"X-Whisp-Onboarding-Import-Secret","type":"apiKey"}}},"info":{"description":"Lean runtime surface for whisp-go.\n\nOnboarding and setup-time auth are owned by whisp-onboarding-panel. whisp-go\nimports a completed onboarding session, materializes runtime context,\nevents, interventions, variants, and their typed links.\n","title":"Whisperr Runtime API","version":"0.2.0"},"openapi":"3.0.3","paths":{"/dashboard/apps/{app_id}/api-keys":{"get":{"operationId":"listDashboardAPIKeys","parameters":[{"$ref":"#/components/parameters/AppIDPath"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardAPIKeysResponse"}}},"description":"Active API key metadata. Raw key material is never returned."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"DashboardBearer":[]}],"summary":"List active API keys for an app","tags":["Dashboard"]},"post":{"operationId":"createDashboardAPIKey","parameters":[{"$ref":"#/components/parameters/AppIDPath"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDashboardAPIKeyRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDashboardAPIKeyResponse"}}},"description":"API key created. Raw key material is returned once."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"DashboardBearer":[]}],"summary":"Create an API key for an app","tags":["Dashboard"]}},"/dashboard/apps/{app_id}/api-keys/{key_id}":{"delete":{"operationId":"deleteDashboardAPIKey","parameters":[{"$ref":"#/components/parameters/AppIDPath"},{"in":"path","name":"key_id","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"API key revoked."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"DashboardBearer":[]}],"summary":"Revoke an API key","tags":["Dashboard"]}},"/dashboard/apps/{app_id}/delivery/channels":{"get":{"operationId":"listDashboardDeliveryChannels","parameters":[{"$ref":"#/components/parameters/AppIDPath"}],"responses":{"200":{"content":{"application/json":{"schema":{"items":{"properties":{"available":{"type":"boolean"},"description":{"type":"string"},"key":{"enum":["email","push","sms","whatsapp","voice"],"type":"string"},"label":{"type":"string"},"status":{"enum":["active","verifying","not_connected","error","coming_soon"],"type":"string"}},"required":["key","label","description","status","available"],"type":"object"},"type":"array"}}},"description":"Bare channel summary array."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Delivery is unconfigured or schema migrations are pending."}},"security":[{"DashboardBearer":[]}],"summary":"List delivery channel availability and connection state","tags":["Delivery"]}},"/dashboard/apps/{app_id}/delivery/email/activity":{"get":{"operationId":"listDashboardDeliveryEmailActivity","parameters":[{"$ref":"#/components/parameters/AppIDPath"},{"in":"query","name":"limit","required":false,"schema":{"default":50,"maximum":200,"minimum":1,"type":"integer"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryEmailActivityResponse"}}},"description":"Recent outbound messages with parsed provider events."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Message Delivery is not configured."}},"security":[{"DashboardBearer":[]}],"summary":"List email message activity","tags":["Delivery"]}},"/dashboard/apps/{app_id}/delivery/email/server/provision":{"post":{"operationId":"provisionDashboardDeliveryEmailServer","parameters":[{"$ref":"#/components/parameters/AppIDPath"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryEmailServerResponse"}}},"description":"Postmark server, outbound stream, and webhook are provisioned."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The email provider rejected the request."},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The email provider is unavailable or misconfigured."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Message Delivery is not configured."}},"security":[{"DashboardBearer":[]}],"summary":"Provision the app's isolated Postmark server","tags":["Delivery"]}},"/dashboard/apps/{app_id}/delivery/email/settings":{"get":{"operationId":"getDashboardDeliveryEmailSettings","parameters":[{"$ref":"#/components/parameters/AppIDPath"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryEmailSettingsResponse"}}},"description":"The default From identity for the email channel."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Message Delivery is not configured."}},"security":[{"DashboardBearer":[]}],"summary":"Get the app's email sender identity","tags":["Delivery"]},"patch":{"operationId":"updateDashboardDeliveryEmailSettings","parameters":[{"$ref":"#/components/parameters/AppIDPath"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDeliveryEmailSettingsRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryEmailSettingsResponse"}}},"description":"The updated From identity."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The sender identity could not be saved."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Message Delivery is not configured."}},"security":[{"DashboardBearer":[]}],"summary":"Update the app's email sender identity","tags":["Delivery"]}},"/dashboard/apps/{app_id}/delivery/email/templates":{"get":{"operationId":"listDashboardDeliveryEmailTemplates","parameters":[{"$ref":"#/components/parameters/AppIDPath"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryEmailTemplatesResponse"}}},"description":"App-scoped email templates with latest versions when present."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Message Delivery is not configured."}},"security":[{"DashboardBearer":[]}],"summary":"List email templates","tags":["Delivery"]},"post":{"operationId":"createDashboardDeliveryEmailTemplate","parameters":[{"$ref":"#/components/parameters/AppIDPath"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateDeliveryEmailTemplateRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryEmailTemplateResponse"}}},"description":"Draft email template created."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Template name already exists."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Message Delivery is not configured."}},"security":[{"DashboardBearer":[]}],"summary":"Create an email template","tags":["Delivery"]}},"/dashboard/apps/{app_id}/delivery/email/templates/preview":{"post":{"operationId":"previewDashboardDeliveryEmailTemplate","parameters":[{"$ref":"#/components/parameters/AppIDPath"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompileDeliveryEmailTemplateRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryEmailTemplatePreviewResponse"}}},"description":"Safe HTML and generated text preview."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Message Delivery is not configured."}},"security":[{"DashboardBearer":[]}],"summary":"Compile an email template preview","tags":["Delivery"]}},"/dashboard/apps/{app_id}/delivery/email/templates/{template_id}":{"get":{"operationId":"getDashboardDeliveryEmailTemplate","parameters":[{"$ref":"#/components/parameters/AppIDPath"},{"$ref":"#/components/parameters/DeliveryTemplateIDPath"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryEmailTemplateResponse"}}},"description":"Template metadata and stored versions."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Message Delivery is not configured."}},"security":[{"DashboardBearer":[]}],"summary":"Get an email template","tags":["Delivery"]},"patch":{"operationId":"updateDashboardDeliveryEmailTemplate","parameters":[{"$ref":"#/components/parameters/AppIDPath"},{"$ref":"#/components/parameters/DeliveryTemplateIDPath"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateDeliveryEmailTemplateRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryEmailTemplateResponse"}}},"description":"Template metadata updated."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Template name or lifecycle transition conflicts."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Message Delivery is not configured."}},"security":[{"DashboardBearer":[]}],"summary":"Update an email template","tags":["Delivery"]}},"/dashboard/apps/{app_id}/delivery/email/templates/{template_id}/send":{"post":{"operationId":"sendDashboardDeliveryEmailTemplate","parameters":[{"$ref":"#/components/parameters/AppIDPath"},{"$ref":"#/components/parameters/DeliveryTemplateIDPath"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendDeliveryEmailTemplateRequest"}}},"required":true},"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryOutboundMessageResponse"}}},"description":"Email send was submitted to the provider."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Sender identity, active From domain, delivery server, or active template is not ready."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The email provider rejected the send request."},"429":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The email provider is rate limiting requests."},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The email provider is unavailable."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Message Delivery or secret encryption is not configured."}},"security":[{"DashboardBearer":[]}],"summary":"Send an active email template","tags":["Delivery"]}},"/dashboard/apps/{app_id}/delivery/email/templates/{template_id}/versions":{"post":{"operationId":"createDashboardDeliveryEmailTemplateVersion","parameters":[{"$ref":"#/components/parameters/AppIDPath"},{"$ref":"#/components/parameters/DeliveryTemplateIDPath"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CompileDeliveryEmailTemplateRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryEmailTemplateVersionResponse"}}},"description":"Compiled template version created."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Template lifecycle does not allow a new generated version."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Message Delivery is not configured."}},"security":[{"DashboardBearer":[]}],"summary":"Create a compiled email template version","tags":["Delivery"]}},"/dashboard/apps/{app_id}/delivery/email/templates/{template_id}/versions/generate":{"post":{"operationId":"generateDashboardDeliveryEmailTemplateVersion","parameters":[{"$ref":"#/components/parameters/AppIDPath"},{"$ref":"#/components/parameters/DeliveryTemplateIDPath"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateDeliveryEmailTemplateRequest"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryEmailTemplateVersionResponse"}}},"description":"Generated block source was compiled and stored as a version."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Template lifecycle does not allow a generated version."},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The template generation provider is unavailable or returned invalid output."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Template generation is not configured."}},"security":[{"DashboardBearer":[]}],"summary":"Generate a compiled email template version from a brief","tags":["Delivery"]}},"/dashboard/apps/{app_id}/delivery/email/templates/{template_id}/versions/{version_id}/preview":{"get":{"operationId":"renderDashboardDeliveryEmailTemplatePreview","parameters":[{"$ref":"#/components/parameters/AppIDPath"},{"$ref":"#/components/parameters/DeliveryTemplateIDPath"},{"$ref":"#/components/parameters/DeliveryTemplateVersionIDPath"},{"in":"query","name":"mode","required":false,"schema":{"default":"desktop","enum":["desktop","text"],"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryEmailTemplatePreviewResponse"}}},"description":"Stored template preview in the requested mode."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Message Delivery is not configured."}},"security":[{"DashboardBearer":[]}],"summary":"Render a stored email template preview","tags":["Delivery"]}},"/dashboard/apps/{app_id}/delivery/email/templates/{template_id}/versions/{version_id}/publish":{"post":{"operationId":"publishDashboardDeliveryEmailTemplateVersion","parameters":[{"$ref":"#/components/parameters/AppIDPath"},{"$ref":"#/components/parameters/DeliveryTemplateIDPath"},{"$ref":"#/components/parameters/DeliveryTemplateVersionIDPath"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeliveryEmailTemplateResponse"}}},"description":"Reviewed version was published to Postmark and activated locally."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Template is not reviewed, or the delivery server has not been provisioned."},"422":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The email provider rejected the template."},"502":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"The email provider is unavailable."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Message Delivery or secret encryption is not configured."}},"security":[{"DashboardBearer":[]}],"summary":"Publish a reviewed email template version","tags":["Delivery"]}},"/dashboard/apps/{app_id}/delivery/providers":{"get":{"operationId":"listDashboardDeliveryProviders","parameters":[{"$ref":"#/components/parameters/AppIDPath"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"providers":{"items":{"additionalProperties":true,"type":"object"},"type":"array"}},"required":["providers"],"type":"object"}}},"description":"Provider catalog with the app's current connection state."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Delivery is unconfigured or schema migrations are pending."}},"security":[{"DashboardBearer":[]}],"summary":"List the delivery provider catalog and app connections","tags":["Delivery"]}},"/dashboard/apps/{app_id}/events":{"get":{"operationId":"listDashboardEvents","parameters":[{"$ref":"#/components/parameters/AppIDPath"}],"responses":{"200":{"description":"Recent event list."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"$ref":"#/components/responses/SchemaMigrationsPending"}},"security":[{"DashboardBearer":[]}],"summary":"List recently ingested events","tags":["Dashboard"]}},"/dashboard/apps/{app_id}/events/catalog":{"get":{"description":"Returns the event catalog generated during universe generation for the app's active runtime config version, including each event's description, rationale, advisory wireability, and typed intervention-variant links.\n","operationId":"getDashboardEventsCatalog","parameters":[{"$ref":"#/components/parameters/AppIDPath"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardEventsCatalogResponse"}}},"description":"Generated event catalog for the active config version."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"DashboardBearer":[]}],"summary":"Get the app's generated event catalog","tags":["Dashboard"]}},"/dashboard/apps/{app_id}/events/kpis":{"get":{"operationId":"getDashboardEventKPIs","parameters":[{"$ref":"#/components/parameters/AppIDPath"}],"responses":{"200":{"description":"Event KPI values."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"$ref":"#/components/responses/SchemaMigrationsPending"}},"security":[{"DashboardBearer":[]}],"summary":"Get event stream KPI values","tags":["Dashboard"]}},"/dashboard/apps/{app_id}/integrations":{"get":{"operationId":"getDashboardIntegrations","parameters":[{"$ref":"#/components/parameters/AppIDPath"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardIntegrationsResponse"}}},"description":"Runtime integration and source state."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"DashboardBearer":[]}],"summary":"Get dashboard integration source state","tags":["Dashboard"]}},"/dashboard/apps/{app_id}/integrations/coverage":{"get":{"operationId":"getDashboardIntegrationCoverage","parameters":[{"$ref":"#/components/parameters/AppIDPath"}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object"}}},"description":"Runtime event coverage and received-event state."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"503":{"$ref":"#/components/responses/SchemaMigrationsPending"}},"security":[{"DashboardBearer":[]}],"summary":"Get runtime event integration coverage","tags":["Dashboard"]}},"/dashboard/apps/{app_id}/interventions":{"get":{"operationId":"listDashboardInterventions","parameters":[{"$ref":"#/components/parameters/AppIDPath"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardInterventionsResponse"}}},"description":"Active runtime intervention configuration."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"DashboardBearer":[]}],"summary":"List dashboard intervention sub-variants for an app","tags":["Dashboard"]}},"/dashboard/apps/{app_id}/interventions/generation-status":{"get":{"description":"Explicit lifecycle state of the universe generation LLM pass so the dashboard can show a generating / ready / failed view without inferring state from error messages.\n","operationId":"getDashboardInterventionsGenerationStatus","parameters":[{"$ref":"#/components/parameters/AppIDPath"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardInterventionsGenerationStatus"}}},"description":"Current universe generation status."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"DashboardBearer":[]}],"summary":"Universe generation status for the interventions page","tags":["Dashboard"]}},"/dashboard/apps/{app_id}/interventions/parents/{parent}":{"patch":{"operationId":"setDashboardParentStatus","parameters":[{"$ref":"#/components/parameters/AppIDPath"},{"in":"path","name":"parent","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardStatusRequest"}}},"required":true},"responses":{"200":{"description":"Status updated."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"DashboardBearer":[]}],"summary":"Pause or resume all sub-variants in a parent strategy","tags":["Dashboard"]}},"/dashboard/apps/{app_id}/interventions/recent":{"get":{"operationId":"listDashboardRecentDispatches","parameters":[{"$ref":"#/components/parameters/AppIDPath"}],"responses":{"200":{"description":"Recent dispatch list."}},"security":[{"DashboardBearer":[]}],"summary":"List recent decision dispatches","tags":["Dashboard"]}},"/dashboard/apps/{app_id}/interventions/retry-generation":{"post":{"description":"Re-runs a failed universe generation. Guarded server-side: only allowed when the generation has failed and the per-import retry cap has not been reached.\n","operationId":"retryDashboardInterventionsGeneration","parameters":[{"$ref":"#/components/parameters/AppIDPath"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardInterventionsGenerationStatus"}}},"description":"Generation re-enqueued."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"Generation is not in a retryable state or the retry limit was reached."}},"security":[{"DashboardBearer":[]}],"summary":"Retry a failed universe generation","tags":["Dashboard"]}},"/dashboard/apps/{app_id}/interventions/{code}":{"patch":{"operationId":"setDashboardSubVariantStatus","parameters":[{"$ref":"#/components/parameters/AppIDPath"},{"in":"path","name":"code","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardStatusRequest"}}},"required":true},"responses":{"200":{"description":"Status updated."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"DashboardBearer":[]}],"summary":"Pause or resume a sub-variant","tags":["Dashboard"]}},"/dashboard/apps/{app_id}/knowledge":{"get":{"description":"Returns the complete Project Knowledge read model including the full runtime universe and generation units. Retained for the dev-mode and legacy paths; production Project Knowledge pages compose from the resource-scoped endpoints (business-profile, customer-profile, brand-voice, event-context, runtime) instead.\n","operationId":"getDashboardKnowledge","parameters":[{"$ref":"#/components/parameters/AppIDPath"}],"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object"}}},"description":"Full Project Knowledge dashboard."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"DashboardBearer":[]}],"summary":"Get the full Project Knowledge dashboard (legacy/dev)","tags":["Dashboard"]}},"/dashboard/apps/{app_id}/knowledge/brand-voice":{"get":{"description":"Returns only the Brand voice section (tone, forbidden phrases, sample sentence), server-projected from fixed business context fields and child voice rows.\n","operationId":"getDashboardKnowledgeBrandVoice","parameters":[{"$ref":"#/components/parameters/AppIDPath"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardKnowledgeBrandVoice"}}},"description":"Brand voice section."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"DashboardBearer":[]}],"summary":"Get the Brand voice section","tags":["Dashboard"]},"patch":{"description":"Patches Brand voice fields (tone, forbidden phrases, sample sentence) and returns the refreshed section.\n","operationId":"updateDashboardKnowledgeBrandVoice","parameters":[{"$ref":"#/components/parameters/AppIDPath"}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardKnowledgeBrandVoice"}}},"description":"Refreshed Brand voice section."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"DashboardBearer":[]}],"summary":"Update the Brand voice section","tags":["Dashboard"]}},"/dashboard/apps/{app_id}/knowledge/business-context":{"patch":{"description":"Patches editable business context fields (company name, ICP, tone, etc.) and returns the full Project Knowledge dashboard. Retained for the legacy path; production editors use the per-section PATCH endpoints.\n","operationId":"updateDashboardBusinessContext","parameters":[{"$ref":"#/components/parameters/AppIDPath"}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object"}}},"description":"Refreshed full Project Knowledge dashboard."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"DashboardBearer":[]}],"summary":"Update editable business context fields (legacy)","tags":["Dashboard"]}},"/dashboard/apps/{app_id}/knowledge/business-profile":{"get":{"description":"Returns only the Business profile section (name, industry, sub-industry, product category, pricing model), server-projected from fixed business context fields.\n","operationId":"getDashboardKnowledgeBusinessProfile","parameters":[{"$ref":"#/components/parameters/AppIDPath"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardKnowledgeBusinessProfile"}}},"description":"Business profile section."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"DashboardBearer":[]}],"summary":"Get the Business profile section","tags":["Dashboard"]},"patch":{"description":"Patches Business profile fields (company name, industry, sub-industry, product category, pricing model) and returns the refreshed section.\n","operationId":"updateDashboardKnowledgeBusinessProfile","parameters":[{"$ref":"#/components/parameters/AppIDPath"}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardKnowledgeBusinessProfile"}}},"description":"Refreshed Business profile section."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"DashboardBearer":[]}],"summary":"Update the Business profile section","tags":["Dashboard"]}},"/dashboard/apps/{app_id}/knowledge/customer-profile":{"get":{"description":"Returns only the Customer \u0026 ICP section (primary ICP, modifiers, activation criterion, churn signals, anti-ICP), server-projected from fixed business context fields and child signal rows.\n","operationId":"getDashboardKnowledgeCustomerProfile","parameters":[{"$ref":"#/components/parameters/AppIDPath"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardKnowledgeCustomerProfile"}}},"description":"Customer \u0026 ICP section."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"DashboardBearer":[]}],"summary":"Get the Customer \u0026 ICP section","tags":["Dashboard"]},"patch":{"description":"Patches Customer \u0026 ICP fields (classified ICP, activation, anti-ICP, at-risk signals) and returns the refreshed section.\n","operationId":"updateDashboardKnowledgeCustomerProfile","parameters":[{"$ref":"#/components/parameters/AppIDPath"}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardKnowledgeCustomerProfile"}}},"description":"Refreshed Customer \u0026 ICP section."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"DashboardBearer":[]}],"summary":"Update the Customer \u0026 ICP section","tags":["Dashboard"]}},"/dashboard/apps/{app_id}/knowledge/event-context":{"get":{"description":"Returns the cohesive event-driven resource consumed by the Interventions list and Users page: runtime event taxonomy, selected interventions with their trigger events, custom events, and event sources. Excludes the raw runtime universe.\n","operationId":"getDashboardKnowledgeEventContext","parameters":[{"$ref":"#/components/parameters/AppIDPath"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardKnowledgeEventContext"}}},"description":"Event-driven knowledge context."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"DashboardBearer":[]}],"summary":"Get the event-driven knowledge context","tags":["Dashboard"]}},"/dashboard/apps/{app_id}/knowledge/runtime":{"get":{"description":"Returns the full runtime universe (events, interventions, variants, and typed links), generation units, and the event-source snapshot for the app's active runtime config version. Consumed only by the dev-mode Project Knowledge view.\n","operationId":"getDashboardKnowledgeRuntime","parameters":[{"$ref":"#/components/parameters/AppIDPath"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardKnowledgeRuntimeDetail"}}},"description":"Runtime universe for the active config version."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"DashboardBearer":[]}],"summary":"Get the dev-only Project Knowledge runtime universe","tags":["Dashboard"]}},"/dashboard/apps/{app_id}/policy-generation":{"post":{"description":"Resolves the active config server-side, verifies that universe generation completed with a valid non-empty graph, and idempotently returns or enqueues the first-policy or regeneration job. Wizard coverage is not a readiness requirement.\n","operationId":"triggerDashboardPolicyGeneration","parameters":[{"$ref":"#/components/parameters/AppIDPath"}],"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardPolicyGenerationResponse"}}},"description":"Policy generation is pending or running."},"403":{"description":"Owner or admin access is required."},"404":{"$ref":"#/components/responses/NotFound"},"409":{"description":"Universe generation or its graph is not ready."}},"security":[{"DashboardBearer":[]}],"summary":"Explicitly enqueue policy generation","tags":["Dashboard"]}},"/dashboard/apps/{app_id}/users/stats":{"get":{"operationId":"getDashboardUserStats","parameters":[{"$ref":"#/components/parameters/AppIDPath"}],"responses":{"200":{"content":{"application/json":{"schema":{"properties":{"avgEngagement":{"nullable":true,"type":"number"},"directorySampleSize":{"nullable":true,"type":"number"},"highRiskCount":{"nullable":true,"type":"number"},"lifecycleStageCount":{"nullable":true,"type":"number"},"subscriptionRevenue":{"nullable":true,"type":"number"},"totalUsers":{"nullable":true,"type":"number"}},"required":["totalUsers","avgEngagement","highRiskCount","subscriptionRevenue","lifecycleStageCount","directorySampleSize"],"type":"object"}}},"description":"Metrics from the authoritative users and user-state directory."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"DashboardBearer":[]}],"summary":"Get aggregate user-directory metrics","tags":["Dashboard"]}},"/dashboard/session":{"get":{"operationId":"getDashboardSession","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DashboardSessionResponse"}}},"description":"Dashboard user and accessible runtime apps."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"DashboardBearer":[]}],"summary":"Get dashboard session and active runtime app","tags":["Dashboard"]}},"/delivery/webhooks/postmark/{token}":{"post":{"operationId":"receivePostmarkDeliveryWebhook","parameters":[{"$ref":"#/components/parameters/WebhookTokenPath"}],"requestBody":{"content":{"application/json":{"schema":{"additionalProperties":true,"type":"object"}}},"required":true},"responses":{"200":{"description":"Webhook accepted for raw ingestion."},"401":{"$ref":"#/components/responses/Unauthorized"},"413":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Webhook payload is too large."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}},"description":"Message Delivery is not configured."}},"summary":"Receive a raw Postmark delivery webhook","tags":["Delivery"]}},"/health":{"get":{"operationId":"getHealth","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}},"description":"Service and dependencies are healthy."},"503":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}},"description":"At least one dependency is unavailable."}},"summary":"Check service health","tags":["System"]}},"/internal/onboarding/import":{"post":{"description":"Accepts only a completed onboarding session id. whisp-go fetches the\nrelated org, app, business context, intake context, source metadata,\nand snapshots from the onboarding Supabase project. Onboarding-generated\ninterventions and events are context only; whisp-go queues a focused\nruntime universe generation job.\n","operationId":"importOnboardingSession","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportOnboardingSessionRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportOnboardingSessionResponse"}}},"description":"Session was materialized or an existing import was returned."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"409":{"description":"Onboarding session is not complete."},"422":{"description":"Completed session did not contain a valid runtime config."},"501":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportOnboardingSessionResponse"}}},"description":"Import materializer is not configured in this build."},"503":{"description":"Import auth is not configured while the materializer is enabled."}},"security":[{"OnboardingImportSecret":[]}],"summary":"Import a completed onboarding session","tags":["Internal"]}},"/metrics":{"get":{"operationId":"getMetrics","responses":{"200":{"content":{"text/plain":{"schema":{"type":"string"}}},"description":"Prometheus metrics payload."}},"summary":"Expose Prometheus metrics","tags":["System"]}},"/v1/decisions/preview":{"post":{"operationId":"previewDecision","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewDecisionRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PreviewDecisionResponse"}}},"description":"Decision preview returned."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"APIKey":[]}],"summary":"Preview a decision for a runtime user","tags":["Decisioning"]}},"/v1/events/batch":{"post":{"operationId":"trackEventBatch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrackEventBatchRequest"}}},"required":true},"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrackEventBatchResponse"}}},"description":"Valid events accepted and invalid events counted as rejected."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}},"security":[{"APIKey":[]}],"summary":"Track a batch of product events","tags":["Ingestion"]}},"/v1/events/track":{"post":{"description":"Records a single product event for the app's user. Event meaning is versioned by event_code: if the meaning of an event ever changes (what it counts, or when the host app emits it), the host must emit a new event_code. Existing codes are never redefined.","operationId":"trackEvent","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrackEventRequest"}}},"required":true},"responses":{"202":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrackEventResponse"}}},"description":"Event accepted and evaluation job enqueued."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}},"security":[{"APIKey":[]}],"summary":"Track one product event","tags":["Ingestion"]}},"/v1/identify":{"post":{"description":"Upserts a user by external id, captures identity traits, and registers contact channels / preferred channel. Idempotent on (app, external id); safe to call before any event is tracked.","operationId":"identifyUser","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdentifyRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IdentifyResponse"}}},"description":"User upserted."},"400":{"$ref":"#/components/responses/BadRequest"},"401":{"$ref":"#/components/responses/Unauthorized"}},"security":[{"APIKey":[]}],"summary":"Identify a runtime user","tags":["Users"]}},"/v1/users/{external_id}":{"get":{"operationId":"getUser","parameters":[{"$ref":"#/components/parameters/ExternalUserIDPath"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetUserResponse"}}},"description":"User returned."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"APIKey":[]}],"summary":"Get a runtime user by external id","tags":["Users"]}},"/v1/users/{external_id}/state":{"get":{"operationId":"getUserState","parameters":[{"$ref":"#/components/parameters/ExternalUserIDPath"}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GetUserStateResponse"}}},"description":"User state returned."},"401":{"$ref":"#/components/responses/Unauthorized"},"404":{"$ref":"#/components/responses/NotFound"}},"security":[{"APIKey":[]}],"summary":"Get runtime state for a user","tags":["Users"]}}},"servers":[{"url":"/"}],"tags":[{"name":"System"},{"name":"Internal"},{"name":"Dashboard"},{"name":"Delivery"},{"name":"Ingestion"},{"name":"Users"},{"name":"Decisioning"}]}