Adjust your service retention period with the **Service Retention Period gRPC API**.

## Overview

This documentation details the Service Retention Period gRPC API, empowering you to modify the default 30-day period for removing services from your [Service Catalog](https://coralogix.com/docs/user-guides/apm/features/service-catalog/index.md) or databases from your [Database Catalog](https://coralogix.com/docs/user-guides/apm/features/database-monitoring/index.md) in the absence of traffic.

## Permissions

To utilize the API, you must have the `service-catalog:Update` permission. This permission is automatically granted to the following roles: Data Admin, Platform Admin, Observability Lead, and Legacy Admin. Find out more [here](https://coralogix.com/docs/user-guides/aaa/access-control/permissions/index.md).

## Prerequisites

- [Alerts, Rules & Tags API key](https://coralogix.com/docs/user-guides/account-management/api-keys/api-keys/index.md) to successfully authenticate
- Choose the api.\[[DOMAIN_VALUE]\]:443 endpoint that corresponds to your Coralogix [domain](https://coralogix.com/docs/user-guides/account-management/account-settings/coralogix-domain/index.md) using the domain selector at the top of the page.

## 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

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

### Request

Below is the complete request header for the Service Catalog and Database Catalog. For both, input the api.\[[DOMAIN_VALUE]\]:443 endpoint that corresponds to your Coralogix [domain](https://coralogix.com/docs/user-guides/account-management/account-settings/coralogix-domain/index.md) using the domain selector at the top of the page. The request payload should include the following structure:

Service Catalog:

```python
grpcurl -H "Authorization: Bearer <PERSONAL_API_KEY>" -d @ api.[[DOMAIN_VALUE]]:443 com.coralogixapis.service_catalog.v1.ApmSettingsService/ReplaceRetentionPeriod <<EOF
{
    "retention_period_in_days": <value>,
    "catalog": "SERVICE_CATALOG"
}
EOF
```

Database Catalog:

```python
grpcurl -H "Authorization: Bearer <PERSONAL_API_KEY>" -d @ api.[[DOMAIN_VALUE]]:443 com.coralogixapis.service_catalog.v1.ApmSettingsService/ReplaceRetentionPeriod <<EOF
{
    "retention_period_in_days": <value>,
    "catalog": "DATABASE_CATALOG"
}
EOF
```

## Additional resources

|                     |                                                                                                                                                                                                                                                                                                                                |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Documentation       | [Service Catalog](https://coralogix.com/docs/user-guides/apm/features/service-catalog/index.md) [Database Monitoring](https://coralogix.com/docs/user-guides/apm/features/database-monitoring/index.md) [APM Onboarding Tutorial](https://coralogix.com/docs/user-guides/apm/getting-started/apm-onboarding-tutorial/index.md) |
| Coralogix Endpoints | [Coralogix Endpoints](https://coralogix.com/docs/integrations/coralogix-endpoints/index.md)                                                                                                                                                                                                                                    |

## Support

**Need help?**

Our world-class customer success team is available 24/7 to walk you through your setup and answer any questions that may come up.

Feel free to reach out to us **via our in-app chat** or by sending us an email at **[support@coralogix.com](mailto:support@coralogix.com)**.
