Arthur GenAI Engine

GenAI guardrails and evaluation API — tasks, default and task-scoped rules, prompt/response validation, inferences, and feedback. Bearer API-key auth.

OpenAPI Specification

arthur-engine-openapi.json Raw ↑
{"openapi":"3.1.0","info":{"title":"Arthur GenAI Engine","version":"2.1.688"},"paths":{"/api/v2/engine-config":{"get":{"tags":["Engine Config"],"summary":"Get Engine Config","description":"Returns engine-level configuration for the frontend. Public endpoint — no authentication required.","operationId":"get_engine_config_api_v2_engine_config_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EngineConfigResponse"}}}}}}},"/api/v2/usage/tokens":{"get":{"tags":["Usage"],"summary":"Get Token Usage","description":"Get token usage.","operationId":"get_token_usage_api_v2_usage_tokens_get","security":[{"API Key":[]}],"parameters":[{"name":"start_time","in":"query","required":false,"schema":{"type":"string","format":"date-time","description":"Inclusive start date in ISO8601 string format. Defaults to the beginning of the current day if not provided.","title":"Start Time"},"description":"Inclusive start date in ISO8601 string format. Defaults to the beginning of the current day if not provided."},{"name":"end_time","in":"query","required":false,"schema":{"type":"string","format":"date-time","description":"Exclusive end date in ISO8601 string format. Defaults to the end of the current day if not provided.","title":"End Time"},"description":"Exclusive end date in ISO8601 string format. Defaults to the end of the current day if not provided."},{"name":"group_by","in":"query","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/TokenUsageScope"},"description":"Entities to group token counts on.","default":["rule_type"],"title":"Group By"},"description":"Entities to group token counts on."}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/TokenUsageResponse"},"title":"Response Get Token Usage Api V2 Usage Tokens Get"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/display-settings":{"get":{"tags":["Settings"],"summary":"Get Display Settings","description":"Get display settings (e.g. default currency for cost formatting).","operationId":"get_display_settings_api_v2_display_settings_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DisplaySettingsResponse"}}}}}}},"/api/v2/configuration":{"get":{"summary":"Get Configuration","description":"Get application configuration settings.","operationId":"get_configuration_api_v2_configuration_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplicationConfigurationResponse"}}}}},"security":[{"API Key":[]}]},"post":{"summary":"Update Configuration","description":"Update application configuration settings.","operationId":"update_configuration_api_v2_configuration_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplicationConfigurationUpdateRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApplicationConfigurationResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]}]}},"/api/v2/feedback/{inference_id}":{"post":{"tags":["Feedback"],"summary":"Post Feedback","description":"Post feedback for LLM Application.","operationId":"post_feedback_api_v2_feedback__inference_id__post","security":[{"API Key":[]}],"parameters":[{"name":"inference_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Inference Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FeedbackRequest"}}}},"responses":{"201":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InferenceFeedbackResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/feedback/query":{"get":{"tags":["Feedback"],"summary":"Query Feedback","description":"Paginated feedback querying. See parameters for available filters. Includes feedback from archived tasks and rules.","operationId":"query_feedback_api_v2_feedback_query_get","security":[{"API Key":[]}],"parameters":[{"name":"start_time","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Inclusive start date in ISO8601 string format","title":"Start Time"},"description":"Inclusive start date in ISO8601 string format"},{"name":"end_time","in":"query","required":false,"schema":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"Exclusive end date in ISO8601 string format","title":"End Time"},"description":"Exclusive end date in ISO8601 string format"},{"name":"feedback_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Feedback ID to filter on","title":"Feedback Id"},"description":"Feedback ID to filter on"},{"name":"inference_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Inference ID to filter on","title":"Inference Id"},"description":"Inference ID to filter on"},{"name":"target","in":"query","required":false,"schema":{"anyOf":[{"$ref":"#/components/schemas/InferenceFeedbackTarget"},{"type":"array","items":{"$ref":"#/components/schemas/InferenceFeedbackTarget"}},{"type":"null"}],"description":"Target of the feedback. Must be one of ['context', 'response_results', 'prompt_results']","title":"Target"},"description":"Target of the feedback. Must be one of ['context', 'response_results', 'prompt_results']"},{"name":"score","in":"query","required":false,"schema":{"anyOf":[{"type":"integer"},{"type":"array","items":{"type":"integer"}},{"type":"null"}],"description":"Score of the feedback. Must be an integer.","title":"Score"},"description":"Score of the feedback. Must be an integer."},{"name":"feedback_user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"User ID of the user giving feedback to filter on (query will perform fuzzy search)","title":"Feedback User Id"},"description":"User ID of the user giving feedback to filter on (query will perform fuzzy search)"},{"name":"conversation_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Conversation ID to filter on","title":"Conversation Id"},"description":"Conversation ID to filter on"},{"name":"task_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"array","items":{"type":"string"}},{"type":"null"}],"description":"Task ID to filter on","title":"Task Id"},"description":"Task ID to filter on"},{"name":"inference_user_id","in":"query","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"User ID of the user who created the inferences to filter on (query will perform fuzzy search)","title":"Inference User Id"},"description":"User ID of the user who created the inferences to filter on (query will perform fuzzy search)"},{"name":"sort","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PaginationSortMethod","description":"Sort the results (asc/desc)","default":"desc"},"description":"Sort the results (asc/desc)"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","description":"Page size. Default is 10. Must be greater than 0 and less than 5000.","default":10,"title":"Page Size"},"description":"Page size. Default is 10. Must be greater than 0 and less than 5000."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","description":"Page number","default":0,"title":"Page"},"description":"Page number"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryFeedbackResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/inferences/query":{"get":{"tags":["Inferences"],"summary":"Query Inferences","description":"Paginated inference querying. See parameters for available filters. Includes inferences from archived tasks and rules.","operationId":"query_inferences_api_v2_inferences_query_get","security":[{"API Key":[]}],"parameters":[{"name":"task_ids","in":"query","required":false,"schema":{"type":"array","items":{"type":"string"},"description":"Task ID to filter on.","default":[],"title":"Task Ids"},"description":"Task ID to filter on."},{"name":"task_name","in":"query","required":false,"schema":{"type":"string","description":"Task name to filter on.","title":"Task Name"},"description":"Task name to filter on."},{"name":"conversation_id","in":"query","required":false,"schema":{"type":"string","description":"Conversation ID to filter on.","title":"Conversation Id"},"description":"Conversation ID to filter on."},{"name":"inference_id","in":"query","required":false,"schema":{"type":"string","description":"Inference ID to filter on.","title":"Inference Id"},"description":"Inference ID to filter on."},{"name":"user_id","in":"query","required":false,"schema":{"type":"string","description":"User ID to filter on.","title":"User Id"},"description":"User ID to filter on."},{"name":"start_time","in":"query","required":false,"schema":{"type":"string","format":"date-time","description":"Inclusive start date in ISO8601 string format.","title":"Start Time"},"description":"Inclusive start date in ISO8601 string format."},{"name":"end_time","in":"query","required":false,"schema":{"type":"string","format":"date-time","description":"Exclusive end date in ISO8601 string format.","title":"End Time"},"description":"Exclusive end date in ISO8601 string format."},{"name":"rule_types","in":"query","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/RuleType"},"description":"List of RuleType to query for. Any inference that ran any rule in the list will be returned. Defaults to all statuses. If used in conjunction with with rule_statuses, will return inferences with rules in the intersection of rule_types and rule_statuses.","default":[],"title":"Rule Types"},"description":"List of RuleType to query for. Any inference that ran any rule in the list will be returned. Defaults to all statuses. If used in conjunction with with rule_statuses, will return inferences with rules in the intersection of rule_types and rule_statuses."},{"name":"rule_statuses","in":"query","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/RuleResultEnum"},"description":"List of RuleResultEnum to query for. Any inference with any rule status in the list will be returned. Defaults to all statuses. If used in conjunction with with rule_types, will return inferences with rules in the intersection of rule_statuses and rule_types.","default":[],"title":"Rule Statuses"},"description":"List of RuleResultEnum to query for. Any inference with any rule status in the list will be returned. Defaults to all statuses. If used in conjunction with with rule_types, will return inferences with rules in the intersection of rule_statuses and rule_types."},{"name":"prompt_statuses","in":"query","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/RuleResultEnum"},"description":"List of RuleResultEnum to query for at inference prompt stage level. Must be 'Pass' / 'Fail'. Defaults to both.","default":[],"title":"Prompt Statuses"},"description":"List of RuleResultEnum to query for at inference prompt stage level. Must be 'Pass' / 'Fail'. Defaults to both."},{"name":"response_statuses","in":"query","required":false,"schema":{"type":"array","items":{"$ref":"#/components/schemas/RuleResultEnum"},"description":"List of RuleResultEnum to query for at inference response stage level. Must be 'Pass' / 'Fail'. Defaults to both. Inferences missing responses will not be affected by this filter.","default":[],"title":"Response Statuses"},"description":"List of RuleResultEnum to query for at inference response stage level. Must be 'Pass' / 'Fail'. Defaults to both. Inferences missing responses will not be affected by this filter."},{"name":"include_count","in":"query","required":false,"schema":{"type":"boolean","description":"Whether to include the total count of matching inferences. Set to False to improve query performance for large datasets. Count will be returned as -1 if set to False.","default":true,"title":"Include Count"},"description":"Whether to include the total count of matching inferences. Set to False to improve query performance for large datasets. Count will be returned as -1 if set to False."},{"name":"sort","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PaginationSortMethod","description":"Sort the results (asc/desc)","default":"desc"},"description":"Sort the results (asc/desc)"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","description":"Page size. Default is 10. Must be greater than 0 and less than 5000.","default":10,"title":"Page Size"},"description":"Page size. Default is 10. Must be greater than 0 and less than 5000."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","description":"Page number","default":0,"title":"Page"},"description":"Page number"}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/QueryInferencesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/default_rules":{"get":{"tags":["Rules"],"summary":"Get Default Rules","description":"Get default rules.","operationId":"get_default_rules_api_v2_default_rules_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/RuleResponse"},"type":"array","title":"Response Get Default Rules Api V2 Default Rules Get"}}}}},"security":[{"API Key":[]}]},"post":{"tags":["Rules"],"summary":"Create Default Rule","description":"Create a default rule. Default rules are applied universally across existing tasks, subsequently created new tasks, and any non-task related requests. Once a rule is created, it is immutable. Available rules are 'KeywordRule', 'ModelHallucinationRuleV2', 'ModelSensitiveDataRule', 'PIIDataRule', 'PromptInjectionRule', 'RegexRule', 'ToxicityRule'. Note: The rules are cached by the validation endpoints for 60 seconds.","operationId":"create_default_rule_api_v2_default_rules_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewRuleRequest"},"examples":{"example1":{"summary":"Sensitive Data Example","description":"Sensitive Data Example with its required configuration","value":{"name":"Sensitive Data Rule","type":"ModelSensitiveDataRule","apply_to_prompt":true,"apply_to_response":false,"config":{"examples":[{"example":"John has O negative blood group","result":true},{"example":"Most of the people have A positive blood group","result":false}],"hint":"specific individual's blood types"}}},"example2":{"summary":"Regex Example","description":"Regex Example with its required configuration. Be sure to properly encode requests using JSON libraries. For example, the regex provided encodes to a different string when encoded to account for escape characters.","value":{"name":"SSN Regex Rule","type":"RegexRule","apply_to_prompt":true,"apply_to_response":true,"config":{"regex_patterns":["\\d{3}-\\d{2}-\\d{4}","\\d{5}-\\d{6}-\\d{7}"]}}},"example3":{"summary":"Keywords Rule Example","description":"Keywords Rule Example with its required configuration","value":{"name":"Blocked Keywords Rule","type":"KeywordRule","apply_to_prompt":true,"apply_to_response":true,"config":{"keywords":["Blocked_Keyword_1","Blocked_Keyword_2"]}}},"example4":{"summary":"Prompt Injection Rule Example","description":"Prompt Injection Rule Example, no configuration required","value":{"name":"Prompt Injection Rule","type":"PromptInjectionRule","apply_to_prompt":true,"apply_to_response":false}},"example5":{"summary":"Hallucination Rule V1 Example (Deprecated)","description":"Hallucination Rule Example, no configuration required (This rule is deprecated. Use ModelHallucinationRuleV2 instead.)","value":{"name":"Hallucination Rule","type":"ModelHallucinationRule","apply_to_prompt":false,"apply_to_response":true}},"example6":{"summary":"Hallucination Rule V2 Example","description":"Hallucination Rule Example, no configuration required","value":{"name":"Hallucination Rule","type":"ModelHallucinationRuleV2","apply_to_prompt":false,"apply_to_response":true}},"example7":{"summary":"Hallucination Rule V3 Example (Beta)","description":"Hallucination Rule Example, no configuration required. This rule is in beta and must be enabled by the system administrator.","value":{"name":"Hallucination Rule","type":"ModelHallucinationRuleV3","apply_to_prompt":false,"apply_to_response":true}},"example8":{"summary":"PII Rule Example","description":"PII Rule Example, no configuration required. \"disabled_pii_entities\", \"confidence_threshold\", and \"allow_list\" accepted. Valid value for \"confidence_threshold\" is 0.0-1.0. Valid values for \"disabled_pii_entities\" are CREDIT_CARD,CRYPTO,DATE_TIME,EMAIL_ADDRESS,IBAN_CODE,IP_ADDRESS,NRP,LOCATION,PERSON,PHONE_NUMBER,MEDICAL_LICENSE,URL,US_BANK_NUMBER,US_DRIVER_LICENSE,US_ITIN,US_PASSPORT,US_SSN","value":{"name":"PII Rule","type":"PIIDataRule","apply_to_prompt":true,"apply_to_response":true,"config":{"disabled_pii_entities":["EMAIL_ADDRESS","PHONE_NUMBER"],"confidence_threshold":"0.5","allow_list":["arthur.ai","Arthur"]}}},"example9":{"summary":"Toxicity Rule Example","description":"Toxicity Rule Example, no configuration required. Threshold accepted","value":{"name":"Toxicity Rule","type":"ToxicityRule","apply_to_prompt":true,"apply_to_response":true,"config":{"threshold":0.5}}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]}]}},"/api/v2/default_rules/{rule_id}":{"delete":{"tags":["Rules"],"summary":"Archive Default Rule","description":"Archive existing default rule.","operationId":"archive_default_rule_api_v2_default_rules__rule_id__delete","security":[{"API Key":[]}],"parameters":[{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Rule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/rules/search":{"post":{"tags":["Rules"],"summary":"Search Rules","description":"Search default and/or task rules.","operationId":"search_rules_api_v2_rules_search_post","security":[{"API Key":[]}],"parameters":[{"name":"sort","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PaginationSortMethod","description":"Sort the results (asc/desc)","default":"desc"},"description":"Sort the results (asc/desc)"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","description":"Page size. Default is 10. Must be greater than 0 and less than 5000.","default":10,"title":"Page Size"},"description":"Page size. Default is 10. Must be greater than 0 and less than 5000."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","description":"Page number","default":0,"title":"Page"},"description":"Page number"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchRulesRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchRulesResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/tasks":{"get":{"tags":["Tasks"],"summary":"Get All Tasks","description":"[Deprecated] Use /tasks/search endpoint. This endpoint will be removed in a future release.","operationId":"get_all_tasks_api_v2_tasks_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/TaskResponse"},"type":"array","title":"Response Get All Tasks Api V2 Tasks Get"}}}}},"deprecated":true,"security":[{"API Key":[]}]},"post":{"tags":["Tasks"],"summary":"Create Task","description":"Register a new task. When a new task is created, all existing default rules will be auto-applied for this new task. Optionally specify if the task is agentic.","operationId":"create_task_api_v2_tasks_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewTaskRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}},"security":[{"API Key":[]}]}},"/api/v2/tasks/{task_id}":{"delete":{"tags":["Tasks"],"summary":"Archive Task","description":"Archive task. Also archives all task-scoped rules. Associated default rules are unaffected.","operationId":"archive_task_api_v2_tasks__task_id__delete","security":[{"API Key":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"get":{"tags":["Tasks"],"summary":"Get Task","description":"Get tasks.","operationId":"get_task_api_v2_tasks__task_id__get","security":[{"API Key":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/tasks/{task_id}/unarchive":{"post":{"tags":["Tasks"],"summary":"Unarchive Task","description":"Unarchive a previously archived task. Also unarchives all task-scoped rules and metrics that were archived with it.","operationId":"unarchive_task_api_v2_tasks__task_id__unarchive_post","security":[{"API Key":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/agent-tasks":{"get":{"tags":["Tasks"],"summary":"Get Agent Tasks","description":"Get agentic tasks with enriched agent metadata (tools, sub-agents, models). Returns only agentic tasks.","operationId":"get_agent_tasks_api_v2_agent_tasks_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"items":{"$ref":"#/components/schemas/EnrichedTaskResponse"},"type":"array","title":"Response Get Agent Tasks Api V2 Agent Tasks Get"}}}}},"security":[{"API Key":[]}]}},"/api/v2/task":{"post":{"tags":["Tasks"],"summary":"Redirect To Tasks","description":"Redirect to /tasks endpoint.","operationId":"redirect_to_tasks_api_v2_task_post","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}}}}},"/api/v2/tasks/search":{"post":{"tags":["Tasks"],"summary":"Search Tasks","description":"Search tasks. Can filter by task IDs, task name substring, and agentic status.","operationId":"search_tasks_api_v2_tasks_search_post","security":[{"API Key":[]}],"parameters":[{"name":"sort","in":"query","required":false,"schema":{"$ref":"#/components/schemas/PaginationSortMethod","description":"Sort the results (asc/desc)","default":"desc"},"description":"Sort the results (asc/desc)"},{"name":"page_size","in":"query","required":false,"schema":{"type":"integer","description":"Page size. Default is 10. Must be greater than 0 and less than 5000.","default":10,"title":"Page Size"},"description":"Page size. Default is 10. Must be greater than 0 and less than 5000."},{"name":"page","in":"query","required":false,"schema":{"type":"integer","description":"Page number","default":0,"title":"Page"},"description":"Page number"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchTasksRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchTasksResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/tasks/{task_id}/rules":{"post":{"tags":["Tasks"],"summary":"Create Task Rule","description":"Create a rule to be applied only to this task. Available rule types are KeywordRule, ModelHallucinationRuleV2, ModelSensitiveDataRule, PIIDataRule, PromptInjectionRule, RegexRule, ToxicityRule.Note: The rules are cached by the validation endpoints for 60 seconds.","operationId":"create_task_rule_api_v2_tasks__task_id__rules_post","security":[{"API Key":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewRuleRequest"},"examples":{"example1":{"summary":"Sensitive Data Example","description":"Sensitive Data Example with its required configuration","value":{"name":"Sensitive Data Rule","type":"ModelSensitiveDataRule","apply_to_prompt":true,"apply_to_response":false,"config":{"examples":[{"example":"John has O negative blood group","result":true},{"example":"Most of the people have A positive blood group","result":false}],"hint":"specific individual's blood types"}}},"example2":{"summary":"Regex Example","description":"Regex Example with its required configuration. Be sure to properly encode requests using JSON libraries. For example, the regex provided encodes to a different string when encoded to account for escape characters.","value":{"name":"SSN Regex Rule","type":"RegexRule","apply_to_prompt":true,"apply_to_response":true,"config":{"regex_patterns":["\\d{3}-\\d{2}-\\d{4}","\\d{5}-\\d{6}-\\d{7}"]}}},"example3":{"summary":"Keywords Rule Example","description":"Keywords Rule Example with its required configuration","value":{"name":"Blocked Keywords Rule","type":"KeywordRule","apply_to_prompt":true,"apply_to_response":true,"config":{"keywords":["Blocked_Keyword_1","Blocked_Keyword_2"]}}},"example4":{"summary":"Prompt Injection Rule Example","description":"Prompt Injection Rule Example, no configuration required","value":{"name":"Prompt Injection Rule","type":"PromptInjectionRule","apply_to_prompt":true,"apply_to_response":false}},"example5":{"summary":"Hallucination Rule V1 Example (Deprecated)","description":"Hallucination Rule Example, no configuration required (This rule is deprecated. Use ModelHallucinationRuleV2 instead.)","value":{"name":"Hallucination Rule","type":"ModelHallucinationRule","apply_to_prompt":false,"apply_to_response":true}},"example6":{"summary":"Hallucination Rule V2 Example","description":"Hallucination Rule Example, no configuration required","value":{"name":"Hallucination Rule","type":"ModelHallucinationRuleV2","apply_to_prompt":false,"apply_to_response":true}},"example7":{"summary":"Hallucination Rule V3 Example (Beta)","description":"Hallucination Rule Example, no configuration required. This rule is in beta and must be enabled by the system administrator.","value":{"name":"Hallucination Rule","type":"ModelHallucinationRuleV3","apply_to_prompt":false,"apply_to_response":true}},"example8":{"summary":"PII Rule Example","description":"PII Rule Example, no configuration required. \"disabled_pii_entities\", \"confidence_threshold\", and \"allow_list\" accepted. Valid value for \"confidence_threshold\" is 0.0-1.0. Valid values for \"disabled_pii_entities\" are CREDIT_CARD,CRYPTO,DATE_TIME,EMAIL_ADDRESS,IBAN_CODE,IP_ADDRESS,NRP,LOCATION,PERSON,PHONE_NUMBER,MEDICAL_LICENSE,URL,US_BANK_NUMBER,US_DRIVER_LICENSE,US_ITIN,US_PASSPORT,US_SSN","value":{"name":"PII Rule","type":"PIIDataRule","apply_to_prompt":true,"apply_to_response":true,"config":{"disabled_pii_entities":["EMAIL_ADDRESS","PHONE_NUMBER"],"confidence_threshold":"0.5","allow_list":["arthur.ai","Arthur"]}}},"example9":{"summary":"Toxicity Rule Example","description":"Toxicity Rule Example, no configuration required. Threshold accepted","value":{"name":"Toxicity Rule","type":"ToxicityRule","apply_to_prompt":true,"apply_to_response":true,"config":{"threshold":0.5}}}}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/tasks/{task_id}/rules/{rule_id}":{"patch":{"tags":["Tasks"],"summary":"Update Task Rules","description":"Enable or disable an existing rule for this task including the default rules.","operationId":"update_task_rules_api_v2_tasks__task_id__rules__rule_id__patch","security":[{"API Key":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Rule Id"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRuleRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/TaskResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}},"delete":{"tags":["Tasks"],"summary":"Archive Task Rule","description":"Archive an existing rule for this task.","operationId":"archive_task_rule_api_v2_tasks__task_id__rules__rule_id__delete","security":[{"API Key":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"}},{"name":"rule_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Rule Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}},"/api/v2/tasks/{task_id}/metrics":{"post":{"tags":["Tasks"],"summary":"Create Task Metric","description":"Create metrics for a task. Only agentic tasks can have metrics.","operationId":"create_task_metric_api_v2_tasks__task_id__metrics_post","security":[{"API Key":[]}],"parameters":[{"name":"task_id","in":"path","required":true,"schema":{"type":"string","format":"uuid","title":"Task Id"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewMetricRequest"},"examples":{"example1":{"type":"QueryRelevance","name":"My User Query Relevance","metric_metadata":"This is a test metric metadata"},"example2":{"type":"QueryRelevance","name":"My User Query Relevance with Config","metric_metadata":"This is a test metric metadata","config":{"relevance_threshold":0.8,"use_llm_judge":false}},"example3":{"type":"ResponseRelevance","name":"My Response Relevance","metric_metadata":"This is a test metric metadata","config":{"use_llm_judge":true}

# --- truncated at 32 KB (576 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/arthurai/refs/heads/main/openapi/arthur-engine-openapi.json