Launch Week 02 wrapped — explore all five launches

Create Alert

POSThttps://api.confident-ai.com/v2/scheduled-alerts

Creates an alert that re-runs an aggregate query on a schedule and notifies when the result crosses the threshold, and returns its id. Notifications are delivered through the project's integrations that have alerting enabled for the alert's severity, so an alert in a project with no such integration still evaluates but reaches nobody.

POST/v2/scheduled-alerts
curl -X POST "https://api.confident-ai.com/v2/scheduled-alerts" \
  -H "CONFIDENT_API_KEY: <PROJECT-API-KEY>" \
  -H "Content-Type: application/json" \
  -d '{
  "recurrence": "ONCE",
  "repeatEvery": 1,
  "repeatUnit": "MINUTE",
  "startAt": "2025-02-01T09:00:00Z",
  "maxRuns": 12,
  "endAt": "2025-12-31T23:59:59Z",
  "description": "Errors above 5% over the last hour.",
  "filters": {
    "operator": "AND",
    "groups": [
      {
        "operator": "AND",
        "filters": [
          {
            "category": "Trace Name",
            "condition": "Is",
            "value": "checkout"
          }
        ]
      }
    ]
  },
  "severity": "CRITICAL",
  "name": "Trace error rate spike",
  "dataModel": "TRACE",
  "aggregation": "ERROR_RATE",
  "thresholdSettings": {
    "value": 0.05,
    "direction": "above"
  },
  "enabled": true
}'
200
{
  "success": true,
  "data": {
    "id": "<SCHEDULED-ALERT-ID>"
  },
  "link": "https://app.confident-ai.com/project/<PROJECT-ID>/monitors",
  "deprecated": false
}

Headers

  • CONFIDENT_API_KEYstringRequired

    The API key of your Confident AI project.

Request body

  • recurrenceenum

    How often a schedule fires: ONCE runs a single time at startAt, INTERVAL repeats every repeatEvery repeatUnits.

    Show 2 enum valuesHide 2 enum values
    • ONCE
    • INTERVAL
  • repeatEveryinteger | null

    How many repeatUnits apart the runs are, for an INTERVAL schedule. Send null to clear it.

  • repeatUnitenum | null

    The unit repeatEvery counts for an INTERVAL schedule.

    Show 5 enum valuesHide 5 enum values
    • MINUTE
    • HOUR
    • DAY
    • WEEK
    • MONTH
  • startAtstring | null

    When the schedule first runs, as an ISO 8601 datetime. Send null to start it immediately.

  • maxRunsinteger | null

    How many times the schedule runs before it stops. Send null to let it run indefinitely.

  • endAtstring | null

    When the schedule stops running, as an ISO 8601 datetime. Send null to leave it open-ended.

  • descriptionstring | null

    What the alert means and what to do about it, included in the notification. Send null to clear it.

  • filtersobject | null

    A set of filter groups combined by a top-level operator. Each group combines its filter rows by its own operator, and each row matches one property, such as Name or User Id, against a value with a condition such as Is or Contains.

    Show 2 propertiesHide 2 properties
    • operatorenumRequired

      Show 2 enum valuesHide 2 enum values
      • AND
      • OR
    • groupslist of objectsRequired

      Show 2 propertiesHide 2 properties
      • operatorenumRequired

        Show 2 enum valuesHide 2 enum values
        • AND
        • OR
      • filterslist of objectsRequired

        Show 4 propertiesHide 4 properties
        • categoryenumRequired

          Show 80 enum valuesHide 80 enum values
          • User Id
          • Thread Id
          • Trace Uuid
          • Trace Name
          • Trace Version
          • Trace Status
          • Trace Tags
          • Trace
          • Span Uuid
          • Name
          • Span Name
          • Span Type
          • Span Status
          • Metrics Status
          • Error Status
          • Name
          • Model
          • Provider
          • Integration
          • Embedder
          • Chunk Size
          • Top-K
          • Hyperparameter
          • Dataset
          • Dataset Name
          • Test Run ID
          • Identifier
          • Test File
          • Status
          • Official
          • Evals Mode
          • Tests Passed
          • Tests Failed
          • Pass Rate
          • Fail Rate
          • Star Rating
          • Thumbs Rating
          • Explanation
          • Expected Output
          • Expected Outcome
          • Annotator
          • End User
          • Annotation Type
          • Annotation Name
          • Criteria
          • Annotation Date
          • Metric Score
          • Metric Status
          • Name
          • Metadata
          • Classifier
          • Metric
          • Metric Name
          • Trace Count
          • Test Case ID
          • Requested review from
          • Assigned to
          • Tags
          • Labels
          • Tools Called
          • Finalized
          • Golden ID
          • Ingestion Task
          • Latency
          • Environment
          • Review flag
          • Vulnerability
          • Vulnerability Type
          • Attack Method
          • Risk Category
          • Framework
          • Assessment ID
          • Prompt Alias
          • Prompt Version
          • Prompt Label
          • Prompt Commit Hash
          • Prompt
          • Annotations
          • Status Code
          • Actor Type
        • conditionenum | enum | enum | enum | enum | enum | enum | enum | enum | enumRequired

          Show 10 variantsHide 10 variants
          • enum

            Show 6 enum valuesHide 6 enum values
            • Is less than
            • Is equal or less than
            • Is greater than
            • Is equal or greater than
            • Is equal to
            • Does not equal
          • OR
          • enum

            Show 2 enum valuesHide 2 enum values
            • Has
            • Has not
          • OR
          • enum

            Show 2 enum valuesHide 2 enum values
            • Is
            • Is not
          • OR
          • enum

            Show 2 enum valuesHide 2 enum values
            • Is one of
            • Is not one of
          • OR
          • enum

            Show 4 enum valuesHide 4 enum values
            • Is
            • Is not
            • Is empty
            • Is not empty
          • OR
          • enum

            Show 2 enum valuesHide 2 enum values
            • Contains
            • Does not contain
          • OR
          • enum

            Show 3 enum valuesHide 3 enum values
            • Contains
            • Contains only
            • Does not contain
          • OR
          • enum

            Show 4 enum valuesHide 4 enum values
            • Has decreased by more than
            • Has decreased by less than
            • Has increased by more than
            • Has increased by less than
          • OR
          • enum

            Show 1 enum valueHide 1 enum value
            • Has changed from
          • OR
          • enum

            Show 1 enum valueHide 1 enum value
            • Is between
        • valuestring | number | list of stringsRequired

          Show 3 variantsHide 3 variants
          • string

          • OR
          • number

          • OR
          • list of strings

        • keystring

  • severityenum

    How urgent the alert is. It also decides who hears about it: an integration receives an alert only when it subscribes to that severity.

    Show 4 enum valuesHide 4 enum values
    • CRITICAL
    • ERROR
    • WARNING
    • INFO
  • namestringRequired

    A name for the alert, shown in the notification.

  • dataModelenumRequired

    What kind of production item an alert measures over. TRACE and SPAN alerts aggregate single requests; THREAD alerts aggregate conversations.

    Show 8 enum valuesHide 8 enum values
    • TRACE
    • SPAN
    • LLM_SPAN
    • AGENT_SPAN
    • RETRIEVER_SPAN
    • TOOL_SPAN
    • CUSTOM_SPAN
    • THREAD
  • aggregationstringRequired

    What to measure, as an aggregation token. Which tokens are valid depends on dataModel: TRACE accepts COUNT, ERROR_RATE, PASS_RATE, UNIQUE_END_USERS, UNIQUE_THREADS, AVG_LATENCY, P50_LATENCY, P90_LATENCY, P99_LATENCY, TOTAL_COST, AVG_COST, UNIQUE_METADATA_VALUES; SPAN accepts COUNT, AVG_LATENCY, P50_LATENCY, P90_LATENCY, P99_LATENCY, ERROR_RATE, ERROR_COUNT, INPUT_COST, OUTPUT_COST, TOTAL_COST, AVG_COST, INPUT_TOKENS, OUTPUT_TOKENS, TOTAL_TOKENS, UNIQUE_METADATA_VALUES; LLM_SPAN accepts COUNT, AVG_LATENCY, P50_LATENCY, P90_LATENCY, P99_LATENCY, ERROR_RATE, ERROR_COUNT, INPUT_COST, OUTPUT_COST, TOTAL_COST, AVG_COST, INPUT_TOKENS, OUTPUT_TOKENS, TOTAL_TOKENS, UNIQUE_METADATA_VALUES; AGENT_SPAN accepts COUNT, AVG_LATENCY, P50_LATENCY, P90_LATENCY, P99_LATENCY, ERROR_RATE, ERROR_COUNT, INPUT_COST, OUTPUT_COST, TOTAL_COST, AVG_COST, UNIQUE_METADATA_VALUES; RETRIEVER_SPAN accepts COUNT, AVG_LATENCY, P50_LATENCY, P90_LATENCY, P99_LATENCY, ERROR_RATE, ERROR_COUNT, INPUT_COST, OUTPUT_COST, TOTAL_COST, AVG_COST, UNIQUE_METADATA_VALUES; TOOL_SPAN accepts COUNT, AVG_LATENCY, P50_LATENCY, P90_LATENCY, P99_LATENCY, ERROR_RATE, ERROR_COUNT, INPUT_COST, OUTPUT_COST, TOTAL_COST, AVG_COST, UNIQUE_METADATA_VALUES; CUSTOM_SPAN accepts COUNT, AVG_LATENCY, P50_LATENCY, P90_LATENCY, P99_LATENCY, ERROR_RATE, ERROR_COUNT, INPUT_COST, OUTPUT_COST, TOTAL_COST, AVG_COST, UNIQUE_METADATA_VALUES; THREAD accepts COUNT, UNIQUE_USERS, UNIQUE_METADATA_VALUES.

  • thresholdSettingsobjectRequired

    When the alert fires. Latency is compared in seconds, cost in USD, and rates such as ERROR_RATE as fractions between 0 and 1.

    Show 2 propertiesHide 2 properties
    • valuenumberRequired

      The number the measured value is compared against.

    • directionenumRequired

      Whether the alert fires when the measured value rises above the threshold or falls below it.

      Show 2 enum valuesHide 2 enum values
      • above
      • below
  • enabledboolean

    Whether the schedule runs. Defaults to true.

Response

Create Alert succeeded.

  • successboolean

    Indicates if the request was successful.

  • dataobject

    A reference to a scheduled alert by its id.

    Show 1 propertyHide 1 property
    • idstring

      The id of the scheduled alert, generated by Confident AI.

  • linkstring

    This is the URL of the resource on the Confident AI platform.

  • deprecatedboolean

    Indicates if this endpoint is deprecated.

Built byConfident AI