{"openapi":"3.0.0","info":{"title":"Ingram Cloud API","version":"1","description":"The Ingram Cloud /v1 REST API — agents, smiths, runs, memory, tools, deployments."},"servers":[{"url":"https://api.cloud.ingram.tech"}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"A tenant-admin or smith-scoped token (the `tha_`/`thp_` handle is the bearer value). See the auth docs."}},"schemas":{"HealthOut":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]},"service":{"type":"string"},"commit":{"type":"string"}},"required":["ok","service","commit"]},"ReadyOut":{"type":"object","properties":{"ok":{"type":"boolean"},"service":{"type":"string"},"checks":{"type":"object","properties":{"db":{"type":"string"}},"required":["db"]}},"required":["ok","service","checks"]},"CatalogListOut":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CatalogEntryOut"}}},"required":["data"]},"CatalogEntryOut":{"type":"object","properties":{"slug":{"type":"string"},"display_name":{"type":"string"},"description":{"type":"string"},"mcp_url":{"type":"string"},"auth":{"type":"object","properties":{"kind":{"type":"string"},"provider":{"type":"string","nullable":true},"client_mode":{"type":"string"}},"required":["kind","provider","client_mode"]},"scopes":{"type":"array","items":{"type":"string"}},"default_allowlist":{"type":"array","nullable":true,"items":{"type":"string"}},"default_approval_policy":{"type":"array","items":{"type":"object","properties":{"match":{"type":"string"},"require":{"type":"string"}},"required":["match"]}},"logo_url":{"type":"string","nullable":true},"docs_url":{"type":"string","nullable":true}},"required":["slug","display_name","description","mcp_url","auth","scopes","default_allowlist","default_approval_policy","logo_url","docs_url"]},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"message":{"type":"string"},"type":{"type":"string"},"param":{"type":"string","nullable":true},"code":{"type":"string","enum":["address_in_use","address_required","admin_required","agent_exists","agent_in_use","agent_target_no_setup","agent_unpublished","auth_not_configured","auth_required","bad_inbound_secret","bad_public_key","bad_signature","bad_webhook","bad_webhook_secret","bedrock_unconfigured","broker_unavailable","budget_exceeded","budget_exists","card_required","catch_all_exists","client_unavailable","code_already_redeemed","concurrency_limit_exceeded","connect_failed","conversation_locked","conversation_not_found","default_agent","discovery_failed","display_name_required","email_send_failed","email_unconfigured","embedding_unavailable","empty_application_id","empty_bot_token","empty_config","empty_credentials","empty_key","empty_patch","empty_token","file_already_attached","forbidden_target","handle_unavailable","idempotency_in_progress","idempotency_key_reused","insufficient_credits","insufficient_scope","internal_error","invalid_action","invalid_address","invalid_amount","invalid_approval_policy","invalid_auth_kind","invalid_bundle","invalid_client_mode","invalid_code","invalid_cron","invalid_cursor","invalid_decision","invalid_group_by","invalid_input","invalid_kind","invalid_limit","invalid_manifest_template","invalid_meter","invalid_name","invalid_percent","invalid_period","invalid_quantity","invalid_reasoning_effort","invalid_request","invalid_response_format","invalid_return_url","invalid_scope","invalid_setup","invalid_slug","invalid_state","invalid_threshold","invalid_timezone","invalid_token_scope","invalid_tool_choice","invalid_url","invalid_variables","mcp_no_setup","minting_unavailable","missing_signature","model_key_missing","model_request_failed","name_required","no_customer","no_saved_card","not_found","nothing_to_update","organization_required","password_required","payload_too_large","permissions_required","rate_limit_exceeded","refresh_failed","rename_unsupported","replay_unsupported","resume_failed","run_cancelled","run_failed","run_not_paused","schema_error","scope_id_required","secret_required","service_overloaded","session_mismatch","session_not_found","setup_unsupported","skill_exists","skill_in_use","slack_api_error","slack_app_cap_reached","slack_app_unconfigured","slack_factory_unconfigured","slack_oauth_unconfigured","smith_exists","smith_mismatch","smith_required","smith_unresolved","storage_unavailable","stripe_error","stripe_unconfigured","structured_output_failed","target_not_supported","telegram_api_error","telegram_bot_unconfigured","tenant_token_required","too_many_inputs","tool_loop_failed","unauthenticated","unknown_catalog_entry","unknown_provider","unsupported","unsupported_api_version","unsupported_background","unsupported_credential","unsupported_policy_rule","unsupported_tools","url_required","user_required","verification_failed","web_no_setup","whatsapp_api_error","whatsapp_subscribe_failed","whatsapp_unconfigured","whatsapp_validation_failed","workspace_id_unsupported"]}},"required":["message","type","param","code"]}},"required":["error"]},"ApprovalListOut":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ApprovalOut"}},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["data","has_more"]},"ApprovalOut":{"type":"object","properties":{"id":{"type":"string"},"run_id":{"type":"string","nullable":true},"smith_id":{"type":"string","nullable":true},"tool_call_id":{"type":"string","nullable":true},"tool":{"type":"string","nullable":true},"args":{"type":"object","additionalProperties":{"nullable":true}},"elicitation":{"type":"object","nullable":true,"properties":{"message":{"type":"string"},"requested_schema":{"type":"object","additionalProperties":{"nullable":true}}},"required":["message","requested_schema"]},"status":{"type":"string"},"actor":{"type":"string","nullable":true},"reason":{"type":"string","nullable":true},"created_at":{"type":"string","nullable":true},"resolved_at":{"type":"string","nullable":true}},"required":["id","run_id","smith_id","tool_call_id","tool","args","elicitation","status","actor","reason","created_at","resolved_at"]},"ProjectOut":{"type":"object","properties":{"id":{"type":"string"},"organization":{"type":"string"},"name":{"type":"string"},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"created_at":{"type":"string","nullable":true},"archived_at":{"type":"string","nullable":true}},"required":["id","organization","name","metadata","created_at","archived_at"]},"ProjectIn":{"type":"object","properties":{"name":{"type":"string"},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}}},"required":["name"]},"ProjectListOut":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ProjectOut"}},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["data","has_more"]},"ProjectTokenOut":{"type":"object","properties":{"id":{"type":"string"},"token":{"type":"string"},"scope":{"type":"string"},"sub":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"expires_at":{"type":"string","nullable":true}},"required":["id","token","scope","sub","scopes","expires_at"]},"ProjectTokenIn":{"type":"object","properties":{"ttl_seconds":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true,"maximum":315360000},"name":{"type":"string","nullable":true}}},"AppInstallListOut":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AppInstallOut"}},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["data","has_more"]},"AppInstallOut":{"type":"object","properties":{"id":{"type":"string"},"organization":{"type":"string"},"client_id":{"type":"string"},"client_name":{"type":"string"},"project":{"type":"string"},"scope":{"type":"string"},"created_at":{"type":"string"},"revoked_at":{"type":"string","nullable":true}},"required":["id","organization","client_id","client_name","project","scope","created_at","revoked_at"]},"CustomerOut":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"external_ids":{"type":"object","additionalProperties":{"type":"string"}},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"smith_count":{"type":"integer"},"created_at":{"type":"string","nullable":true}},"required":["id","name","external_ids","metadata","created_at"]},"CustomerCreate":{"type":"object","properties":{"name":{"type":"string"},"external_ids":{"type":"object","additionalProperties":{"type":"string"}},"metadata":{"type":"object","additionalProperties":{"nullable":true}}},"required":["name"]},"CustomerListOut":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/CustomerOut"}},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"]},"CustomerPatch":{"type":"object","properties":{"name":{"type":"string","nullable":true},"external_ids":{"type":"object","nullable":true,"additionalProperties":{"type":"string"}},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}}}},"BudgetOut":{"type":"object","properties":{"id":{"type":"string"},"scope":{"type":"string","enum":["tenant","agent","smith","customer"]},"scope_id":{"type":"string","nullable":true},"period":{"type":"string"},"limit":{"type":"number"},"currency":{"type":"string"},"action":{"type":"string","enum":["warn","block"]},"created_at":{"type":"string","nullable":true}},"required":["id","scope","period","limit","currency","action"]},"BudgetIn":{"type":"object","properties":{"scope":{"type":"string"},"scope_id":{"type":"string","nullable":true},"limit":{"type":"number"},"action":{"type":"string","default":"warn"},"period":{"type":"string","default":"monthly"}},"required":["scope","limit"]},"BudgetListOut":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/BudgetOut"}},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["data","has_more"]},"BudgetStatusOut":{"type":"object","properties":{"id":{"type":"string"},"scope":{"type":"string","enum":["tenant","agent","smith","customer"]},"scope_id":{"type":"string","nullable":true},"period":{"type":"string"},"limit":{"type":"number"},"currency":{"type":"string"},"action":{"type":"string","enum":["warn","block"]},"created_at":{"type":"string","nullable":true},"period_start":{"type":"string"},"period_key":{"type":"string"},"spent":{"type":"number"},"pct":{"type":"number"},"over":{"type":"boolean"}},"required":["id","scope","period","limit","currency","action","period_start","period_key","spent","pct","over"]},"BudgetPatch":{"type":"object","properties":{"limit":{"type":"number","nullable":true},"action":{"type":"string","nullable":true}}},"BalanceOut":{"type":"object","properties":{"currency":{"type":"string"},"balance_cents":{"type":"integer"},"stripe_customer":{"type":"boolean"}},"required":["currency","balance_cents","stripe_customer"]},"LedgerListOut":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/LedgerEntryOut"}},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"]},"LedgerEntryOut":{"type":"object","properties":{"id":{"type":"string"},"amount_cents":{"type":"integer"},"currency":{"type":"string"},"kind":{"type":"string"},"description":{"type":"string"},"created_at":{"type":"string","nullable":true}},"required":["id","amount_cents","currency","kind","description","created_at"]},"OrgUsageOut":{"type":"object","properties":{"period":{"type":"string"},"currency":{"type":"string"},"total_drawn_cents":{"type":"integer"},"total_tokens":{"type":"integer"},"projects":{"type":"array","items":{"$ref":"#/components/schemas/OrgUsageProject"}}},"required":["period","currency","total_drawn_cents","total_tokens","projects"]},"OrgUsageProject":{"type":"object","properties":{"project_id":{"type":"string"},"name":{"type":"string"},"drawn_cents":{"type":"integer"},"tokens":{"type":"integer"},"budget_limit":{"type":"number","nullable":true},"budget_action":{"type":"string","nullable":true}},"required":["project_id","name","drawn_cents","tokens","budget_limit","budget_action"]},"OrgUsageSeriesOut":{"type":"object","properties":{"currency":{"type":"string"},"from":{"type":"string"},"to":{"type":"string"},"projects":{"type":"array","items":{"type":"object","properties":{"project_id":{"type":"string"},"name":{"type":"string"}},"required":["project_id","name"]}},"points":{"type":"array","items":{"$ref":"#/components/schemas/OrgUsageSeriesPoint"}}},"required":["currency","from","to","projects","points"]},"OrgUsageSeriesPoint":{"type":"object","properties":{"day":{"type":"string"},"project_id":{"type":"string"},"drawn_cents":{"type":"integer"}},"required":["day","project_id","drawn_cents"]},"CheckoutOut":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"]},"CheckoutIn":{"type":"object","properties":{"amount_cents":{"type":"integer"},"return_url":{"type":"string"}},"required":["amount_cents","return_url"]},"SetupOut":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"]},"SetupIn":{"type":"object","properties":{"return_url":{"type":"string"}},"required":["return_url"]},"RedeemOut":{"type":"object","properties":{"amount_cents":{"type":"integer"},"currency":{"type":"string"}},"required":["amount_cents","currency"]},"RedeemIn":{"type":"object","properties":{"code":{"type":"string"}},"required":["code"]},"ConfirmOut":{"type":"object","properties":{"credited":{"type":"boolean"},"payment_status":{"type":"string"}},"required":["credited","payment_status"]},"ConfirmIn":{"type":"object","properties":{"session_id":{"type":"string"}},"required":["session_id"]},"AutoreloadOut":{"type":"object","properties":{"enabled":{"type":"boolean"},"threshold_cents":{"type":"integer"},"amount_cents":{"type":"integer"}},"required":["enabled","threshold_cents","amount_cents"]},"ReloadOut":{"type":"object","properties":{"credited":{"type":"boolean"},"payment_status":{"type":"string"}},"required":["credited","payment_status"]},"ReloadIn":{"type":"object","properties":{"amount_cents":{"type":"integer"}}},"PortalOut":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"]},"StripeWebhookAck":{"type":"object","properties":{"received":{"type":"boolean","enum":[true]}},"required":["received"]},"ScheduleOut":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"cron":{"type":"string"},"timezone":{"type":"string"},"input":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}},"thread_id":{"type":"string","nullable":true},"enabled":{"type":"boolean"},"next_fire_at":{"type":"string","nullable":true},"last_fire_at":{"type":"string","nullable":true},"created_at":{"type":"string","nullable":true}},"required":["id","name","cron","timezone","input","thread_id","enabled","next_fire_at","last_fire_at","created_at"]},"ScheduleIn":{"type":"object","properties":{"cron":{"type":"string"},"name":{"type":"string","nullable":true},"timezone":{"type":"string","default":"UTC"},"input":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}},"default":[]},"thread_id":{"type":"string","nullable":true},"enabled":{"type":"boolean","default":true}},"required":["cron"]},"ScheduleListOut":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ScheduleOut"}},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["data","has_more"]},"SchedulePatch":{"type":"object","properties":{"name":{"type":"string","nullable":true},"cron":{"type":"string","nullable":true},"timezone":{"type":"string","nullable":true},"input":{"type":"array","nullable":true,"items":{"type":"object","additionalProperties":{"nullable":true}}},"thread_id":{"type":"string","nullable":true},"enabled":{"type":"boolean","nullable":true}}},"ScheduleRunNowOut":{"type":"object","properties":{"schedule_id":{"type":"string"},"delivery_id":{"type":"string"},"status":{"type":"string","enum":["queued"]}},"required":["schedule_id","delivery_id","status"]},"ConnectionOut":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"status":{"type":"string"},"expires_at":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"created_at":{"type":"string","nullable":true}},"required":["id","provider","scopes","status","expires_at","created_at"]},"ConnectionIn":{"type":"object","properties":{"provider":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"credential":{"$ref":"#/components/schemas/Credential"},"metadata":{"type":"object","additionalProperties":{"nullable":true}}},"required":["provider","credential"]},"Credential":{"type":"object","properties":{"kind":{"type":"string"},"access_token":{"type":"string","nullable":true},"refresh_token":{"type":"string","nullable":true},"expires_at":{"type":"string","nullable":true},"token_uri":{"type":"string","nullable":true}}},"ConnectionListOut":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ConnectionOut"}},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["data","has_more"]},"ConnectionPatch":{"type":"object","properties":{"scopes":{"type":"array","nullable":true,"items":{"type":"string"}},"credential":{"allOf":[{"$ref":"#/components/schemas/Credential"},{"nullable":true}]},"status":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}}}},"AuthorizeOut":{"type":"object","properties":{"authorize_url":{"type":"string","nullable":true},"provider":{"type":"string"}},"required":["authorize_url","provider"]},"AuthorizeIn":{"type":"object","properties":{"provider":{"type":"string"},"return_url":{"type":"string","nullable":true},"mcp_server":{"type":"string","nullable":true}},"required":["provider"]},"ConnectionCallbackOut":{"type":"object","properties":{"status":{"type":"string","enum":["ok"]}},"required":["status"]},"ClientMetadataDocument":{"type":"object","properties":{"client_id":{"type":"string"},"client_name":{"type":"string"},"client_uri":{"type":"string"},"redirect_uris":{"type":"array","items":{"type":"string"}},"grant_types":{"type":"array","items":{"type":"string"}},"response_types":{"type":"array","items":{"type":"string"}},"token_endpoint_auth_method":{"type":"string"},"jwks_uri":{"type":"string"}},"required":["client_id","client_name","client_uri","redirect_uris","grant_types","response_types","token_endpoint_auth_method","jwks_uri"]},"ConversationOut":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["conversation"]},"created_at":{"type":"integer"},"updated_at":{"type":"integer"},"title":{"type":"string","nullable":true},"smith_id":{"type":"string"},"metadata":{"type":"object","additionalProperties":{"nullable":true}}},"required":["id","object","created_at","updated_at","title","smith_id","metadata"]},"ConversationCreate":{"type":"object","properties":{"title":{"type":"string"},"metadata":{"type":"object","additionalProperties":{"nullable":true}}}},"ConversationListOut":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/ConversationOut"}},"first_id":{"type":"string","nullable":true},"last_id":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["object","data","first_id","last_id","has_more"]},"ConversationUpdate":{"type":"object","properties":{"title":{"type":"string"},"metadata":{"type":"object","additionalProperties":{"nullable":true}}}},"ConversationDeleted":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["conversation.deleted"]},"deleted":{"type":"boolean","enum":[true]}},"required":["id","object","deleted"]},"ConversationItemListOut":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/ConversationItem"}},"first_id":{"type":"string","nullable":true},"last_id":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["object","data","first_id","last_id","has_more"]},"ConversationItem":{"type":"object","properties":{"id":{"type":"string"},"type":{"type":"string"},"role":{"type":"string"},"status":{"type":"string"},"content":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}},"call_id":{"type":"string"},"name":{"type":"string"},"arguments":{"type":"string"},"output":{"type":"string"},"server_label":{"type":"string"}},"required":["id","type"]},"DeploymentCreatedOut":{"type":"object","properties":{"id":{"type":"string"},"target":{"$ref":"#/components/schemas/DeploymentTarget"},"kind":{"$ref":"#/components/schemas/DeploymentKind"},"address":{"type":"string","nullable":true},"provider":{"type":"string","nullable":true},"provider_metadata":{"type":"object","additionalProperties":{"nullable":true}},"secret_keys":{"type":"array","items":{"type":"string"}},"mcp_url":{"type":"string"},"page_url":{"type":"string"},"status":{"type":"string"},"created_at":{"type":"string","nullable":true},"start_token":{"type":"string"},"deep_link":{"type":"string"},"prefilled_message":{"type":"string"},"install_url":{"type":"string"},"state":{"type":"string"},"slack_app_id":{"type":"string"}},"required":["id","target","kind","address","provider","status","created_at"]},"DeploymentTarget":{"type":"object","properties":{"type":{"type":"string","enum":["smith","agent"]},"id":{"type":"string"}},"required":["type","id"]},"DeploymentKind":{"type":"string","enum":["whatsapp","telegram","slack","discord","sms","voice","email","mcp","web"]},"DeploymentIn":{"type":"object","properties":{"target":{"$ref":"#/components/schemas/DeploymentTarget"},"kind":{"$ref":"#/components/schemas/DeploymentKind"},"address":{"type":"string","nullable":true},"provider":{"type":"string","nullable":true},"provider_metadata":{"type":"object","additionalProperties":{"nullable":true}},"secrets":{"type":"object","additionalProperties":{"nullable":true}},"setup":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}}},"required":["target","kind"]},"DeploymentListOut":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/DeploymentOut"}},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["data","has_more"]},"DeploymentOut":{"type":"object","properties":{"id":{"type":"string"},"target":{"$ref":"#/components/schemas/DeploymentTarget"},"kind":{"$ref":"#/components/schemas/DeploymentKind"},"address":{"type":"string","nullable":true},"provider":{"type":"string","nullable":true},"provider_metadata":{"type":"object","additionalProperties":{"nullable":true}},"secret_keys":{"type":"array","items":{"type":"string"}},"mcp_url":{"type":"string"},"page_url":{"type":"string"},"status":{"type":"string"},"created_at":{"type":"string","nullable":true}},"required":["id","target","kind","address","provider","status","created_at"]},"DeploymentPatch":{"type":"object","properties":{"display_name":{"type":"string","nullable":true},"owner_email":{"type":"string","nullable":true}}},"InboundEventListOut":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/InboundEventOut"}},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["data","has_more"]},"InboundEventOut":{"type":"object","properties":{"id":{"type":"string"},"source":{"type":"string"},"type":{"type":"string"},"subject":{"type":"string"},"idempotency_key":{"type":"string"},"smith_id":{"type":"string"},"data":{"type":"object","additionalProperties":{"nullable":true}},"created_at":{"type":"string","nullable":true}},"required":["id","source","type","subject","idempotency_key","smith_id","data","created_at"]},"AgentOut":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string","nullable":true},"name":{"type":"string"},"is_default":{"type":"boolean"},"draft":{"$ref":"#/components/schemas/AgentDraft"},"active_version":{"type":"integer","nullable":true},"rollout_version":{"type":"integer","nullable":true},"rollout_percent":{"type":"integer"},"smith_count":{"type":"integer"},"last_activity_at":{"type":"string","nullable":true},"created_at":{"type":"string","nullable":true},"updated_at":{"type":"string","nullable":true}},"required":["id","slug","name","is_default","draft","active_version","rollout_version","rollout_percent","created_at","updated_at"]},"AgentDraft":{"type":"object","properties":{"instructions":{"type":"string","nullable":true},"model":{"type":"string","nullable":true},"enabled_hosted_tools":{"type":"array","items":{"type":"string"}},"vector_store_ids":{"type":"array","items":{"type":"string"}},"mcp_servers":{"type":"array","nullable":true,"items":{"type":"string"}},"skills":{"type":"array","items":{"$ref":"#/components/schemas/SkillRef"}},"auto_memory":{"type":"boolean","nullable":true},"memory_consolidation":{"type":"boolean","nullable":true},"variables":{"type":"array","items":{"$ref":"#/components/schemas/AgentVariable"}},"ui_resources":{"type":"array","items":{"$ref":"#/components/schemas/UiResource"}}},"required":["instructions","model","enabled_hosted_tools","vector_store_ids","mcp_servers","skills","auto_memory","memory_consolidation","variables","ui_resources"]},"SkillRef":{"type":"object","properties":{"skill_id":{"type":"string"},"version":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["skill_id"]},"AgentVariable":{"type":"object","properties":{"name":{"type":"string"},"default":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"required":{"type":"boolean"}},"required":["name"]},"UiResource":{"type":"object","properties":{"name":{"type":"string"},"content_hash":{"type":"string"},"csp":{"$ref":"#/components/schemas/UiCsp"},"permissions":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"prefers_border":{"type":"boolean","nullable":true},"domain":{"type":"string","nullable":true},"tool":{"$ref":"#/components/schemas/UiResourceTool"}},"required":["name","content_hash"]},"UiCsp":{"type":"object","nullable":true,"properties":{"connectDomains":{"type":"array","items":{"type":"string"}},"resourceDomains":{"type":"array","items":{"type":"string"}},"frameDomains":{"type":"array","items":{"type":"string"}},"baseUriDomains":{"type":"array","items":{"type":"string"}}}},"UiResourceTool":{"type":"object","nullable":true,"properties":{"description":{"type":"string"},"input_schema":{"type":"object","additionalProperties":{"nullable":true}},"instruction":{"type":"string","nullable":true},"mutating":{"type":"boolean"},"visibility":{"type":"array","items":{"type":"string","enum":["model","app"]}}},"required":["description"]},"AgentIn":{"type":"object","properties":{"name":{"type":"string"},"slug":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"model":{"type":"string","nullable":true},"enabled_hosted_tools":{"type":"array","nullable":true,"items":{"type":"string"}},"vector_store_ids":{"type":"array","nullable":true,"items":{"type":"string"}},"mcp_servers":{"type":"array","nullable":true,"items":{"type":"string"}},"skills":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/SkillRef"}},"auto_memory":{"type":"boolean","nullable":true},"memory_consolidation":{"type":"boolean","nullable":true},"variables":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/AgentVariable"}}},"required":["name"]},"AgentListOut":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AgentOut"}},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["data","has_more"]},"AgentPatch":{"type":"object","properties":{"name":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"model":{"type":"string","nullable":true},"enabled_hosted_tools":{"type":"array","nullable":true,"items":{"type":"string"}},"vector_store_ids":{"type":"array","nullable":true,"items":{"type":"string"}},"mcp_servers":{"type":"array","nullable":true,"items":{"type":"string"}},"skills":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/SkillRef"}},"auto_memory":{"type":"boolean","nullable":true},"memory_consolidation":{"type":"boolean","nullable":true},"variables":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/AgentVariable"}}}},"AgentVersionListOut":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AgentVersionOut"}},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["data","has_more"]},"AgentVersionOut":{"type":"object","properties":{"version":{"type":"integer"},"snapshot":{"type":"object","properties":{"instructions":{"type":"string","nullable":true},"model":{"type":"string","nullable":true},"enabled_hosted_tools":{"type":"array","items":{"type":"string"}},"vector_store_ids":{"type":"array","items":{"type":"string"}},"mcp_servers":{"type":"array","nullable":true,"items":{"type":"string"}},"skills":{"type":"array","items":{"$ref":"#/components/schemas/SkillRef"}},"auto_memory":{"type":"boolean","nullable":true},"memory_consolidation":{"type":"boolean","nullable":true},"variables":{"type":"array","items":{"$ref":"#/components/schemas/AgentVariable"}},"ui_resources":{"type":"array","items":{"$ref":"#/components/schemas/UiResource"}}}},"created_by":{"type":"string","nullable":true},"note":{"type":"string","nullable":true},"created_at":{"type":"string","nullable":true}},"required":["version","snapshot","created_by","note","created_at"]},"PublishIn":{"type":"object","properties":{"note":{"type":"string","nullable":true}}},"RolloutIn":{"type":"object","properties":{"version":{"type":"integer"},"percent":{"type":"integer","minimum":0,"maximum":100,"default":100}},"required":["version"]},"ImportIn":{"type":"object","properties":{"from_smith":{"type":"string"},"name":{"type":"string"}},"required":["from_smith","name"]},"AttachOut":{"type":"object","properties":{"attached":{"type":"array","items":{"type":"object","properties":{"smith_id":{"type":"string"},"override_keys":{"type":"array","items":{"type":"string"}}},"required":["smith_id","override_keys"]}},"count":{"type":"integer"}},"required":["attached","count"]},"AttachIn":{"type":"object","properties":{"all":{"type":"boolean","default":false},"smith_ids":{"type":"array","nullable":true,"items":{"type":"string"}}}},"UiResourceListOut":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/UiResource"}}},"required":["data"]},"SmithOut":{"type":"object","properties":{"id":{"type":"string"},"external_id":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true},"locale":{"type":"string","nullable":true},"timezone":{"type":"string","nullable":true},"customer_id":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"model":{"type":"string"},"instructions":{"type":"string"},"rendered_instructions":{"type":"string","nullable":true},"enabled_hosted_tools":{"type":"array","items":{"type":"string"}},"vector_store_ids":{"type":"array","items":{"type":"string"}},"mcp_servers":{"type":"array","nullable":true,"items":{"type":"string"}},"skills":{"type":"array","items":{"$ref":"#/components/schemas/SkillRef"}},"auto_memory":{"type":"boolean"},"memory_consolidation":{"type":"boolean"},"config_source":{"type":"string","enum":["agent","override","custom"]},"agent_id":{"type":"string","nullable":true},"agent_version":{"type":"integer","nullable":true},"pin":{"type":"integer","nullable":true},"override_keys":{"type":"array","items":{"type":"string"}},"inherited":{"type":"object","nullable":true,"properties":{"model":{"type":"string"},"instructions":{"type":"string","nullable":true},"enabled_hosted_tools":{"type":"array","items":{"type":"string"}},"vector_store_ids":{"type":"array","items":{"type":"string"}},"mcp_servers":{"type":"array","nullable":true,"items":{"type":"string"}},"skills":{"type":"array","items":{"$ref":"#/components/schemas/SkillRef"}},"auto_memory":{"type":"boolean","nullable":true},"memory_consolidation":{"type":"boolean","nullable":true}},"required":["model","instructions","enabled_hosted_tools","vector_store_ids","mcp_servers","skills","auto_memory","memory_consolidation"]},"created_at":{"type":"string"}},"required":["id","external_id","display_name","locale","timezone","model","instructions","created_at"]},"SmithCreate":{"type":"object","properties":{"external_id":{"type":"string","nullable":true},"display_name":{"type":"string","nullable":true},"locale":{"type":"string","nullable":true},"timezone":{"type":"string","nullable":true},"customer_id":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"agent_id":{"type":"string","nullable":true},"pin":{"type":"integer","nullable":true},"model":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"enabled_hosted_tools":{"type":"array","nullable":true,"items":{"type":"string"}},"vector_store_ids":{"type":"array","nullable":true,"items":{"type":"string"}},"mcp_servers":{"type":"array","nullable":true,"items":{"type":"string"}},"skills":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/SkillRef"}},"auto_memory":{"type":"boolean","nullable":true},"memory_consolidation":{"type":"boolean","nullable":true}}},"SmithListOut":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SmithOut"}},"has_more":{"type":"boolean"},"next_cursor":{"type":"string","nullable":true}},"required":["data","has_more"]},"SmithPatch":{"type":"object","properties":{"display_name":{"type":"string","nullable":true},"locale":{"type":"string","nullable":true},"timezone":{"type":"string","nullable":true},"customer_id":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"agent_id":{"type":"string","nullable":true},"pin":{"type":"integer","nullable":true},"model":{"type":"string","nullable":true},"instructions":{"type":"string","nullable":true},"enabled_hosted_tools":{"type":"array","nullable":true,"items":{"type":"string"}},"vector_store_ids":{"type":"array","nullable":true,"items":{"type":"string"}},"mcp_servers":{"type":"array","nullable":true,"items":{"type":"string"}},"skills":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/SkillRef"}},"auto_memory":{"type":"boolean","nullable":true},"memory_consolidation":{"type":"boolean","nullable":true}}},"ModelKeyListOut":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ModelKeyOut"}}},"required":["data"]},"ModelKeyOut":{"type":"object","properties":{"provider":{"type":"string"},"base_url":{"type":"string","nullable":true},"workspace_id":{"type":"string","nullable":true},"has_key":{"type":"boolean"},"updated_at":{"type":"string","nullable":true}},"required":["provider","base_url","workspace_id","has_key","updated_at"]},"ModelKeyConfiguredOut":{"type":"object","properties":{"provider":{"type":"string"},"configured":{"type":"boolean"},"base_url":{"type":"string","nullable":true},"workspace_id":{"type":"string","nullable":true}},"required":["provider","configured","base_url","workspace_id"]},"ModelKeyIn":{"type":"object","properties":{"api_key":{"type":"string"},"base_url":{"type":"string","nullable":true},"workspace_id":{"type":"string","nullable":true}},"required":["api_key"]},"RevisionListOut":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SmithRevisionOut"}},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["data","has_more"]},"SmithRevisionOut":{"type":"object","properties":{"version":{"type":"integer"},"snapshot":{"type":"object","properties":{"instructions":{"type":"string","nullable":true},"model":{"type":"string","nullable":true},"enabled_hosted_tools":{"type":"array","items":{"type":"string"}},"vector_store_ids":{"type":"array","items":{"type":"string"}},"mcp_servers":{"type":"array","nullable":true,"items":{"type":"string"}},"skills":{"type":"array","nullable":true,"items":{"$ref":"#/components/schemas/SkillRef"}},"auto_memory":{"type":"boolean","nullable":true},"memory_consolidation":{"type":"boolean","nullable":true}}},"created_by":{"type":"string","nullable":true},"note":{"type":"string","nullable":true},"created_at":{"type":"string","nullable":true}},"required":["version","snapshot"]},"RestoreIn":{"type":"object","properties":{"note":{"type":"string","nullable":true}}},"Skill":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["skill"]},"name":{"type":"string"},"description":{"type":"string"},"default_version":{"type":"integer"},"created_at":{"type":"string"},"updated_at":{"type":"string"}},"required":["id","object","name","description","default_version","created_at","updated_at"]},"SkillListOut":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/Skill"}}},"required":["object","data"]},"SkillUpdateIn":{"type":"object","properties":{"default_version":{"type":"integer","minimum":0,"exclusiveMinimum":true}},"required":["default_version"]},"SkillVersion":{"type":"object","properties":{"skill_id":{"type":"string"},"version":{"type":"integer"},"description":{"type":"string"},"license":{"type":"string","nullable":true},"compatibility":{"nullable":true},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"references":{"type":"array","items":{"type":"string"}},"scripts":{"type":"array","items":{"type":"string"}},"assets":{"type":"array","items":{"type":"string"}},"files":{"type":"array","items":{"$ref":"#/components/schemas/SkillFile"}},"referenced_by":{"type":"array","items":{"$ref":"#/components/schemas/SkillReference"}},"bytes":{"type":"integer"},"created_at":{"type":"string"}},"required":["skill_id","version","description","license","metadata","references","scripts","assets","files","referenced_by","bytes","created_at"]},"SkillFile":{"type":"object","properties":{"path":{"type":"string"},"size":{"type":"integer"},"sha256":{"type":"string"},"media_type":{"type":"string"}},"required":["path","size","sha256","media_type"]},"SkillReference":{"type":"object","properties":{"agent_id":{"type":"string"},"version":{"type":"integer"}},"required":["agent_id","version"]},"SkillVersionListOut":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/SkillVersion"}}},"required":["object","data"]},"RunListOut":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/RunOut"}},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["data","has_more"]},"RunOut":{"type":"object","properties":{"id":{"type":"string"},"smith_id":{"type":"string"},"thread_id":{"type":"string"},"status":{"type":"string"},"channel":{"type":"string"},"input":{"type":"array","items":{"$ref":"#/components/schemas/InputMessage"}},"output":{"type":"object","nullable":true,"properties":{"content":{"type":"string"},"content_type":{"type":"string"},"tool_calls":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}},"suggested_replies":{"type":"array","items":{"type":"string"}}}},"stop_reason":{"type":"string","nullable":true},"warnings":{"type":"array","items":{"$ref":"#/components/schemas/RunWarning"}},"usage":{"$ref":"#/components/schemas/RunUsage"},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"actor":{"$ref":"#/components/schemas/Actor"},"created_at":{"type":"string","nullable":true},"updated_at":{"type":"string","nullable":true}},"required":["id","smith_id","thread_id","status","channel","input","output","stop_reason","warnings","usage","actor","created_at","updated_at"]},"InputMessage":{"type":"object","properties":{"role":{"type":"string"},"content":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}}]}},"required":["role","content"]},"RunWarning":{"type":"object","properties":{"code":{"type":"string"},"message":{"type":"string"}},"required":["code","message"]},"RunUsage":{"type":"object","nullable":true,"properties":{"input_tokens":{"type":"number"},"output_tokens":{"type":"number"},"total_tokens":{"type":"number"},"cost":{"type":"number"}},"required":["input_tokens","output_tokens","total_tokens"]},"Actor":{"type":"object","nullable":true,"properties":{"kind":{"type":"string","enum":["smith","tenant","operator"]},"id":{"type":"string"},"token_id":{"type":"string"},"email":{"type":"string","default":""}},"required":["kind","id","token_id"]},"RunEventOut":{"type":"object","properties":{"seq":{"type":"integer"},"type":{"type":"string"},"data":{"type":"object","additionalProperties":{"nullable":true}},"created_at":{"type":"string","nullable":true}},"required":["seq","type","data","created_at"]},"RunStreamFrame":{"type":"object","properties":{"v":{"type":"number","enum":[1]},"run_id":{"type":"string"}},"required":["v","run_id"],"additionalProperties":{"nullable":true}},"RunIn":{"type":"object","properties":{"input":{"type":"array","items":{"$ref":"#/components/schemas/InputMessage"}},"thread_id":{"type":"string","nullable":true},"stream":{"type":"boolean"},"channel":{"type":"string"},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"response_format":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}}}},"RunReplayIn":{"type":"object","properties":{"stream":{"type":"boolean"}}},"RunCancelAck":{"type":"object","properties":{"id":{"type":"string"},"status":{"type":"string","enum":["cancelled"]}},"required":["id","status"]},"Submit":{"type":"object","properties":{"kind":{"type":"string"},"tool_call_id":{"type":"string","nullable":true},"result":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"approval_id":{"type":"string","nullable":true},"decision":{"type":"string","nullable":true},"content":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}},"actor":{"type":"string","nullable":true},"reason":{"type":"string","nullable":true},"stream":{"type":"boolean"}},"required":["kind"]},"FileOut":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["file"]},"bytes":{"type":"integer"},"created_at":{"type":"integer"},"filename":{"type":"string"},"purpose":{"type":"string"},"status":{"type":"string","enum":["processed"]},"status_details":{"nullable":true}},"required":["id","object","bytes","created_at","filename","purpose","status","status_details"]},"FileListOut":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/FileOut"}},"first_id":{"type":"string","nullable":true},"last_id":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["object","data","first_id","last_id","has_more"]},"FileDeleted":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["file"]},"deleted":{"type":"boolean","enum":[true]}},"required":["id","object","deleted"]},"VectorStoreOut":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["vector_store"]},"created_at":{"type":"integer"},"name":{"type":"string"},"description":{"type":"string","nullable":true},"usage_bytes":{"type":"integer"},"status":{"type":"string","enum":["in_progress","completed"]},"file_counts":{"type":"object","properties":{"in_progress":{"type":"integer"},"completed":{"type":"integer"},"failed":{"type":"integer"},"cancelled":{"type":"integer"},"total":{"type":"integer"}},"required":["in_progress","completed","failed","cancelled","total"]},"last_active_at":{"type":"integer","nullable":true},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"smith_id":{"type":"string"},"embedding_model":{"type":"string"}},"required":["id","object","created_at","name","description","usage_bytes","status","file_counts","last_active_at","metadata","smith_id","embedding_model"]},"VectorStoreIn":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"file_ids":{"type":"array","items":{"type":"string"},"maxItems":500},"chunking_strategy":{"$ref":"#/components/schemas/ChunkingStrategyIn"},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"smith_id":{"type":"string"},"embedding_model":{"type":"string"}}},"ChunkingStrategyIn":{"anyOf":[{"type":"object","properties":{"type":{"type":"string","enum":["auto"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["static"]},"static":{"type":"object","properties":{"max_chunk_size_tokens":{"type":"integer","minimum":100,"maximum":4096},"chunk_overlap_tokens":{"type":"integer","minimum":0}},"required":["max_chunk_size_tokens","chunk_overlap_tokens"]}},"required":["type","static"]}]},"VectorStoreListOut":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/VectorStoreOut"}},"first_id":{"type":"string","nullable":true},"last_id":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["object","data","first_id","last_id","has_more"]},"VectorStorePatch":{"type":"object","properties":{"name":{"type":"string","nullable":true},"description":{"type":"string","nullable":true},"metadata":{"type":"object","nullable":true,"additionalProperties":{"nullable":true}}}},"VectorStoreDeleted":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["vector_store.deleted"]},"deleted":{"type":"boolean","enum":[true]}},"required":["id","object","deleted"]},"VectorStoreFileOut":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["vector_store.file"]},"usage_bytes":{"type":"integer"},"created_at":{"type":"integer"},"vector_store_id":{"type":"string"},"status":{"type":"string","enum":["in_progress","completed","failed","cancelled"]},"last_error":{"type":"object","nullable":true,"properties":{"code":{"type":"string","enum":["server_error","unsupported_file","no_text_layer","invalid_file"]},"message":{"type":"string"}},"required":["code","message"]},"chunking_strategy":{"$ref":"#/components/schemas/ChunkingStrategyOut"},"attributes":{"type":"object","nullable":true,"additionalProperties":{"anyOf":[{"type":"string","maxLength":512},{"type":"number"},{"type":"boolean"}]}}},"required":["id","object","usage_bytes","created_at","vector_store_id","status","last_error","chunking_strategy","attributes"]},"ChunkingStrategyOut":{"type":"object","properties":{"type":{"type":"string","enum":["static"]},"static":{"type":"object","properties":{"max_chunk_size_tokens":{"type":"integer"},"chunk_overlap_tokens":{"type":"integer"}},"required":["max_chunk_size_tokens","chunk_overlap_tokens"]}},"required":["type","static"]},"VectorStoreFileIn":{"type":"object","properties":{"file_id":{"type":"string"},"attributes":{"type":"object","nullable":true,"additionalProperties":{"anyOf":[{"type":"string","maxLength":512},{"type":"number"},{"type":"boolean"}]}},"chunking_strategy":{"$ref":"#/components/schemas/ChunkingStrategyIn"}},"required":["file_id"]},"VectorStoreFileListOut":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/VectorStoreFileOut"}},"first_id":{"type":"string","nullable":true},"last_id":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["object","data","first_id","last_id","has_more"]},"VectorStoreFileContentOut":{"type":"object","properties":{"object":{"type":"string","enum":["vector_store.file_content.page"]},"data":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["text"]},"text":{"type":"string"}},"required":["type","text"]}},"has_more":{"type":"boolean","enum":[false]},"next_page":{"nullable":true}},"required":["object","data","has_more","next_page"]},"VectorStoreFileUpdate":{"type":"object","properties":{"attributes":{"type":"object","nullable":true,"additionalProperties":{"anyOf":[{"type":"string","maxLength":512},{"type":"number"},{"type":"boolean"}]}}},"required":["attributes"]},"VectorStoreFileDeleted":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["vector_store.file.deleted"]},"deleted":{"type":"boolean","enum":[true]}},"required":["id","object","deleted"]},"VectorStoreFileBatchOut":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["vector_store.files_batch"]},"created_at":{"type":"integer"},"vector_store_id":{"type":"string"},"status":{"type":"string","enum":["in_progress","completed","cancelled","failed"]},"file_counts":{"type":"object","properties":{"in_progress":{"type":"integer"},"completed":{"type":"integer"},"failed":{"type":"integer"},"cancelled":{"type":"integer"},"total":{"type":"integer"}},"required":["in_progress","completed","failed","cancelled","total"]}},"required":["id","object","created_at","vector_store_id","status","file_counts"]},"VectorStoreFileBatchIn":{"type":"object","properties":{"file_ids":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":2000},"attributes":{"type":"object","nullable":true,"additionalProperties":{"anyOf":[{"type":"string","maxLength":512},{"type":"number"},{"type":"boolean"}]}},"chunking_strategy":{"$ref":"#/components/schemas/ChunkingStrategyIn"},"files":{"type":"array","items":{"type":"object","properties":{"file_id":{"type":"string"},"attributes":{"type":"object","nullable":true,"additionalProperties":{"anyOf":[{"type":"string","maxLength":512},{"type":"number"},{"type":"boolean"}]}},"chunking_strategy":{"$ref":"#/components/schemas/ChunkingStrategyIn"}},"required":["file_id"]},"minItems":1,"maxItems":2000}}},"VectorStoreSearchOut":{"type":"object","properties":{"object":{"type":"string","enum":["vector_store.search_results.page"]},"search_query":{"type":"array","items":{"type":"string"}},"data":{"type":"array","items":{"$ref":"#/components/schemas/VectorStoreSearchResult"}},"has_more":{"type":"boolean"},"next_page":{"type":"string","nullable":true}},"required":["object","search_query","data","has_more","next_page"]},"VectorStoreSearchResult":{"type":"object","properties":{"file_id":{"type":"string"},"filename":{"type":"string"},"score":{"type":"number"},"attributes":{"type":"object","nullable":true,"additionalProperties":{"anyOf":[{"type":"string","maxLength":512},{"type":"number"},{"type":"boolean"}]}},"content":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string","enum":["text"]},"text":{"type":"string"}},"required":["type","text"]}}},"required":["file_id","filename","score","attributes","content"]},"VectorStoreSearchIn":{"type":"object","properties":{"query":{"anyOf":[{"type":"string","minLength":1},{"type":"array","items":{"type":"string","minLength":1},"minItems":1}]},"max_num_results":{"type":"integer","minimum":1,"maximum":50},"filters":{"$ref":"#/components/schemas/VectorStoreFilter"},"ranking_options":{"$ref":"#/components/schemas/VectorStoreRankingOptions"}},"required":["query"]},"VectorStoreFilter":{"type":"object","nullable":true,"properties":{"type":{"type":"string","enum":["eq","ne","gt","gte","lt","lte","in","nin","and","or"]},"key":{"type":"string"},"value":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]}}]},"filters":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}}},"required":["type"]},"VectorStoreRankingOptions":{"type":"object","properties":{"score_threshold":{"type":"number","minimum":0,"maximum":1},"hybrid_search":{"type":"object","properties":{"embedding_weight":{"type":"number","minimum":0},"text_weight":{"type":"number","minimum":0}},"required":["embedding_weight","text_weight"]}}},"HostedPageOut":{"type":"object","properties":{"id":{"type":"string"},"title":{"type":"string"},"greeting":{"type":"string"},"requires_password":{"type":"boolean"},"status":{"type":"string"}},"required":["id","title","greeting","requires_password","status"]},"HostedChatIn":{"type":"object","properties":{"visitor_id":{"type":"string","minLength":1,"maxLength":128,"description":"Stable per-browser id; an agent-target page mints one smith per value."},"message":{"type":"string"},"thread_id":{"type":"string","description":"Continue an existing thread."},"password":{"type":"string","description":"Required when `requires_password`."}},"required":["visitor_id","message"]},"OpenAIModelListOut":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"$ref":"#/components/schemas/OpenAIModelOut"}}},"required":["object","data"]},"OpenAIModelOut":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["model"]},"created":{"type":"number"},"owned_by":{"type":"string"}},"required":["id","object","created","owned_by"]},"ChatCompletionChunk":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["chat.completion.chunk"]},"created":{"type":"number"},"model":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"}},"required":["index"],"additionalProperties":{"nullable":true}}}},"required":["id","object","created","model","choices"],"additionalProperties":{"nullable":true}},"ChatCompletionOut":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["chat.completion"]},"created":{"type":"number"},"model":{"type":"string"},"choices":{"type":"array","items":{"type":"object","properties":{"index":{"type":"number"}},"required":["index"],"additionalProperties":{"nullable":true}}}},"required":["id","object","created","model","choices"],"additionalProperties":{"nullable":true}},"ResponsesEvent":{"type":"object","properties":{"type":{"type":"string","description":"e.g. `response.output_text.delta`."}},"required":["type"],"additionalProperties":{"nullable":true}},"ResponsesOut":{"type":"object","properties":{"id":{"type":"string"},"object":{"type":"string","enum":["response"]},"created_at":{"type":"number"},"model":{"type":"string"},"output":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"}},"required":["type"],"additionalProperties":{"nullable":true}}}},"required":["id","object","created_at","model","output"],"additionalProperties":{"nullable":true}},"EmbeddingsOut":{"type":"object","properties":{"object":{"type":"string","enum":["list"]},"data":{"type":"array","items":{"type":"object","properties":{"object":{"type":"string","enum":["embedding"]},"index":{"type":"number"},"embedding":{"type":"array","items":{"type":"number"}}},"required":["object","index","embedding"]}},"model":{"type":"string"},"usage":{"type":"object","properties":{"prompt_tokens":{"type":"number"},"total_tokens":{"type":"number"}},"required":["prompt_tokens","total_tokens"]}},"required":["object","data","model","usage"]},"WorkingMemoryOut":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]},"WorkingMemorySet":{"type":"object","properties":{"content":{"type":"string"}},"required":["content"]},"RecallOut":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/RecallHit"}}},"required":["data"]},"RecallHit":{"type":"object","properties":{"thread_id":{"type":"string"},"content":{"type":"string"},"score":{"type":"number"}},"required":["thread_id","content","score"]},"RecallBody":{"type":"object","properties":{"query":{"type":"string"},"limit":{"type":"integer","default":10}},"required":["query"]},"McpServerOut":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"url":{"type":"string"},"auth":{"$ref":"#/components/schemas/McpAuth"},"origin":{"type":"string"},"catalog_slug":{"type":"string","nullable":true},"tool_allowlist":{"type":"array","nullable":true,"items":{"type":"string"}},"approval_policy":{"type":"array","items":{"$ref":"#/components/schemas/ApprovalRule"}},"tools":{"type":"array","items":{"$ref":"#/components/schemas/McpTool"}},"tools_discovered":{"type":"integer"},"tools_refreshed_at":{"type":"string","nullable":true},"status":{"type":"string"},"discovery_error":{"type":"string","nullable":true},"last_call_error":{"type":"string","nullable":true},"last_call_error_at":{"type":"string","nullable":true},"created_at":{"type":"string","nullable":true}},"required":["id","name","url","auth","tools","tools_discovered","tools_refreshed_at","status","discovery_error","last_call_error","last_call_error_at","created_at"]},"McpAuth":{"type":"object","properties":{"kind":{"type":"string"},"provider":{"type":"string","nullable":true},"client_mode":{"type":"string"}},"required":["kind","provider"]},"ApprovalRule":{"type":"object","properties":{"match":{"type":"string"},"require":{"type":"string"}},"required":["match"]},"McpTool":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string","nullable":true},"requires_approval":{"type":"boolean"},"enabled":{"type":"boolean"}},"required":["name","description","requires_approval","enabled"]},"McpServerIn":{"type":"object","properties":{"url":{"type":"string","nullable":true},"catalog":{"type":"string","nullable":true},"auth":{"$ref":"#/components/schemas/McpAuthIn"},"tool_allowlist":{"type":"array","nullable":true,"items":{"type":"string"}},"approval_policy":{"type":"array","nullable":true,"items":{"type":"object","properties":{"match":{"type":"string"},"require":{"type":"string"}},"required":["match"],"additionalProperties":{"nullable":true}}}}},"McpAuthIn":{"type":"object","nullable":true,"properties":{"kind":{"type":"string","nullable":true},"provider":{"type":"string","nullable":true},"secret":{"type":"string","nullable":true},"client_mode":{"type":"string","nullable":true}}},"McpServerListOut":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/McpServerOut"}},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["data","has_more"]},"OAuthProtectedResourceMetadata":{"type":"object","properties":{"resource":{"type":"string"},"authorization_servers":{"type":"array","items":{"type":"string"}},"bearer_methods_supported":{"type":"array","items":{"type":"string"}},"scopes_supported":{"type":"array","items":{"type":"string"}}},"required":["resource","authorization_servers","bearer_methods_supported","scopes_supported"]},"OAuthServerMetadata":{"type":"object","properties":{"issuer":{"type":"string"},"authorization_endpoint":{"type":"string"},"token_endpoint":{"type":"string"},"registration_endpoint":{"type":"string"},"jwks_uri":{"type":"string"},"response_types_supported":{"type":"array","items":{"type":"string"}},"grant_types_supported":{"type":"array","items":{"type":"string"}},"code_challenge_methods_supported":{"type":"array","items":{"type":"string"}},"token_endpoint_auth_methods_supported":{"type":"array","items":{"type":"string"}},"token_endpoint_auth_signing_alg_values_supported":{"type":"array","items":{"type":"string"}},"scopes_supported":{"type":"array","items":{"type":"string"}},"client_id_metadata_document_supported":{"type":"boolean"},"authorization_response_iss_parameter_supported":{"type":"boolean"}},"required":["issuer","authorization_endpoint","token_endpoint","registration_endpoint","jwks_uri","response_types_supported","grant_types_supported","code_challenge_methods_supported","token_endpoint_auth_methods_supported","token_endpoint_auth_signing_alg_values_supported","scopes_supported","client_id_metadata_document_supported","authorization_response_iss_parameter_supported"]},"Jwks":{"type":"object","properties":{"keys":{"type":"array","items":{"type":"object","properties":{"kid":{"type":"string"},"alg":{"type":"string"}},"required":["kid","alg"],"additionalProperties":{"nullable":true}}}},"required":["keys"]},"OAuthClientRegistrationOut":{"type":"object","properties":{"client_id":{"type":"string"},"client_id_issued_at":{"type":"number"},"client_name":{"type":"string"},"redirect_uris":{"type":"array","items":{"type":"string"}},"token_endpoint_auth_method":{"type":"string"},"grant_types":{"type":"array","items":{"type":"string"}},"response_types":{"type":"array","items":{"type":"string"}}},"required":["client_id","client_id_issued_at","client_name","redirect_uris","token_endpoint_auth_method","grant_types","response_types"]},"OAuthError":{"type":"object","properties":{"error":{"type":"string"},"error_description":{"type":"string"}},"required":["error","error_description"]},"OAuthTokenOut":{"type":"object","properties":{"access_token":{"type":"string"},"token_type":{"type":"string"},"expires_in":{"type":"number"},"refresh_token":{"type":"string"},"scope":{"type":"string"}},"required":["access_token","token_type","scope"]},"AuthorizeRequestOut":{"type":"object","properties":{"kind":{"type":"string","enum":["connector","app"]},"client_id":{"type":"string"},"client_name":{"type":"string"},"scope":{"type":"string"},"target_name":{"type":"string"},"tenant":{"type":"string"},"resource":{"type":"string"},"deployment_id":{"type":"string"}},"required":["kind","client_id","client_name","scope","target_name","tenant","resource","deployment_id"]},"AuthorizeRedirectOut":{"type":"object","properties":{"redirect_url":{"type":"string"}},"required":["redirect_url"]},"AuthorizeCompleteIn":{"type":"object","properties":{"smith_id":{"type":"string","nullable":true},"user":{"$ref":"#/components/schemas/AuthorizeUser"}}},"AuthorizeUser":{"type":"object","nullable":true,"properties":{"sub":{"type":"string"},"email":{"type":"string","nullable":true},"email_verified":{"type":"boolean","nullable":true},"name":{"type":"string","nullable":true},"picture":{"type":"string","nullable":true}},"required":["sub"]},"TraceListOut":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TraceOut"}},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["data","has_more"]},"TraceOut":{"type":"object","properties":{"id":{"type":"string"},"smith_id":{"type":"string","nullable":true},"app_id":{"type":"string","nullable":true},"run_id":{"type":"string","nullable":true},"root_kind":{"$ref":"#/components/schemas/SpanKind"},"name":{"type":"string"},"status":{"type":"string"},"started_at":{"type":"string"},"ended_at":{"type":"string","nullable":true},"duration_ms":{"type":"integer","nullable":true},"total_tokens":{"type":"integer","nullable":true},"total_cost":{"type":"number","nullable":true},"attributes":{"type":"object","additionalProperties":{"nullable":true}}},"required":["id","smith_id","app_id","run_id","root_kind","name","status","started_at","ended_at","duration_ms","total_tokens","total_cost","attributes"]},"SpanKind":{"type":"string","enum":["run","model_call","tool_call","memory_op","retrieval","runtime_event"]},"TraceDetailOut":{"type":"object","properties":{"id":{"type":"string"},"smith_id":{"type":"string","nullable":true},"app_id":{"type":"string","nullable":true},"run_id":{"type":"string","nullable":true},"root_kind":{"$ref":"#/components/schemas/SpanKind"},"name":{"type":"string"},"status":{"type":"string"},"started_at":{"type":"string"},"ended_at":{"type":"string","nullable":true},"duration_ms":{"type":"integer","nullable":true},"total_tokens":{"type":"integer","nullable":true},"total_cost":{"type":"number","nullable":true},"attributes":{"type":"object","additionalProperties":{"nullable":true}},"spans":{"type":"array","items":{"$ref":"#/components/schemas/SpanOut"}},"span_tree":{"type":"array","items":{"$ref":"#/components/schemas/SpanNodeOut"}}},"required":["id","smith_id","app_id","run_id","root_kind","name","status","started_at","ended_at","duration_ms","total_tokens","total_cost","attributes","spans","span_tree"]},"SpanOut":{"type":"object","properties":{"id":{"type":"string"},"trace_id":{"type":"string"},"parent_span_id":{"type":"string","nullable":true},"kind":{"$ref":"#/components/schemas/SpanKind"},"name":{"type":"string"},"status":{"type":"string"},"started_at":{"type":"string"},"ended_at":{"type":"string","nullable":true},"duration_ms":{"type":"integer","nullable":true},"model":{"type":"string","nullable":true},"input_tokens":{"type":"integer","nullable":true},"output_tokens":{"type":"integer","nullable":true},"cost":{"type":"number","nullable":true},"attributes":{"type":"object","additionalProperties":{"nullable":true}}},"required":["id","trace_id","parent_span_id","kind","name","status","started_at","ended_at","duration_ms","model","input_tokens","output_tokens","cost","attributes"]},"SpanNodeOut":{"type":"object","properties":{"id":{"type":"string"},"trace_id":{"type":"string"},"parent_span_id":{"type":"string","nullable":true},"kind":{"$ref":"#/components/schemas/SpanKind"},"name":{"type":"string"},"status":{"type":"string"},"started_at":{"type":"string"},"ended_at":{"type":"string","nullable":true},"duration_ms":{"type":"integer","nullable":true},"model":{"type":"string","nullable":true},"input_tokens":{"type":"integer","nullable":true},"output_tokens":{"type":"integer","nullable":true},"cost":{"type":"number","nullable":true},"attributes":{"type":"object","additionalProperties":{"nullable":true}},"children":{"type":"array","items":{"$ref":"#/components/schemas/SpanNodeOut"}}},"required":["id","trace_id","parent_span_id","kind","name","status","started_at","ended_at","duration_ms","model","input_tokens","output_tokens","cost","attributes","children"]},"UsageBreakdownOut":{"type":"object","properties":{"group_by":{"type":"string","enum":["app","smith","model","customer"]},"totals":{"type":"object","properties":{"tokens":{"type":"number"},"input_tokens":{"type":"number"},"cache_read_tokens":{"type":"number"},"cache_write_tokens":{"type":"number"},"cost":{"type":"number"},"run_count":{"type":"number"}},"required":["tokens","input_tokens","cache_read_tokens","cache_write_tokens","cost","run_count"]},"groups":{"type":"array","items":{"type":"object","properties":{"app":{"type":"string","nullable":true},"smith":{"type":"string","nullable":true},"model":{"type":"string","nullable":true},"customer":{"type":"string","nullable":true},"tokens":{"type":"number"},"input_tokens":{"type":"number"},"cache_read_tokens":{"type":"number"},"cache_write_tokens":{"type":"number"},"cost":{"type":"number"},"run_count":{"type":"number"}},"required":["tokens","input_tokens","cache_read_tokens","cache_write_tokens","cost","run_count"]}},"meters":{"type":"array","items":{"type":"object","properties":{"meter":{"type":"string"},"customer":{"type":"string","nullable":true},"quantity":{"type":"number"},"events":{"type":"number"}},"required":["meter","quantity","events"]}}},"required":["group_by","totals","groups"]},"UsageEventListOut":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/UsageEventOut"}},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"]},"UsageEventOut":{"type":"object","properties":{"id":{"type":"string"},"smith_id":{"type":"string"},"customer_id":{"type":"string","nullable":true},"meter":{"type":"string"},"quantity":{"type":"number"},"day":{"type":"string"},"metadata":{"type":"object","additionalProperties":{"nullable":true}},"created_at":{"type":"string","nullable":true}},"required":["id","smith_id","customer_id","meter","quantity","day","metadata","created_at"]},"TraceIngestOut":{"type":"object","properties":{"accepted":{"type":"integer"}},"required":["accepted"]},"TraceIngestIn":{"type":"object","properties":{"spans":{"type":"array","items":{"type":"object","additionalProperties":{"nullable":true}}}}},"UsageEventIn":{"type":"object","properties":{"smith_id":{"type":"string","nullable":true},"meter":{"type":"string"},"quantity":{"type":"number"},"idempotency_key":{"type":"string","nullable":true},"metadata":{"type":"object","additionalProperties":{"nullable":true}}}},"ProviderListOut":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ProviderOut"}}},"required":["data"]},"ProviderOut":{"type":"object","properties":{"provider":{"type":"string"},"client_id":{"type":"string","nullable":true},"token_uri":{"type":"string","nullable":true},"scopes_allowed":{"type":"array","items":{"type":"string"}},"refresh_webhook":{"type":"string","nullable":true},"authorize_url":{"type":"string","nullable":true},"has_client_secret":{"type":"boolean"}},"required":["provider","client_id","token_uri","scopes_allowed","refresh_webhook","authorize_url","has_client_secret"]},"ProviderConfiguredOut":{"type":"object","properties":{"provider":{"type":"string"},"configured":{"type":"boolean"}},"required":["provider","configured"]},"ProviderIn":{"type":"object","properties":{"client_id":{"type":"string","nullable":true},"client_secret":{"type":"string","nullable":true},"token_uri":{"type":"string","nullable":true},"scopes_allowed":{"type":"array","items":{"type":"string"},"default":[]},"refresh_webhook":{"type":"string","nullable":true},"authorize_url":{"type":"string","nullable":true}}},"ModelsListOut":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/ModelOut"}},"providers":{"type":"array","items":{"$ref":"#/components/schemas/ModelProviderOut"}}},"required":["data","providers"]},"ModelOut":{"type":"object","properties":{"id":{"type":"string"},"provider":{"type":"string"},"label":{"type":"string"},"available":{"type":"boolean"},"source":{"type":"string","nullable":true,"enum":["byok","hosted",null]}},"required":["id","provider","label","available"]},"ModelProviderOut":{"type":"object","properties":{"id":{"type":"string"},"label":{"type":"string"},"base_url":{"type":"boolean"},"hosted":{"type":"boolean"}},"required":["id","label","base_url"]},"SandboxSecretListOut":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SandboxSecretOut"}}},"required":["data"]},"SandboxSecretOut":{"type":"object","properties":{"name":{"type":"string"},"updated_at":{"type":"string","nullable":true}},"required":["name","updated_at"]},"SandboxSecretConfiguredOut":{"type":"object","properties":{"name":{"type":"string"},"configured":{"type":"boolean"}},"required":["name","configured"]},"SandboxSecretIn":{"type":"object","properties":{"value":{"type":"string"}},"required":["value"]},"HostedToolsListOut":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/HostedToolOut"}}},"required":["data"]},"HostedToolOut":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"}},"required":["name","description"]},"WebhookCreateOut":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"active":{"type":"boolean"},"secret":{"type":"string"}},"required":["id","url","events","active","secret"]},"WebhookIn":{"type":"object","properties":{"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"},"default":[]},"active":{"type":"boolean","default":true}},"required":["url"]},"WebhookListOut":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookOut"}},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["data","has_more"]},"WebhookOut":{"type":"object","properties":{"id":{"type":"string"},"url":{"type":"string"},"events":{"type":"array","items":{"type":"string"}},"active":{"type":"boolean"},"created_at":{"type":"string","nullable":true}},"required":["id","url","events","active","created_at"]},"WebhookIdOut":{"type":"object","properties":{"id":{"type":"string"}},"required":["id"]},"WebhookPatch":{"type":"object","properties":{"url":{"type":"string","nullable":true},"events":{"type":"array","nullable":true,"items":{"type":"string"}},"active":{"type":"boolean","nullable":true}}},"WebhookRotateOut":{"type":"object","properties":{"id":{"type":"string"},"secret":{"type":"string"},"previous_secret_expires_at":{"type":"string","nullable":true}},"required":["id","secret","previous_secret_expires_at"]},"WebhookRotateIn":{"type":"object","properties":{"grace_seconds":{"type":"integer","minimum":0,"maximum":604800,"default":86400}}},"WebhookTestOut":{"type":"object","properties":{"delivered":{"type":"boolean"}},"required":["delivered"]},"WebhookDeliveryListOut":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/WebhookDeliveryOut"}},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["data","has_more"]},"WebhookDeliveryOut":{"type":"object","properties":{"id":{"type":"string"},"event_id":{"type":"string"},"event_type":{"type":"string"},"url":{"type":"string"},"status":{"type":"string"},"attempts":{"type":"number"},"last_status":{"type":"number","nullable":true},"last_error":{"type":"string"},"next_attempt_at":{"type":"string","nullable":true},"delivered_at":{"type":"string","nullable":true},"created_at":{"type":"string","nullable":true}},"required":["id","event_id","event_type","url","status","attempts","last_status","last_error","next_attempt_at","delivered_at","created_at"]},"WebhookRedeliverOut":{"type":"object","properties":{"delivery_id":{"type":"string"},"delivered":{"type":"boolean"},"status":{"type":"number","nullable":true}},"required":["delivery_id","delivered","status"]},"EventListOut":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/EventOut"}},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["data","has_more"]},"EventOut":{"type":"object","properties":{"v":{"type":"integer"},"id":{"type":"string"},"type":{"type":"string"},"smith_id":{"type":"string","nullable":true},"data":{"type":"object","additionalProperties":{"nullable":true}},"actor":{"$ref":"#/components/schemas/Actor"},"created_at":{"type":"string","nullable":true}},"required":["v","id","type","smith_id","data","actor","created_at"]},"MintedTokenOut":{"type":"object","properties":{"id":{"type":"string"},"token":{"type":"string"},"scope":{"type":"string"},"sub":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"expires_at":{"type":"string","nullable":true}},"required":["id","token","scope","sub","scopes","expires_at"]},"TokenIn":{"type":"object","properties":{"scope":{"type":"string","default":"smith"},"smith_id":{"type":"string","nullable":true},"permissions":{"type":"array","nullable":true,"items":{"type":"string"}},"ttl_seconds":{"type":"integer","nullable":true,"minimum":0,"exclusiveMinimum":true,"maximum":315360000},"name":{"type":"string","nullable":true}}},"TokenListOut":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/TokenOut"}},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["data","has_more"]},"TokenOut":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string","nullable":true},"sub":{"type":"string"},"scopes":{"type":"array","items":{"type":"string"}},"prefix":{"type":"string","nullable":true},"created_at":{"type":"string","nullable":true},"expires_at":{"type":"string","nullable":true},"revoked_at":{"type":"string","nullable":true}},"required":["id","name","sub","scopes","prefix","created_at","expires_at","revoked_at"]},"UsageOut":{"type":"object","properties":{"totals":{"type":"object","properties":{"runs":{"type":"integer"},"input_tokens":{"type":"integer"},"output_tokens":{"type":"integer"},"total_tokens":{"type":"integer"}},"required":["runs","input_tokens","output_tokens","total_tokens"]},"series":{"type":"array","items":{"type":"object","properties":{"date":{"type":"string"},"runs":{"type":"integer"},"total_tokens":{"type":"integer"}},"required":["date","runs","total_tokens"]}}},"required":["totals","series"]},"TelegramBotOut":{"type":"object","properties":{"configured":{"type":"boolean"},"bot_username":{"type":"string"},"bot_id":{"type":"integer"},"has_token":{"type":"boolean"},"webhook_url":{"type":"string"}},"required":["configured"]},"TelegramBotIn":{"type":"object","properties":{"bot_token":{"type":"string"},"webhook_secret":{"type":"string","nullable":true}},"required":["bot_token"]},"WebhookAck":{"type":"object","properties":{"ok":{"type":"boolean","enum":[true]}},"required":["ok"]},"WhatsAppConfigOut":{"type":"object","properties":{"configured":{"type":"boolean"},"phone_number_id":{"type":"string"},"display_phone_number":{"type":"string","nullable":true},"waba_id":{"type":"string","nullable":true},"webhook_url":{"type":"string"}},"required":["configured"]},"WhatsAppConfigIn":{"type":"object","properties":{"phone_number_id":{"type":"string"},"access_token":{"type":"string"},"waba_id":{"type":"string"}}},"EmailConfigOut":{"type":"object","properties":{"configured":{"type":"boolean"},"from_domain":{"type":"string"},"display_name":{"type":"string","nullable":true},"has_token":{"type":"boolean"},"inbound_url":{"type":"string"},"inbound_secret":{"type":"string"}},"required":["configured"]},"EmailConfigIn":{"type":"object","properties":{"cloudflare_account_id":{"type":"string"},"cloudflare_api_token":{"type":"string"},"from_domain":{"type":"string"},"display_name":{"type":"string","nullable":true},"inbound_secret":{"type":"string","nullable":true}},"required":["cloudflare_account_id","cloudflare_api_token","from_domain"]},"SuppressionListOut":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/SuppressionEntry"}},"next_cursor":{"type":"string","nullable":true},"has_more":{"type":"boolean"}},"required":["data","next_cursor","has_more"]},"SuppressionEntry":{"type":"object","properties":{"address":{"type":"string"},"reason":{"type":"string"},"created_at":{"type":"string","nullable":true}},"required":["address","reason","created_at"]},"SuppressionOut":{"type":"object","properties":{"address":{"type":"string"},"reason":{"type":"string"}},"required":["address","reason"]},"SuppressionIn":{"type":"object","properties":{"address":{"type":"string"},"reason":{"type":"string"}},"required":["address"]},"SlackAppOut":{"type":"object","properties":{"configured":{"type":"boolean"},"bot_user_id":{"type":"string"},"team_id":{"type":"string"},"events_url":{"type":"string"},"oauth_ready":{"type":"boolean"},"oauth_redirect_url":{"type":"string"},"return_url":{"type":"string"},"factory":{"$ref":"#/components/schemas/SlackFactoryStatus"}},"required":["configured"]},"SlackFactoryStatus":{"type":"object","properties":{"configured":{"type":"boolean"}},"required":["configured"]},"SlackAppIn":{"type":"object","properties":{"bot_token":{"type":"string","nullable":true},"signing_secret":{"type":"string","nullable":true},"client_id":{"type":"string","nullable":true},"client_secret":{"type":"string","nullable":true},"oauth_scopes":{"type":"string","nullable":true},"oauth_user_scopes":{"type":"string","nullable":true},"return_url":{"type":"string","nullable":true},"factory":{"$ref":"#/components/schemas/SlackFactoryIn"}}},"SlackFactoryIn":{"type":"object","nullable":true,"properties":{"config_token":{"type":"string"},"config_refresh_token":{"type":"string","nullable":true},"manifest_template":{"type":"object","additionalProperties":{"nullable":true}}},"required":["config_token","manifest_template"]},"SlackEventAck":{"anyOf":[{"$ref":"#/components/schemas/WebhookAck"},{"type":"object","properties":{"challenge":{"type":"string"}},"required":["challenge"]}]},"DiscordAppOut":{"type":"object","properties":{"configured":{"type":"boolean"},"application_id":{"type":"string"},"public_key":{"type":"string"},"has_bot_token":{"type":"boolean"},"webhook_url":{"type":"string"}},"required":["configured"]},"DiscordAppIn":{"type":"object","properties":{"application_id":{"type":"string"},"public_key":{"type":"string"},"bot_token":{"type":"string"}},"required":["application_id","public_key","bot_token"]},"SandboxClaimOut":{"type":"object","properties":{"command_id":{"type":"string","nullable":true,"description":"Null when nothing is queued."},"command":{"type":"string","nullable":true}},"required":["command_id","command"]},"SandboxResultOut":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"]},"SandboxResultIn":{"type":"object","properties":{"command_id":{"type":"string"},"stdout":{"type":"string"},"stderr":{"type":"string"},"return_code":{"type":"integer"},"truncated":{"type":"boolean","default":false},"duration_ms":{"type":"integer","minimum":0,"default":0}},"required":["command_id","stdout","stderr","return_code"]},"SandboxOutputOut":{"type":"object","properties":{"file_id":{"type":"string"},"filename":{"type":"string"},"bytes":{"type":"integer"},"media_type":{"type":"string"}},"required":["file_id","filename","bytes","media_type"]},"SandboxSkillsOut":{"type":"object","properties":{"skills":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string"},"version":{"type":"integer"},"dir":{"type":"string"},"files":{"type":"array","items":{"type":"object","properties":{"path":{"type":"string"},"url":{"type":"string"}},"required":["path","url"]}}},"required":["name","version","dir","files"]}}},"required":["skills"]},"SandboxSkillErrorsIn":{"type":"object","properties":{"failures":{"type":"array","items":{"type":"object","properties":{"skill":{"type":"string","nullable":true},"error":{"type":"string"}},"required":["skill","error"]}}},"required":["failures"]}},"parameters":{}},"paths":{"/health":{"get":{"tags":["Operations"],"security":[],"summary":"Liveness — the process is up","description":"Static: it answers as long as the process serves. Says nothing about whether this replica can reach the database — that is `/ready`. `commit` is the git SHA this image was built from, empty outside a built image.","responses":{"200":{"description":"Alive.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthOut"}}}}}}},"/ready":{"get":{"tags":["Operations"],"security":[],"summary":"Readiness — this replica can serve","description":"Probes Postgres with a cheap `SELECT 1`. The deploy gate polls this; the load balancer deliberately does not, since restarting a task cannot fix a shared database.","responses":{"200":{"description":"Ready.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadyOut"}}}},"503":{"description":"Not ready — the database is unreachable.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadyOut"}}}}}}},"/metrics":{"get":{"tags":["Operations"],"security":[],"summary":"Prometheus metrics","description":"Request rate, latency and errors, run throughput, DB pool saturation, process stats. Requires `IC_METRICS_TOKEN` as a bearer token — the endpoint refuses every request if the token is unset or doesn't match.","responses":{"200":{"description":"The Prometheus text exposition format.","content":{"text/plain":{"schema":{"type":"string"}}}},"401":{"description":"`IC_METRICS_TOKEN` is unset, or the bearer token didn't match.","content":{"text/plain":{"schema":{"type":"string"}}}}}}},"/openapi.json":{"get":{"tags":["Operations"],"security":[],"summary":"This document","description":"Generated from the live routes on every request. The console's `/docs/openapi.json` redirects here.","responses":{"200":{"description":"An OpenAPI 3.0 document.","content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":{"nullable":true}}}}}}}},"/v1/catalog":{"get":{"summary":"List catalog integration presets","tags":["Catalog"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The Ingram-curated MCP integration presets.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogListOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/catalog/{slug}":{"get":{"summary":"Get a catalog integration preset","tags":["Catalog"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"slug","in":"path"}],"responses":{"200":{"description":"The catalog entry.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CatalogEntryOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/approvals":{"get":{"summary":"List approvals","tags":["Approvals"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"smith_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"The tenant's approvals, newest first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalListOut"}}}},"400":{"description":"Malformed request (e.g. a bad pagination cursor).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/approvals/{aprId}":{"get":{"summary":"Get an approval","tags":["Approvals"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"aprId","in":"path"}],"responses":{"200":{"description":"The approval.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApprovalOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organization/projects":{"post":{"summary":"Create a project","tags":["Projects"],"security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectIn"}}}},"responses":{"201":{"description":"The created (or adopted) project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"List projects","tags":["Projects"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string"},"required":false,"name":"name","in":"query"}],"responses":{"200":{"description":"The org's live projects, newest first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectListOut"}}}},"400":{"description":"Malformed request (e.g. a bad pagination cursor).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organization/projects/{pid}":{"get":{"summary":"Get a project","tags":["Projects"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"pid","in":"path"}],"responses":{"200":{"description":"The project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Archive a project","tags":["Projects"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"pid","in":"path"}],"responses":{"204":{"description":"Archived."},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organization/projects/{pid}/tokens":{"post":{"summary":"Mint a project token","tags":["Projects"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"pid","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectTokenIn"}}}},"responses":{"201":{"description":"The minted token (secret shown once).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProjectTokenOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organization/projects/{pid}/tokens/{tid}":{"delete":{"summary":"Revoke a project token","tags":["Projects"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"pid","in":"path"},{"schema":{"type":"string"},"required":true,"name":"tid","in":"path"}],"responses":{"204":{"description":"Revoked."},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organization/apps":{"get":{"summary":"List linked apps","tags":["Projects"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"The apps linked to this org, newest first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppInstallListOut"}}}},"400":{"description":"Malformed request (e.g. a bad pagination cursor).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organization/apps/{id}":{"delete":{"summary":"Disconnect a linked app","description":"Revokes every token the app holds. The project stays.","tags":["Projects"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Disconnected."},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/customers":{"post":{"summary":"Create a customer","tags":["Customers"],"security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerCreate"}}}},"responses":{"201":{"description":"The created customer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"List customers","tags":["Customers"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"The tenant's live customers, newest first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerListOut"}}}},"400":{"description":"Malformed request (e.g. a bad pagination cursor).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/customers/{cid}":{"get":{"summary":"Get a customer","tags":["Customers"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"cid","in":"path"}],"responses":{"200":{"description":"The customer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"summary":"Update a customer","tags":["Customers"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"cid","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerPatch"}}}},"responses":{"200":{"description":"The updated customer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Archive a customer","tags":["Customers"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"cid","in":"path"}],"responses":{"204":{"description":"Archived."},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/budgets":{"post":{"summary":"Create a budget","tags":["Budgets"],"security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BudgetIn"}}}},"responses":{"201":{"description":"The created budget.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BudgetOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (e.g. duplicate slug, resource in use).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"List budgets","tags":["Budgets"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"The tenant's budgets, newest first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BudgetListOut"}}}},"400":{"description":"Malformed request (e.g. a bad pagination cursor).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/budgets/{bid}":{"get":{"summary":"Get a budget","tags":["Budgets"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"bid","in":"path"}],"responses":{"200":{"description":"The budget.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BudgetOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"summary":"Update a budget","tags":["Budgets"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"bid","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BudgetPatch"}}}},"responses":{"200":{"description":"The updated budget.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BudgetOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete a budget","tags":["Budgets"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"bid","in":"path"}],"responses":{"204":{"description":"Deleted."},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/budgets/{bid}/status":{"get":{"summary":"Get a budget's month-to-date status","tags":["Budgets"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"bid","in":"path"}],"responses":{"200":{"description":"The budget plus its month-to-date spend.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BudgetStatusOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organization/billing/balance":{"get":{"summary":"Get the organization's credit balance","tags":["Billing"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The credit balance.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BalanceOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organization/billing/ledger":{"get":{"summary":"List recent credit ledger entries","tags":["Billing"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string","enum":["credit","debit"]},"required":false,"name":"direction","in":"query"}],"responses":{"200":{"description":"The ledger entries, newest first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LedgerListOut"}}}},"400":{"description":"Malformed request (e.g. a bad pagination cursor).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organization/billing/usage":{"get":{"summary":"Per-project draw from the org wallet for a month","tags":["Billing"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","pattern":"^\\d{4}-\\d{2}$"},"required":false,"name":"period","in":"query"}],"responses":{"200":{"description":"Credits drawn per project this period.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgUsageOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organization/billing/usage/series":{"get":{"summary":"Daily per-project draw over a rolling window","tags":["Billing"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":365},"required":false,"name":"days","in":"query"}],"responses":{"200":{"description":"Daily credits drawn per project.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgUsageSeriesOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organization/billing/checkout":{"post":{"summary":"Start a credit top-up (embedded Stripe Checkout)","tags":["Billing"],"security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutIn"}}}},"responses":{"201":{"description":"The embedded Checkout client secret.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organization/billing/setup":{"post":{"summary":"Add a card to unlock the welcome credit","tags":["Billing"],"security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupIn"}}}},"responses":{"201":{"description":"The hosted card-setup URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetupOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organization/billing/redeem":{"post":{"summary":"Redeem a one-time credit code","tags":["Billing"],"security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RedeemIn"}}}},"responses":{"200":{"description":"The amount credited to the wallet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RedeemOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (e.g. duplicate slug, resource in use).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organization/billing/confirm":{"post":{"summary":"Confirm + credit a returning Checkout Session","tags":["Billing"],"security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmIn"}}}},"responses":{"200":{"description":"Whether the session credited the balance.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfirmOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organization/billing/autoreload":{"get":{"summary":"Get the organization's auto-reload settings","tags":["Billing"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The auto-reload configuration.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoreloadOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"summary":"Set the organization's auto-reload settings","tags":["Billing"],"security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoreloadOut"}}}},"responses":{"200":{"description":"The saved auto-reload configuration.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AutoreloadOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organization/billing/reload":{"post":{"summary":"Charge the saved card to top up now","tags":["Billing"],"security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReloadIn"}}}},"responses":{"200":{"description":"Whether the off-session charge credited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReloadOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (e.g. duplicate slug, resource in use).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/organization/billing/portal":{"get":{"summary":"Open the Stripe billing portal","tags":["Billing"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"return_url","in":"query"}],"responses":{"200":{"description":"The Stripe billing-portal URL.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/stripe/webhook":{"post":{"tags":["Billing"],"security":[],"summary":"Stripe webhook receiver (provider → us)","description":"Authenticated by the webhook signing secret over the raw body, not a bearer token. Credits the wallet on `checkout.session.completed`.","requestBody":{"description":"A Stripe `Event`.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"responses":{"200":{"description":"Received.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StripeWebhookAck"}}}},"400":{"description":"Malformed request (e.g. a bad pagination cursor).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/smiths/{pid}/schedules":{"post":{"summary":"Create a schedule","tags":["Schedules"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"pid","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleIn"}}}},"responses":{"201":{"description":"The created schedule.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"List a smith's schedules","tags":["Schedules"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"pid","in":"path"},{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"The smith's schedules, newest first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleListOut"}}}},"400":{"description":"Malformed request (e.g. a bad pagination cursor).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/smiths/{pid}/schedules/{sid}":{"patch":{"summary":"Update a schedule","tags":["Schedules"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"pid","in":"path"},{"schema":{"type":"string"},"required":true,"name":"sid","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SchedulePatch"}}}},"responses":{"200":{"description":"The updated schedule.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete a schedule","tags":["Schedules"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"pid","in":"path"},{"schema":{"type":"string"},"required":true,"name":"sid","in":"path"}],"responses":{"204":{"description":"Deleted."},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/smiths/{pid}/schedules/{sid}/run_now":{"post":{"summary":"Fire a schedule immediately","tags":["Schedules"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"pid","in":"path"},{"schema":{"type":"string"},"required":true,"name":"sid","in":"path"}],"responses":{"202":{"description":"The fire was enqueued onto the smith's lane.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ScheduleRunNowOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/smiths/{pid}/connections":{"post":{"summary":"Create a connection","tags":["Connections"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"pid","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionIn"}}}},"responses":{"201":{"description":"The created connection (secret-free).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"List a smith's connections","tags":["Connections"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"pid","in":"path"},{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string"},"required":false,"name":"provider","in":"query"}],"responses":{"200":{"description":"The smith's connections (secret-free).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionListOut"}}}},"400":{"description":"Malformed request (e.g. a bad pagination cursor).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/smiths/{pid}/connections/{cid}":{"get":{"summary":"Get a connection","tags":["Connections"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"pid","in":"path"},{"schema":{"type":"string"},"required":true,"name":"cid","in":"path"}],"responses":{"200":{"description":"The connection (secret-free).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"summary":"Update a connection","tags":["Connections"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"pid","in":"path"},{"schema":{"type":"string"},"required":true,"name":"cid","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionPatch"}}}},"responses":{"200":{"description":"The updated connection (secret-free).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete a connection","tags":["Connections"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"pid","in":"path"},{"schema":{"type":"string"},"required":true,"name":"cid","in":"path"}],"responses":{"204":{"description":"Deleted."},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/smiths/{pid}/connections/{cid}/refresh":{"post":{"summary":"Force a token refresh","tags":["Connections"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"pid","in":"path"},{"schema":{"type":"string"},"required":true,"name":"cid","in":"path"}],"responses":{"200":{"description":"The refreshed connection (secret-free).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (e.g. duplicate slug, resource in use).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/smiths/{pid}/connections/authorize":{"post":{"summary":"Mint an OAuth authorize URL","tags":["Connections"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"pid","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizeIn"}}}},"responses":{"200":{"description":"The minted authorize URL and echoed provider.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizeOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/oauth/callback":{"get":{"tags":["Connections"],"security":[],"summary":"Connector OAuth callback (browser redirect)","description":"The one Redirect URI registered with every provider; the `state` names the flow, and the flow names the provider. Authenticated by that one-time `state` minted by `POST …/connections/authorize`, not a bearer token — send the end-user's browser here.","parameters":[{"schema":{"type":"string"},"required":false,"name":"state","in":"query"},{"schema":{"type":"string"},"required":false,"name":"code","in":"query"},{"schema":{"type":"string","description":"Set when the user denied consent."},"required":false,"description":"Set when the user denied consent.","name":"error","in":"query"},{"schema":{"type":"string","description":"The authorization server's issuer (RFC 9207), when it sends one."},"required":false,"description":"The authorization server's issuer (RFC 9207), when it sends one.","name":"iss","in":"query"}],"responses":{"200":{"description":"Connected, when the flow carried no `return_url`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectionCallbackOut"}}}},"302":{"description":"Back to the flow's `return_url` with `connection=ok|error`.","headers":{"Location":{"schema":{"type":"string"},"required":true}}},"400":{"description":"Malformed request (e.g. a bad pagination cursor).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/oauth/client-metadata.json":{"get":{"tags":["Connections"],"security":[],"summary":"Ingram Cloud's OAuth client registration (Client ID Metadata Document)","description":"What an authorization server reads when a registered MCP server's AS accepts URL-identified clients: this URL is the `client_id`.","responses":{"200":{"description":"The metadata document.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClientMetadataDocument"}}}}}}},"/v1/conversations":{"post":{"summary":"Create a conversation","tags":["Conversations"],"security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationCreate"}}}},"responses":{"200":{"description":"The created conversation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationOut"}}}},"400":{"description":"Malformed request (e.g. a bad pagination cursor).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"List conversations","tags":["Conversations"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"order","in":"query"},{"schema":{"type":"string"},"required":false,"name":"after","in":"query"}],"responses":{"200":{"description":"The smith's conversations, newest first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationListOut"}}}},"400":{"description":"Malformed request (e.g. a bad pagination cursor).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/conversations/{cnvId}":{"get":{"summary":"Get a conversation","tags":["Conversations"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"cnvId","in":"path"}],"responses":{"200":{"description":"The conversation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Update a conversation","tags":["Conversations"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"cnvId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationUpdate"}}}},"responses":{"200":{"description":"The updated conversation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete a conversation","tags":["Conversations"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"cnvId","in":"path"}],"responses":{"200":{"description":"Deletion acknowledged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationDeleted"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/conversations/{cnvId}/items":{"get":{"summary":"List items in a conversation","tags":["Conversations"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"cnvId","in":"path"},{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"order","in":"query"},{"schema":{"type":"string"},"required":false,"name":"after","in":"query"}],"responses":{"200":{"description":"The conversation's items.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConversationItemListOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/deployments":{"post":{"summary":"Create a deployment","tags":["Deployments"],"security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeploymentIn"}}}},"responses":{"201":{"description":"The created deployment (plus any setup affordances).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeploymentCreatedOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (e.g. duplicate slug, resource in use).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"List deployments","tags":["Deployments"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","enum":["smith","agent"]},"required":false,"name":"target_type","in":"query"},{"schema":{"type":"string"},"required":false,"name":"target_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"Deployments in the project, newest first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeploymentListOut"}}}},"400":{"description":"Malformed request (e.g. a bad pagination cursor).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/deployments/{depId}":{"get":{"summary":"Get a deployment","tags":["Deployments"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"depId","in":"path"}],"responses":{"200":{"description":"The deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeploymentOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"summary":"Update a deployment","tags":["Deployments"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"depId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeploymentPatch"}}}},"responses":{"200":{"description":"The updated deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeploymentOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (e.g. duplicate slug, resource in use).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete a deployment","tags":["Deployments"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"depId","in":"path"}],"responses":{"204":{"description":"Deleted."},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/inbound_events":{"get":{"summary":"List inbound events","tags":["Deployments"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"source","in":"query"},{"schema":{"type":"string"},"required":false,"name":"smith_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"since","in":"query"},{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"The matching inbound events, newest first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboundEventListOut"}}}},"400":{"description":"Malformed request (e.g. a bad pagination cursor).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/inbound_events/{ievId}":{"get":{"summary":"Get an inbound event","tags":["Deployments"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"ievId","in":"path"}],"responses":{"200":{"description":"The inbound event.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InboundEventOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents":{"post":{"summary":"Create an agent","tags":["agents"],"security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentIn"}}}},"responses":{"201":{"description":"The created agent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (e.g. duplicate slug, resource in use).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"List agents","tags":["agents"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"The tenant's live agents.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentListOut"}}}},"400":{"description":"Malformed request (e.g. a bad pagination cursor).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{aid}":{"get":{"summary":"Get an agent","tags":["agents"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"aid","in":"path"}],"responses":{"200":{"description":"The agent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"summary":"Update an agent's draft","tags":["agents"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"aid","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentPatch"}}}},"responses":{"200":{"description":"The updated agent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Archive an agent","tags":["agents"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"aid","in":"path"}],"responses":{"204":{"description":"Archived."},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (e.g. duplicate slug, resource in use).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{aid}/versions":{"get":{"summary":"List an agent's published versions","tags":["agents"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"aid","in":"path"},{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"The version snapshots, newest first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentVersionListOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Publish the draft as the next version","tags":["agents"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"aid","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishIn"}}}},"responses":{"201":{"description":"The published version snapshot.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentVersionOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{aid}/rollout":{"post":{"summary":"Roll out a version to smiths","tags":["agents"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"aid","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RolloutIn"}}}},"responses":{"200":{"description":"The agent after the rollout change.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/import":{"post":{"summary":"Import a smith's config into a new agent","tags":["agents"],"security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportIn"}}}},"responses":{"201":{"description":"The new agent.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AgentOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (e.g. duplicate slug, resource in use).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{aid}/attach":{"post":{"summary":"Attach existing smiths to an agent","tags":["agents"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"aid","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachIn"}}}},"responses":{"200":{"description":"Which smiths were attached and their config drift.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttachOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (e.g. duplicate slug, resource in use).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{aid}/ui":{"post":{"tags":["Agents"],"security":[{"bearerAuth":[]}],"summary":"Upload or replace a UI template","description":"Multipart: an HTML `file` part plus a JSON `metadata` part. Documented but not Zod-validated — the `file` part is a `File`.","parameters":[{"schema":{"type":"string"},"required":true,"name":"aid","in":"path"}],"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"The template HTML."},"metadata":{"type":"string","description":"JSON: `{ name, csp?, permissions?, tool? }`."}},"required":["file","metadata"]}}}},"responses":{"200":{"description":"The stored template.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UiResource"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"List an agent's UI templates","tags":["agents"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"aid","in":"path"}],"responses":{"200":{"description":"The agent's draft UI templates.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UiResourceListOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{aid}/ui/{name}":{"get":{"summary":"Retrieve a UI template","tags":["agents"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"aid","in":"path"},{"schema":{"type":"string"},"required":true,"name":"name","in":"path"}],"responses":{"200":{"description":"The UI template metadata.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UiResource"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete a UI template","tags":["agents"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"aid","in":"path"},{"schema":{"type":"string"},"required":true,"name":"name","in":"path"}],"responses":{"204":{"description":"Deleted."},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/agents/{aid}/ui/{name}/content":{"get":{"tags":["Agents"],"security":[{"bearerAuth":[]}],"summary":"Fetch a UI template's body","description":"Served inline rather than as a redirect: a presigned URL is single-use and carries the blob's ETag, not ours — both defeat the caching this exists for. Send `If-None-Match` to revalidate.","parameters":[{"schema":{"type":"string"},"required":true,"name":"aid","in":"path"},{"schema":{"type":"string"},"required":true,"name":"name","in":"path"},{"schema":{"type":"string"},"required":false,"name":"if-none-match","in":"header"}],"responses":{"200":{"description":"The template body.","content":{"text/html":{"schema":{"type":"string","format":"binary"}}}},"304":{"description":"Not modified — the `ETag` still matches."},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/smiths":{"post":{"summary":"Create a smith","tags":["Smiths"],"security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmithCreate"}}}},"responses":{"200":{"description":"The existing smith (re-provision by external_id).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmithOut"}}}},"201":{"description":"The created smith.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmithOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (e.g. duplicate slug, resource in use).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"List smiths","tags":["Smiths"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string"},"required":false,"name":"external_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"external_id_prefix","in":"query"},{"schema":{"type":"string"},"required":false,"name":"customer_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_id","in":"query"}],"responses":{"200":{"description":"The tenant's live smiths, newest first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmithListOut"}}}},"400":{"description":"Malformed request (e.g. a bad pagination cursor).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/smiths/{pid}":{"get":{"summary":"Get a smith","tags":["Smiths"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"pid","in":"path"}],"responses":{"200":{"description":"The smith.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmithOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"summary":"Update a smith","tags":["Smiths"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"pid","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmithPatch"}}}},"responses":{"200":{"description":"The updated smith.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmithOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (e.g. duplicate slug, resource in use).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Archive a smith","tags":["Smiths"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"pid","in":"path"}],"responses":{"204":{"description":"Archived."},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/smiths/{pid}/model_keys":{"get":{"summary":"List a smith's model keys","tags":["Smiths"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"pid","in":"path"}],"responses":{"200":{"description":"The smith's keys (presence only).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelKeyListOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/smiths/{pid}/model_keys/{provider}":{"put":{"summary":"Set a smith's model key","tags":["Smiths"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"pid","in":"path"},{"schema":{"type":"string"},"required":true,"name":"provider","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelKeyIn"}}}},"responses":{"200":{"description":"The key was configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelKeyConfiguredOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete a smith's model key","tags":["Smiths"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"pid","in":"path"},{"schema":{"type":"string"},"required":true,"name":"provider","in":"path"}],"responses":{"204":{"description":"Deleted."},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/smiths/{pid}/revisions":{"get":{"summary":"List a smith's config revisions","tags":["Smiths"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"pid","in":"path"},{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"The smith's config revisions, newest first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevisionListOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/smiths/{pid}/revisions/{version}/restore":{"post":{"summary":"Restore a smith config revision","tags":["Smiths"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"pid","in":"path"},{"schema":{"type":"string"},"required":true,"name":"version","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RestoreIn"}}}},"responses":{"200":{"description":"The newly-appended revision.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SmithRevisionOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/skills":{"post":{"summary":"Upload a skill","description":"Multipart. Every file of the bundle rides `files[]`, with its relative path as the part filename. Creates the skill and version 1.","tags":["Skills"],"security":[{"bearerAuth":[]}],"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files[]":{"type":"array","items":{"type":"string","format":"binary"},"description":"Every file of the bundle. The relative path rides the part's filename, e.g. `invoice-review/SKILL.md`."},"file":{"type":"string","format":"binary","description":"The whole bundle as a zip, as an alternative to `files[]`. Entry paths include the root directory; at most 32 MB unpacked."}}}}}},"responses":{"200":{"description":"The created skill.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Skill"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (e.g. duplicate slug, resource in use).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"List skills","tags":["Skills"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The tenant's skills.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillListOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/skills/{id}":{"get":{"summary":"Get a skill","tags":["Skills"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The skill.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Skill"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Move the default version","tags":["Skills"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillUpdateIn"}}}},"responses":{"200":{"description":"The skill.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Skill"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete a skill","tags":["Skills"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted."},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (e.g. duplicate slug, resource in use).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/skills/{id}/versions":{"post":{"summary":"Publish a new version","description":"Multipart, exactly as `POST /v1/skills`. `default_version` is unchanged.","tags":["Skills"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"files[]":{"type":"array","items":{"type":"string","format":"binary"},"description":"Every file of the bundle. The relative path rides the part's filename, e.g. `invoice-review/SKILL.md`."},"file":{"type":"string","format":"binary","description":"The whole bundle as a zip, as an alternative to `files[]`. Entry paths include the root directory; at most 32 MB unpacked."}}}}}},"responses":{"200":{"description":"The new version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillVersion"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"List a skill's versions","tags":["Skills"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The versions, newest first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillVersionListOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/skills/{id}/versions/{v}":{"get":{"summary":"Get one version","description":"Includes the file list with sizes and content hashes.","tags":["Skills"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"v","in":"path"}],"responses":{"200":{"description":"The version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SkillVersion"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete one version","tags":["Skills"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"v","in":"path"}],"responses":{"204":{"description":"Deleted."},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (e.g. duplicate slug, resource in use).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/skills/{id}/versions/{v}/content":{"get":{"summary":"Download a version's bytes","description":"With `?path=`, one file. Without it, the whole version as a zip — the same shape `POST /v1/skills` accepts, so a version round-trips.","tags":["Skills"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"},{"schema":{"type":"string"},"required":true,"name":"v","in":"path"},{"schema":{"type":"string"},"required":false,"name":"path","in":"query"}],"responses":{"200":{"description":"The file, or the version as a zip.","content":{"application/zip":{"schema":{"type":"string","format":"binary"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/runs":{"get":{"summary":"List runs (tenant feed)","tags":["Runs"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"external_id_prefix","in":"query"},{"schema":{"type":"string"},"required":false,"name":"smith_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"agent_id","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"The tenant's runs, newest first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunListOut"}}}},"400":{"description":"Malformed request (e.g. a bad pagination cursor).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/smiths/{pid}/runs":{"get":{"summary":"List a smith's runs","tags":["Runs"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"pid","in":"path"},{"schema":{"type":"string"},"required":false,"name":"status","in":"query"},{"schema":{"type":"number","nullable":true},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"The smith's runs, newest first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunListOut"}}}},"400":{"description":"Malformed request (e.g. a bad pagination cursor).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["Runs"],"security":[{"bearerAuth":[]}],"summary":"Start a run","description":"Streams the `{v:1}` SSE envelope when `stream` is true, otherwise answers the finished run record. `Idempotency-Key` replays the original run rather than starting a second — as a `run.duplicate` frame when streaming.","parameters":[{"schema":{"type":"string"},"required":true,"name":"pid","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunIn"}}}},"responses":{"200":{"description":"The run's frames, or the finished run.","content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/RunStreamFrame"}},"application/json":{"schema":{"$ref":"#/components/schemas/RunOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"No payment method, or the credit balance is exhausted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/smiths/{pid}/runs/{rid}":{"get":{"summary":"Get a run","tags":["Runs"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"pid","in":"path"},{"schema":{"type":"string"},"required":true,"name":"rid","in":"path"}],"responses":{"200":{"description":"The run.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/smiths/{pid}/runs/{rid}/events":{"get":{"tags":["Runs"],"security":[{"bearerAuth":[]}],"summary":"Follow a run's events as they are recorded","description":"The recorded feed, replayed as SSE. Each frame's `id:` is its sequence number — send it back as `Last-Event-ID` to resume without a gap.","parameters":[{"schema":{"type":"string"},"required":true,"name":"pid","in":"path"},{"schema":{"type":"string"},"required":true,"name":"rid","in":"path"},{"schema":{"type":"string","description":"Resume past this sequence number."},"required":false,"description":"Resume past this sequence number.","name":"last-event-id","in":"header"}],"responses":{"200":{"description":"The run's recorded events, in order.","content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/RunEventOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/smiths/{pid}/runs/{rid}/replay":{"post":{"tags":["Runs"],"security":[{"bearerAuth":[]}],"summary":"Replay a recorded run","description":"Re-drives the prior run's input on a fresh thread, pinning the config that run recorded. `metadata.replay.deterministic` says whether a snapshot was available. Streams like a normal create when `stream` is true.","parameters":[{"schema":{"type":"string"},"required":true,"name":"pid","in":"path"},{"schema":{"type":"string"},"required":true,"name":"rid","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunReplayIn"}}}},"responses":{"200":{"description":"The replay's frames, or the finished run.","content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/RunStreamFrame"}},"application/json":{"schema":{"$ref":"#/components/schemas/RunOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"No payment method, or the credit balance is exhausted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/smiths/{pid}/runs/{rid}/submit":{"post":{"tags":["Runs"],"security":[{"bearerAuth":[]}],"summary":"Resume a paused run, or cancel a live one","description":"The one way a paused run moves: submit an approval decision, or `kind: \"cancel\"` to stop an in-flight turn (which also aborts the model stream, so generation stops being billed).","parameters":[{"schema":{"type":"string"},"required":true,"name":"pid","in":"path"},{"schema":{"type":"string"},"required":true,"name":"rid","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Submit"}}}},"responses":{"200":{"description":"The run after the submission — or the cancel acknowledgement.","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/RunOut"},{"$ref":"#/components/schemas/RunCancelAck"}]}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (e.g. duplicate slug, resource in use).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/files":{"post":{"tags":["Files"],"security":[{"bearerAuth":[]}],"summary":"Upload a file","description":"Multipart, mirroring OpenAI's Files API. The body is documented but not Zod-validated — the `file` part is a `File`, not a string.","requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"},"purpose":{"type":"string","description":"OpenAI-compatible purpose."}},"required":["file"]}}}},"responses":{"200":{"description":"The stored file.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"List files","tags":["Files"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"purpose","in":"query"},{"schema":{"type":"string"},"required":false,"name":"after","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":10000},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":false,"name":"order","in":"query"}],"responses":{"200":{"description":"The tenant's uploads and sandbox output files.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileListOut"}}}},"400":{"description":"Malformed request (e.g. a bad pagination cursor).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/files/{id}":{"get":{"summary":"Retrieve a file","tags":["Files"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The OpenAI File object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete a file","tags":["Files"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deletion acknowledged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FileDeleted"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/files/{id}/content":{"get":{"tags":["Files"],"security":[{"bearerAuth":[]}],"summary":"Download a file's bytes","description":"Answers the bytes inline, or 302s to a presigned URL when the blob store issues one.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The file's bytes, with its stored media type.","content":{"application/octet-stream":{"schema":{"type":"string","format":"binary"}}}},"302":{"description":"To a presigned URL for the blob.","headers":{"Location":{"schema":{"type":"string"},"required":true}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/vector_stores":{"post":{"summary":"Create a vector store","tags":["Vector stores"],"security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VectorStoreIn"}}}},"responses":{"200":{"description":"The created vector store.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VectorStoreOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"List vector stores","tags":["Vector stores"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":false,"name":"order","in":"query"},{"schema":{"type":"string"},"required":false,"name":"after","in":"query"},{"schema":{"type":"string"},"required":false,"name":"before","in":"query"}],"responses":{"200":{"description":"The tenant's vector stores.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VectorStoreListOut"}}}},"400":{"description":"Malformed request (e.g. a bad pagination cursor).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/vector_stores/{vsId}":{"get":{"summary":"Retrieve a vector store","tags":["Vector stores"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"vsId","in":"path"}],"responses":{"200":{"description":"The vector store.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VectorStoreOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Modify a vector store","tags":["Vector stores"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"vsId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VectorStorePatch"}}}},"responses":{"200":{"description":"The updated vector store.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VectorStoreOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete a vector store","tags":["Vector stores"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"vsId","in":"path"}],"responses":{"200":{"description":"Deletion acknowledged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VectorStoreDeleted"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/vector_stores/{vsId}/files":{"post":{"summary":"Attach a file to a vector store","tags":["Vector stores"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"vsId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VectorStoreFileIn"}}}},"responses":{"200":{"description":"The attached file (indexing).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VectorStoreFileOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (e.g. duplicate slug, resource in use).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"List files in a vector store","tags":["Vector stores"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"vsId","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":false,"name":"order","in":"query"},{"schema":{"type":"string"},"required":false,"name":"after","in":"query"},{"schema":{"type":"string"},"required":false,"name":"before","in":"query"},{"schema":{"type":"string","enum":["in_progress","completed","failed","cancelled"]},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"The store's files.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VectorStoreFileListOut"}}}},"400":{"description":"Malformed request (e.g. a bad pagination cursor).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/vector_stores/{vsId}/files/{fileId}":{"get":{"summary":"Retrieve a vector store file","tags":["Vector stores"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"vsId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"fileId","in":"path"}],"responses":{"200":{"description":"The vector store file.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VectorStoreFileOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Update a vector store file's attributes","tags":["Vector stores"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"vsId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"fileId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VectorStoreFileUpdate"}}}},"responses":{"200":{"description":"The updated vector store file.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VectorStoreFileOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Detach a file from a vector store","tags":["Vector stores"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"vsId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"fileId","in":"path"}],"responses":{"200":{"description":"Detachment acknowledged.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VectorStoreFileDeleted"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/vector_stores/{vsId}/files/{fileId}/content":{"get":{"summary":"Retrieve a vector store file's parsed content","tags":["Vector stores"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"vsId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"fileId","in":"path"}],"responses":{"200":{"description":"The file's indexed chunks.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VectorStoreFileContentOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/vector_stores/{vsId}/file_batches":{"post":{"summary":"Attach a batch of files","tags":["Vector stores"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"vsId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VectorStoreFileBatchIn"}}}},"responses":{"200":{"description":"The file batch (indexing).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VectorStoreFileBatchOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Conflict (e.g. duplicate slug, resource in use).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/vector_stores/{vsId}/file_batches/{batchId}":{"get":{"summary":"Retrieve a file batch","tags":["Vector stores"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"vsId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"batchId","in":"path"}],"responses":{"200":{"description":"The file batch.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VectorStoreFileBatchOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/vector_stores/{vsId}/file_batches/{batchId}/cancel":{"post":{"summary":"Cancel a file batch","tags":["Vector stores"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"vsId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"batchId","in":"path"}],"responses":{"200":{"description":"The cancelled batch.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VectorStoreFileBatchOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/vector_stores/{vsId}/file_batches/{batchId}/files":{"get":{"summary":"List files in a file batch","tags":["Vector stores"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"vsId","in":"path"},{"schema":{"type":"string"},"required":true,"name":"batchId","in":"path"},{"schema":{"type":"integer","minimum":1,"maximum":100},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string","enum":["asc","desc"]},"required":false,"name":"order","in":"query"},{"schema":{"type":"string"},"required":false,"name":"after","in":"query"},{"schema":{"type":"string"},"required":false,"name":"before","in":"query"},{"schema":{"type":"string","enum":["in_progress","completed","failed","cancelled"]},"required":false,"name":"filter","in":"query"}],"responses":{"200":{"description":"The batch's files.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VectorStoreFileListOut"}}}},"400":{"description":"Malformed request (e.g. a bad pagination cursor).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/vector_stores/{vsId}/search":{"post":{"summary":"Search a vector store","tags":["Vector stores"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"vsId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/VectorStoreSearchIn"}}}},"responses":{"200":{"description":"The search results page.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VectorStoreSearchOut"}}}},"400":{"description":"Malformed request (e.g. a bad pagination cursor).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/hosted/{depId}":{"get":{"tags":["Hosted pages"],"security":[],"summary":"Public metadata for a hosted agent page","parameters":[{"schema":{"type":"string"},"required":true,"name":"depId","in":"path"}],"responses":{"200":{"description":"What the page needs to render itself.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HostedPageOut"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/hosted/{depId}/chat":{"post":{"tags":["Hosted pages"],"security":[],"summary":"Send a visitor's turn and stream the reply","description":"Always streams — the reply is the `{v:1}` SSE envelope, the same frames the run feed serves. Cost is bounded by the project budget.","parameters":[{"schema":{"type":"string"},"required":true,"name":"depId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HostedChatIn"}}}},"responses":{"200":{"description":"The run's frames, in order.","content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/RunStreamFrame"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/models":{"get":{"tags":["OpenAI-compatible"],"security":[{"bearerAuth":[]}],"summary":"List models (OpenAI-compatible)","description":"The models you can run, in OpenAI's `model` list shape — what `client.models.list()` and any OpenAI-shaped model picker read. Curated catalog filtered to providers a key resolves for; `GET /v1/tenant/models` is the richer view (labels, `available`, whose key).","responses":{"200":{"description":"The runnable models.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIModelListOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/models/{model}":{"get":{"tags":["OpenAI-compatible"],"security":[{"bearerAuth":[]}],"summary":"Retrieve a model (OpenAI-compatible)","description":"One entry of `GET /v1/models`. A model outside the curated catalog, or one whose provider has no key, is `404` — it is still settable on an agent, since model ids are never restricted at the API.","parameters":[{"schema":{"type":"string"},"required":true,"name":"model","in":"path"}],"responses":{"200":{"description":"The model.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenAIModelOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/chat/completions":{"post":{"tags":["OpenAI-compatible"],"security":[{"bearerAuth":[]}],"summary":"Chat completions (OpenAI-compatible)","description":"The primary integration path: point any OpenAI client at this base URL and the smith answers. Server-executed tool calls, approvals and memory all ride the standard channels. `stream: true` emits OpenAI's `chat.completion.chunk` SSE; otherwise a `chat.completion` object.","requestBody":{"description":"An OpenAI chat-completions request.","content":{"application/json":{"schema":{"$ref":"#/$defs/ChatCompletionIn","$defs":{"ChatCompletionIn":{"type":"object","properties":{"model":{"description":"The smith's model; omit to use its own.","type":"string"},"messages":{"type":"array","items":{"type":"object","properties":{"role":{"type":"string"}},"required":["role"],"additionalProperties":{}}},"stream":{"type":"boolean"},"stream_options":{"type":"object","properties":{"include_usage":{"type":"boolean"}},"additionalProperties":{}},"user":{"type":"string"},"tools":{"type":"array","items":{"type":"object","properties":{"type":{"type":"string"}},"required":["type"],"additionalProperties":{}}},"tool_choice":{},"reasoning_effort":{"description":"Honoured whatever provider backs the model.","type":"string"},"response_format":{"type":"object","properties":{"type":{"type":"string"}},"additionalProperties":{}}},"additionalProperties":{}}}}}}},"responses":{"200":{"description":"The completion, streamed or whole.","content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/ChatCompletionChunk"}},"application/json":{"schema":{"$ref":"#/components/schemas/ChatCompletionOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"No payment method, or the credit balance is exhausted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/responses":{"post":{"tags":["OpenAI-compatible"],"security":[{"bearerAuth":[]}],"summary":"Responses (OpenAI-compatible)","description":"OpenAI's Responses API over a smith. Server-executed tool calls arrive as standard `tool-call`/`tool-result` items and approvals as `tool-approval-request`; `previous_response_id` and `conversation` continue a thread. `stream: true` emits the Responses event SSE.","requestBody":{"description":"An OpenAI Responses request.","content":{"application/json":{"schema":{"$ref":"#/$defs/ResponsesIn","$defs":{"ResponsesIn":{"type":"object","properties":{"model":{"type":"string"},"input":{},"instructions":{"type":"string"},"stream":{"type":"boolean"},"background":{"description":"Run off-request; poll `GET /v1/responses/{id}`.","type":"boolean"},"previous_response_id":{"description":"Continue a thread.","type":"string"},"conversation":{"description":"Continue a conversation.","type":"string"},"user":{"type":"string"},"tools":{"description":"`function` (the client-tool loop), `file_search`, or `mcp` (`server_label`, `server_url`, `headers`/`authorization`, `allowed_tools`, `require_approval`) — a server mounted for this response.","type":"array","items":{"type":"object","properties":{"type":{"type":"string"}},"required":["type"],"additionalProperties":{}}},"tool_choice":{},"reasoning":{"type":"object","properties":{"effort":{"type":["string","null"]}},"additionalProperties":{}},"include":{"description":"`file_search_call.results` is the one we honour.","type":"array","items":{"type":"string"}},"text":{"description":"`text.format` — structured outputs.","type":"object","properties":{},"additionalProperties":{}}},"additionalProperties":{}}}}}}},"responses":{"200":{"description":"The response, streamed or whole.","content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/ResponsesEvent"}},"application/json":{"schema":{"$ref":"#/components/schemas/ResponsesOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"No payment method, or the credit balance is exhausted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/responses/{id}":{"get":{"tags":["OpenAI-compatible"],"security":[{"bearerAuth":[]}],"summary":"Retrieve a response","description":"The response for a run id — including one still `queued` or `in_progress`, which is how a `background: true` create is followed to completion.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponsesOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/responses/{id}/cancel":{"post":{"tags":["OpenAI-compatible"],"security":[{"bearerAuth":[]}],"summary":"Cancel a response","description":"Ends the run and stops its model stream. Defined from any state, so cancelling a response that already finished is not an error — it answers the response as it stands.","parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"The cancelled response.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResponsesOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/embeddings":{"post":{"tags":["OpenAI-compatible"],"security":[{"bearerAuth":[]}],"summary":"Embed text (OpenAI-compatible)","description":"Mirrors OpenAI's Embeddings API and runs on the project's own OpenAI model key. Scope `embeddings:write`.","requestBody":{"description":"The OpenAI embeddings request.","content":{"application/json":{"schema":{"$ref":"#/$defs/EmbeddingsIn","$defs":{"EmbeddingsIn":{"type":"object","properties":{"input":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}}],"description":"One string or a batch."},"model":{"description":"Defaults to `openai.text-embedding-3-small`.","type":"string"}},"required":["input"]}}}}}},"responses":{"200":{"description":"The vectors, in input order.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmbeddingsOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/smiths/{pid}/memory":{"get":{"summary":"Read a smith's working memory","tags":["Memory"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"pid","in":"path"}],"responses":{"200":{"description":"The smith's working-memory doc.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkingMemoryOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"summary":"Replace a smith's working memory","tags":["Memory"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"pid","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkingMemorySet"}}}},"responses":{"200":{"description":"The updated working-memory doc.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkingMemoryOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/smiths/{pid}/memory/recall":{"post":{"summary":"Recall relevant past messages","tags":["Memory"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"pid","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecallBody"}}}},"responses":{"200":{"description":"The ranked recall hits, each with a `score`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RecallOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenant/mcp/{name}":{"put":{"summary":"Register or replace an MCP server","tags":["MCP"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"name","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpServerIn"}}}},"responses":{"200":{"description":"The registered server, with its freshly discovered tools.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpServerOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"Get a registered MCP server","tags":["MCP"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"name","in":"path"}],"responses":{"200":{"description":"The MCP server.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpServerOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete a registered MCP server","tags":["MCP"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"name","in":"path"}],"responses":{"204":{"description":"Deleted."},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenant/mcp":{"get":{"summary":"List registered MCP servers","tags":["MCP"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"The tenant's registered MCP servers, newest first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpServerListOut"}}}},"400":{"description":"Malformed request (e.g. a bad pagination cursor).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenant/mcp/{name}/refresh":{"post":{"summary":"Re-run tool discovery for an MCP server","tags":["MCP"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"name","in":"path"}],"responses":{"200":{"description":"The server, with its freshly discovered tools.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/McpServerOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"Live tool discovery against the MCP server failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/deployments/{depId}/mcp":{"post":{"tags":["MCP"],"security":[{"bearerAuth":[]}],"summary":"The deployment's MCP endpoint (JSON-RPC)","description":"Streamable-HTTP MCP. Framing is JSON-RPC 2.0 and the method vocabulary is MCP's, so the bodies are documented opaquely rather than restated here. Unauthenticated calls answer 401 with a `WWW-Authenticate` pointing at the protected-resource metadata — that pointer is how a host discovers the authorization server. Every method past `initialize` runs as one smith: a smith-scoped token IS that smith, and a tenant-admin token names one with an `IC-Smith-Id` header — optional only on a `smith` target, which falls back to its own target.","parameters":[{"schema":{"type":"string"},"required":true,"name":"depId","in":"path"}],"requestBody":{"description":"A JSON-RPC 2.0 request.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"responses":{"200":{"description":"A JSON-RPC 2.0 response — or, for a request carrying `_meta.progressToken` and for `subscriptions/listen`, a `text/event-stream` of JSON-RPC messages.","content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":{"nullable":true}}}}},"202":{"description":"A notification — accepted, no reply body."},"400":{"description":"Malformed request (e.g. a bad pagination cursor).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/.well-known/oauth-protected-resource/v1/deployments/{depId}/mcp":{"get":{"tags":["Connector OAuth"],"security":[],"summary":"Protected-resource metadata for an MCP deployment (RFC 9728)","parameters":[{"schema":{"type":"string"},"required":true,"name":"depId","in":"path"}],"responses":{"200":{"description":"Which authorization server guards this MCP endpoint.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthProtectedResourceMetadata"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/.well-known/oauth-authorization-server":{"get":{"tags":["Connector OAuth"],"security":[],"summary":"Authorization-server metadata (RFC 8414)","responses":{"200":{"description":"The AS endpoints a host needs to connect.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthServerMetadata"}}}}}}},"/.well-known/jwks.json":{"get":{"tags":["Connector OAuth"],"security":[],"summary":"The signing keys for every minted token","responses":{"200":{"description":"RS256 public keys; `kid` matches the JWT header.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Jwks"}}}}}}},"/oauth/register":{"post":{"tags":["Connector OAuth"],"security":[],"summary":"Register a host as a public client (RFC 7591)","requestBody":{"description":"An RFC 7591 registration.","content":{"application/json":{"schema":{"$ref":"#/$defs/OAuthClientRegistrationIn","$defs":{"OAuthClientRegistrationIn":{"type":"object","properties":{"redirect_uris":{"type":"array","items":{"type":"string"}},"client_name":{"type":"string"}},"required":["redirect_uris"]}}}}}},"responses":{"201":{"description":"The registered client.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthClientRegistrationOut"}}}},"400":{"description":"`redirect_uris` was empty or held a non-https URL (http allowed on localhost).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthError"}}}}}}},"/oauth/authorize":{"get":{"tags":["Connector OAuth"],"security":[],"summary":"The consent page (browser endpoint)","description":"Renders the consent page, or 302s to the tenant's own authorize_url when it has delegated consent. Not a JSON API — send the end-user's browser here.","parameters":[{"schema":{"type":"string","enum":["code"],"description":"Required; only `code` is supported."},"required":false,"description":"Required; only `code` is supported.","name":"response_type","in":"query"},{"schema":{"type":"string","description":"Required."},"required":false,"description":"Required.","name":"client_id","in":"query"},{"schema":{"type":"string","description":"Required, and must be one this client registered."},"required":false,"description":"Required, and must be one this client registered.","name":"redirect_uri","in":"query"},{"schema":{"type":"string","description":"The deployment's MCP URL (RFC 8707) for a connector grant. Omit for an app grant: the console then asks the user which organization to link."},"required":false,"description":"The deployment's MCP URL (RFC 8707) for a connector grant. Omit for an app grant: the console then asks the user which organization to link.","name":"resource","in":"query"},{"schema":{"type":"string","description":"App grant only: the permissions the app asks for — `tenant:*` or v1 scopes, space-separated."},"required":false,"description":"App grant only: the permissions the app asks for — `tenant:*` or v1 scopes, space-separated.","name":"scope","in":"query"},{"schema":{"type":"string","description":"Required (PKCE)."},"required":false,"description":"Required (PKCE).","name":"code_challenge","in":"query"},{"schema":{"type":"string","enum":["S256"],"description":"Required; only `S256` is supported."},"required":false,"description":"Required; only `S256` is supported.","name":"code_challenge_method","in":"query"},{"schema":{"type":"string"},"required":false,"name":"state","in":"query"}],"responses":{"200":{"description":"The consent page.","content":{"text/html":{"schema":{"type":"string"}}}},"302":{"description":"To the tenant's delegated authorize page, or back to `redirect_uri` with an `error`.","headers":{"Location":{"schema":{"type":"string"},"required":true}}},"400":{"description":"Unknown `client_id`, or a `redirect_uri` this client never registered.","content":{"text/html":{"schema":{"type":"string"}}}}}},"post":{"tags":["Connector OAuth"],"security":[],"summary":"Submit consent (browser endpoint)","description":"The consent form's target: the end-user pastes an existing IC token as `connect_token` to prove who they are, and we 302 back with the code.","requestBody":{"description":"The consent form.","content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"response_type":{"description":"Required; only `code` is supported.","type":"string","const":"code"},"client_id":{"description":"Required.","type":"string"},"redirect_uri":{"description":"Required, and must be one this client registered.","type":"string"},"resource":{"description":"The deployment's MCP URL (RFC 8707) for a connector grant. Omit for an app grant: the console then asks the user which organization to link.","type":"string"},"scope":{"description":"App grant only: the permissions the app asks for — `tenant:*` or v1 scopes, space-separated.","type":"string"},"code_challenge":{"description":"Required (PKCE).","type":"string"},"code_challenge_method":{"description":"Required; only `S256` is supported.","type":"string","const":"S256"},"state":{"type":"string"},"connect_token":{"type":"string"}},"required":["connect_token"]}}}},"responses":{"302":{"description":"Back to `redirect_uri` with `code` and `state`.","headers":{"Location":{"schema":{"type":"string"},"required":true}}},"400":{"description":"Unknown `client_id`, or an unregistered `redirect_uri`.","content":{"text/html":{"schema":{"type":"string"}}}},"401":{"description":"The consent page again, reporting a bad `connect_token`.","content":{"text/html":{"schema":{"type":"string"}}}}}}},"/oauth/token":{"post":{"tags":["Connector OAuth"],"security":[],"summary":"Exchange a code, or rotate a refresh token (RFC 6749)","requestBody":{"description":"An RFC 6749 token request.","content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"grant_type":{"description":"Required; anything else answers `unsupported_grant_type`.","type":"string","enum":["authorization_code","refresh_token"]},"client_id":{"description":"Required.","type":"string"},"code":{"type":"string"},"redirect_uri":{"type":"string"},"code_verifier":{"type":"string"},"refresh_token":{"type":"string"},"client_assertion_type":{"description":"`urn:ietf:params:oauth:client-assertion-type:jwt-bearer` — required with `client_assertion` when the client registered `private_key_jwt`.","type":"string"},"client_assertion":{"description":"The RFC 7523 assertion.","type":"string"}}}}}},"responses":{"200":{"description":"A `runs:write approvals:write` smith token and a fresh rotating refresh token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthTokenOut"}}}},"400":{"description":"`invalid_grant` (unknown, used, or expired code; PKCE or `redirect_uri` mismatch) or `unsupported_grant_type`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthError"}}}},"401":{"description":"`invalid_client` — the grant belongs to another client.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OAuthError"}}}}}}},"/v1/oauth/authorize-requests/{request_id}":{"get":{"summary":"Read a pending delegated authorize request","tags":["Tenant"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"request_id","in":"path"}],"responses":{"200":{"description":"Render data for the consent page.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizeRequestOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/oauth/authorize-requests/{request_id}/complete":{"post":{"summary":"Complete a delegated authorize request","description":"A connector request (tenant-admin token) names the smith the end-user authorized. An app request (organization token) links the app to that organization: its project is created or adopted by the app's name, and the code it mints exchanges for that project's token.","tags":["Tenant"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"request_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizeCompleteIn"}}}},"responses":{"200":{"description":"Where to 302 the browser (carries the code).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizeRedirectOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/oauth/authorize-requests/{request_id}/decline":{"post":{"summary":"Decline a delegated authorize request","tags":["Tenant"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"request_id","in":"path"}],"responses":{"200":{"description":"Where to 302 the browser (access_denied).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthorizeRedirectOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/traces":{"get":{"summary":"List traces","tags":["Observability"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string"},"required":false,"name":"smith_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"app_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"run_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"status","in":"query"},{"schema":{"type":"string"},"required":false,"name":"since","in":"query"}],"responses":{"200":{"description":"The tenant's traces, newest first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TraceListOut"}}}},"400":{"description":"Malformed request (e.g. a bad pagination cursor).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/traces/{traceId}":{"get":{"summary":"Get a trace with its spans","tags":["Observability"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"traceId","in":"path"}],"responses":{"200":{"description":"The trace with its flat spans and nested tree.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TraceDetailOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/runs/{rid}/trace":{"get":{"summary":"Get the trace for a run","tags":["Observability"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"rid","in":"path"}],"responses":{"200":{"description":"The run's trace with its flat spans and nested tree.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TraceDetailOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/usage":{"get":{"summary":"Usage breakdown (tokens, cost, meters)","tags":["Observability"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"group_by","in":"query"},{"schema":{"type":"string"},"required":false,"name":"period","in":"query"},{"schema":{"type":"string"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string"},"required":false,"name":"to","in":"query"},{"schema":{"type":"string"},"required":false,"name":"smith_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"customer_id","in":"query"}],"responses":{"200":{"description":"The usage breakdown over the requested filters.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageBreakdownOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/usage/events":{"get":{"summary":"List billable usage events","tags":["Observability"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"},{"schema":{"type":"string"},"required":false,"name":"smith_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"meter","in":"query"},{"schema":{"type":"string"},"required":false,"name":"customer_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"from","in":"query"},{"schema":{"type":"string"},"required":false,"name":"to","in":"query"}],"responses":{"200":{"description":"The usage-event ledger, newest first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageEventListOut"}}}},"400":{"description":"Malformed request (e.g. a bad pagination cursor).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Record a billable usage event","tags":["Observability"],"security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageEventIn"}}}},"responses":{"201":{"description":"The recorded usage event.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageEventOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/traces:ingest":{"post":{"summary":"Ingest externally-pushed spans","tags":["Observability"],"security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TraceIngestIn"}}}},"responses":{"202":{"description":"The spans were accepted and written.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TraceIngestOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenant/providers":{"get":{"summary":"List OAuth client providers","tags":["Tenant"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The tenant's configured providers.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderListOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenant/providers/{provider}":{"get":{"summary":"Get an OAuth client provider","tags":["Tenant"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"provider","in":"path"}],"responses":{"200":{"description":"The provider config.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"summary":"Configure an OAuth client provider","tags":["Tenant"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"provider","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderIn"}}}},"responses":{"200":{"description":"The provider was configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderConfiguredOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete an OAuth client provider","tags":["Tenant"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"provider","in":"path"}],"responses":{"204":{"description":"Deleted."},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenant/models":{"get":{"summary":"List the model catalog","tags":["Tenant"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Selectable models + runnable backends.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelsListOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenant/model_keys":{"get":{"summary":"List BYOK model keys","tags":["Tenant"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The configured BYOK keys (presence only).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelKeyListOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenant/model_keys/{provider}":{"put":{"summary":"Set a BYOK model key","tags":["Tenant"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"provider","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelKeyIn"}}}},"responses":{"200":{"description":"The key was configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ModelKeyConfiguredOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete a BYOK model key","tags":["Tenant"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"provider","in":"path"}],"responses":{"204":{"description":"Deleted."},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenant/sandbox_secrets":{"get":{"summary":"List sandbox secrets (names only)","description":"The environment a `run_command` box is launched with. Values are never echoed — a secret leaves storage only into a box's environment.","tags":["Tenant"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The configured names.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SandboxSecretListOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenant/sandbox_secrets/{name}":{"put":{"summary":"Set a sandbox secret","description":"Sealed at rest and decrypted only when a box launches. Every box this tenant launches carries every secret, so scope each credential to one purpose and keep it short-lived — a box runs model-generated commands.","tags":["Tenant"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","pattern":"^[A-Z_][A-Z0-9_]*$"},"required":true,"name":"name","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SandboxSecretIn"}}}},"responses":{"200":{"description":"The secret was configured.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SandboxSecretConfiguredOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete a sandbox secret","tags":["Tenant"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string","pattern":"^[A-Z_][A-Z0-9_]*$"},"required":true,"name":"name","in":"path"}],"responses":{"204":{"description":"Deleted."},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenant/hosted_tools":{"get":{"summary":"List the hosted-tool catalog","tags":["Tenant"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The tools hosted by Ingram Cloud, available to agents.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HostedToolsListOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenant/webhooks":{"post":{"summary":"Create a webhook","tags":["Tenant"],"security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookIn"}}}},"responses":{"201":{"description":"The created webhook (signing secret shown once).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookCreateOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"List webhooks","tags":["Tenant"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"The tenant's webhooks, newest first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookListOut"}}}},"400":{"description":"Malformed request (e.g. a bad pagination cursor).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenant/webhooks/{wid}":{"patch":{"summary":"Update a webhook","tags":["Tenant"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"wid","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookPatch"}}}},"responses":{"200":{"description":"The updated webhook's id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookIdOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete a webhook","tags":["Tenant"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"wid","in":"path"}],"responses":{"204":{"description":"Deleted."},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenant/webhooks/{wid}/rotate_secret":{"post":{"summary":"Rotate a webhook's signing secret","tags":["Tenant"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"wid","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookRotateIn"}}}},"responses":{"200":{"description":"The rotated webhook (new signing secret shown once).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookRotateOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenant/webhooks/{wid}/test":{"post":{"summary":"Fire a test webhook delivery","tags":["Tenant"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"wid","in":"path"}],"responses":{"200":{"description":"A signed test event was delivered.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookTestOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenant/webhooks/{wid}/deliveries":{"get":{"summary":"List a webhook's delivery attempts","tags":["Tenant"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"wid","in":"path"},{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"The webhook's deliveries, newest first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookDeliveryListOut"}}}},"400":{"description":"Malformed request (e.g. a bad pagination cursor).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenant/webhooks/{wid}/deliveries/{did}/redeliver":{"post":{"summary":"Redeliver a webhook delivery","tags":["Tenant"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"wid","in":"path"},{"schema":{"type":"string"},"required":true,"name":"did","in":"path"}],"responses":{"200":{"description":"The redelivery outcome.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookRedeliverOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/events":{"get":{"summary":"Poll the event feed","tags":["Tenant"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"type","in":"query"},{"schema":{"type":"string"},"required":false,"name":"smith_id","in":"query"},{"schema":{"type":"string"},"required":false,"name":"since","in":"query"},{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"The matching events, newest first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventListOut"}}}},"400":{"description":"Malformed request (e.g. a bad pagination cursor).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenant/tokens":{"post":{"summary":"Mint a token","tags":["Tenant"],"security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenIn"}}}},"responses":{"201":{"description":"The minted token (secret shown once).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MintedTokenOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"List tokens","tags":["Tenant"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"The tenant's minted tokens.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TokenListOut"}}}},"400":{"description":"Malformed request (e.g. a bad pagination cursor).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenant/tokens/{tid}":{"delete":{"summary":"Revoke a token","tags":["Tenant"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"tid","in":"path"}],"responses":{"204":{"description":"Revoked."},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenant/usage":{"get":{"summary":"Aggregated token usage","tags":["Tenant"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Per-day token usage + totals.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenant/telegram":{"put":{"summary":"Configure the tenant's Telegram bot","tags":["Telegram"],"security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TelegramBotIn"}}}},"responses":{"200":{"description":"The bot config after the write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TelegramBotOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"Get the tenant's Telegram bot status","tags":["Telegram"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The bot config status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TelegramBotOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Remove the tenant's Telegram bot","tags":["Telegram"],"security":[{"bearerAuth":[]}],"responses":{"204":{"description":"Removed."},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/telegram/webhook/{tenant}":{"post":{"tags":["Telegram"],"security":[],"summary":"Inbound Telegram updates (provider → us)","description":"Telegram calls this; it authenticates by the per-tenant webhook secret in `X-Telegram-Bot-Api-Secret-Token`, not a bearer token. Acks immediately and runs the turn off the request, so Telegram never retries on a slow run.","parameters":[{"schema":{"type":"string"},"required":true,"name":"tenant","in":"path"}],"requestBody":{"description":"A Telegram `Update`.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"responses":{"200":{"description":"Accepted, or ignored (unknown tenant).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookAck"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenant/whatsapp":{"put":{"summary":"Register the tenant's WhatsApp number","tags":["WhatsApp"],"security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppConfigIn"}}}},"responses":{"200":{"description":"The registered number (IC subscribes it to the app-level webhook).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppConfigOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"Get the tenant's WhatsApp config status","tags":["WhatsApp"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The config status (secrets presence-only).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WhatsAppConfigOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Remove the tenant's WhatsApp config","tags":["WhatsApp"],"security":[{"bearerAuth":[]}],"responses":{"204":{"description":"Removed."},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/whatsapp/webhook":{"get":{"tags":["WhatsApp"],"security":[],"summary":"Meta's webhook verify handshake (provider → us)","description":"Meta calls this once when the app-level webhook is registered. Echoes `hub.challenge` when `hub.verify_token` matches the platform token.","parameters":[{"schema":{"type":"string"},"required":false,"name":"hub.mode","in":"query"},{"schema":{"type":"string"},"required":false,"name":"hub.verify_token","in":"query"},{"schema":{"type":"string"},"required":false,"name":"hub.challenge","in":"query"}],"responses":{"200":{"description":"The echoed `hub.challenge`, verbatim.","content":{"text/plain":{"schema":{"type":"string"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"tags":["WhatsApp"],"security":[],"summary":"Inbound WhatsApp messages (provider → us)","description":"One app-level webhook for every tenant; routed by the phone number id in the payload. Authenticated by the app-secret HMAC over the raw body, not a bearer token. Acks immediately and runs the turn off the request.","requestBody":{"description":"A Meta change payload.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"responses":{"200":{"description":"Accepted, or ignored (unparseable payload).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookAck"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenant/email":{"put":{"summary":"Configure the tenant's email sending","tags":["Email"],"security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailConfigIn"}}}},"responses":{"200":{"description":"The saved config (the inbound secret is shown once).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailConfigOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"Get the tenant's email config status","tags":["Email"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The config status (the API token is never returned).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EmailConfigOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Remove the tenant's email config","tags":["Email"],"security":[{"bearerAuth":[]}],"responses":{"204":{"description":"Removed."},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenant/email/suppressions":{"get":{"summary":"List the tenant's suppressed addresses","tags":["Email"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"limit","in":"query"},{"schema":{"type":"string"},"required":false,"name":"cursor","in":"query"}],"responses":{"200":{"description":"The block list, newest first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuppressionListOut"}}}},"400":{"description":"Malformed request (e.g. a bad pagination cursor).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Suppress an address","tags":["Email"],"security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuppressionIn"}}}},"responses":{"201":{"description":"The suppressed address.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuppressionOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenant/email/suppressions/{address}":{"delete":{"summary":"Remove a suppressed address","tags":["Email"],"security":[{"bearerAuth":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"address","in":"path"}],"responses":{"204":{"description":"Removed."},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/email/inbound/{tenant}":{"post":{"tags":["Email"],"security":[],"summary":"Inbound email (provider → us)","description":"Authenticated by the per-tenant inbound secret in `X-Inbound-Secret`, not a bearer token. Records and enqueues off the request; the turn runs in the drainer and the reply follows by email.","parameters":[{"schema":{"type":"string"},"required":true,"name":"tenant","in":"path"}],"requestBody":{"description":"A provider-normalised inbound message.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"responses":{"200":{"description":"Accepted, or ignored (unknown tenant).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookAck"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenant/slack":{"put":{"summary":"Configure the tenant's Slack posture","tags":["Slack"],"security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SlackAppIn"}}}},"responses":{"200":{"description":"The tenant's Slack posture after the change.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SlackAppOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"Get the tenant's Slack posture","tags":["Slack"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The tenant's Slack posture.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SlackAppOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Remove the tenant's Slack posture","tags":["Slack"],"security":[{"bearerAuth":[]}],"responses":{"204":{"description":"Removed."},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/slack/oauth/{tenant}":{"get":{"tags":["Slack"],"security":[],"summary":"Slack install callback (browser redirect)","description":"The Redirect URL registered with the Slack app. Authenticated by the one-time `state`, not a bearer token — send the installing user's browser here. Ends in a 302 into the tenant's product, or a terminal page.","parameters":[{"schema":{"type":"string"},"required":true,"name":"tenant","in":"path"},{"schema":{"type":"string"},"required":false,"name":"code","in":"query"},{"schema":{"type":"string"},"required":false,"name":"state","in":"query"},{"schema":{"type":"string","description":"Set when the user denied the install."},"required":false,"description":"Set when the user denied the install.","name":"error","in":"query"}],"responses":{"200":{"description":"A terminal page — the install finished or could not.","content":{"text/html":{"schema":{"type":"string"}}}},"302":{"description":"Into the tenant's product, on success.","headers":{"Location":{"schema":{"type":"string"},"required":true}}}}}},"/v1/slack/events/{tenant}":{"post":{"tags":["Slack"],"security":[],"summary":"Slack Events API receiver (provider → us)","description":"Authenticated by the Slack request signature over the raw body. The `url_verification` handshake is answered before signature checking — Slack validates a new app's Request URL before we hold its signing secret, and echoing the challenge changes no state.","parameters":[{"schema":{"type":"string"},"required":true,"name":"tenant","in":"path"}],"requestBody":{"description":"A Slack event envelope.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"responses":{"200":{"description":"`{ok:true}`, or the echoed `challenge` for `url_verification`.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SlackEventAck"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/slack/interactivity/{tenant}":{"post":{"tags":["Slack"],"security":[],"summary":"Slack interactivity receiver (provider → us)","description":"Block-action callbacks (an approval button). Same signature auth as the events receiver; the payload arrives form-encoded as `payload=<json>`.","parameters":[{"schema":{"type":"string"},"required":true,"name":"tenant","in":"path"}],"requestBody":{"description":"Slack's form-encoded interaction.","content":{"application/x-www-form-urlencoded":{"schema":{"type":"object","properties":{"payload":{"type":"string","description":"A JSON-encoded interaction."}},"required":["payload"]}}}},"responses":{"200":{"description":"Accepted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookAck"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/tenant/discord":{"put":{"summary":"Configure the tenant's Discord app","tags":["Discord"],"security":[{"bearerAuth":[]}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscordAppIn"}}}},"responses":{"200":{"description":"The Discord app config after the write.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscordAppOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"Get the tenant's Discord app status","tags":["Discord"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The Discord app config status.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscordAppOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Remove the tenant's Discord app","tags":["Discord"],"security":[{"bearerAuth":[]}],"responses":{"204":{"description":"Removed."},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"The token lacks the required scope or is smith-scoped.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/discord/webhook/{tenant}":{"post":{"tags":["Discord"],"security":[],"summary":"Discord Interactions Endpoint (provider → us)","description":"Discord calls this; authenticated by the per-request Ed25519 signature over the raw body, verified with the tenant app's public key. Answers the interaction ack immediately and runs the turn off the request.","parameters":[{"schema":{"type":"string"},"required":true,"name":"tenant","in":"path"}],"requestBody":{"description":"A Discord `Interaction`.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}},"responses":{"200":{"description":"An interaction callback — `{type:1}` (PONG) or the deferred ack.","content":{"application/json":{"schema":{"type":"object","properties":{},"additionalProperties":{"nullable":true}}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/internal/sandbox/{sbxId}/claim":{"post":{"tags":["Sandbox (internal)"],"security":[],"summary":"Claim the next queued command (called by the sandbox)","description":"Returns the oldest queued command for this sandbox, or nulls when there is none. The first successful claim marks the box `ready`.","parameters":[{"schema":{"type":"string"},"required":true,"name":"sbxId","in":"path"}],"responses":{"200":{"description":"The next command, if any.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SandboxClaimOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/internal/sandbox/{sbxId}/result":{"post":{"tags":["Sandbox (internal)"],"security":[],"summary":"Report a command's result (called by the sandbox)","description":"Terminal — there is no retry, because re-running a shell command is not idempotent. A result for a command this box does not hold is refused.","parameters":[{"schema":{"type":"string"},"required":true,"name":"sbxId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SandboxResultIn"}}}},"responses":{"200":{"description":"Recorded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SandboxResultOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/internal/sandbox/{sbxId}/outputs":{"post":{"tags":["Sandbox (internal)"],"security":[],"summary":"Store a file the command left in $OUTPUT_DIR (called by the sandbox)","description":"Multipart: `file` and `command_id`. Stored as a file of the box's run (`source: \"output\"`) and appended to the command's `files`, which the tool result carries. Only the running command this box holds can take one.","parameters":[{"schema":{"type":"string"},"required":true,"name":"sbxId","in":"path"}],"requestBody":{"content":{"multipart/form-data":{"schema":{"type":"object","properties":{"file":{"type":"string","format":"binary"},"command_id":{"type":"string"}},"required":["file","command_id"]}}}},"responses":{"200":{"description":"The stored file.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SandboxOutputOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"No such resource (tenant-scoped).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"The body is over the size ceiling.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The request shape or a domain rule was violated.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/internal/sandbox/{sbxId}/skills":{"get":{"tags":["Sandbox (internal)"],"security":[],"summary":"The run's skill bundles, as presigned URLs","description":"Box-facing. The box writes each file under /skills/<name>/ at boot, so a skill's scripts/ are on disk before the first command runs.","parameters":[{"schema":{"type":"string"},"required":true,"name":"sbxId","in":"path"}],"responses":{"200":{"description":"The manifest.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SandboxSkillsOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/internal/sandbox/{sbxId}/skills/errors":{"post":{"tags":["Sandbox (internal)"],"security":[],"summary":"Report skills the box could not restore","description":"Box-facing. A skill that never reached /skills/<name>/ becomes a `skill_files_unavailable` warning on the box's run, so the degraded answer says so instead of the model meeting a bare shell error.","parameters":[{"schema":{"type":"string"},"required":true,"name":"sbxId","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SandboxSkillErrorsIn"}}}},"responses":{"200":{"description":"Recorded.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SandboxResultOut"}}}},"401":{"description":"Missing or invalid bearer token.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}}}