# API How-Tos

The Logging Service offers regional APIs that enable programmatic interaction with the platform. These APIs serve various purposes: task automation, system integration, and platform functionality extension. Additionally, the APIs allow you to filter logs based on different criteria, such as the date range, log level, and source.

## Sub-user access control

A sub-user is a user who has access to the Logging Service but is not an administrator or an owner. IONOS Cloud's crucial access control restriction does not allow sub-users to view or modify pipelines belonging to other sub-user accounts, except the primary administrator, who retains full cross-pipeline privileges. Ensure that the sub-user pipeline ownership and access permissions align with your organizational needs.

If a sub-user account creates a pipeline, access is restricted only to that sub-user and the primary administrator. Other sub-users cannot access or perform CRUD operations on the respective pipeline. For example, if sub-user A creates Pipeline 1, only sub-user A and the primary administrator account can view, edit, delete, or manage Pipeline 1. No other sub-user accounts will have access to it.

{% hint style="warning" %}
**Warning:** User privileges set using the IONOS Cloud API or the DCD apply to pipeline access only, not to Grafana access.
{% endhint %}

## Endpoints

A regional endpoint is necessary to interact with the Logging Service REST API endpoints. Currently, IONOS Cloud supports only the following regions for the Logging Service:

* Berlin: `https://logging.de-txl.ionos.com/pipelines`
* Frankfurt: `https://logging.de-fra.ionos.com/pipelines`
* London: `https://logging.gb-lhr.ionos.com/pipelines`
* Worcester: `https://logging.gb-bhx.ionos.com/pipelines`
* Paris: `https://logging.fr-par.ionos.com/pipelines`
* Logroño: `https://logging.es-vit.ionos.com/pipelines`
* Lenexa: `https://logging.us-mci.ionos.com/pipelines`
* Las Vegas: `https://logging.us-las.ionos.com/pipelines`
* Newark: `https://logging.us-ewr.ionos.com/pipelines`

{% hint style="info" %}
**Note:** We recommend using the authorized IP addresses associated with each endpoint if you need to configure firewall rules to restrict traffic sent to the Logging Service endpoints. It enables you to configure rules accordingly to ensure traffic is redirected only through authorized IP addresses for each endpoint. For more information about the authorized IP addresses, see [<mark style="color:blue;">FAQs</mark>](https://docs.ionos.com/sections-test/guides/observability/logging-service-faqs#can-i-restrict-the-traffic-sent-to-logging-service-endpoints).
{% endhint %}

## Request parameter headers

To interact with the Logging Service REST API endpoints, the header must contain the following values:

| **Header**        | **Required** | **Type** | **Description**                                                                                                                                                                                                                                |
| ----------------- | :----------: | :------: | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Authorization** |      yes     |  string  | A `Bearer $TOKEN` is a string that is tied to your account. For information on generating tokens, see [<mark style="color:blue;">Create New Tokens</mark>](https://api.ionos.com/docs/authentication/v1/#tag/tokens/operation/tokensGenerate). |
| **Content-Type**  |      yes     |  string  | Set this to `application/json`.                                                                                                                                                                                                                |

## Quick Links

Here are some of the most common API How-Tos for the Logging Service:

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><mark style="color:blue;"><strong>Set Up a Logging Pipeline Instance</strong></mark></td><td>Create an instance of a logging pipeline.</td><td><a href="api-how-tos/set-up-logging-pipeline-instance">set-up-logging-pipeline-instance</a></td></tr><tr><td><mark style="color:blue;"><strong>Obtain a new Key</strong></mark></td><td>Obtain a new key for a logging pipeline.</td><td><a href="api-how-tos/obtain-key">obtain-key</a></td></tr><tr><td><mark style="color:blue;"><strong>Modify a Logging Pipeline Instance</strong></mark></td><td>Update an existing logging pipeline.</td><td><a href="api-how-tos/modify-logging-pipeline-instance">modify-logging-pipeline-instance</a></td></tr><tr><td><mark style="color:blue;"><strong>Retrieve Logging Pipeline Information</strong></mark></td><td>Retrieve information about a specific logging pipeline.</td><td><a href="api-how-tos/retrieve-logging-pipeline-information">retrieve-logging-pipeline-information</a></td></tr><tr><td><mark style="color:blue;"><strong>Delete a Logging Pipeline Instance</strong></mark></td><td>Delete a specific logging pipeline.</td><td><a href="api-how-tos/delete-logging-pipeline-instance">delete-logging-pipeline-instance</a></td></tr><tr><td><mark style="color:blue;"><strong>Modify the Log Retention Policy</strong></mark></td><td>Customize the retention policy for each log stream.</td><td><a href="https://github.com/ionos-cloud/twt-products-documentation/blob/gitbook-main/observability/logging-service/api-how-tos/modify-log-retention-policy.md">https://github.com/ionos-cloud/twt-products-documentation/blob/gitbook-main/observability/logging-service/api-how-tos/modify-log-retention-policy.md</a></td></tr><tr><td><mark style="color:blue;"><strong>Integration with IONOS Telemetry API</strong></mark></td><td>Use the pre-configured IONOS Telemetry API datasource to query metrics from the IONOS Cloud Telemetry API.</td><td><a href="api-how-tos/telemetry-api">telemetry-api</a></td></tr></tbody></table>

## Next steps

We recommend you refer to the following after creating an instance via the API:

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><mark style="color:blue;"><strong>Send Logs to the Platform</strong></mark></td><td>Steps to send logs to the logging platform.</td><td><a href="quick-start/send-logs-to-platform">send-logs-to-platform</a></td></tr><tr><td><mark style="color:blue;"><strong>Access Logs from the Platform</strong></mark></td><td>Steps to access logs from the logging platform.</td><td><a href="quick-start/access-logs-from-platform">access-logs-from-platform</a></td></tr></tbody></table>
