{"openapi":"3.1.0","info":{"title":"decli API","description":"REST and GraphQL endpoints for the decli web platform","version":"2.0.0"},"paths":{"/api/graphql":{"get":{"summary":"Handle Http Get","operationId":"handle_http_get_api_graphql_get","responses":{"200":{"description":"The GraphiQL integrated development environment.","content":{"application/json":{"schema":{}}}},"404":{"description":"Not found if GraphiQL or query via GET are not enabled."}}},"post":{"summary":"Handle Http Post","operationId":"handle_http_post_api_graphql_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/auth/google/status":{"get":{"tags":["Auth"],"summary":"Google Oauth Status","description":"Operator diagnostics — no secrets.","operationId":"google_oauth_status_auth_google_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Google Oauth Status Auth Google Status Get"}}}}}}},"/auth/google":{"get":{"tags":["Auth"],"summary":"Google Oauth Redirect","description":"Start Google Workspace OAuth (primary web auth for dev + prod).","operationId":"google_oauth_redirect_auth_google_get","parameters":[{"name":"return_to","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Return To"}},{"name":"hd","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Hd"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/auth/google/callback":{"get":{"tags":["Auth"],"summary":"Google Oauth Callback","description":"OAuth callback — issues session JWT for the web session bridge.","operationId":"google_oauth_callback_auth_google_callback_get","parameters":[{"name":"code","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Code"}},{"name":"state","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"State"}},{"name":"error","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},{"name":"error_description","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error Description"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/me/settings":{"get":{"tags":["me"],"summary":"Get Settings","operationId":"get_settings_api_v1_me_settings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSettings"}}}}},"security":[{"HTTPBearer":[]}]},"put":{"tags":["me"],"summary":"Update Settings","operationId":"update_settings_api_v1_me_settings_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSettingsUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserSettings"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/me/providers/{provider}":{"put":{"tags":["me"],"summary":"Configure Provider","operationId":"configure_provider_api_v1_me_providers__provider__put","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderConfigRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["me"],"summary":"Remove Provider","operationId":"remove_provider_api_v1_me_providers__provider__delete","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderConfigResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/me/providers/{provider}/test":{"post":{"tags":["me"],"summary":"Test Provider","operationId":"test_provider_api_v1_me_providers__provider__test_post","security":[{"HTTPBearer":[]}],"parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderTestResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/me/cli/session":{"post":{"tags":["me"],"summary":"Create Cli Session","operationId":"create_cli_session_api_v1_me_cli_session_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CliSessionResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/me/providers/export":{"get":{"tags":["me"],"summary":"Export Providers","operationId":"export_providers_api_v1_me_providers_export_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderExportResponse"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/me/environment":{"get":{"tags":["me"],"summary":"Get Environment","description":"Standard session metadata: device fleet location + Google Air Quality.","operationId":"get_environment_api_v1_me_environment_get","security":[{"HTTPBearer":[]}],"parameters":[{"name":"lat","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Lat"}},{"name":"lng","in":"query","required":false,"schema":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Lng"}},{"name":"refresh","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Refresh"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnvironmentResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/status":{"get":{"tags":["v1"],"summary":"Service Status","operationId":"service_status_api_v1_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ServiceStatusResponse"}}}}}}},"/api/v1/me":{"get":{"tags":["v1"],"summary":"Current User","operationId":"current_user_api_v1_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserProfile"}}}}},"security":[{"HTTPBearer":[]}]}},"/api/v1/nlp/interpret":{"post":{"tags":["v1"],"summary":"Nlp Interpret","operationId":"nlp_interpret_api_v1_nlp_interpret_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NlpInterpretRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NlpInterpretResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/commands":{"get":{"tags":["v1"],"summary":"List Commands","operationId":"list_commands_api_v1_commands_get","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":50,"title":"Limit"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CommandRecord"},"title":"Response List Commands Api V1 Commands Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["v1"],"summary":"Create Command","operationId":"create_command_api_v1_commands_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CommandRecord"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workflows":{"get":{"tags":["v1"],"summary":"List Workflows","operationId":"list_workflows_api_v1_workflows_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Workflow"},"type":"array","title":"Response List Workflows Api V1 Workflows Get"}}}}}},"post":{"tags":["v1"],"summary":"Create Workflow","operationId":"create_workflow_api_v1_workflows_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowCreate"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workflow"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/workflows/{workflow_id}":{"get":{"tags":["v1"],"summary":"Get Workflow","operationId":"get_workflow_api_v1_workflows__workflow_id__get","parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workflow"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["v1"],"summary":"Update Workflow","operationId":"update_workflow_api_v1_workflows__workflow_id__patch","parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Workflow"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["v1"],"summary":"Delete Workflow","operationId":"delete_workflow_api_v1_workflows__workflow_id__delete","parameters":[{"name":"workflow_id","in":"path","required":true,"schema":{"type":"string","title":"Workflow Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiEnvelope"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/integrations":{"get":{"tags":["v1"],"summary":"List Integrations","operationId":"list_integrations_api_v1_integrations_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/Integration"},"type":"array","title":"Response List Integrations Api V1 Integrations Get"}}}}}}},"/":{"get":{"summary":"Root","operationId":"root__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Root  Get"}}}}}}},"/api/health":{"get":{"summary":"Health Check","description":"Health probe used by `decli services` and Caddy.","operationId":"health_check_api_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Health Check Api Health Get"}}}}}}}},"components":{"schemas":{"ApiEnvelope":{"properties":{"success":{"type":"boolean","title":"Success","default":true},"data":{"title":"Data"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"}},"type":"object","title":"ApiEnvelope"},"CliSessionResponse":{"properties":{"token":{"type":"string","title":"Token"},"expires_in_days":{"type":"integer","title":"Expires In Days","default":90}},"type":"object","required":["token"],"title":"CliSessionResponse"},"CommandCreate":{"properties":{"command":{"type":"string","minLength":1,"title":"Command"},"args":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Args"},"exit_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Exit Code"},"duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Ms"},"source":{"type":"string","title":"Source","default":"api"}},"type":"object","required":["command"],"title":"CommandCreate"},"CommandRecord":{"properties":{"id":{"type":"string","title":"Id"},"command":{"type":"string","title":"Command"},"args":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Args"},"exit_code":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Exit Code"},"duration_ms":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Duration Ms"},"source":{"type":"string","title":"Source","default":"api"},"created_at":{"type":"string","format":"date-time","title":"Created At"}},"type":"object","required":["id","command","created_at"],"title":"CommandRecord"},"EnvironmentResponse":{"properties":{"surface":{"type":"string","title":"Surface","default":"web"},"captured_at":{"type":"string","title":"Captured At","default":""},"host":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Host"},"deploy_env":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Deploy Env"},"device_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Id"},"device_kind":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Kind"},"device_network":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Network"},"device_place":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Device Place"},"device_lat":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Device Lat"},"device_lng":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Device Lng"},"aqi":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Aqi"},"aqi_category":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Aqi Category"},"aqi_dominant_pollutant":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Aqi Dominant Pollutant"},"aqi_code":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Aqi Code"},"aqi_region":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Aqi Region"},"aqi_health":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Aqi Health"},"raw":{"additionalProperties":true,"type":"object","title":"Raw"}},"type":"object","title":"EnvironmentResponse","description":"Standard session environment: host, device fleet, air quality."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"Integration":{"properties":{"id":{"type":"string","title":"Id"},"service":{"type":"string","title":"Service"},"name":{"type":"string","title":"Name"},"enabled":{"type":"boolean","title":"Enabled"},"last_sync_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Sync At"}},"type":"object","required":["id","service","name","enabled"],"title":"Integration"},"NlpInterpretRequest":{"properties":{"text":{"type":"string","maxLength":2000,"minLength":1,"title":"Text"}},"type":"object","required":["text"],"title":"NlpInterpretRequest"},"NlpInterpretResponse":{"properties":{"understood":{"type":"boolean","title":"Understood"},"command":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Command"},"params":{"items":{"type":"string"},"type":"array","title":"Params"},"confidence":{"anyOf":[{"type":"number"},{"type":"null"}],"title":"Confidence"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"suggestions":{"items":{"type":"string"},"type":"array","title":"Suggestions"},"source":{"type":"string","title":"Source","default":"api"}},"type":"object","required":["understood"],"title":"NlpInterpretResponse"},"ProviderConfigRequest":{"properties":{"api_key":{"type":"string","minLength":1,"title":"Api Key"},"organization_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Organization Id"},"project_id":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Project Id"},"api_secret":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Api Secret"}},"type":"object","required":["api_key"],"title":"ProviderConfigRequest"},"ProviderConfigResponse":{"properties":{"provider":{"type":"string","title":"Provider"},"configured":{"type":"boolean","title":"Configured"},"key_preview":{"type":"string","title":"Key Preview"},"message":{"type":"string","title":"Message"}},"type":"object","required":["provider","configured","key_preview","message"],"title":"ProviderConfigResponse"},"ProviderExportResponse":{"properties":{"providers":{"additionalProperties":{"additionalProperties":{"type":"string"},"type":"object"},"type":"object","title":"Providers"}},"type":"object","title":"ProviderExportResponse"},"ProviderStatus":{"properties":{"configured":{"type":"boolean","title":"Configured","default":false},"key_preview":{"type":"string","title":"Key Preview","default":""}},"type":"object","title":"ProviderStatus"},"ProviderTestResponse":{"properties":{"provider":{"type":"string","title":"Provider"},"validated":{"type":"boolean","title":"Validated"},"smoke_response":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Smoke Response"},"message":{"type":"string","title":"Message"}},"type":"object","required":["provider","validated","message"],"title":"ProviderTestResponse"},"ServiceStatusResponse":{"properties":{"status":{"type":"string","title":"Status"},"version":{"type":"string","title":"Version"},"mode":{"type":"string","title":"Mode"},"bridge_reachable":{"type":"boolean","title":"Bridge Reachable"},"bridge_url":{"type":"string","title":"Bridge Url"},"uptime_seconds":{"type":"number","title":"Uptime Seconds"}},"type":"object","required":["status","version","mode","bridge_reachable","bridge_url","uptime_seconds"],"title":"ServiceStatusResponse"},"UserProfile":{"properties":{"id":{"type":"string","title":"Id"},"email":{"type":"string","title":"Email"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"username":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Username"}},"type":"object","required":["id","email"],"title":"UserProfile"},"UserSettings":{"properties":{"profile_name":{"type":"string","title":"Profile Name","default":""},"profile_handle":{"type":"string","title":"Profile Handle","default":""},"active_provider":{"type":"string","title":"Active Provider","default":"claude"},"debug_logs":{"type":"boolean","title":"Debug Logs","default":true},"natural_language":{"type":"boolean","title":"Natural Language","default":true},"providers":{"additionalProperties":{"$ref":"#/components/schemas/ProviderStatus"},"type":"object","title":"Providers"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"type":"object","title":"UserSettings"},"UserSettingsUpdate":{"properties":{"profile_name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Profile Name"},"profile_handle":{"anyOf":[{"type":"string","maxLength":64},{"type":"null"}],"title":"Profile Handle"},"active_provider":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Active Provider"},"debug_logs":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Debug Logs"},"natural_language":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Natural Language"}},"type":"object","title":"UserSettingsUpdate"},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"Workflow":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"trigger":{"additionalProperties":true,"type":"object","title":"Trigger"},"steps":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Steps"},"enabled":{"type":"boolean","title":"Enabled","default":true},"last_run_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Run At"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["id","name","trigger","steps","created_at","updated_at"],"title":"Workflow"},"WorkflowCreate":{"properties":{"name":{"type":"string","maxLength":120,"minLength":1,"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"trigger":{"additionalProperties":true,"type":"object","title":"Trigger"},"steps":{"items":{"additionalProperties":true,"type":"object"},"type":"array","title":"Steps"},"enabled":{"type":"boolean","title":"Enabled","default":true}},"type":"object","required":["name"],"title":"WorkflowCreate"},"WorkflowUpdate":{"properties":{"name":{"anyOf":[{"type":"string","maxLength":120,"minLength":1},{"type":"null"}],"title":"Name"},"description":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Description"},"trigger":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Trigger"},"steps":{"anyOf":[{"items":{"additionalProperties":true,"type":"object"},"type":"array"},{"type":"null"}],"title":"Steps"},"enabled":{"anyOf":[{"type":"boolean"},{"type":"null"}],"title":"Enabled"}},"type":"object","title":"WorkflowUpdate"}},"securitySchemes":{"HTTPBearer":{"type":"http","scheme":"bearer"}}}}