diff --git a/docs/api-ref/alerts/assign-alert.mdx b/docs/api-ref/alerts/assign-alert.mdx new file mode 100644 index 000000000..4195b278d --- /dev/null +++ b/docs/api-ref/alerts/assign-alert.mdx @@ -0,0 +1,3 @@ +--- +openapi: post /alerts/{fingerprint}/assign/{last_received} +--- \ No newline at end of file diff --git a/docs/api-ref/alerts/delete-alert.mdx b/docs/api-ref/alerts/delete-alert.mdx new file mode 100644 index 000000000..eaa7465af --- /dev/null +++ b/docs/api-ref/alerts/delete-alert.mdx @@ -0,0 +1,3 @@ +--- +openapi: delete /alerts +--- \ No newline at end of file diff --git a/docs/api-ref/alerts/enrich-alert.mdx b/docs/api-ref/alerts/enrich-alert.mdx new file mode 100644 index 000000000..6f700169e --- /dev/null +++ b/docs/api-ref/alerts/enrich-alert.mdx @@ -0,0 +1,3 @@ +--- +openapi: post /alerts/enrich +--- \ No newline at end of file diff --git a/docs/api-ref/alerts/get-alert-history.mdx b/docs/api-ref/alerts/get-alert-history.mdx new file mode 100644 index 000000000..6d5c17749 --- /dev/null +++ b/docs/api-ref/alerts/get-alert-history.mdx @@ -0,0 +1,3 @@ +--- +openapi: get /alerts/{fingerprint}/history +--- \ No newline at end of file diff --git a/docs/api-ref/alerts/get-alert.mdx b/docs/api-ref/alerts/get-alert.mdx new file mode 100644 index 000000000..d293028b0 --- /dev/null +++ b/docs/api-ref/alerts/get-alert.mdx @@ -0,0 +1,3 @@ +--- +openapi: get /alerts/{fingerprint} +--- \ No newline at end of file diff --git a/docs/api-ref/alerts/get-all-alerts.mdx b/docs/api-ref/alerts/get-all-alerts.mdx new file mode 100644 index 000000000..b425ccc40 --- /dev/null +++ b/docs/api-ref/alerts/get-all-alerts.mdx @@ -0,0 +1,3 @@ +--- +openapi: get /alerts +--- \ No newline at end of file diff --git a/docs/api-ref/alerts/receive-generic-event.mdx b/docs/api-ref/alerts/receive-generic-event.mdx new file mode 100644 index 000000000..ca8fbf014 --- /dev/null +++ b/docs/api-ref/alerts/receive-generic-event.mdx @@ -0,0 +1,3 @@ +--- +openapi: post /alerts/event +--- \ No newline at end of file diff --git a/docs/api-ref/alerts/search-alerts.mdx b/docs/api-ref/alerts/search-alerts.mdx new file mode 100644 index 000000000..1b5f4f4ed --- /dev/null +++ b/docs/api-ref/alerts/search-alerts.mdx @@ -0,0 +1,3 @@ +--- +openapi: post /alerts/search +--- \ No newline at end of file diff --git a/docs/api-ref/enrichment/create-extraction-rule.mdx b/docs/api-ref/enrichment/create-extraction-rule.mdx new file mode 100644 index 000000000..235f1589f --- /dev/null +++ b/docs/api-ref/enrichment/create-extraction-rule.mdx @@ -0,0 +1,3 @@ +--- +openapi: post /extraction +--- \ No newline at end of file diff --git a/docs/api-ref/enrichment/create-rule.mdx b/docs/api-ref/enrichment/create-rule.mdx new file mode 100644 index 000000000..6994f6aab --- /dev/null +++ b/docs/api-ref/enrichment/create-rule.mdx @@ -0,0 +1,3 @@ +--- +openapi: post /mapping +--- \ No newline at end of file diff --git a/docs/api-ref/enrichment/delete-extraction-rule.mdx b/docs/api-ref/enrichment/delete-extraction-rule.mdx new file mode 100644 index 000000000..fc9571b0e --- /dev/null +++ b/docs/api-ref/enrichment/delete-extraction-rule.mdx @@ -0,0 +1,3 @@ +--- +openapi: delete /extraction/{rule_id} +--- \ No newline at end of file diff --git a/docs/api-ref/enrichment/delete-rule.mdx b/docs/api-ref/enrichment/delete-rule.mdx new file mode 100644 index 000000000..4a7a1c386 --- /dev/null +++ b/docs/api-ref/enrichment/delete-rule.mdx @@ -0,0 +1,3 @@ +--- +openapi: delete /mapping/{rule_id} +--- \ No newline at end of file diff --git a/docs/api-ref/enrichment/get-extraction-rules.mdx b/docs/api-ref/enrichment/get-extraction-rules.mdx new file mode 100644 index 000000000..619c38eca --- /dev/null +++ b/docs/api-ref/enrichment/get-extraction-rules.mdx @@ -0,0 +1,3 @@ +--- +openapi: get /extraction +--- \ No newline at end of file diff --git a/docs/api-ref/enrichment/get-rules.mdx b/docs/api-ref/enrichment/get-rules.mdx new file mode 100644 index 000000000..b1ac11c0b --- /dev/null +++ b/docs/api-ref/enrichment/get-rules.mdx @@ -0,0 +1,3 @@ +--- +openapi: get /mapping +--- \ No newline at end of file diff --git a/docs/api-ref/enrichment/update-extraction-rule.mdx b/docs/api-ref/enrichment/update-extraction-rule.mdx new file mode 100644 index 000000000..3b0dfcc7d --- /dev/null +++ b/docs/api-ref/enrichment/update-extraction-rule.mdx @@ -0,0 +1,3 @@ +--- +openapi: put /extraction/{rule_id} +--- \ No newline at end of file diff --git a/docs/api-ref/enrichment/update-rule.mdx b/docs/api-ref/enrichment/update-rule.mdx new file mode 100644 index 000000000..842be2e45 --- /dev/null +++ b/docs/api-ref/enrichment/update-rule.mdx @@ -0,0 +1,3 @@ +--- +openapi: put /mapping +--- \ No newline at end of file diff --git a/docs/api-ref/groups/get-groups.mdx b/docs/api-ref/groups/get-groups.mdx new file mode 100644 index 000000000..c7d6e3113 --- /dev/null +++ b/docs/api-ref/groups/get-groups.mdx @@ -0,0 +1,3 @@ +--- +openapi: get /groups/ +--- \ No newline at end of file diff --git a/docs/api-ref/preset/create-preset.mdx b/docs/api-ref/preset/create-preset.mdx new file mode 100644 index 000000000..8925cb323 --- /dev/null +++ b/docs/api-ref/preset/create-preset.mdx @@ -0,0 +1,3 @@ +--- +openapi: post /preset +--- \ No newline at end of file diff --git a/docs/api-ref/preset/delete-preset.mdx b/docs/api-ref/preset/delete-preset.mdx new file mode 100644 index 000000000..9e770eab0 --- /dev/null +++ b/docs/api-ref/preset/delete-preset.mdx @@ -0,0 +1,3 @@ +--- +openapi: delete /preset/{uuid} +--- \ No newline at end of file diff --git a/docs/api-ref/preset/get-presets.mdx b/docs/api-ref/preset/get-presets.mdx new file mode 100644 index 000000000..33c3d5aea --- /dev/null +++ b/docs/api-ref/preset/get-presets.mdx @@ -0,0 +1,3 @@ +--- +openapi: get /preset +--- \ No newline at end of file diff --git a/docs/api-ref/preset/update-preset.mdx b/docs/api-ref/preset/update-preset.mdx new file mode 100644 index 000000000..669be7d4c --- /dev/null +++ b/docs/api-ref/preset/update-preset.mdx @@ -0,0 +1,3 @@ +--- +openapi: put /preset/{uuid} +--- \ No newline at end of file diff --git a/docs/api-ref/providers/get-installed-providers.mdx b/docs/api-ref/providers/get-installed-providers.mdx new file mode 100644 index 000000000..4de9cceb2 --- /dev/null +++ b/docs/api-ref/providers/get-installed-providers.mdx @@ -0,0 +1,3 @@ +--- +openapi: get /providers/export +--- \ No newline at end of file diff --git a/docs/api-ref/providers/install-provider-oauth2.mdx b/docs/api-ref/providers/install-provider-oauth2.mdx new file mode 100644 index 000000000..3eb4a90fb --- /dev/null +++ b/docs/api-ref/providers/install-provider-oauth2.mdx @@ -0,0 +1,3 @@ +--- +openapi: post /providers/install/oauth2/{provider_type} +--- \ No newline at end of file diff --git a/docs/api-ref/providers/invoke-provider-method.mdx b/docs/api-ref/providers/invoke-provider-method.mdx new file mode 100644 index 000000000..e80c49497 --- /dev/null +++ b/docs/api-ref/providers/invoke-provider-method.mdx @@ -0,0 +1,3 @@ +--- +openapi: post /providers/{provider_id}/invoke/{method} +--- \ No newline at end of file diff --git a/docs/api-ref/providers/update-provider.mdx b/docs/api-ref/providers/update-provider.mdx new file mode 100644 index 000000000..1ee02f7ed --- /dev/null +++ b/docs/api-ref/providers/update-provider.mdx @@ -0,0 +1,3 @@ +--- +openapi: put /providers/{provider_id} +--- \ No newline at end of file diff --git a/docs/api-ref/providers/validate-provider-scopes.mdx b/docs/api-ref/providers/validate-provider-scopes.mdx new file mode 100644 index 000000000..64b6e5854 --- /dev/null +++ b/docs/api-ref/providers/validate-provider-scopes.mdx @@ -0,0 +1,3 @@ +--- +openapi: post /providers/{provider_id}/scopes +--- \ No newline at end of file diff --git a/docs/api-ref/pusher/pusher-authentication.mdx b/docs/api-ref/pusher/pusher-authentication.mdx new file mode 100644 index 000000000..ed9c2b39b --- /dev/null +++ b/docs/api-ref/pusher/pusher-authentication.mdx @@ -0,0 +1,3 @@ +--- +openapi: post /pusher/auth +--- \ No newline at end of file diff --git a/docs/api-ref/rules/create-rule.mdx b/docs/api-ref/rules/create-rule.mdx new file mode 100644 index 000000000..11c79981e --- /dev/null +++ b/docs/api-ref/rules/create-rule.mdx @@ -0,0 +1,3 @@ +--- +openapi: post /rules +--- \ No newline at end of file diff --git a/docs/api-ref/rules/delete-rule.mdx b/docs/api-ref/rules/delete-rule.mdx new file mode 100644 index 000000000..66eb16654 --- /dev/null +++ b/docs/api-ref/rules/delete-rule.mdx @@ -0,0 +1,3 @@ +--- +openapi: delete /rules/{rule_id} +--- \ No newline at end of file diff --git a/docs/api-ref/rules/get-rules.mdx b/docs/api-ref/rules/get-rules.mdx new file mode 100644 index 000000000..44e0acce0 --- /dev/null +++ b/docs/api-ref/rules/get-rules.mdx @@ -0,0 +1,3 @@ +--- +openapi: get /rules +--- \ No newline at end of file diff --git a/docs/api-ref/rules/update-rule.mdx b/docs/api-ref/rules/update-rule.mdx new file mode 100644 index 000000000..1e5125d5f --- /dev/null +++ b/docs/api-ref/rules/update-rule.mdx @@ -0,0 +1,3 @@ +--- +openapi: put /rules/{rule_id} +--- \ No newline at end of file diff --git a/docs/api-ref/settings/create-key.mdx b/docs/api-ref/settings/create-key.mdx new file mode 100644 index 000000000..c6928f71e --- /dev/null +++ b/docs/api-ref/settings/create-key.mdx @@ -0,0 +1,3 @@ +--- +openapi: post /settings/apikey +--- \ No newline at end of file diff --git a/docs/api-ref/settings/create-user.mdx b/docs/api-ref/settings/create-user.mdx new file mode 100644 index 000000000..aa2658e3e --- /dev/null +++ b/docs/api-ref/settings/create-user.mdx @@ -0,0 +1,3 @@ +--- +openapi: post /settings/users +--- \ No newline at end of file diff --git a/docs/api-ref/settings/delete-api-key.mdx b/docs/api-ref/settings/delete-api-key.mdx new file mode 100644 index 000000000..ed21cb1bc --- /dev/null +++ b/docs/api-ref/settings/delete-api-key.mdx @@ -0,0 +1,3 @@ +--- +openapi: delete /settings/apikey/{keyId} +--- \ No newline at end of file diff --git a/docs/api-ref/settings/delete-smtp-settings.mdx b/docs/api-ref/settings/delete-smtp-settings.mdx new file mode 100644 index 000000000..4df0259bd --- /dev/null +++ b/docs/api-ref/settings/delete-smtp-settings.mdx @@ -0,0 +1,3 @@ +--- +openapi: delete /settings/smtp +--- \ No newline at end of file diff --git a/docs/api-ref/settings/delete-user.mdx b/docs/api-ref/settings/delete-user.mdx new file mode 100644 index 000000000..807cb5357 --- /dev/null +++ b/docs/api-ref/settings/delete-user.mdx @@ -0,0 +1,3 @@ +--- +openapi: delete /settings/users/{user_email} +--- \ No newline at end of file diff --git a/docs/api-ref/settings/get-keys.mdx b/docs/api-ref/settings/get-keys.mdx new file mode 100644 index 000000000..4c8ca4e81 --- /dev/null +++ b/docs/api-ref/settings/get-keys.mdx @@ -0,0 +1,3 @@ +--- +openapi: get /settings/apikeys +--- \ No newline at end of file diff --git a/docs/api-ref/settings/get-smtp-settings.mdx b/docs/api-ref/settings/get-smtp-settings.mdx new file mode 100644 index 000000000..0f701924a --- /dev/null +++ b/docs/api-ref/settings/get-smtp-settings.mdx @@ -0,0 +1,3 @@ +--- +openapi: get /settings/smtp +--- \ No newline at end of file diff --git a/docs/api-ref/settings/get-users.mdx b/docs/api-ref/settings/get-users.mdx new file mode 100644 index 000000000..8381a37ef --- /dev/null +++ b/docs/api-ref/settings/get-users.mdx @@ -0,0 +1,3 @@ +--- +openapi: get /settings/users +--- \ No newline at end of file diff --git a/docs/api-ref/settings/test-smtp-settings.mdx b/docs/api-ref/settings/test-smtp-settings.mdx new file mode 100644 index 000000000..64cc998d6 --- /dev/null +++ b/docs/api-ref/settings/test-smtp-settings.mdx @@ -0,0 +1,3 @@ +--- +openapi: post /settings/smtp/test +--- \ No newline at end of file diff --git a/docs/api-ref/settings/update-api-key.mdx b/docs/api-ref/settings/update-api-key.mdx new file mode 100644 index 000000000..fbd612468 --- /dev/null +++ b/docs/api-ref/settings/update-api-key.mdx @@ -0,0 +1,3 @@ +--- +openapi: put /settings/apikey +--- \ No newline at end of file diff --git a/docs/api-ref/settings/update-smtp-settings.mdx b/docs/api-ref/settings/update-smtp-settings.mdx new file mode 100644 index 000000000..acf77b1fc --- /dev/null +++ b/docs/api-ref/settings/update-smtp-settings.mdx @@ -0,0 +1,3 @@ +--- +openapi: post /settings/smtp +--- \ No newline at end of file diff --git a/docs/api-ref/status/status.mdx b/docs/api-ref/status/status.mdx new file mode 100644 index 000000000..84b74c746 --- /dev/null +++ b/docs/api-ref/status/status.mdx @@ -0,0 +1,3 @@ +--- +openapi: get /status +--- \ No newline at end of file diff --git a/docs/api-ref/users/delete-user.mdx b/docs/api-ref/users/delete-user.mdx new file mode 100644 index 000000000..e9f610042 --- /dev/null +++ b/docs/api-ref/users/delete-user.mdx @@ -0,0 +1,3 @@ +--- +openapi: delete /users/{user_email} +--- \ No newline at end of file diff --git a/docs/api-ref/whoami/get-tenant-id.mdx b/docs/api-ref/whoami/get-tenant-id.mdx new file mode 100644 index 000000000..947dc6048 --- /dev/null +++ b/docs/api-ref/whoami/get-tenant-id.mdx @@ -0,0 +1,3 @@ +--- +openapi: get /whoami +--- \ No newline at end of file diff --git a/docs/api-ref/workflows/get-raw-workflow-by-id.mdx b/docs/api-ref/workflows/get-raw-workflow-by-id.mdx new file mode 100644 index 000000000..c7879fb42 --- /dev/null +++ b/docs/api-ref/workflows/get-raw-workflow-by-id.mdx @@ -0,0 +1,3 @@ +--- +openapi: get /workflows/{workflow_id}/raw +--- \ No newline at end of file diff --git a/docs/api-ref/workflows/get-workflow-executions-by-alert-fingerprint.mdx b/docs/api-ref/workflows/get-workflow-executions-by-alert-fingerprint.mdx new file mode 100644 index 000000000..8f5abbcf3 --- /dev/null +++ b/docs/api-ref/workflows/get-workflow-executions-by-alert-fingerprint.mdx @@ -0,0 +1,3 @@ +--- +openapi: get /workflows/executions +--- \ No newline at end of file diff --git a/docs/api-ref/workflows/get-workflow-executions.mdx b/docs/api-ref/workflows/get-workflow-executions.mdx new file mode 100644 index 000000000..654dfebdb --- /dev/null +++ b/docs/api-ref/workflows/get-workflow-executions.mdx @@ -0,0 +1,3 @@ +--- +openapi: get /workflows/executions/list +--- \ No newline at end of file diff --git a/docs/api-ref/workflows/run-workflow-from-definition.mdx b/docs/api-ref/workflows/run-workflow-from-definition.mdx new file mode 100644 index 000000000..f80b1b792 --- /dev/null +++ b/docs/api-ref/workflows/run-workflow-from-definition.mdx @@ -0,0 +1,3 @@ +--- +openapi: post /workflows/test +--- \ No newline at end of file diff --git a/docs/api-ref/workflows/update-workflow-by-id.mdx b/docs/api-ref/workflows/update-workflow-by-id.mdx new file mode 100644 index 000000000..2a8ffae2c --- /dev/null +++ b/docs/api-ref/workflows/update-workflow-by-id.mdx @@ -0,0 +1,3 @@ +--- +openapi: put /workflows/{workflow_id} +--- \ No newline at end of file diff --git a/docs/generate_readme_from_openapijson.sh b/docs/generate_readme_from_openapijson.sh new file mode 100644 index 000000000..0db8899be --- /dev/null +++ b/docs/generate_readme_from_openapijson.sh @@ -0,0 +1,8 @@ + +#!/bin/bash + +# Before running this script, make sure you have update the openapi.json from the backend, (/docs route) + +python3 openapi_converter.py --source ./openapi.json --dest ./openapi_converted.json +npx @mintlify/scraping@latest openapi-file ./openapi_converted.json -o ./api-ref +rm ./openapi_converted.json \ No newline at end of file diff --git a/docs/openapi.json b/docs/openapi.json index 03eff51a8..380a33002 100644 --- a/docs/openapi.json +++ b/docs/openapi.json @@ -1 +1 @@ -{"openapi":"3.0.2","info":{"title":"FastAPI","version":"0.1.0"},"paths":{"/providers":{"get":{"tags":["providers"],"summary":"Get Providers","operationId":"get_providers_providers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/providers/{provider_type}/{provider_id}/configured-alerts":{"get":{"tags":["providers"],"summary":"Get Alerts Configuration","description":"Get alerts configuration from a provider","operationId":"get_alerts_configuration_providers__provider_type___provider_id__configured_alerts_get","parameters":[{"required":true,"schema":{"title":"Provider Type","type":"string"},"name":"provider_type","in":"path"},{"required":true,"schema":{"title":"Provider Id","type":"string"},"name":"provider_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Get Alerts Configuration Providers Provider Type Provider Id Configured Alerts Get","type":"array","items":{}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]}]}},"/providers/{provider_type}/{provider_id}/logs":{"get":{"tags":["providers"],"summary":"Get Logs","description":"Get logs from a provider","operationId":"get_logs_providers__provider_type___provider_id__logs_get","parameters":[{"required":true,"schema":{"title":"Provider Type","type":"string"},"name":"provider_type","in":"path"},{"required":true,"schema":{"title":"Provider Id","type":"string"},"name":"provider_id","in":"path"},{"required":false,"schema":{"title":"Limit","type":"integer","default":5},"name":"limit","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Get Logs Providers Provider Type Provider Id Logs Get","type":"array","items":{}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]}]}},"/providers/{provider_type}/schema":{"get":{"tags":["providers"],"summary":"Get Alerts Schema","description":"Get the provider's API schema used to push alerts configuration","operationId":"get_alerts_schema_providers__provider_type__schema_get","parameters":[{"required":true,"schema":{"title":"Provider Type","type":"string"},"name":"provider_type","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Get Alerts Schema Providers Provider Type Schema Get","type":"object"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/providers/{provider_type}/{provider_id}/alerts":{"post":{"tags":["providers"],"summary":"Add Alert","description":"Push new alerts to the provider","operationId":"add_alert_providers__provider_type___provider_id__alerts_post","parameters":[{"required":true,"schema":{"title":"Provider Type","type":"string"},"name":"provider_type","in":"path"},{"required":true,"schema":{"title":"Provider Id","type":"string"},"name":"provider_id","in":"path"},{"required":false,"schema":{"title":"Alert Id","type":"string"},"name":"alert_id","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"title":"Alert","type":"object"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]}]}},"/providers/test":{"post":{"tags":["providers"],"summary":"Test Provider","description":"Test a provider's alert retrieval","operationId":"test_provider_providers_test_post","requestBody":{"content":{"application/json":{"schema":{"title":"Provider Info","type":"object"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/providers/{provider_type}/{provider_id}":{"delete":{"tags":["providers"],"summary":"Delete Provider","operationId":"delete_provider_providers__provider_type___provider_id__delete","parameters":[{"required":true,"schema":{"title":"Provider Type","type":"string"},"name":"provider_type","in":"path"},{"required":true,"schema":{"title":"Provider Id","type":"string"},"name":"provider_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/providers/install":{"post":{"tags":["providers"],"summary":"Install Provider","operationId":"install_provider_providers_install_post","requestBody":{"content":{"application/json":{"schema":{"title":"Provider Info","type":"object"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/providers/install/webhook/{provider_type}/{provider_id}":{"post":{"tags":["providers"],"summary":"Install Provider Webhook","operationId":"install_provider_webhook_providers_install_webhook__provider_type___provider_id__post","parameters":[{"required":true,"schema":{"title":"Provider Type","type":"string"},"name":"provider_type","in":"path"},{"required":true,"schema":{"title":"Provider Id","type":"string"},"name":"provider_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/providers/{provider_type}/webhook":{"get":{"tags":["providers"],"summary":"Get Webhook Settings","operationId":"get_webhook_settings_providers__provider_type__webhook_get","parameters":[{"required":true,"schema":{"title":"Provider Type","type":"string"},"name":"provider_type","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderWebhookSettings"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/healthcheck":{"get":{"tags":["healthcheck"],"summary":"Healthcheck","description":"simple healthcheck endpoint","operationId":"healthcheck_healthcheck_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Healthcheck Healthcheck Get","type":"object"}}}}}}},"/tenant/onboarded":{"get":{"tags":["tenant"],"summary":"Is Onboarded","description":"Check if a tenant is onboarded (meaning - installed github bot)","operationId":"is_onboarded_tenant_onboarded_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/tenant/github":{"post":{"tags":["tenant"],"summary":"Save Github Installation Id","operationId":"save_github_installation_id_tenant_github_post","responses":{"204":{"description":"Successful Response"}},"security":[{"OAuth2PasswordBearer":[]}]}},"/ai/create-alert":{"post":{"tags":["ai"],"summary":"Create Alert","operationId":"create_alert_ai_create_alert_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAlert"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Create Alert Ai Create Alert Post","type":"object"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]}]}},"/ai/repair-alert":{"post":{"tags":["ai"],"summary":"Repair Alert","operationId":"repair_alert_ai_repair_alert_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RepairAlert"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Repair Alert Ai Repair Alert Post","type":"object"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]}]}},"/alerts":{"get":{"tags":["alerts"],"summary":"Get Alerts","description":"Get alerts","operationId":"get_alerts_alerts_get","parameters":[{"required":false,"schema":{"title":"Provider Type","type":"string"},"name":"provider_type","in":"query"},{"required":false,"schema":{"title":"Provider Id","type":"string"},"name":"provider_id","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Get Alerts Alerts Get","type":"array","items":{"$ref":"#/components/schemas/AlertDto"}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/alerts/event/{provider_type}":{"post":{"tags":["alerts"],"summary":"Receive Event","description":"Receive an alert event from a provider","operationId":"receive_event_alerts_event__provider_type__post","parameters":[{"required":true,"schema":{"title":"Provider Type","type":"string"},"name":"provider_type","in":"path"},{"required":false,"schema":{"title":"Provider Id","type":"string"},"name":"provider_id","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Receive Event Alerts Event Provider Type Post","type":"object","additionalProperties":{"type":"string"}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]}]}},"/settings/webhook":{"get":{"tags":["settings"],"summary":"Webhook Settings","description":"Get details about the webhook endpoint (e.g. the API url and an API key)","operationId":"webhook_settings_settings_webhook_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSettings"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/workflows":{"get":{"tags":["workflows","alerts"],"summary":"Get Workflows","description":"Get workflows","operationId":"get_workflows_workflows_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Get Workflows Workflows Get","type":"array","items":{"$ref":"#/components/schemas/WorkflowDTO"}}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"post":{"tags":["workflows","alerts"],"summary":"Create Workflow","description":"Create a workflow","operationId":"create_workflow_workflows_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_create_workflow_workflows_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Create Workflow Workflows Post","type":"object"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/workflows/{workflow_id}/run":{"post":{"tags":["workflows","alerts"],"summary":"Run Workflow","description":"Run a workflow","operationId":"run_workflow_workflows__workflow_id__run_post","parameters":[{"required":true,"schema":{"title":"Workflow Id","type":"string"},"name":"workflow_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"title":"Body","type":"object"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Run Workflow Workflows Workflow Id Run Post","type":"object"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/workflows/{workflow_id}":{"get":{"tags":["workflows","alerts"],"summary":"Get Workflow By Id","description":"Get workflow executions by ID","operationId":"get_workflow_by_id_workflows__workflow_id__get","parameters":[{"required":true,"schema":{"title":"Workflow Id","type":"string"},"name":"workflow_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"title":"Response Get Workflow By Id Workflows Workflow Id Get","type":"array","items":{"$ref":"#/components/schemas/WorkflowExecutionDTO"}}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]},"delete":{"tags":["workflows","alerts"],"summary":"Delete Workflow By Id","description":"Delete workflow","operationId":"delete_workflow_by_id_workflows__workflow_id__delete","parameters":[{"required":true,"schema":{"title":"Workflow Id","type":"string"},"name":"workflow_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}},"/workflows/{workflow_id}/runs/{workflow_execution_id}":{"get":{"tags":["workflows","alerts"],"summary":"Get Workflow Execution Status","description":"Get a workflow execution status","operationId":"get_workflow_execution_status_workflows__workflow_id__runs__workflow_execution_id__get","parameters":[{"required":true,"schema":{"title":"Workflow Id","type":"string"},"name":"workflow_id","in":"path"},{"required":true,"schema":{"title":"Workflow Execution Id","type":"string"},"name":"workflow_execution_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowExecutionDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"OAuth2PasswordBearer":[]}]}}},"components":{"schemas":{"AlertDto":{"title":"AlertDto","required":["id","name","status","lastReceived"],"type":"object","properties":{"id":{"title":"Id","type":"string"},"name":{"title":"Name","type":"string"},"status":{"title":"Status","type":"string"},"lastReceived":{"title":"Lastreceived","type":"string"},"environment":{"title":"Environment","type":"string","default":"undefined"},"isDuplicate":{"title":"Isduplicate","type":"boolean"},"duplicateReason":{"title":"Duplicatereason","type":"string"},"service":{"title":"Service","type":"string"},"source":{"title":"Source","type":"array","items":{"type":"string"},"default":[]},"message":{"title":"Message","type":"string"},"description":{"title":"Description","type":"string"},"severity":{"title":"Severity","type":"string"},"fatigueMeter":{"title":"Fatiguemeter","type":"integer"},"pushed":{"title":"Pushed","type":"boolean","default":false},"event_id":{"title":"Event Id","type":"string"}}},"Body_create_workflow_workflows_post":{"title":"Body_create_workflow_workflows_post","required":["file"],"type":"object","properties":{"file":{"title":"File","type":"string","format":"binary"}}},"CreateAlert":{"title":"CreateAlert","required":["alert","provider_type"],"type":"object","properties":{"alert":{"title":"Alert","type":"string"},"provider_type":{"title":"Provider Type","type":"string"},"provider_id":{"title":"Provider Id","type":"string"},"repository_context":{"title":"Repository Context","type":"object","default":{}}}},"HTTPValidationError":{"title":"HTTPValidationError","type":"object","properties":{"detail":{"title":"Detail","type":"array","items":{"$ref":"#/components/schemas/ValidationError"}}}},"ProviderDTO":{"title":"ProviderDTO","required":["type","name","installed"],"type":"object","properties":{"type":{"title":"Type","type":"string"},"id":{"title":"Id","type":"string"},"name":{"title":"Name","type":"string"},"installed":{"title":"Installed","type":"boolean"}}},"ProviderWebhookSettings":{"title":"ProviderWebhookSettings","required":["webhookTemplate"],"type":"object","properties":{"webhookDescription":{"title":"Webhookdescription","type":"string"},"webhookTemplate":{"title":"Webhooktemplate","type":"string"}}},"RepairAlert":{"title":"RepairAlert","required":["bad_alert","error","provider_type"],"type":"object","properties":{"bad_alert":{"title":"Bad Alert","type":"object"},"error":{"title":"Error","type":"string"},"provider_type":{"title":"Provider Type","type":"string"}}},"ValidationError":{"title":"ValidationError","required":["loc","msg","type"],"type":"object","properties":{"loc":{"title":"Location","type":"array","items":{"anyOf":[{"type":"string"},{"type":"integer"}]}},"msg":{"title":"Message","type":"string"},"type":{"title":"Error Type","type":"string"}}},"WebhookSettings":{"title":"WebhookSettings","required":["webhookApi","apiKey"],"type":"object","properties":{"webhookApi":{"title":"Webhookapi","type":"string"},"apiKey":{"title":"Apikey","type":"string"}}},"WorkflowDTO":{"title":"WorkflowDTO","required":["id","created_by","creation_time","interval","providers"],"type":"object","properties":{"id":{"title":"Id","type":"string"},"description":{"title":"Description","type":"string","default":"Workflow file doesn't contain description"},"created_by":{"title":"Created By","type":"string"},"creation_time":{"title":"Creation Time","type":"string","format":"date-time"},"triggers":{"title":"Triggers","type":"array","items":{"type":"object"}},"interval":{"title":"Interval","type":"integer"},"last_execution_time":{"title":"Last Execution Time","type":"string","format":"date-time"},"last_execution_status":{"title":"Last Execution Status","type":"string"},"providers":{"title":"Providers","type":"array","items":{"$ref":"#/components/schemas/ProviderDTO"}}}},"WorkflowExecutionDTO":{"title":"WorkflowExecutionDTO","required":["id","workflow_id","started","triggered_by","status"],"type":"object","properties":{"id":{"title":"Id","type":"string"},"workflow_id":{"title":"Workflow Id","type":"string"},"started":{"title":"Started","type":"string","format":"date-time"},"triggered_by":{"title":"Triggered By","type":"string"},"status":{"title":"Status","type":"string"},"logs":{"title":"Logs","type":"array","items":{"$ref":"#/components/schemas/WorkflowExecutionLogsDTO"}},"error":{"title":"Error","type":"string"},"execution_time":{"title":"Execution Time","type":"integer"}}},"WorkflowExecutionLogsDTO":{"title":"WorkflowExecutionLogsDTO","required":["id","timestamp","message"],"type":"object","properties":{"id":{"title":"Id","type":"integer"},"timestamp":{"title":"Timestamp","type":"string","format":"date-time"},"message":{"title":"Message","type":"string"}}}},"securitySchemes":{"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"token"}}},"API Key":{"type":"apiKey","in":"header","name":"X-API-KEY"},"HTTPBasic":{"type":"http","scheme":"basic"}}}} +{"openapi":"3.1.0","info":{"title":"Keep API","description":"Rest API powering https://platform.keephq.dev and friends 🏄‍♀️","version":"0.1.0"},"paths":{"/providers":{"get":{"tags":["providers"],"summary":"Get Providers","operationId":"get_providers_providers_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/providers/export":{"get":{"tags":["providers"],"summary":"Get Installed Providers","description":"export all installed providers","operationId":"get_installed_providers_providers_export_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/providers/{provider_type}/{provider_id}/configured-alerts":{"get":{"tags":["providers"],"summary":"Get Alerts Configuration","description":"Get alerts configuration from a provider","operationId":"get_alerts_configuration_providers__provider_type___provider_id__configured_alerts_get","parameters":[{"required":true,"schema":{"type":"string","title":"Provider Type"},"name":"provider_type","in":"path"},{"required":true,"schema":{"type":"string","title":"Provider Id"},"name":"provider_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{},"type":"array","title":"Response Get Alerts Configuration Providers Provider Type Provider Id Configured Alerts Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/providers/{provider_type}/{provider_id}/logs":{"get":{"tags":["providers"],"summary":"Get Logs","description":"Get logs from a provider","operationId":"get_logs_providers__provider_type___provider_id__logs_get","parameters":[{"required":true,"schema":{"type":"string","title":"Provider Type"},"name":"provider_type","in":"path"},{"required":true,"schema":{"type":"string","title":"Provider Id"},"name":"provider_id","in":"path"},{"required":false,"schema":{"type":"integer","title":"Limit","default":5},"name":"limit","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{},"type":"array","title":"Response Get Logs Providers Provider Type Provider Id Logs Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/providers/{provider_type}/schema":{"get":{"tags":["providers"],"summary":"Get Alerts Schema","description":"Get the provider's API schema used to push alerts configuration","operationId":"get_alerts_schema_providers__provider_type__schema_get","parameters":[{"required":true,"schema":{"type":"string","title":"Provider Type"},"name":"provider_type","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Alerts Schema Providers Provider Type Schema Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/providers/{provider_type}/{provider_id}/alerts":{"post":{"tags":["providers"],"summary":"Add Alert","description":"Push new alerts to the provider","operationId":"add_alert_providers__provider_type___provider_id__alerts_post","parameters":[{"required":true,"schema":{"type":"string","title":"Provider Type"},"name":"provider_type","in":"path"},{"required":true,"schema":{"type":"string","title":"Provider Id"},"name":"provider_id","in":"path"},{"required":false,"schema":{"type":"string","title":"Alert Id"},"name":"alert_id","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Alert"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/providers/test":{"post":{"tags":["providers"],"summary":"Test Provider","description":"Test a provider's alert retrieval","operationId":"test_provider_providers_test_post","requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Provider Info"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/providers/{provider_type}/{provider_id}":{"delete":{"tags":["providers"],"summary":"Delete Provider","operationId":"delete_provider_providers__provider_type___provider_id__delete","parameters":[{"required":true,"schema":{"type":"string","title":"Provider Type"},"name":"provider_type","in":"path"},{"required":true,"schema":{"type":"string","title":"Provider Id"},"name":"provider_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/providers/{provider_id}/scopes":{"post":{"tags":["providers"],"summary":"Validate Provider Scopes","description":"Validate provider scopes","operationId":"validate_provider_scopes_providers__provider_id__scopes_post","parameters":[{"required":true,"schema":{"type":"string","title":"Provider Id"},"name":"provider_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"anyOf":[{"type":"boolean"},{"type":"string"}]},"type":"object","title":"Response Validate Provider Scopes Providers Provider Id Scopes Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/providers/{provider_id}":{"put":{"tags":["providers"],"summary":"Update Provider","description":"Update provider","operationId":"update_provider_providers__provider_id__put","parameters":[{"required":true,"schema":{"type":"string","title":"Provider Id"},"name":"provider_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/providers/install":{"post":{"tags":["providers"],"summary":"Install Provider","operationId":"install_provider_providers_install_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/providers/install/oauth2/{provider_type}":{"post":{"tags":["providers"],"summary":"Install Provider Oauth2","operationId":"install_provider_oauth2_providers_install_oauth2__provider_type__post","parameters":[{"required":true,"schema":{"type":"string","title":"Provider Type"},"name":"provider_type","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Provider Info"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/providers/{provider_id}/invoke/{method}":{"post":{"tags":["providers"],"summary":"Invoke Provider Method","description":"Invoke provider special method","operationId":"invoke_provider_method_providers__provider_id__invoke__method__post","parameters":[{"required":true,"schema":{"type":"string","title":"Provider Id"},"name":"provider_id","in":"path"},{"required":true,"schema":{"type":"string","title":"Method"},"name":"method","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Method Params"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/providers/install/webhook/{provider_type}/{provider_id}":{"post":{"tags":["providers"],"summary":"Install Provider Webhook","operationId":"install_provider_webhook_providers_install_webhook__provider_type___provider_id__post","parameters":[{"required":true,"schema":{"type":"string","title":"Provider Type"},"name":"provider_type","in":"path"},{"required":true,"schema":{"type":"string","title":"Provider Id"},"name":"provider_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/providers/{provider_type}/webhook":{"get":{"tags":["providers"],"summary":"Get Webhook Settings","operationId":"get_webhook_settings_providers__provider_type__webhook_get","parameters":[{"required":true,"schema":{"type":"string","title":"Provider Type"},"name":"provider_type","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProviderWebhookSettings"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/healthcheck":{"get":{"tags":["healthcheck"],"summary":"Healthcheck","description":"simple healthcheck endpoint","operationId":"healthcheck_healthcheck_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Healthcheck Healthcheck Get"}}}}}}},"/alerts":{"get":{"tags":["alerts"],"summary":"Get All Alerts","description":"Get last alerts occurrence","operationId":"get_all_alerts_alerts_get","parameters":[{"required":false,"schema":{"type":"boolean","title":"Sync","default":false},"name":"sync","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/AlertDto"},"type":"array","title":"Response Get All Alerts Alerts Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]},"delete":{"tags":["alerts"],"summary":"Delete Alert","description":"Delete alert by finerprint and last received time","operationId":"delete_alert_alerts_delete","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteRequestBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Delete Alert Alerts Delete"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/alerts/{fingerprint}/history":{"get":{"tags":["alerts"],"summary":"Get Alert History","description":"Get alert history","operationId":"get_alert_history_alerts__fingerprint__history_get","parameters":[{"required":true,"schema":{"type":"string","title":"Fingerprint"},"name":"fingerprint","in":"path"},{"required":false,"schema":{"type":"string","title":"Provider Id"},"name":"provider_id","in":"query"},{"required":false,"schema":{"type":"string","title":"Provider Type"},"name":"provider_type","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/AlertDto"},"type":"array","title":"Response Get Alert History Alerts Fingerprint History Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/alerts/{fingerprint}/assign/{last_received}":{"post":{"tags":["alerts"],"summary":"Assign Alert","description":"Assign alert to user","operationId":"assign_alert_alerts__fingerprint__assign__last_received__post","parameters":[{"required":true,"schema":{"type":"string","title":"Fingerprint"},"name":"fingerprint","in":"path"},{"required":true,"schema":{"type":"string","title":"Last Received"},"name":"last_received","in":"path"},{"required":false,"schema":{"type":"boolean","title":"Unassign","default":false},"name":"unassign","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Assign Alert Alerts Fingerprint Assign Last Received Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/alerts/event":{"post":{"tags":["alerts"],"summary":"Receive Generic Event","description":"Receive a generic alert event","operationId":"receive_generic_event_alerts_event_post","parameters":[{"required":false,"schema":{"type":"string","title":"Fingerprint"},"name":"fingerprint","in":"query"}],"requestBody":{"content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/AlertDto"},{"items":{"$ref":"#/components/schemas/AlertDto"},"type":"array"},{"type":"object"}],"title":"Event"}}},"required":true},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/AlertDto"},{"items":{"$ref":"#/components/schemas/AlertDto"},"type":"array"}],"title":"Response Receive Generic Event Alerts Event Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/alerts/event/{provider_type}":{"post":{"tags":["alerts"],"summary":"Receive Event","description":"Receive an alert event from a provider","operationId":"receive_event_alerts_event__provider_type__post","parameters":[{"required":true,"schema":{"type":"string","title":"Provider Type"},"name":"provider_type","in":"path"},{"required":false,"schema":{"type":"string","title":"Provider Id"},"name":"provider_id","in":"query"},{"required":false,"schema":{"type":"string","title":"Fingerprint"},"name":"fingerprint","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Receive Event Alerts Event Provider Type Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/alerts/{fingerprint}":{"get":{"tags":["alerts"],"summary":"Get Alert","description":"Get alert by fingerprint","operationId":"get_alert_alerts__fingerprint__get","parameters":[{"required":true,"schema":{"type":"string","title":"Fingerprint"},"name":"fingerprint","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AlertDto"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/alerts/enrich":{"post":{"tags":["alerts"],"summary":"Enrich Alert","description":"Enrich an alert","operationId":"enrich_alert_alerts_enrich_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnrichAlertRequestBody"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"additionalProperties":{"type":"string"},"type":"object","title":"Response Enrich Alert Alerts Enrich Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/alerts/search":{"post":{"tags":["alerts"],"summary":"Search Alerts","description":"Search alerts","operationId":"search_alerts_alerts_search_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchAlertsRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/AlertDto"},"type":"array","title":"Response Search Alerts Alerts Search Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/settings/webhook":{"get":{"tags":["settings"],"summary":"Webhook Settings","description":"Get details about the webhook endpoint (e.g. the API url and an API key)","operationId":"webhook_settings_settings_webhook_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookSettings"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/settings/users":{"get":{"tags":["settings"],"summary":"Get Users","description":"Get all users","operationId":"get_users_settings_users_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/User"},"type":"array","title":"Response Get Users Settings Users Get"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]},"post":{"tags":["settings"],"summary":"Create User","description":"Create a user","operationId":"create_user_settings_users_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/keep__api__routes__settings__CreateUserRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/settings/users/{user_email}":{"delete":{"tags":["settings"],"summary":"Delete User","description":"Delete a user","operationId":"delete_user_settings_users__user_email__delete","parameters":[{"required":true,"schema":{"type":"string","title":"User Email"},"name":"user_email","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/settings/smtp":{"get":{"tags":["settings"],"summary":"Get Smtp Settings","description":"Get SMTP settings","operationId":"get_smtp_settings_settings_smtp_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]},"post":{"tags":["settings"],"summary":"Update Smtp Settings","description":"Install or update SMTP settings","operationId":"update_smtp_settings_settings_smtp_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SMTPSettings"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]},"delete":{"tags":["settings"],"summary":"Delete Smtp Settings","description":"Delete SMTP settings","operationId":"delete_smtp_settings_settings_smtp_delete","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/settings/smtp/test":{"post":{"tags":["settings"],"summary":"Test Smtp Settings","description":"Test SMTP settings","operationId":"test_smtp_settings_settings_smtp_test_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SMTPSettings"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/settings/apikey":{"put":{"tags":["settings"],"summary":"Update Api Key","description":"Update API key secret","operationId":"update_api_key_settings_apikey_put","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]},"post":{"tags":["settings"],"summary":"Create Key","description":"Create API key","operationId":"create_key_settings_apikey_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/settings/apikeys":{"get":{"tags":["settings"],"summary":"Get Keys","description":"Get API keys","operationId":"get_keys_settings_apikeys_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/settings/apikey/{keyId}":{"delete":{"tags":["settings"],"summary":"Delete Api Key","description":"Delete API key","operationId":"delete_api_key_settings_apikey__keyId__delete","parameters":[{"required":true,"schema":{"type":"string","title":"Keyid"},"name":"keyId","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/workflows":{"get":{"tags":["workflows","alerts"],"summary":"Get Workflows","description":"Get workflows","operationId":"get_workflows_workflows_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/WorkflowDTO"},"type":"array","title":"Response Get Workflows Workflows Get"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]},"post":{"tags":["workflows","alerts"],"summary":"Create Workflow","description":"Create or update a workflow","operationId":"create_workflow_workflows_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_create_workflow_workflows_post"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowCreateOrUpdateDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/workflows/export":{"get":{"tags":["workflows","alerts"],"summary":"Export Workflows","description":"export all workflow Yamls","operationId":"export_workflows_workflows_export_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"type":"string"},"type":"array","title":"Response Export Workflows Workflows Export Get"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/workflows/{workflow_id}/run":{"post":{"tags":["workflows","alerts"],"summary":"Run Workflow","description":"Run a workflow","operationId":"run_workflow_workflows__workflow_id__run_post","parameters":[{"required":true,"schema":{"type":"string","title":"Workflow Id"},"name":"workflow_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","title":"Body"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Run Workflow Workflows Workflow Id Run Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/workflows/test":{"post":{"tags":["workflows","alerts"],"summary":"Run Workflow From Definition","description":"Test run a workflow from a definition","operationId":"run_workflow_from_definition_workflows_test_post","requestBody":{"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/Body_run_workflow_from_definition_workflows_test_post"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Run Workflow From Definition Workflows Test Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/workflows/{workflow_id}":{"get":{"tags":["workflows","alerts"],"summary":"Get Workflow By Id","description":"Get workflow executions by ID","operationId":"get_workflow_by_id_workflows__workflow_id__get","parameters":[{"required":true,"schema":{"type":"string","title":"Workflow Id"},"name":"workflow_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/WorkflowExecutionDTO"},"type":"array","title":"Response Get Workflow By Id Workflows Workflow Id Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]},"put":{"tags":["workflows","alerts"],"summary":"Update Workflow By Id","description":"Update a workflow","operationId":"update_workflow_by_id_workflows__workflow_id__put","parameters":[{"required":true,"schema":{"type":"string","title":"Workflow Id"},"name":"workflow_id","in":"path"}],"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowCreateOrUpdateDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]},"delete":{"tags":["workflows","alerts"],"summary":"Delete Workflow By Id","description":"Delete workflow","operationId":"delete_workflow_by_id_workflows__workflow_id__delete","parameters":[{"required":true,"schema":{"type":"string","title":"Workflow Id"},"name":"workflow_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/workflows/{workflow_id}/raw":{"get":{"tags":["workflows","alerts"],"summary":"Get Raw Workflow By Id","description":"Get workflow executions by ID","operationId":"get_raw_workflow_by_id_workflows__workflow_id__raw_get","parameters":[{"required":true,"schema":{"type":"string","title":"Workflow Id"},"name":"workflow_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"string","title":"Response Get Raw Workflow By Id Workflows Workflow Id Raw Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/workflows/executions":{"get":{"tags":["workflows","alerts"],"summary":"Get Workflow Executions By Alert Fingerprint","description":"Get workflow executions by alert fingerprint","operationId":"get_workflow_executions_by_alert_fingerprint_workflows_executions_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/WorkflowToAlertExecutionDTO"},"type":"array","title":"Response Get Workflow Executions By Alert Fingerprint Workflows Executions Get"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/workflows/{workflow_id}/runs/{workflow_execution_id}":{"get":{"tags":["workflows","alerts"],"summary":"Get Workflow Execution Status","description":"Get a workflow execution status","operationId":"get_workflow_execution_status_workflows__workflow_id__runs__workflow_execution_id__get","parameters":[{"required":true,"schema":{"type":"string","title":"Workflow Execution Id"},"name":"workflow_execution_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WorkflowExecutionDTO"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/workflows/executions/list":{"get":{"tags":["workflows","alerts"],"summary":"Get Workflow Executions","description":"List last workflow executions","operationId":"get_workflow_executions_workflows_executions_list_get","parameters":[{"description":"Workflow execution ID","required":false,"schema":{"type":"string","title":"Workflow Execution Id","description":"Workflow execution ID"},"name":"workflow_execution_id","in":"query"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/WorkflowExecutionDTO"},"type":"array","title":"Response Get Workflow Executions Workflows Executions List Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/whoami":{"get":{"tags":["whoami"],"summary":"Get Tenant Id","description":"Get tenant id","operationId":"get_tenant_id_whoami_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Get Tenant Id Whoami Get"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/pusher/auth":{"post":{"tags":["pusher"],"summary":"Pusher Authentication","description":"Authenticate a user to a private channel\n\nArgs:\n request (Request): The request object\n tenant_id (str, optional): The tenant ID. Defaults to Depends(verify_bearer_token).\n pusher_client (Pusher, optional): Pusher client. Defaults to Depends(get_pusher_client).\n\nRaises:\n HTTPException: 403 if the user is not allowed to access the channel.\n\nReturns:\n dict: The authentication response.","operationId":"pusher_authentication_pusher_auth_post","requestBody":{"content":{"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/Body_pusher_authentication_pusher_auth_post"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Pusher Authentication Pusher Auth Post"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/status":{"get":{"tags":["status"],"summary":"Status","description":"simple status endpoint","operationId":"status_status_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"object","title":"Response Status Status Get"}}}}}}},"/rules":{"get":{"tags":["rules"],"summary":"Get Rules","description":"Get Rules","operationId":"get_rules_rules_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]},"post":{"tags":["rules"],"summary":"Create Rule","description":"Create Rule","operationId":"create_rule_rules_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleCreateDto"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/rules/{rule_id}":{"put":{"tags":["rules"],"summary":"Update Rule","description":"Update Rule","operationId":"update_rule_rules__rule_id__put","parameters":[{"required":true,"schema":{"type":"string","title":"Rule Id"},"name":"rule_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]},"delete":{"tags":["rules"],"summary":"Delete Rule","description":"Delete Rule","operationId":"delete_rule_rules__rule_id__delete","parameters":[{"required":true,"schema":{"type":"string","title":"Rule Id"},"name":"rule_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/preset":{"get":{"tags":["preset"],"summary":"Get Presets","description":"Get all presets for tenant","operationId":"get_presets_preset_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/PresetDto"},"type":"array","title":"Response Get Presets Preset Get"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]},"post":{"tags":["preset"],"summary":"Create Preset","description":"Create a preset for tenant","operationId":"create_preset_preset_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdatePresetDto"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PresetDto"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/preset/{uuid}":{"put":{"tags":["preset"],"summary":"Update Preset","description":"Update a preset for tenant","operationId":"update_preset_preset__uuid__put","parameters":[{"required":true,"schema":{"type":"string","title":"Uuid"},"name":"uuid","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateOrUpdatePresetDto"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PresetDto"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]},"delete":{"tags":["preset"],"summary":"Delete Preset","description":"Delete a preset for tenant","operationId":"delete_preset_preset__uuid__delete","parameters":[{"required":true,"schema":{"type":"string","title":"Uuid"},"name":"uuid","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/groups/":{"get":{"tags":["groups"],"summary":"Get Groups","description":"Get groups","operationId":"get_groups_groups__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"type":"object"},"type":"array","title":"Response Get Groups Groups Get"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/users":{"get":{"tags":["users"],"summary":"Get Users","description":"Get all users","operationId":"get_users_users_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/User"},"type":"array","title":"Response Get Users Users Get"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]},"post":{"tags":["users"],"summary":"Create User","description":"Create a user","operationId":"create_user_users_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/keep__api__routes__users__CreateUserRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/users/{user_email}":{"delete":{"tags":["users"],"summary":"Delete User","description":"Delete a user","operationId":"delete_user_users__user_email__delete","parameters":[{"required":true,"schema":{"type":"string","title":"User Email"},"name":"user_email","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/mapping":{"get":{"tags":["enrichment","mapping"],"summary":"Get Rules","description":"Get all mapping rules","operationId":"get_rules_mapping_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/MappingRuleDtoOut"},"type":"array","title":"Response Get Rules Mapping Get"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]},"put":{"tags":["enrichment","mapping"],"summary":"Update Rule","description":"Update an existing rule","operationId":"update_rule_mapping_put","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MappingRuleDtoUpdate"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MappingRuleDtoOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]},"post":{"tags":["enrichment","mapping"],"summary":"Create Rule","description":"Create a new mapping rule","operationId":"create_rule_mapping_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MappingRuleDtoIn"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MappingRule"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/mapping/{rule_id}":{"delete":{"tags":["enrichment","mapping"],"summary":"Delete Rule","description":"Delete a mapping rule","operationId":"delete_rule_mapping__rule_id__delete","parameters":[{"required":true,"schema":{"type":"integer","title":"Rule Id"},"name":"rule_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/extraction":{"get":{"tags":["enrichment","extraction"],"summary":"Get Extraction Rules","description":"Get all extraction rules","operationId":"get_extraction_rules_extraction_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/ExtractionRuleDtoOut"},"type":"array","title":"Response Get Extraction Rules Extraction Get"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]},"post":{"tags":["enrichment","extraction"],"summary":"Create Extraction Rule","description":"Create a new extraction rule","operationId":"create_extraction_rule_extraction_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractionRuleDtoBase"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractionRuleDtoOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}},"/extraction/{rule_id}":{"put":{"tags":["enrichment","extraction"],"summary":"Update Extraction Rule","description":"Update an existing extraction rule","operationId":"update_extraction_rule_extraction__rule_id__put","parameters":[{"required":true,"schema":{"type":"integer","title":"Rule Id"},"name":"rule_id","in":"path"}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractionRuleDtoBase"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExtractionRuleDtoOut"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]},"delete":{"tags":["enrichment","extraction"],"summary":"Delete Extraction Rule","description":"Delete an extraction rule","operationId":"delete_extraction_rule_extraction__rule_id__delete","parameters":[{"required":true,"schema":{"type":"integer","title":"Rule Id"},"name":"rule_id","in":"path"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]},{"HTTPBasic":[]},{"OAuth2PasswordBearer":[]}]}}},"components":{"schemas":{"AlertDto":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"status":{"$ref":"#/components/schemas/AlertStatus"},"severity":{"$ref":"#/components/schemas/AlertSeverity"},"lastReceived":{"type":"string","title":"Lastreceived"},"environment":{"type":"string","title":"Environment","default":"undefined"},"isDuplicate":{"type":"boolean","title":"Isduplicate"},"duplicateReason":{"type":"string","title":"Duplicatereason"},"service":{"type":"string","title":"Service"},"source":{"items":{"type":"string"},"type":"array","title":"Source","default":[]},"apiKeyRef":{"type":"string","title":"Apikeyref"},"message":{"type":"string","title":"Message"},"description":{"type":"string","title":"Description"},"pushed":{"type":"boolean","title":"Pushed","default":false},"event_id":{"type":"string","title":"Event Id"},"url":{"type":"string","maxLength":65536,"minLength":1,"format":"uri","title":"Url"},"labels":{"type":"object","title":"Labels","default":{}},"fingerprint":{"type":"string","title":"Fingerprint"},"deleted":{"type":"boolean","title":"Deleted","default":false},"dismissUntil":{"type":"string","title":"Dismissuntil"},"dismissed":{"type":"boolean","title":"Dismissed","default":false},"assignee":{"type":"string","title":"Assignee"},"providerId":{"type":"string","title":"Providerid"},"group":{"type":"boolean","title":"Group","default":false},"note":{"type":"string","title":"Note"},"startedAt":{"type":"string","title":"Startedat"},"isNoisy":{"type":"boolean","title":"Isnoisy","default":false}},"type":"object","required":["id","name","status","severity","lastReceived"],"title":"AlertDto","examples":[{"id":"1234","name":"Alert name","status":"firing","lastReceived":"2021-01-01T00:00:00.000Z","environment":"production","isDuplicate":false,"service":"backend","source":["keep"],"message":"Keep: Alert message","description":"Keep: Alert description","severity":"critical","pushed":true,"event_id":"1234","url":"https://www.keephq.dev?alertId=1234","labels":{"key":"value"},"ticket_url":"https://www.keephq.dev?enrichedTicketId=456","fingerprint":"1234"}]},"AlertSeverity":{"enum":["critical","high","warning","info","low"],"title":"AlertSeverity","description":"An enumeration."},"AlertStatus":{"enum":["firing","resolved","acknowledged","suppressed","pending"],"title":"AlertStatus","description":"An enumeration."},"Body_create_workflow_workflows_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","title":"Body_create_workflow_workflows_post"},"Body_pusher_authentication_pusher_auth_post":{"properties":{"channel_name":{"title":"Channel Name"},"socket_id":{"title":"Socket Id"}},"type":"object","required":["channel_name","socket_id"],"title":"Body_pusher_authentication_pusher_auth_post"},"Body_run_workflow_from_definition_workflows_test_post":{"properties":{"file":{"type":"string","format":"binary","title":"File"}},"type":"object","title":"Body_run_workflow_from_definition_workflows_test_post"},"CreateOrUpdatePresetDto":{"properties":{"name":{"type":"string","title":"Name"},"options":{"items":{"$ref":"#/components/schemas/PresetOption"},"type":"array","title":"Options"},"is_private":{"type":"boolean","title":"Is Private","default":false},"is_noisy":{"type":"boolean","title":"Is Noisy","default":false}},"type":"object","required":["options"],"title":"CreateOrUpdatePresetDto"},"DeleteRequestBody":{"properties":{"fingerprint":{"type":"string","title":"Fingerprint"},"lastReceived":{"type":"string","title":"Lastreceived"},"restore":{"type":"boolean","title":"Restore","default":false}},"type":"object","required":["fingerprint","lastReceived"],"title":"DeleteRequestBody"},"EnrichAlertRequestBody":{"properties":{"enrichments":{"additionalProperties":{"type":"string"},"type":"object","title":"Enrichments"},"fingerprint":{"type":"string","title":"Fingerprint"}},"type":"object","required":["enrichments","fingerprint"],"title":"EnrichAlertRequestBody"},"ExtractionRuleDtoBase":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"priority":{"type":"integer","title":"Priority","default":0},"attribute":{"type":"string","title":"Attribute"},"condition":{"type":"string","title":"Condition"},"disabled":{"type":"boolean","title":"Disabled","default":false},"regex":{"type":"string","title":"Regex"},"pre":{"type":"boolean","title":"Pre","default":false}},"type":"object","required":["name","regex"],"title":"ExtractionRuleDtoBase"},"ExtractionRuleDtoOut":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"priority":{"type":"integer","title":"Priority","default":0},"attribute":{"type":"string","title":"Attribute"},"condition":{"type":"string","title":"Condition"},"disabled":{"type":"boolean","title":"Disabled","default":false},"regex":{"type":"string","title":"Regex"},"pre":{"type":"boolean","title":"Pre","default":false},"id":{"type":"integer","title":"Id"},"created_by":{"type":"string","title":"Created By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"updated_by":{"type":"string","title":"Updated By"},"updated_at":{"type":"string","format":"date-time","title":"Updated At"}},"type":"object","required":["name","regex","id","created_at"],"title":"ExtractionRuleDtoOut"},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"MappingRule":{"properties":{"id":{"type":"integer","title":"Id"},"tenant_id":{"type":"string","title":"Tenant Id"},"priority":{"type":"integer","title":"Priority","default":0},"name":{"type":"string","maxLength":255,"title":"Name"},"description":{"type":"string","maxLength":2048,"title":"Description"},"file_name":{"type":"string","maxLength":255,"title":"File Name"},"created_by":{"type":"string","maxLength":255,"title":"Created By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"disabled":{"type":"boolean","title":"Disabled","default":false},"override":{"type":"boolean","title":"Override","default":true},"condition":{"type":"string","maxLength":2000,"title":"Condition"},"matchers":{"items":{"type":"string"},"type":"array","title":"Matchers"},"rows":{"items":{"type":"object"},"type":"array","title":"Rows"},"updated_by":{"type":"string","maxLength":255,"title":"Updated By"},"last_updated_at":{"type":"string","format":"date-time","title":"Last Updated At"}},"type":"object","required":["tenant_id","name","matchers","rows"],"title":"MappingRule"},"MappingRuleDtoIn":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"file_name":{"type":"string","title":"File Name"},"priority":{"type":"integer","title":"Priority","default":0},"matchers":{"items":{"type":"string"},"type":"array","title":"Matchers"},"rows":{"items":{"type":"object"},"type":"array","title":"Rows"}},"type":"object","required":["name","matchers","rows"],"title":"MappingRuleDtoIn"},"MappingRuleDtoOut":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"file_name":{"type":"string","title":"File Name"},"priority":{"type":"integer","title":"Priority","default":0},"matchers":{"items":{"type":"string"},"type":"array","title":"Matchers"},"id":{"type":"integer","title":"Id"},"created_by":{"type":"string","title":"Created By"},"created_at":{"type":"string","format":"date-time","title":"Created At"},"attributes":{"items":{"type":"string"},"type":"array","title":"Attributes","default":[]},"updated_by":{"type":"string","title":"Updated By"},"last_updated_at":{"type":"string","format":"date-time","title":"Last Updated At"}},"type":"object","required":["name","matchers","id","created_at"],"title":"MappingRuleDtoOut"},"MappingRuleDtoUpdate":{"properties":{"name":{"type":"string","title":"Name"},"description":{"type":"string","title":"Description"},"file_name":{"type":"string","title":"File Name"},"priority":{"type":"integer","title":"Priority","default":0},"matchers":{"items":{"type":"string"},"type":"array","title":"Matchers"},"id":{"type":"integer","title":"Id"},"rows":{"items":{"type":"object"},"type":"array","title":"Rows"}},"type":"object","required":["name","matchers","id"],"title":"MappingRuleDtoUpdate"},"PresetDto":{"properties":{"id":{"type":"string","format":"uuid","title":"Id"},"name":{"type":"string","title":"Name"},"options":{"items":{},"type":"array","title":"Options","default":[]},"created_by":{"type":"string","title":"Created By"},"is_private":{"type":"boolean","title":"Is Private","default":false},"is_noisy":{"type":"boolean","title":"Is Noisy","default":false},"should_do_noise_now":{"type":"boolean","title":"Should Do Noise Now","default":false},"alerts_count":{"type":"integer","title":"Alerts Count","default":0}},"type":"object","required":["id","name"],"title":"PresetDto"},"PresetOption":{"properties":{"label":{"type":"string","title":"Label"},"value":{"anyOf":[{"type":"string"},{"type":"object"}],"title":"Value"}},"type":"object","required":["label","value"],"title":"PresetOption"},"ProviderDTO":{"properties":{"type":{"type":"string","title":"Type"},"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name"},"installed":{"type":"boolean","title":"Installed"}},"type":"object","required":["type","name","installed"],"title":"ProviderDTO"},"ProviderWebhookSettings":{"properties":{"webhookDescription":{"type":"string","title":"Webhookdescription"},"webhookTemplate":{"type":"string","title":"Webhooktemplate"},"webhookMarkdown":{"type":"string","title":"Webhookmarkdown"}},"type":"object","required":["webhookTemplate"],"title":"ProviderWebhookSettings"},"RuleCreateDto":{"properties":{"ruleName":{"type":"string","title":"Rulename"},"sqlQuery":{"type":"object","title":"Sqlquery"},"celQuery":{"type":"string","title":"Celquery"},"timeframeInSeconds":{"type":"integer","title":"Timeframeinseconds"},"groupingCriteria":{"items":{},"type":"array","title":"Groupingcriteria","default":[]},"groupDescription":{"type":"string","title":"Groupdescription"}},"type":"object","required":["ruleName","sqlQuery","celQuery","timeframeInSeconds"],"title":"RuleCreateDto"},"SMTPSettings":{"properties":{"host":{"type":"string","title":"Host"},"port":{"type":"integer","title":"Port"},"from_email":{"type":"string","title":"From Email"},"username":{"type":"string","title":"Username"},"password":{"type":"string","format":"password","title":"Password","writeOnly":true},"secure":{"type":"boolean","title":"Secure","default":true},"to_email":{"type":"string","title":"To Email","default":"keep@example.com"}},"type":"object","required":["host","port","from_email"],"title":"SMTPSettings","example":{"host":"smtp.example.com","port":587,"username":"user@example.com","password":"password","secure":true,"from_email":"noreply@example.com","to_email":""}},"SearchAlertsRequest":{"properties":{"query":{"type":"string","title":"Query"},"timeframe":{"type":"integer","title":"Timeframe"}},"type":"object","required":["query","timeframe"],"title":"SearchAlertsRequest"},"User":{"properties":{"email":{"type":"string","title":"Email"},"name":{"type":"string","title":"Name"},"role":{"type":"string","title":"Role"},"picture":{"type":"string","title":"Picture"},"created_at":{"type":"string","title":"Created At"},"last_login":{"type":"string","title":"Last Login"}},"type":"object","required":["email","name","role","created_at"],"title":"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"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"},"WebhookSettings":{"properties":{"webhookApi":{"type":"string","title":"Webhookapi"},"apiKey":{"type":"string","title":"Apikey"},"modelSchema":{"type":"object","title":"Modelschema"}},"type":"object","required":["webhookApi","apiKey","modelSchema"],"title":"WebhookSettings"},"WorkflowCreateOrUpdateDTO":{"properties":{"workflow_id":{"type":"string","title":"Workflow Id"},"status":{"type":"string","enum":["created","updated"],"title":"Status"},"revision":{"type":"integer","title":"Revision","default":1}},"type":"object","required":["workflow_id","status"],"title":"WorkflowCreateOrUpdateDTO"},"WorkflowDTO":{"properties":{"id":{"type":"string","title":"Id"},"name":{"type":"string","title":"Name","default":"Workflow file doesn't contain name"},"description":{"type":"string","title":"Description","default":"Workflow file doesn't contain description"},"created_by":{"type":"string","title":"Created By"},"creation_time":{"type":"string","format":"date-time","title":"Creation Time"},"triggers":{"items":{"type":"object"},"type":"array","title":"Triggers"},"interval":{"type":"integer","title":"Interval"},"last_execution_time":{"type":"string","format":"date-time","title":"Last Execution Time"},"last_execution_status":{"type":"string","title":"Last Execution Status"},"providers":{"items":{"$ref":"#/components/schemas/ProviderDTO"},"type":"array","title":"Providers"},"workflow_raw":{"type":"string","title":"Workflow Raw"},"revision":{"type":"integer","title":"Revision","default":1},"last_updated":{"type":"string","format":"date-time","title":"Last Updated"},"invalid":{"type":"boolean","title":"Invalid","default":false}},"type":"object","required":["id","created_by","creation_time","interval","providers","workflow_raw"],"title":"WorkflowDTO"},"WorkflowExecutionDTO":{"properties":{"id":{"type":"string","title":"Id"},"workflow_id":{"type":"string","title":"Workflow Id"},"started":{"type":"string","format":"date-time","title":"Started"},"triggered_by":{"type":"string","title":"Triggered By"},"status":{"type":"string","title":"Status"},"logs":{"items":{"$ref":"#/components/schemas/WorkflowExecutionLogsDTO"},"type":"array","title":"Logs"},"error":{"type":"string","title":"Error"},"execution_time":{"type":"integer","title":"Execution Time"},"results":{"type":"object","title":"Results"}},"type":"object","required":["id","workflow_id","started","triggered_by","status"],"title":"WorkflowExecutionDTO"},"WorkflowExecutionLogsDTO":{"properties":{"id":{"type":"integer","title":"Id"},"timestamp":{"type":"string","format":"date-time","title":"Timestamp"},"message":{"type":"string","title":"Message"},"context":{"type":"object","title":"Context"}},"type":"object","required":["id","timestamp","message"],"title":"WorkflowExecutionLogsDTO"},"WorkflowToAlertExecutionDTO":{"properties":{"workflow_id":{"type":"string","title":"Workflow Id"},"workflow_execution_id":{"type":"string","title":"Workflow Execution Id"},"alert_fingerprint":{"type":"string","title":"Alert Fingerprint"},"workflow_status":{"type":"string","title":"Workflow Status"},"workflow_started":{"type":"string","format":"date-time","title":"Workflow Started"}},"type":"object","required":["workflow_id","workflow_execution_id","alert_fingerprint","workflow_status","workflow_started"],"title":"WorkflowToAlertExecutionDTO"},"keep__api__routes__settings__CreateUserRequest":{"properties":{"username":{"type":"string","title":"Username"},"password":{"type":"string","title":"Password"},"role":{"type":"string","title":"Role"}},"type":"object","required":["username","role"],"title":"CreateUserRequest"},"keep__api__routes__users__CreateUserRequest":{"properties":{"username":{"type":"string","title":"Username"},"password":{"type":"string","title":"Password"},"role":{"type":"string","title":"Role"}},"type":"object","required":["username","role"],"title":"CreateUserRequest"}},"securitySchemes":{"API Key":{"type":"apiKey","in":"header","name":"X-API-KEY"},"HTTPBasic":{"type":"http","scheme":"basic"},"OAuth2PasswordBearer":{"type":"oauth2","flows":{"password":{"scopes":{},"tokenUrl":"token"}}}}}} \ No newline at end of file diff --git a/docs/openapi_converter.py b/docs/openapi_converter.py new file mode 100644 index 000000000..289e46b56 --- /dev/null +++ b/docs/openapi_converter.py @@ -0,0 +1,63 @@ +from argparse import ArgumentParser +import typing as t +import json +Json = dict[str | t.Literal["anyOf", "type"], "Json"] | list["Json"] | str | bool + + +## Reference: https://github.com/tiangolo/fastapi/discussions/9789 +def convert_3_dot_1_to_3_dot_0(json: dict[str, Json]): + """Will attempt to convert version 3.1.0 of some openAPI json into 3.0.2 + + Usage: + + >>> from pprint import pprint + >>> json = { + ... "some_irrelevant_keys": {...}, + ... "nested_dict": {"nested_key": {"anyOf": [{"type": "string"}, {"type": "null"}]}}, + ... "examples": [{...}, {...}] + ... } + >>> convert_3_dot_1_to_3_dot_0(json) + >>> pprint(json) + {'example': {Ellipsis}, + 'nested_dict': {'nested_key': {'anyOf': [{'type': 'string'}], + 'nullable': True}}, + 'openapi': '3.0.2', + 'some_irrelevant_keys': {Ellipsis}} + """ + json["openapi"] = "3.0.2" + + def inner(yaml_dict: Json): + if isinstance(yaml_dict, dict): + if "anyOf" in yaml_dict and isinstance((anyOf := yaml_dict["anyOf"]), list): + for i, item in enumerate(anyOf): + if isinstance(item, dict) and item.get("type") == "null": + anyOf.pop(i) + yaml_dict["nullable"] = True + if "examples" in yaml_dict: + examples = yaml_dict["examples"] + del yaml_dict["examples"] + if isinstance(examples, list) and len(examples): + yaml_dict["example"] = examples[0] + for value in yaml_dict.values(): + inner(value) + elif isinstance(yaml_dict, list): + for item in yaml_dict: + inner(item) + + inner(json) + return json + +if __name__ == "__main__": + + parser = ArgumentParser(description="Script for converting openapi version 3.1.0 to 3.0.2") + parser.add_argument("-s", "--source", help="The path to openapi.json") + parser.add_argument("-d", "--dest", help="The path to output") + + args = parser.parse_args() + + with open(args.source, "r") as fd: + content = json.load(fd) + + output = json.dumps(convert_3_dot_1_to_3_dot_0(content)) + with open(args.dest, "wt") as wt: + wt.write(output)