{"openapi":"3.1.0","info":{"title":"PyPSA App","description":"tbd","version":"0.1.0a1.post1.dev98+gd83f4884b.d20260612"},"paths":{"/api/v1/auth/providers":{"get":{"tags":["auth"],"summary":"Get Auth Providers","operationId":"get_auth_providers_api_v1_auth_providers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuthProvidersResponse"}}}}}}},"/api/v1/auth/login/{provider}":{"get":{"tags":["auth"],"summary":"Oauth Login","operationId":"oauth_login_api_v1_auth_login__provider__get","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/login/{provider}/callback":{"get":{"tags":["auth"],"summary":"Oauth Callback","operationId":"oauth_callback_api_v1_auth_login__provider__callback_get","parameters":[{"name":"provider","in":"path","required":true,"schema":{"type":"string","title":"Provider"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/login/password":{"post":{"tags":["auth"],"summary":"Password Login","operationId":"password_login_api_v1_auth_login_password_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PasswordLoginRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/logout":{"get":{"tags":["auth"],"summary":"Logout","operationId":"logout_api_v1_auth_logout_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v1/auth/me":{"get":{"tags":["auth"],"summary":"Get Current User Info","operationId":"get_current_user_info_api_v1_auth_me_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}}}}},"/api/v1/auth/api-keys/":{"get":{"tags":["auth"],"summary":"List Api Keys","operationId":"list_api_keys_api_v1_auth_api_keys__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ApiKeyResponse"},"type":"array","title":"Response List Api Keys Api V1 Auth Api Keys  Get"}}}}}},"post":{"tags":["auth"],"summary":"Create Api Key","operationId":"create_api_key_api_v1_auth_api_keys__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyCreate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/auth/api-keys/{key_id}":{"delete":{"tags":["auth"],"summary":"Delete Api Key","operationId":"delete_api_key_api_v1_auth_api_keys__key_id__delete","parameters":[{"name":"key_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Key Id"}}],"responses":{"204":{"description":"Successful Response"},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/public/runs/{run_id}":{"get":{"tags":["public"],"summary":"Get Public Run","operationId":"get_public_run_api_v1_public_runs__run_id__get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Run UUID","title":"Run Id"},"description":"Run UUID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublicRunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/permissions":{"get":{"tags":["admin"],"summary":"Get Permissions","description":"Get all available permissions and role mappings","operationId":"get_permissions_api_v1_admin_permissions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Get Permissions Api V1 Admin Permissions Get"}}}}}}},"/api/v1/admin/users":{"get":{"tags":["admin"],"summary":"List Users","description":"List all users","operationId":"list_users_api_v1_admin_users_get","parameters":[{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort By"}},{"name":"sort_dir","in":"query","required":false,"schema":{"enum":["asc","desc"],"type":"string","default":"asc","title":"Sort Dir"}},{"name":"filter_q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filter Q"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["admin"],"summary":"Create User","description":"Create a user (currently only bot role is supported).","operationId":"create_user_api_v1_admin_users_post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/users/{user_id}":{"get":{"tags":["admin"],"summary":"Get User Detail","description":"Get a single user by ID.","operationId":"get_user_detail_api_v1_admin_users__user_id__get","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"User UUID","title":"User Id"},"description":"User UUID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["admin"],"summary":"Delete User","description":"Delete a user","operationId":"delete_user_api_v1_admin_users__user_id__delete","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"User UUID","title":"User Id"},"description":"User UUID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/users/{user_id}/stats":{"get":{"tags":["admin"],"summary":"Get User Stats","description":"Aggregated activity stats for a single user.","operationId":"get_user_stats_api_v1_admin_users__user_id__stats_get","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"User UUID","title":"User Id"},"description":"User UUID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserStatsResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/users/{user_id}/role":{"patch":{"tags":["admin"],"summary":"Update User Role","description":"Update user role","operationId":"update_user_role_api_v1_admin_users__user_id__role_patch","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"User UUID","title":"User Id"},"description":"User UUID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserRoleUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/users/{user_id}/approve":{"post":{"tags":["admin"],"summary":"Approve User","description":"Approve a pending user","operationId":"approve_user_api_v1_admin_users__user_id__approve_post","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"User UUID","title":"User Id"},"description":"User UUID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/users/{user_id}/backends":{"get":{"tags":["admin"],"summary":"List User Backends","description":"List backends assigned to a user.","operationId":"list_user_backends_api_v1_admin_users__user_id__backends_get","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"User UUID","title":"User Id"},"description":"User UUID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/BackendResponse"},"title":"Response List User Backends Api V1 Admin Users  User Id  Backends Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["admin"],"summary":"Assign Backend To User","description":"Assign a backend to a user (mirror of POST /backends/{id}/users).","operationId":"assign_backend_to_user_api_v1_admin_users__user_id__backends_post","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"User UUID","title":"User Id"},"description":"User UUID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BackendAssign"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/users/{user_id}/backends/{backend_id}":{"delete":{"tags":["admin"],"summary":"Unassign Backend From User","description":"Remove a backend from a user.\n\nMirror of DELETE /backends/{id}/users/{user_id}.","operationId":"unassign_backend_from_user_api_v1_admin_users__user_id__backends__backend_id__delete","parameters":[{"name":"backend_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Backend Id"}},{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"User UUID","title":"User Id"},"description":"User UUID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/users/{user_id}/api-keys":{"get":{"tags":["admin"],"summary":"List User Api Keys","description":"List API keys owned by a user.","operationId":"list_user_api_keys_api_v1_admin_users__user_id__api_keys_get","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"User UUID","title":"User Id"},"description":"User UUID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/ApiKeyResponse"},"title":"Response List User Api Keys Api V1 Admin Users  User Id  Api Keys Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/networks":{"get":{"tags":["admin"],"summary":"List All Networks","description":"List ALL networks (admin only) - bypasses normal visibility rules","operationId":"list_all_networks_api_v1_admin_networks_get","parameters":[{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort By"}},{"name":"sort_dir","in":"query","required":false,"schema":{"enum":["asc","desc"],"type":"string","default":"asc","title":"Sort Dir"}},{"name":"filter_q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filter Q"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NetworkListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/networks/{network_id}":{"patch":{"tags":["admin"],"summary":"Update Network Admin","description":"Update network properties (admin only) - can change owner, visibility, name","operationId":"update_network_admin_api_v1_admin_networks__network_id__patch","parameters":[{"name":"network_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Network Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NetworkAdminUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NetworkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["admin"],"summary":"Delete Network Admin","description":"Delete any network (admin only)","operationId":"delete_network_admin_api_v1_admin_networks__network_id__delete","parameters":[{"name":"network_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Network Id"}},{"name":"remove_file","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Remove File"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/runs":{"get":{"tags":["admin"],"summary":"List All Runs","description":"List ALL runs (admin only) - bypasses normal visibility rules","operationId":"list_all_runs_api_v1_admin_runs_get","parameters":[{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort By"}},{"name":"sort_dir","in":"query","required":false,"schema":{"enum":["asc","desc"],"type":"string","default":"asc","title":"Sort Dir"}},{"name":"filter_q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filter Q"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/runs/{run_id}":{"patch":{"tags":["admin"],"summary":"Update Run Admin","description":"Update run properties (admin only) - can change owner, visibility","operationId":"update_run_admin_api_v1_admin_runs__run_id__patch","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunAdminUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["admin"],"summary":"Delete Run Admin","description":"Delete any run (admin only)","operationId":"delete_run_admin_api_v1_admin_runs__run_id__delete","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Run Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/backends":{"get":{"tags":["admin"],"summary":"List Backends","description":"List all registered Snakedispatch backends.","operationId":"list_backends_api_v1_admin_backends_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/BackendResponse"},"type":"array","title":"Response List Backends Api V1 Admin Backends Get"}}}}}}},"/api/v1/admin/backends/{backend_id}":{"get":{"tags":["admin"],"summary":"Get Backend Detail","description":"Get a single backend by ID.","operationId":"get_backend_detail_api_v1_admin_backends__backend_id__get","parameters":[{"name":"backend_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Backend UUID","title":"Backend Id"},"description":"Backend UUID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BackendResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/backends/{backend_id}/users":{"get":{"tags":["admin"],"summary":"List Backend Users","description":"List users assigned to a backend.","operationId":"list_backend_users_api_v1_admin_backends__backend_id__users_get","parameters":[{"name":"backend_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Backend UUID","title":"Backend Id"},"description":"Backend UUID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/UserResponse"},"title":"Response List Backend Users Api V1 Admin Backends  Backend Id  Users Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"post":{"tags":["admin"],"summary":"Assign User To Backend","description":"Assign a user to a backend.","operationId":"assign_user_to_backend_api_v1_admin_backends__backend_id__users_post","parameters":[{"name":"backend_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Backend UUID","title":"Backend Id"},"description":"Backend UUID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UserBackendAssign"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/admin/backends/{backend_id}/users/{user_id}":{"delete":{"tags":["admin"],"summary":"Unassign User From Backend","description":"Remove a user from a backend.","operationId":"unassign_user_from_backend_api_v1_admin_backends__backend_id__users__user_id__delete","parameters":[{"name":"user_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"User UUID","title":"User Id"},"description":"User UUID"},{"name":"backend_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Backend UUID","title":"Backend Id"},"description":"Backend UUID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/networks/":{"get":{"tags":["networks"],"summary":"List Networks","description":"List networks with pagination and optional filtering.","operationId":"list_networks_api_v1_networks__get","parameters":[{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort By"}},{"name":"sort_dir","in":"query","required":false,"schema":{"enum":["asc","desc"],"type":"string","default":"asc","title":"Sort Dir"}},{"name":"filter_q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filter Q"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NetworkListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/networks/{network_id}":{"get":{"tags":["networks"],"summary":"Get Network","description":"Get network by ID with owner info","operationId":"get_network_api_v1_networks__network_id__get","parameters":[{"name":"network_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Network UUID","title":"Network Id"},"description":"Network UUID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NetworkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["networks"],"summary":"Update Network","description":"Update network properties. Only owner or admin can update.","operationId":"update_network_api_v1_networks__network_id__patch","parameters":[{"name":"network_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Network UUID","title":"Network Id"},"description":"Network UUID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NetworkUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NetworkResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["networks"],"summary":"Delete Network","description":"Delete network from database and (optionally) file system.","operationId":"delete_network_api_v1_networks__network_id__delete","parameters":[{"name":"network_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Network UUID","title":"Network Id"},"description":"Network UUID"},{"name":"remove_file","in":"query","required":false,"schema":{"type":"boolean","default":false,"title":"Remove File"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/networks/{network_id}/reports":{"get":{"tags":["networks"],"summary":"Get Network Reports","operationId":"get_network_reports_api_v1_networks__network_id__reports_get","parameters":[{"name":"network_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Network UUID","title":"Network Id"},"description":"Network UUID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/ReportsPayload"},{"type":"null"}],"title":"Response Get Network Reports Api V1 Networks  Network Id  Reports Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"put":{"tags":["networks"],"summary":"Save Network Reports","operationId":"save_network_reports_api_v1_networks__network_id__reports_put","parameters":[{"name":"network_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Network UUID","title":"Network Id"},"description":"Network UUID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportsPayload"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportsPayload"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/networks/{network_id}/components/{component_name}":{"get":{"tags":["networks"],"summary":"Get Component Data","operationId":"get_component_data_api_v1_networks__network_id__components__component_name__get","parameters":[{"name":"component_name","in":"path","required":true,"schema":{"type":"string","title":"Component Name"}},{"name":"network_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Network UUID","title":"Network Id"},"description":"Network UUID"},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","minimum":0,"default":0,"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","maximum":500,"minimum":1,"default":50,"title":"Limit"}},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort By"}},{"name":"sort_dir","in":"query","required":false,"schema":{"type":"string","pattern":"^(asc|desc)$","default":"asc","title":"Sort Dir"}},{"name":"search","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Search"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ComponentDataResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/plots/generate":{"post":{"tags":["plots"],"summary":"Generate Plot","description":"Generate plot from PyPSA network or NetworkCollection statistics","operationId":"generate_plot_api_v1_plots_generate_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlotParams"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskQueuedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/plots/explore":{"post":{"tags":["plots"],"summary":"Generate Explore","description":"Generate interactive map from PyPSA network using n.plot.explore()","operationId":"generate_explore_api_v1_plots_explore_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExploreRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskQueuedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/statistics/":{"post":{"tags":["statistics"],"summary":"Get Statistics","description":"Get raw statistics data without plotting","operationId":"get_statistics_api_v1_statistics__post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StatisticsParams"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskQueuedResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cache/redis/stats":{"get":{"tags":["cache"],"summary":"Get Redis Stats","description":"Get Redis cache statistics","operationId":"get_redis_stats_api_v1_cache_redis_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RedisStatsResponse"}}}}}}},"/api/v1/cache/networks/stats":{"get":{"tags":["cache"],"summary":"Get Network Cache Stats","description":"Get in-memory PyPSA network cache statistics","operationId":"get_network_cache_stats_api_v1_cache_networks_stats_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NetworkCacheStatsResponse"}}}}}}},"/api/v1/cache/redis/plots":{"delete":{"tags":["cache"],"summary":"Clear Plot Cache","description":"Clear all plot caches","operationId":"clear_plot_cache_api_v1_cache_redis_plots_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClearCacheResponse"}}}}}}},"/api/v1/cache/redis/{network_id}":{"delete":{"tags":["cache"],"summary":"Clear Redis For Network","description":"Clear Redis cache for a specific network","operationId":"clear_redis_for_network_api_v1_cache_redis__network_id__delete","parameters":[{"name":"network_id","in":"path","required":true,"schema":{"type":"string","title":"Network Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClearCacheResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/cache/redis":{"delete":{"tags":["cache"],"summary":"Clear Redis Cache","description":"Clear all Redis cache","operationId":"clear_redis_cache_api_v1_cache_redis_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClearCacheResponse"}}}}}}},"/api/v1/cache/networks":{"delete":{"tags":["cache"],"summary":"Clear Network Cache","description":"Clear in-memory PyPSA network cache","operationId":"clear_network_cache_api_v1_cache_networks_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}}}}},"/api/v1/version/":{"get":{"tags":["version"],"summary":"Get Version","description":"Get PyPSA and application version information","operationId":"get_version_api_v1_version__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VersionResponse"}}}}}}},"/api/v1/tasks/status/{task_id}":{"get":{"tags":["tasks"],"summary":"Get Task Status","description":"Get status of any background Celery task.\n\nStates:\n- PENDING: Task is waiting to be processed\n- PROGRESS: Task is running (includes progress metadata)\n- SUCCESS: Task completed successfully\n- FAILURE: Task failed with error","operationId":"get_task_status_api_v1_tasks_status__task_id__get","parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskStatusResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/runs/backends":{"get":{"tags":["runs"],"summary":"List User Backends","description":"Return the backends available to the current user.","operationId":"list_user_backends_api_v1_runs_backends_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/BackendPublicResponse"},"type":"array","title":"Response List User Backends Api V1 Runs Backends Get"}}}}}}},"/api/v1/runs/":{"post":{"tags":["runs"],"summary":"Create Run","description":"Submit a new run.","operationId":"create_run_api_v1_runs__post","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunCreate"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["runs"],"summary":"List Runs","description":"List runs visible to the current user.","operationId":"list_runs_api_v1_runs__get","parameters":[{"name":"offset","in":"query","required":false,"schema":{"type":"integer","default":0,"title":"Offset"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","default":100,"title":"Limit"}},{"name":"sort_by","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Sort By"}},{"name":"sort_dir","in":"query","required":false,"schema":{"enum":["asc","desc"],"type":"string","default":"asc","title":"Sort Dir"}},{"name":"filter_q","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Filter Q"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunListResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/runs/{run_id}":{"get":{"tags":["runs"],"summary":"Get Run","description":"Get run detail.","operationId":"get_run_api_v1_runs__run_id__get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Run UUID","title":"Run Id"},"description":"Run UUID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"patch":{"tags":["runs"],"summary":"Update Run","description":"Update run properties. Only owner or admin can update.","operationId":"update_run_api_v1_runs__run_id__patch","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Run UUID","title":"Run Id"},"description":"Run UUID"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunUpdate"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["runs"],"summary":"Remove Run","description":"Remove a run, cancel if still active, and delete the DB row.","operationId":"remove_run_api_v1_runs__run_id__delete","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Run UUID","title":"Run Id"},"description":"Run UUID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/runs/{run_id}/logs":{"get":{"tags":["runs"],"summary":"Stream Run Logs","description":"Stream live logs via SSE, or plain text with ?format=text.","operationId":"stream_run_logs_api_v1_runs__run_id__logs_get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Run UUID","title":"Run Id"},"description":"Run UUID"},{"name":"format","in":"query","required":false,"schema":{"anyOf":[{"const":"text","type":"string"},{"type":"null"}],"description":"'text' for plain text logs","title":"Format"},"description":"'text' for plain text logs"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/runs/{run_id}/workflow":{"get":{"tags":["runs"],"summary":"Get Run Workflow","description":"Get workflow metadata (DAG, rules, jobs, errors) for a run.","operationId":"get_run_workflow_api_v1_runs__run_id__workflow_get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Run UUID","title":"Run Id"},"description":"Run UUID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","additionalProperties":true,"title":"Response Get Run Workflow Api V1 Runs  Run Id  Workflow Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/runs/{run_id}/outputs":{"get":{"tags":["runs"],"summary":"List Run Outputs","description":"List output files for a completed run.","operationId":"list_run_outputs_api_v1_runs__run_id__outputs_get","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Run UUID","title":"Run Id"},"description":"Run UUID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/OutputFileResponse"},"title":"Response List Run Outputs Api V1 Runs  Run Id  Outputs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/runs/{run_id}/outputs/{path}":{"get":{"tags":["runs"],"summary":"Download Run Output","description":"Download an output file, or display inline with ?format=text.","operationId":"download_run_output_api_v1_runs__run_id__outputs__path__get","parameters":[{"name":"path","in":"path","required":true,"schema":{"type":"string","description":"File path relative to work directory","title":"Path"},"description":"File path relative to work directory"},{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Run UUID","title":"Run Id"},"description":"Run UUID"},{"name":"format","in":"query","required":false,"schema":{"anyOf":[{"const":"text","type":"string"},{"type":"null"}],"description":"'text' for inline plain text","title":"Format"},"description":"'text' for inline plain text"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v1/runs/{run_id}/cancel":{"post":{"tags":["runs"],"summary":"Cancel Run","description":"Cancel a running run. Keeps the record visible.","operationId":"cancel_run_api_v1_runs__run_id__cancel_post","parameters":[{"name":"run_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","description":"Run UUID","title":"Run Id"},"description":"Run UUID"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MessageResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/health":{"get":{"summary":"Health Check","operationId":"health_check_health_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":true,"type":"object","title":"Response Health Check Health Get"}}}}}}}},"components":{"schemas":{"ApiKeyCreate":{"properties":{"name":{"type":"string","maxLength":255,"minLength":1,"title":"Name"},"expires_in_days":{"type":"integer","maximum":365.0,"exclusiveMinimum":0.0,"title":"Expires In Days"},"user_id":{"type":"string","format":"uuid","title":"User Id","description":"Bot user to link this API key to"}},"type":"object","required":["name","expires_in_days","user_id"],"title":"ApiKeyCreate"},"ApiKeyResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"key_prefix":{"type":"string","title":"Key Prefix"},"owner":{"$ref":"#/components/schemas/UserPublicResponse"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Used At"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Expires At"},"key":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Key"}},"type":"object","required":["id","name","key_prefix","owner","created_at","last_used_at","expires_at"],"title":"ApiKeyResponse"},"AuthProviderInfo":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"type":{"type":"string","title":"Type"},"login_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Login Url"},"icon":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Icon"}},"type":"object","required":["id","name","type"],"title":"AuthProviderInfo"},"AuthProvidersResponse":{"properties":{"providers":{"items":{"$ref":"#/components/schemas/AuthProviderInfo"},"type":"array","title":"Providers"}},"type":"object","required":["providers"],"title":"AuthProvidersResponse"},"BackendAssign":{"properties":{"backend_id":{"type":"string","format":"uuid","title":"Backend Id"}},"type":"object","required":["backend_id"],"title":"BackendAssign","description":"Request body for assigning a backend to a user."},"BackendPublicResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"is_active":{"type":"boolean","title":"Is Active"}},"type":"object","required":["id","name","is_active"],"title":"BackendPublicResponse","description":"Backend info visible to regular users (no internal URL)."},"BackendResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"is_active":{"type":"boolean","title":"Is Active"},"url":{"type":"string","title":"Url"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Updated At"}},"type":"object","required":["id","name","is_active","url","created_at"],"title":"BackendResponse","description":"Full backend info for admin endpoints."},"CachedNetworkEntry":{"properties":{"file_path":{"type":"string","title":"File Path"},"cached_at":{"type":"string","title":"Cached At"}},"type":"object","required":["file_path","cached_at"],"title":"CachedNetworkEntry"},"ClearCacheResponse":{"properties":{"message":{"type":"string","title":"Message"},"deleted_keys":{"type":"integer","title":"Deleted Keys"}},"type":"object","required":["message","deleted_keys"],"title":"ClearCacheResponse"},"ComponentDataResponse":{"properties":{"component":{"type":"string","title":"Component"},"columns":{"items":{"type":"string"},"type":"array","title":"Columns"},"dtypes":{"additionalProperties":{"type":"string"},"type":"object","title":"Dtypes"},"index":{"items":{"type":"string"},"type":"array","title":"Index"},"data":{"items":{"items":{},"type":"array"},"type":"array","title":"Data"},"total":{"type":"integer","title":"Total"},"offset":{"type":"integer","title":"Offset"},"limit":{"type":"integer","title":"Limit"}},"type":"object","required":["component","columns","dtypes","index","data","total","offset","limit"],"title":"ComponentDataResponse"},"DimensionInfo":{"properties":{"count":{"type":"integer","title":"Count"},"start":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Start"},"end":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"End"},"freq":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Freq"}},"type":"object","required":["count"],"title":"DimensionInfo"},"DimensionsInfo":{"properties":{"timesteps":{"$ref":"#/components/schemas/DimensionInfo"},"periods":{"$ref":"#/components/schemas/DimensionInfo"},"scenarios":{"$ref":"#/components/schemas/DimensionInfo"}},"type":"object","required":["timesteps","periods","scenarios"],"title":"DimensionsInfo"},"ExploreRequest":{"properties":{"network_id":{"type":"string","title":"Network Id","description":"Network UUID"},"branch_components":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Branch Components","description":"Branch types to display (Line, Link, Transformer, Process)"},"geometry":{"type":"boolean","title":"Geometry","description":"Use line geometries instead of straight lines","default":false}},"type":"object","required":["network_id"],"title":"ExploreRequest","description":"Request schema for interactive map via n.plot.explore()"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"ListMeta":{"properties":{"total":{"type":"integer","title":"Total"},"offset":{"type":"integer","title":"Offset"},"limit":{"type":"integer","title":"Limit"},"count":{"type":"integer","title":"Count"}},"type":"object","required":["total","offset","limit","count"],"title":"ListMeta","description":"List endpoint metadata: pagination offsets and counts."},"MessageResponse":{"properties":{"message":{"type":"string","title":"Message"}},"type":"object","required":["message"],"title":"MessageResponse"},"NetworkAdminUpdate":{"properties":{"visibility":{"anyOf":[{"$ref":"#/components/schemas/Visibility"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"user_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"User Id"}},"type":"object","title":"NetworkAdminUpdate","description":"Admin-only fields"},"NetworkCacheStatsResponse":{"properties":{"size":{"type":"integer","title":"Size"},"max_size":{"type":"integer","title":"Max Size"},"ttl_seconds":{"type":"integer","title":"Ttl Seconds"},"hits":{"type":"integer","title":"Hits"},"misses":{"type":"integer","title":"Misses"},"hit_rate_percent":{"type":"number","title":"Hit Rate Percent"},"cached_networks":{"items":{"$ref":"#/components/schemas/CachedNetworkEntry"},"type":"array","title":"Cached Networks"}},"type":"object","required":["size","max_size","ttl_seconds","hits","misses","hit_rate_percent","cached_networks"],"title":"NetworkCacheStatsResponse"},"NetworkListMeta":{"properties":{"total":{"type":"integer","title":"Total"},"offset":{"type":"integer","title":"Offset"},"limit":{"type":"integer","title":"Limit"},"count":{"type":"integer","title":"Count"},"owners":{"anyOf":[{"items":{"$ref":"#/components/schemas/UserPublicResponse"},"type":"array"},{"type":"null"}],"title":"Owners"}},"type":"object","required":["total","offset","limit","count"],"title":"NetworkListMeta","description":"Extended pagination meta with network-specific fields"},"NetworkListResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/NetworkResponse"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/NetworkListMeta"}},"type":"object","required":["data","meta"],"title":"NetworkListResponse"},"NetworkResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"update_history":{"anyOf":[{"items":{},"type":"array"},{"type":"null"}],"title":"Update History"},"filename":{"type":"string","title":"Filename"},"file_size":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"File Size"},"file_hash":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Hash"},"is_external":{"type":"boolean","title":"Is External","default":false},"file_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"File Path"},"file_missing":{"type":"boolean","title":"File Missing","default":false},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"dimensions":{"anyOf":[{"$ref":"#/components/schemas/DimensionsInfo"},{"type":"null"}]},"components_count":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Components Count"},"meta":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Meta"},"facets":{"anyOf":[{"additionalProperties":true,"type":"object"},{"type":"null"}],"title":"Facets"},"visibility":{"$ref":"#/components/schemas/Visibility","default":"private"},"owner":{"$ref":"#/components/schemas/UserPublicResponse"},"source_run_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Source Run Id"},"tags":{"anyOf":[{"items":{"anyOf":[{"type":"string"},{"additionalProperties":true,"type":"object"}]},"type":"array"},{"type":"null"}],"title":"Tags"}},"type":"object","required":["id","created_at","filename","owner"],"title":"NetworkResponse","description":"Network API response"},"NetworkUpdate":{"properties":{"visibility":{"anyOf":[{"$ref":"#/components/schemas/Visibility"},{"type":"null"}]},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"}},"type":"object","title":"NetworkUpdate","description":"Fields any network owner can update"},"OutputFileResponse":{"properties":{"path":{"type":"string","title":"Path"},"size":{"type":"integer","title":"Size"}},"type":"object","required":["path","size"],"title":"OutputFileResponse","description":"Single output file entry."},"PasswordLoginRequest":{"properties":{"email":{"type":"string","format":"email","title":"Email"},"password":{"type":"string","maxLength":128,"minLength":1,"title":"Password"}},"type":"object","required":["email","password"],"title":"PasswordLoginRequest"},"PlotParams":{"properties":{"network_ids":{"items":{"type":"string"},"type":"array","title":"Network Ids","description":"List of network UUIDs (single or multiple)"},"statistic":{"type":"string","title":"Statistic","description":"Statistics method to call"},"parameters":{"additionalProperties":true,"type":"object","title":"Parameters","description":"Parameters for the statistics method"},"plot_type":{"type":"string","title":"Plot Type","description":"Plot method (e.g., 'bar', 'area', 'line')"}},"type":"object","required":["network_ids","statistic","plot_type"],"title":"PlotParams","description":"Request schema for plot generation (extends StatisticsParams with plot_type)"},"PublicRunResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"status":{"$ref":"#/components/schemas/RunStatus"},"workflow":{"type":"string","title":"Workflow"},"configfile":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Configfile"},"git_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Git Ref"},"git_sha":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Git Sha"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"total_job_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Job Count"},"jobs_finished":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Jobs Finished"},"visibility":{"$ref":"#/components/schemas/Visibility"},"owner":{"$ref":"#/components/schemas/UserPublicResponse"},"backend":{"$ref":"#/components/schemas/BackendPublicResponse"},"networks":{"items":{"$ref":"#/components/schemas/RunNetworkSummary"},"type":"array","title":"Networks"}},"type":"object","required":["id","status","workflow","created_at","visibility","owner","backend","networks"],"title":"PublicRunResponse"},"RedisStatsResponse":{"properties":{"available":{"type":"boolean","title":"Available"},"total_keys":{"type":"integer","title":"Total Keys"},"keys_by_type":{"additionalProperties":{"type":"integer"},"type":"object","title":"Keys By Type"},"memory_used":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Memory Used"}},"type":"object","required":["available","total_keys","keys_by_type"],"title":"RedisStatsResponse"},"ReportCard":{"properties":{"id":{"type":"string","title":"Id"},"type":{"type":"string","title":"Type"},"x":{"type":"integer","title":"X"},"y":{"type":"integer","title":"Y"},"w":{"type":"integer","title":"W"},"h":{"type":"integer","title":"H"}},"additionalProperties":true,"type":"object","required":["id","type","x","y","w","h"],"title":"ReportCard"},"ReportSchema":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"cards":{"items":{"$ref":"#/components/schemas/ReportCard"},"type":"array","title":"Cards"},"isDefault":{"type":"boolean","title":"Isdefault","default":false}},"type":"object","required":["id","name","cards"],"title":"ReportSchema"},"ReportsPayload":{"properties":{"reports":{"items":{"$ref":"#/components/schemas/ReportSchema"},"type":"array","title":"Reports"},"activeReportId":{"type":"string","title":"Activereportid"}},"type":"object","required":["reports","activeReportId"],"title":"ReportsPayload"},"RunAdminUpdate":{"properties":{"visibility":{"anyOf":[{"$ref":"#/components/schemas/Visibility"},{"type":"null"}]},"user_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"User Id"}},"type":"object","title":"RunAdminUpdate"},"RunCache":{"properties":{"key":{"type":"string","title":"Key","description":"Cache identifier. Runs sharing a key reuse each other's cached directories."},"dirs":{"items":{"type":"string"},"type":"array","title":"Dirs","description":"Directories to cache (e.g. `./data`)."}},"type":"object","required":["key","dirs"],"title":"RunCache","description":"Cache configuration for a run."},"RunCreate":{"properties":{"workflow":{"type":"string","title":"Workflow","description":"Git URL of the Snakemake workflow repository to clone and run."},"git_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Git Ref","description":"Git branch, tag, or commit SHA to check out. Defaults to the repository's default branch."},"configfile":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Configfile","description":"Path to a Snakemake config file in the workflow repo."},"snakemake_args":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Snakemake Args","description":"Additional snakemake arguments appended to the backend's execution defaults. No need to pass own execution defaults like `--cores` or `--profile`."},"extra_files":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Extra Files","description":"Files written into the working directory before execution. Keys are repo-relative paths, values are file contents."},"env_vars":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Env Vars","description":"Environment variables set before execution. Keys are variable names, values are their contents."},"cache":{"anyOf":[{"$ref":"#/components/schemas/RunCache"},{"type":"null"}],"description":"Optional cache. Restores `dirs` from a previous run with the same `key` before launch, saves them back on success."},"import_networks":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Import Networks","description":"Paths of `.nc` output files to import as networks after the run completes."},"backend_id":{"anyOf":[{"type":"string","format":"uuid"},{"type":"null"}],"title":"Backend Id","description":"Snakedispatch backend that executes this run. Required when more than one backend is active."},"visibility":{"$ref":"#/components/schemas/Visibility","description":"Who can see this run. Public runs are visible to all logged-in users. Private runs only to you.","default":"private"},"callback_url":{"anyOf":[{"type":"string","maxLength":2083,"minLength":1,"format":"uri"},{"type":"null"}],"title":"Callback Url","description":"Webhook invoked when the run finishes. Host must match the allowed callback domains setting."}},"type":"object","required":["workflow"],"title":"RunCreate","description":"POST /runs request body."},"RunListMeta":{"properties":{"total":{"type":"integer","title":"Total"},"offset":{"type":"integer","title":"Offset"},"limit":{"type":"integer","title":"Limit"},"count":{"type":"integer","title":"Count"},"statuses":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Statuses"},"workflows":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Workflows"},"owners":{"anyOf":[{"items":{"$ref":"#/components/schemas/UserPublicResponse"},"type":"array"},{"type":"null"}],"title":"Owners"},"git_refs":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Git Refs"},"configfiles":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Configfiles"},"backends":{"anyOf":[{"items":{"$ref":"#/components/schemas/BackendPublicResponse"},"type":"array"},{"type":"null"}],"title":"Backends"}},"type":"object","required":["total","offset","limit","count"],"title":"RunListMeta","description":"Extended pagination meta with run-specific filter options."},"RunListResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/RunSummary"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/RunListMeta"}},"type":"object","required":["data","meta"],"title":"RunListResponse"},"RunNetworkSummary":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Name"},"filename":{"type":"string","title":"Filename"},"source_path":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Source Path"}},"type":"object","required":["id","filename"],"title":"RunNetworkSummary","description":"Lightweight summary of a network imported by a run."},"RunResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"status":{"$ref":"#/components/schemas/RunStatus"},"owner":{"$ref":"#/components/schemas/UserPublicResponse"},"visibility":{"$ref":"#/components/schemas/Visibility","default":"private"},"backend":{"$ref":"#/components/schemas/BackendPublicResponse"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"workflow":{"type":"string","title":"Workflow"},"configfile":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Configfile"},"git_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Git Ref"},"git_sha":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Git Sha"},"total_job_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Job Count"},"jobs_finished":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Jobs Finished"},"snakemake_args":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Snakemake Args"},"extra_files":{"anyOf":[{"additionalProperties":{"type":"string"},"type":"object"},{"type":"null"}],"title":"Extra Files"},"cache":{"anyOf":[{"$ref":"#/components/schemas/RunCache"},{"type":"null"}]},"import_networks":{"anyOf":[{"items":{"type":"string"},"type":"array"},{"type":"null"}],"title":"Import Networks"},"callback_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Callback Url"},"networks":{"items":{"$ref":"#/components/schemas/RunNetworkSummary"},"type":"array","title":"Networks","default":[]}},"type":"object","required":["id","status","owner","backend","created_at","workflow"],"title":"RunResponse","description":"Full run detail returned by the API."},"RunStatus":{"type":"string","enum":["PENDING","SETUP","RUNNING","UPLOADING","COMPLETED","FAILED","ERROR","CANCELLED"],"title":"RunStatus","description":"Run status, mirrors Snakedispatch's JobStatus."},"RunSummary":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"status":{"$ref":"#/components/schemas/RunStatus"},"owner":{"$ref":"#/components/schemas/UserPublicResponse"},"visibility":{"$ref":"#/components/schemas/Visibility","default":"private"},"backend":{"$ref":"#/components/schemas/BackendPublicResponse"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"started_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Started At"},"completed_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Completed At"},"workflow":{"type":"string","title":"Workflow"},"configfile":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Configfile"},"git_ref":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Git Ref"},"git_sha":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Git Sha"},"total_job_count":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total Job Count"},"jobs_finished":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Jobs Finished"}},"type":"object","required":["id","status","owner","backend","created_at","workflow"],"title":"RunSummary","description":"Lightweight run representation for list endpoints."},"RunUpdate":{"properties":{"visibility":{"anyOf":[{"$ref":"#/components/schemas/Visibility"},{"type":"null"}]}},"type":"object","title":"RunUpdate"},"StatisticsParams":{"properties":{"network_ids":{"items":{"type":"string"},"type":"array","title":"Network Ids","description":"List of network UUIDs (single or multiple)"},"statistic":{"type":"string","title":"Statistic","description":"Statistics method to call"},"parameters":{"additionalProperties":true,"type":"object","title":"Parameters","description":"Parameters for the statistics method"}},"type":"object","required":["network_ids","statistic"],"title":"StatisticsParams","description":"Request for statistics data\n\nFor single network: Maps to Network.statistics.<statistic>(<parameters>)\nFor multiple networks:\n    Maps to NetworkCollection.statistics.<statistic>(<parameters>)"},"TaskQueuedResponse":{"properties":{"task_id":{"type":"string","title":"Task Id"},"status_url":{"type":"string","title":"Status Url"},"message":{"type":"string","title":"Message","default":"Task queued. Poll status_url for results."}},"type":"object","required":["task_id","status_url"],"title":"TaskQueuedResponse","description":"Response when a task is queued"},"TaskStatusResponse":{"properties":{"task_id":{"type":"string","title":"Task Id"},"state":{"type":"string","enum":["PENDING","PROGRESS","SUCCESS","FAILURE"],"title":"State"},"message":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Message"},"current":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Current"},"total":{"anyOf":[{"type":"integer"},{"type":"null"}],"title":"Total"},"result":{"anyOf":[{},{"type":"null"}],"title":"Result"},"error":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Error"}},"type":"object","required":["task_id","state"],"title":"TaskStatusResponse","description":"Response when polling task status"},"UserBackendAssign":{"properties":{"user_id":{"type":"string","format":"uuid","title":"User Id"}},"type":"object","required":["user_id"],"title":"UserBackendAssign","description":"Request body for assigning a user to a backend."},"UserCreate":{"properties":{"username":{"type":"string","maxLength":255,"minLength":1,"title":"Username"},"role":{"$ref":"#/components/schemas/UserRole"},"avatar_url":{"anyOf":[{"type":"string","maxLength":512},{"type":"null"}],"title":"Avatar Url"}},"type":"object","required":["username","role"],"title":"UserCreate","description":"Request body for creating a user"},"UserListResponse":{"properties":{"data":{"items":{"$ref":"#/components/schemas/UserResponse"},"type":"array","title":"Data"},"meta":{"$ref":"#/components/schemas/ListMeta"}},"type":"object","required":["data","meta"],"title":"UserListResponse","description":"Paginated list of users"},"UserPublicResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"username":{"type":"string","title":"Username"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"}},"type":"object","required":["id","username"],"title":"UserPublicResponse","description":"Minimal public user info for embedding in other responses"},"UserResponse":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"username":{"type":"string","title":"Username"},"avatar_url":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Avatar Url"},"email":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"Email"},"role":{"type":"string","title":"Role"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"last_login":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Login"},"permissions":{"items":{"type":"string"},"type":"array","title":"Permissions"}},"type":"object","required":["id","username","role","created_at","permissions"],"title":"UserResponse","description":"Full user information response"},"UserRole":{"type":"string","enum":["admin","user","bot","pending"],"title":"UserRole","description":"User roles for access control"},"UserRoleUpdate":{"properties":{"role":{"$ref":"#/components/schemas/UserRole"}},"type":"object","required":["role"],"title":"UserRoleUpdate","description":"Request body for role update"},"UserStatsResponse":{"properties":{"networks_count":{"type":"integer","title":"Networks Count"},"runs_total":{"type":"integer","title":"Runs Total"},"runs_by_status":{"additionalProperties":{"type":"integer"},"type":"object","title":"Runs By Status"},"runs_by_backend":{"additionalProperties":{"type":"integer"},"type":"object","title":"Runs By Backend"},"total_storage_bytes":{"type":"integer","title":"Total Storage Bytes"},"last_activity":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Last Activity"}},"type":"object","required":["networks_count","runs_total","runs_by_status","runs_by_backend","total_storage_bytes","last_activity"],"title":"UserStatsResponse","description":"Aggregated activity stats for a single user."},"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"},"VersionResponse":{"properties":{"version":{"type":"string","title":"Version"},"pypsa_version":{"type":"string","title":"Pypsa Version"},"local_mode":{"type":"boolean","title":"Local Mode"},"demo_mode":{"type":"boolean","title":"Demo Mode"},"runs_enabled":{"type":"boolean","title":"Runs Enabled"}},"type":"object","required":["version","pypsa_version","local_mode","demo_mode","runs_enabled"],"title":"VersionResponse"},"Visibility":{"type":"string","enum":["public","private"],"title":"Visibility","description":"Resource visibility options for access control"}}}}