# SLO management API

Copy as Markdown[Open in ChatGPT](https://chatgpt.com/?q=Read%20https%3A%2F%2Fdocs-docusaurus.kinsta.page%2Fdeveloper-portal%2Fapis%2Fdata-management%2Fslo-management-api.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)[Open in Claude](https://claude.ai/new?q=Read%20https%3A%2F%2Fdocs-docusaurus.kinsta.page%2Fdeveloper-portal%2Fapis%2Fdata-management%2Fslo-management-api.md%20and%20help%20me%20with%20my%20question%20about%20this%20Coralogix%20documentation%20page.)

## Overview[​](#overview "Direct link to Overview")

The SLO API enables teams, particularly those not utilizing a UI, to efficiently manage their SLOs programmatically. This API will let you retrieve, read, create, update and delete your SLOs.

Note

To create SLO alerts via API or Terraform, [Alerts API v3](https://docs-docusaurus.kinsta.page/developer-portal/apis/data-management/alerts-api/alerts-grpc-api/.md) is required. To migrate from Alerts API v2 to v3, follow \[this guide]\(../../../../developer-portal/apis/data-management/alerts-api/alerts-v2-v3-migration/index.md.

### Prerequisites[​](#prerequisites "Direct link to Prerequisites")

* [API key for Alerts, Rules & Tags](https://docs-docusaurus.kinsta.page/user-guides/account-management/api-keys/api-keys/.md) to successfully authenticate

* Choose the <!-- -->api.:443<!-- --> endpoint that corresponds to your Coralogix [domain](https://docs-docusaurus.kinsta.page/user-guides/account-management/account-settings/coralogix-domain/.md) using the domain selector at the top of the page.

* Administrator permissions to manage your SLOs.

## API Endpoints[​](#api-endpoints "Direct link to API Endpoints")

This reference document lists example requests and responses using [gRPCurl](https://github.com/fullstorydev/grpcurl). The following calls accept arguments as JSON in the request body and return results as JSON in the response body.

### Authentication[​](#authentication "Direct link to Authentication")

Coralogix API uses API keys to authenticate requests. You can view and [manage your API keys](https://docs-docusaurus.kinsta.page/user-guides/account-management/api-keys/api-keys/.md) from the Data Flow tab in Coralogix. You need to use an API key in the Authorization request header to successfully connect.

Example:

```
grpcurl -H "Authorization: Bearer API_KEY_HERE"
```

Then, structure your header by using the <!-- -->api.:443<!-- --> endpoint for your Coralogix domain. To dynamically display the correct endpoint, use the domain selector at the top of the page.

```
-d @ api.eu2.coralogix.com:443
```

For SLO API, the service name will be `ServiceSloService`.

```
com.coralogixapis.apm.services.v1.ServiceSloService/
```

The complete request header should look like this:

```
grpcurl -H "Authorization: Bearer API_KEY_HERE" -d @ api.eu2.coralogix.com:443 com.coralogixapis.apm.services.v1.ServiceSloService/
```

### ListServiceSlos[​](#listserviceslos "Direct link to ListServiceSlos")

Lists all available SLOs from the entire service catalog. In this example, there are two available SLOs, `List_bigger_than_10ms` from `productcatalogservice` and `Latency_bigger_then_1ms` from the `frontend` service. Here you will find the `id` field associated with each SLO.

Example request:

```
grpcurl -H "Authorization: Bearer API_KEY_HERE" -d @ api.eu2.coralogix.com:443 com.coralogixapis.apm.services.v1.ServiceSloService/ListServiceSlos <<EOF

{

}

EOF
```

Example response:

```
{

  "slos": [

    {

      "id": "049b684b-4ef0-449e-8fad-33e5f90775b4",

      "name": "List_bigger_than_10ms",

      "serviceName": "productcatalogservice",

      "description": "Check if the operation of list products is bigger than 10ms for 50% of the spans",

      "targetPercentage": 50,

      "createdAt": "1970-01-20T11:38:56.476Z",

      "remainingErrorBudgetPercentage": 100,

      "latencySli": {

        "thresholdMicroseconds": "10000",

        "thresholdSymbol": "THRESHOLD_SYMBOL_GREATER_OR_EQUAL"

      },

      "filters": [

        {

          "field": "operationname",

          "compareType": "COMPARE_TYPE_IS",

          "fieldValues": [

            "hipstershop.ProductCatalogService/ListProducts"

          ]

        }

      ],

      "period": "SLO_PERIOD_7_DAYS"

    },

    {

      "id": "089d1831-7c40-4a31-bab8-0f64116c18b2",

      "name": "Latency_bigger_then_1ms",

      "serviceName": "frontend",

      "description": "Check if latency is bigger then 1ms ",

      "targetPercentage": 1,

      "createdAt": "1970-01-20T11:40:32.323Z",

      "remainingErrorBudgetPercentage": 100,

      "latencySli": {

        "thresholdMicroseconds": "1000",

        "thresholdSymbol": "THRESHOLD_SYMBOL_GREATER_OR_EQUAL"

      },

      "period": "SLO_PERIOD_7_DAYS"

    }

  ]

}
```

### GetServiceSlo[​](#getserviceslo "Direct link to GetServiceSlo")

Retrieves specific SLO information for a given service. In this example, you are retrieving all SLOs for the `frontend`service. You need to provide the SLO `id`.

Example request:

```
grpcurl -H "Authorization: Bearer API_KEY_HERE" -d @ api.eu2.coralogix.com:443 com.coralogixapis.apm.services.v1.ServiceSloService/GetServiceSlo <<EOF

{

    "id": "049b684b-4ef0-449e-8fad-33e5f90775b4"

}

EOF
```

Example response:

```
{

  "slo": {

    "id": "049b684b-4ef0-449e-8fad-33e5f90775b4",

    "name": "List_bigger_than_10ms",

    "serviceName": "productcatalogservice",

    "description": "Check if the operation of list products is bigger than 10ms for 50% of the spans",

    "targetPercentage": 50,

    "createdAt": "1970-01-20T11:38:56.476Z",

    "remainingErrorBudgetPercentage": 100,

    "latencySli": {

      "thresholdMicroseconds": "10000",

      "thresholdSymbol": "THRESHOLD_SYMBOL_GREATER_OR_EQUAL"

    },

    "filters": [

      {

        "field": "operationname",

        "compareType": "COMPARE_TYPE_IS",

        "fieldValues": [

          "hipstershop.ProductCatalogService/ListProducts"

        ]

      }

    ],

    "period": "SLO_PERIOD_7_DAYS"

  }

}
```

### BatchGetServiceSlos[​](#batchgetserviceslos "Direct link to BatchGetServiceSlos")

Retrieves specified SLOs from the list. You need to provide the `id` for each required SLO. In this example, we are retrieving `List_bigger_than_10ms` and `Latency_bigger_than_1ms`.

Example request:

```
grpcurl -H "Authorization: Bearer API_KEY_HERE" -d @ api.eu2.coralogix.com:443 com.coralogixapis.apm.services.v1.ServiceSloService/BatchGetServiceSlos <<EOF

{

  "ids": ["049b684b-4ef0-449e-8fad-33e5f90775b4", "089d1831-7c40-4a31-bab8-0f64116c18b2"]

}

EOF
```

Example response:

```
{

  "slos": {

    "049b684b-4ef0-449e-8fad-33e5f90775b4": {

      "id": "049b684b-4ef0-449e-8fad-33e5f90775b4",

      "name": "List_bigger_than_10ms",

      "serviceName": "productcatalogservice",

      "description": "Check if the operation of list products is bigger than 10ms for 50% of the spans",

      "targetPercentage": 50,

      "createdAt": "1970-01-20T11:38:56.476Z",

      "remainingErrorBudgetPercentage": 100,

      "latencySli": {

        "thresholdMicroseconds": "10000",

        "thresholdSymbol": "THRESHOLD_SYMBOL_GREATER_OR_EQUAL"

      },

      "filters": [

        {

          "field": "operationname",

          "compareType": "COMPARE_TYPE_IS",

          "fieldValues": [

            "hipstershop.ProductCatalogService/ListProducts"

          ]

        }

      ],

      "period": "SLO_PERIOD_7_DAYS"

    },

    "089d1831-7c40-4a31-bab8-0f64116c18b2": {

      "id": "089d1831-7c40-4a31-bab8-0f64116c18b2",

      "name": "Latency_bigger_then_1ms",

      "serviceName": "frontend",

      "description": "Check if latency is bigger then 1ms ",

      "targetPercentage": 1,

      "createdAt": "1970-01-20T11:40:32.323Z",

      "remainingErrorBudgetPercentage": 100,

      "latencySli": {

        "thresholdMicroseconds": "1000",

        "thresholdSymbol": "THRESHOLD_SYMBOL_GREATER_OR_EQUAL"

      },

      "period": "SLO_PERIOD_7_DAYS"

    }

  }

}
```

### CreateServiceSlo[​](#createserviceslo "Direct link to CreateServiceSlo")

Creates a new SLO with given configuration for a chosen service. In this example, you are creating the `frontendtest`SLO for a `frontend` service.

Example request:

```
grpcurl -H "Authorization: Bearer API_KEY_HERE" -d @ api.eu2.coralogix.com:443 com.coralogixapis.apm.services.v1.ServiceSloService/CreateServiceSlo <<EOF

{

  "slo": {

    "name": "frontendtest",

    "serviceName": "frontend",

    "description": "Sample description for your SLO",

    "targetPercentage": 95,

    "errorSli": {

    },

    "period": "SLO_PERIOD_7_DAYS"

  }

}

EOF
```

Example response:

```
{

  "slo": {

    "id": "0416396c-a1ad-46d8-a10c-a05ea15dc3af",

    "name": "frontendtest",

    "serviceName": "frontend",

    "description": "Sample description for your SLO",

    "targetPercentage": 95,

    "createdAt": "1970-01-20T17:43:33.485Z",

    "remainingErrorBudgetPercentage": 100,

    "errorSli": {},

    "period": "SLO_PERIOD_7_DAYS"

  }

}
```

### ReplaceServiceSlo[​](#replaceserviceslo "Direct link to ReplaceServiceSlo")

Updates an SLO with new field entries for a chosen service. In this example, you are replacing the `description` content for a frontend service SLO. The SLO is supposed to check for errors in the frontend.

Example request:

```
grpcurl -H "Authorization: Bearer API_KEY_HERE" -d @ api.eu2.coralogix.com:443 com.coralogixapis.apm.services.v1.ServiceSloService/ReplaceServiceSlo <<EOF

{

  "slo": {

    "id": "0416396c-a1ad-46d8-a10c-a05ea15dc3af",

    "name": "frontendtest",

    "serviceName": "frontend",

    "description": "Checks for frontend errors.",

    "targetPercentage": 95,

    "errorSli": {},

    "period": "SLO_PERIOD_7_DAYS"

  }

}

EOF
```

Example response:

```
"slo": {

    "id": "0416396c-a1ad-46d8-a10c-a05ea15dc3af",

    "name": "frontendtest",

    "serviceName": "frontend",

    "description": "Checks for frontend errors.",

    "targetPercentage": 95,

    "createdAt": "1970-01-20T17:43:33.485Z",

    "remainingErrorBudgetPercentage": 100,

    "errorSli": {},

    "period": "SLO_PERIOD_7_DAYS"

  }

}
```

### DeleteServiceSlo[​](#deleteserviceslo "Direct link to DeleteServiceSlo")

Deletes a specified SLO for a given service. In this example, you are deleting the `frontendtest` SLO from the `frontend`service.

Example request:

```
grpcurl -H "Authorization: Bearer API_KEY_HERE" -d @ api.eu2.coralogix.com:443 com.coralogixapis.apm.services.v1.ServiceSloService/DeleteServiceSlo <<EOF

{

    "id": "0416396c-a1ad-46d8-a10c-a05ea15dc3af"

}

EOF
```

Example response:

```
{}
```

## Body Parameters[​](#body-parameters "Direct link to Body Parameters")

| Field                            | Type      | Definition                                                             |
| -------------------------------- | --------- | ---------------------------------------------------------------------- |
| id                               | int32     | Unique identifier for the Service Level Objective (SLO).               |
| ids                              | array     | List of service SLO IDs to retrieve.                                   |
| slos                             | array     | List of Service Level Objectives (SLOs) with their respective details. |
| name                             | string    | Name of the SLO.                                                       |
| serviceName                      | string    | Service name associated with the SLO.                                  |
| description                      | string    | Description of the SLO.                                                |
| targetPercentage                 | integer   | Target percentage for the SLO.                                         |
| createdAt                        | timestamp | Timestamp indicating when the SLO was created.                         |
| remainingErrorBudgetPercentage   | integer   | Remaining error budget percentage.                                     |
| errorSli                         | boolean   | Indicates the presence of an error SLI.                                |
| latencySli                       | array     | Defines SLI threshold and relationship.                                |
| latencySli.thresholdMicroseconds | string    | Threshold in microseconds for latency.                                 |
| latencySli.thresholdSymbol       | enum      | Symbol indicating the threshold relationship (e.g.GREATER\_OR\_EQUAL). |
| filters.field                    | string    | Field for the filter.                                                  |
| filters.compareType              | enum      | Type of comparison (e.g., IS, START\_WITH).                            |
| filters.fieldValues              | string    | List of field values for the filter.                                   |
| period                           | enum      | Period for the SLO (e.g., 7 days, 14 days).                            |

**CompareType**

| Name                       | Number | Description                                    |
| -------------------------- | ------ | ---------------------------------------------- |
| COMPARE\_TYPE\_UNSPECIFIED | 0      | Filter entry is unspecified                    |
| COMPARE\_TYPE\_IS          | 1      | Filters for a specific entry.                  |
| COMPARE\_TYPE\_START\_WITH | 2      | Filters for results that start with the entry. |
| COMPARE\_TYPE\_ENDS\_WITH  | 3      | Filters for results that end with the entry.   |
| COMPARE\_TYPE\_INCLUDES    | 4      | Filters for a result that includes the entry.  |

ThresholdSymbol

| Name                                  | Number | Description                                                           |
| ------------------------------------- | ------ | --------------------------------------------------------------------- |
| THRESHOLD\_SYMBOL\_UNSPECIFIED        | 0      | Threshold criterion is not given.                                     |
| THRESHOLD\_SYMBOL\_GREATER            | 1      | Threshold criterion is greater than the specified number.             |
| THRESHOLD\_SYMBOL\_GREATER\_OR\_EQUAL | 2      | Threshold criterion is greater than or equal to the specified number. |
| THRESHOLD\_SYMBOL\_LESS               | 3      | Threshold criterion is less than the specified number.                |
| THRESHOLD\_SYMBOL\_LESS\_OR\_EQUAL    | 4      | Threshold criterion is less than or equal to the specified number.    |
| THRESHOLD\_SYMBOL\_EQUAL              | 5      | Threshold criterion is equal to the specified number.                 |
| THRESHOLD\_SYMBOL\_NOT\_EQUAL         | 6      | Threshold criterion is not equal to the specified number.             |

SloPeriod

| Name                     | Number | Description                                                    |
| ------------------------ | ------ | -------------------------------------------------------------- |
| SLO\_PERIOD\_UNSPECIFIED | 0      | Time period for which the SLO measures results is unspecified. |
| SLO\_PERIOD\_7\_DAYS     | 1      | Time period for which the SLO measures results is 7 days.      |
| SLO\_PERIOD\_14\_DAYS    | 2      | Time period for which the SLO measures results is 14 days.     |
| SLO\_PERIOD\_30\_DAYS    | 3      | Time period for which the SLO measures results is 30 days.     |

## Additional resources[​](#additional-resources "Direct link to Additional resources")

|                     |                                                                                                 |
| ------------------- | ----------------------------------------------------------------------------------------------- |
| Coralogix Endpoints | [Coralogix Endpoints](https://docs-docusaurus.kinsta.page/integrations/coralogix-endpoints/.md) |
