> ## Documentation Index
> Fetch the complete documentation index at: https://docs.chronosphere.io/llms.txt
> Use this file to discover all available pages before exploring further.

# CreateSLO



## OpenAPI

````yaml openapi/api_v1_config_openapi3_DOCUMENTATION_ONLY.json POST /api/v1/config/slos
openapi: 3.0.3
info:
  description: >

    The Config API provides standard HTTP/JSON REST endpoints for creating,
    reading,

    updating, deleting, and listing configurable Chronosphere resources.


    Use this link to download the raw Swagger specification:

    <a href="/api/v1/config/swagger.json">/api/v1/config/swagger.json</a>
  title: Config V1 API
  version: v1
servers:
  - url: https://{tenant}.chronosphere.io
    variables:
      tenant:
        default: tenant
        description: tenant ID assigned by the service provider
security:
  - ApiKeyAuth: []
tags:
  - name: ConfigV1
paths:
  /api/v1/config/slos:
    post:
      tags:
        - SLO
      operationId: CreateSLO
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/configv1CreateSLORequest'
        required: true
        x-originalParamName: body
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/configv1CreateSLOResponse'
          description: A successful response containing the created SLO.
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiError'
          description: Cannot create the SLO because the request is invalid.
        '409':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiError'
          description: >-
            Cannot create the SLO because there is a conflict with an existing
            SLO.
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/apiError'
          description: An unexpected error response.
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/genericError'
          description: An undefined error response.
components:
  schemas:
    configv1CreateSLORequest:
      properties:
        dry_run:
          description: >-
            If `true`, validates the specified configuration without creating
            the SLO. If the specified configuration is valid, the endpoint
            returns a partial response without the SLO. If the specified
            configuration is invalid, the endpoint returns an error.
          type: boolean
        slo:
          allOf:
            - $ref: '#/components/schemas/configv1SLO'
          description: The SLO to create.
      type: object
    configv1CreateSLOResponse:
      properties:
        slo:
          $ref: '#/components/schemas/configv1SLO'
      type: object
    apiError:
      properties:
        message:
          description: An error message describing what went wrong.
          type: string
      type: object
    genericError:
      additionalProperties: true
      type: object
    configv1SLO:
      properties:
        annotations:
          additionalProperties:
            type: string
          description: |-
            Annotations are visible in notifications generated by this SLO.
            You can template annotations with labels from notifications.
          type: object
        collection_ref:
          $ref: '#/components/schemas/configv1CollectionReference'
        created_at:
          description: Timestamp of when the SLO was created. Cannot be set by clients.
          format: date-time
          readOnly: true
          type: string
        definition:
          allOf:
            - $ref: '#/components/schemas/SLODefinition'
          description: Defines the core criteria the SLO measures.
        description:
          type: string
        labels:
          additionalProperties:
            type: string
          description: |-
            Labels are visible in notifications generated by this SLO,
            and can be used to route alerts with notification overrides.
          type: object
        name:
          description: >-
            The name of the SLO. You can modify this value after the SLO is
            created.
          type: string
        notification_policy_slug:
          description: >-
            Optional. Slug of the notification policy to use for the SLO. If you
            don't

            specify a value, then the collection or service this SLO belongs to
            must have a

            notification policy. Required if alerting is enabled for this SLO.
          example: alerting_notification_policy
          type: string
        signal_grouping:
          $ref: '#/components/schemas/MonitorSignalGrouping'
        sli:
          $ref: '#/components/schemas/configv1SLI'
        slug:
          description: >-
            The unique identifier of the SLO. If a `slug` isn't provided, one is
            generated based on the `name` field. You can't modify this field
            after the SLO is created.
          type: string
        updated_at:
          description: >-
            Timestamp of when the SLO was last updated. Cannot be set by
            clients.
          format: date-time
          readOnly: true
          type: string
      required:
        - name
      type: object
    configv1CollectionReference:
      properties:
        slug:
          type: string
        type:
          $ref: '#/components/schemas/configv1CollectionReferenceType'
      type: object
    SLODefinition:
      properties:
        burn_rate_alerting_config:
          description: >-
            Provides the burn rate alert configuration for the SLO. If not
            provided, the

            default burn rates are used. The configuration is only valid if the

            `enable_burn_rate_alerting` flag is set to `true`.
          items:
            $ref: '#/components/schemas/DefinitionBurnRateDefinition'
          type: array
        enable_burn_rate_alerting:
          description: If `true`, enables burn rate alerting.
          type: boolean
        objective:
          description: >-
            The SLO target percentage, which represents the availability of the
            SLO.
          example: '99.9995'
          format: double
          type: number
        time_window:
          allOf:
            - $ref: '#/components/schemas/DefinitionTimeWindow'
          description: >-
            Specifies the duration over which the SLO is evaluated. The SLO is
            considered

            breached if the error budget is depleted in this window. Default:
            `4w` (4

            weeks).
          example: 4w
      type: object
    MonitorSignalGrouping:
      description: >-
        SignalGrouping defines how the set of series from the query are split
        into signals.
      properties:
        label_names:
          description: >-
            Set of label names used to split series into signals. Each unique
            combination

            of labels result in its own signal. For example, if `label_names` is

            `["service", "code"]`, then all series including labels

            `{service="foo",code="404"}` will be grouped together in the same
            signal.


            Cannot be used if `graphite_query` is set.
          items:
            type: string
          type: array
        signal_per_series:
          description: >-
            If set to `true`, each series will have its own signal. Cannot be
            used with

            `label_names`.
          type: boolean
      type: object
    configv1SLI:
      properties:
        additional_promql_filters:
          description: >-
            Specifies additional PromQL filters, which are made available to the
            SLO queries.

            Use these filters to reduce the number of metrics used by the SLO.
          example: cluster!~"dev"
          items:
            $ref: '#/components/schemas/commonPromQLMatcher'
          type: array
        custom_dimension_labels:
          description: >-
            Configures additional labels to export from the underlying queries.
            This feature

            provides a logical budget to group unique combinations of
            dimensions. For

            example, if you want to track a budget per endpoint, add the
            endpoint label as a

            dimension. These dimensions are provided on the top-level SLI so
            that SLOs will

            receive them in the `.GroupBy` variable.
          items:
            type: string
          type: array
        custom_indicator:
          allOf:
            - $ref: '#/components/schemas/SLICustomIndicatorConfig'
          description: >-
            Indicates an error ratio SLI, which measures a count of events
            matching some

            condition against a total number of events. For example, measuring a
            ratio of

            successful requests against the total number of requests. Use
            `custom_indicator`

            to track error ratio SLOs. You can set only one of
            `custom_indicator` or

            `custom_timeslice_indicator`.
        custom_timeslice_indicator:
          allOf:
            - $ref: '#/components/schemas/SLICustomTimeSliceIndicatorConfig'
          description: >-
            Indicates a TimeSlice SLI, which measures a count of time slices
            that meet a

            defined condition, compared against the total number of time slices
            in a

            specific time period. Use `custom_timeslice_indicator` to track
            TimeSlice SLOs.

            You can set only one of `custom_indicator` or
            `custom_timeslice_indicator`.
      type: object
    configv1CollectionReferenceType:
      enum:
        - SIMPLE
        - SERVICE
      title: Type values must match entitiespb.Collection.CollectionType.
      type: string
    DefinitionBurnRateDefinition:
      properties:
        budget:
          description: >-
            The amount of allowed errors during a given time window, expressed
            as a

            percentage of the error budget. Must be a value between `0.0` and
            `100.0`,

            exclusive.
          example: '50.0'
          format: double
          type: number
        labels:
          additionalProperties:
            type: string
          description: >-
            Labels to attach when this burn rate triggers. If you add these
            labels to

            `signal_groupings`, you can route them in the notification policy,
            and can

            route different burn rates to other notifiers.
          type: object
        severity:
          description: >-
            Defines the alert severity level, which can only be one of
            `critical` or

            `warn`.
          type: string
        window:
          description: Time window for the burn rate calculation.
          type: string
      required:
        - window
      type: object
    DefinitionTimeWindow:
      properties:
        duration:
          description: >-
            Time window that defines the evaluation period as a string, in the
            format

            like `"28d"` (28 days) or `"24h"` (24 hours).
          example: '"30d"'
          type: string
      type: object
    commonPromQLMatcher:
      properties:
        name:
          description: Prometheus label name for the matcher
          type: string
        type:
          allOf:
            - $ref: '#/components/schemas/commonPromQLMatcherType'
          description: The type of match to be performed
        value:
          description: Prometheus label value for the matcher
          type: string
      type: object
    SLICustomIndicatorConfig:
      description: >-
        Configuration for error ratio SLIs. You can include these variables in
        PromQL

        queries for SLIs:

        - `{{.Window}}`: Specifies the window of time that the PromQL query
        operates on.

        - `{{.GroupBy}}`: Specifies a comma-separated list of signal and
        dimension
          labels to group the results by.
        - `{{.AdditionalFilters}}`: Requires setting
        `additional_promql_filters`.
      properties:
        bad_query_template:
          description: >-
            A PromQL query that measures the number of "bad" events for this
            SLI.

            Either this or `good_query_template` must be set.
          type: string
        good_query_template:
          description: >-
            A PromQL query that measures the number of "good" events for this
            SLI.

            Either this or `bad_query_template` must be set.
          type: string
        total_query_template:
          description: >-
            A PromQL query that measures the total number of events for this
            SLI.

            This is required for all error ratio SLOs.
          type: string
      required:
        - total_query_template
      type: object
    SLICustomTimeSliceIndicatorConfig:
      description: >-
        Defines the configuration for time slice SLIs. Time slice SLIs are
        evaluated by

        running a PromQL query over a certain time window and comparing the
        result against

        a condition. You can include these variables in PromQL queries for SLIs:

        - `{{.Window}}`: Specifies the window of time that the PromQL query
        operates on.

        - `{{.GroupBy}}`: Specifies a comma-separated list of signal and
        dimension labels
          to group the results by.
        - `{{.TimeSlice}}`: The time slice being evaluated, such as `1m` or
        `5m`.

        - `{{.AdditionalFilters}}`: Requires setting
        `additional_promql_filters`.
      properties:
        condition:
          allOf:
            - $ref: '#/components/schemas/SLITimeSliceCondition'
          description: The condition to use for the SLI.
        query_template:
          description: A PromQL query template for the time slice SLI.
          type: string
        timeslice_size:
          allOf:
            - $ref: '#/components/schemas/SLITimeSliceSize'
          description: The size of the time slice to use for the SLI.
      type: object
    commonPromQLMatcherType:
      enum:
        - MatchEqual
        - MatchRegexp
        - MatchNotEqual
        - MatchNotRegexp
      type: string
    SLITimeSliceCondition:
      description: Defines the condition for evaluating time slice SLIs.
      properties:
        op:
          allOf:
            - $ref: '#/components/schemas/ConditionOp'
          description: The comparison operation to use.
        value:
          description: The value to compare against.
          format: double
          type: number
      type: object
    SLITimeSliceSize:
      description: Defines the supported time slice sizes for time slice SLIs.
      enum:
        - TIMESLICE_SIZE_ONE_MINUTE
        - TIMESLICE_SIZE_FIVE_MINUTES
      type: string
    ConditionOp:
      enum:
        - GEQ
        - GT
        - LEQ
        - LT
        - EQ
        - NEQ
        - EXISTS
        - NOT_EXISTS
        - SIGNAL_NOT_EXISTS
      type: string
  securitySchemes:
    ApiKeyAuth:
      description: Chronosphere API token
      in: header
      name: API-Token
      type: apiKey

````