Skip to main content
SLO & Service Quality/SLO

CreateSLI

Create a new SLI definition with metric type and PromQL queries.

POST/api/v1/slo/slis

Operation ID

CreateSLI

Since

1.0.0

Execution Mode

Synchronous

Auth Context

Auth Required

Auth Context

Send these values as request headers when calling this API.

AuthorizationstringRequired

Bearer Token

X-Tenant-IDstring

X-Tenant-ID

Request Inputs

application/json

Body Fields

  • name
    StringRequired

    Human-readable name for the new SLI.

    Example: api-availability

  • description
    StringRequired

    Detailed description of what this SLI measures.

    Example: HTTP success rate for the public API

  • metricType
    StringRequired

    Metric category: availability | latency | throughput | error_rate.

    Example: availability

  • goodEventsQuery
    StringRequired

    PromQL query that counts good (successful) events.

    Example: sum(rate(http_requests_total{status=~"2.."}[5m]))

  • totalEventsQuery
    StringRequired

    PromQL query that counts all events (the denominator).

    Example: sum(rate(http_requests_total[5m]))

Responses

200 OK
200 OK

On success, this API returns the following response structure.

  • id
    String

    Unique identifier of the SLI definition.

    Example: sli-abc123

  • name
    String

    Human-readable name of the SLI.

    Example: api-availability

  • description
    String

    Detailed description of what this SLI measures.

    Example: Ratio of successful HTTP requests to total requests

  • metricType
    String

    Metric category: availability | latency | throughput | error_rate.

    Example: availability

  • goodEventsQuery
    String

    PromQL expression counting good (successful) events.

    Example: sum(rate(http_requests_total{status=~"2.."}[5m]))

  • totalEventsQuery
    String

    PromQL expression counting all events (denominator).

    Example: sum(rate(http_requests_total[5m]))

  • unit
    String

    Unit of the measured metric (e.g., requests, ms).

    Example: requests

  • sourceProduct
    String

    Product or service that owns this SLI.

    Example: zcf-api

  • createdAt
    String

    Timestamp when this SLI definition was created.

    Example: 2026-01-15T08:00:00Z