Skip to main content
POST
Create Automation
Creates an online evaluation automation that automatically runs evaluators on logs matching specified conditions.

Authentication

All endpoints require API key authentication:
Note: Use your API Key (not JWT token) for all requests. You can find your API keys in the Keywords AI platform under Settings > API Keys.

Required Fields

Optional Fields

Validation Rules

  • evaluator_ids must not be empty
  • All evaluator IDs must exist and belong to your organization
  • sampling_rate must be between 0.0 and 1.0
  • automation_type must be "online_eval" for evaluation automations
  • Condition must be of type "single_log" (aggregation not yet supported)

Examples

Basic Automation (10% Sampling)

Cost-Effective Monitoring (1% Sampling)

Full Evaluation (100% Sampling)

Disabled Automation (Created but Not Active)

Response

Status: 201 Created

Response Fields

How It Works

  1. Condition Evaluation: Incoming logs are evaluated against the specified condition
  2. Sampling: Logs that match the condition are sampled based on sampling_rate
  3. Async Evaluation: Sampled logs are queued for evaluation (doesn’t block logging pipeline)
  4. Score Creation: Evaluators run and scores are saved to the database
  5. Dashboard Visibility: Scores appear in the existing scores dashboard at /api/scores/

Important Notes

  • Evaluation runs asynchronously and doesn’t impact logging latency
  • Sampling reduces evaluation costs while maintaining statistical significance
  • Multiple evaluators can run on the same log
  • Scores are accessible via the standard Scores API
  • Online eval automations do not send notifications (use regular automations for alerts)

Error Responses

400 Bad Request

400 Bad Request - Invalid Sampling Rate

400 Bad Request - Empty Evaluator List

401 Unauthorized

404 Not Found - Condition