> For the complete documentation index, see [llms.txt](https://docs.decisionrules.io/doc/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.decisionrules.io/doc/v1/api/console-logs-api.md).

# Console Logs API

The Console Logs API is a secure REST API that provides console logs.

### Get Console Logs

This endpoint allows you to get console logs of specific solve.&#x20;

## Get Console Logs for a solve

<mark style="color:blue;">`GET`</mark> `https://api.decisionrules.io/consoleLogs/:correlationId`

#### Query Parameters

| Name                                            | Type   | Description                     |
| ----------------------------------------------- | ------ | ------------------------------- |
| correlationId<mark style="color:red;">\*</mark> | String | CorrelationId of specific solve |

#### Headers

| Name                                            | Type   | Description              |
| ----------------------------------------------- | ------ | ------------------------ |
| Authorization<mark style="color:red;">\*</mark> | String | Bearer \<Solver API Key> |

{% hint style="info" %}
If you're using the **Regional Cloud** version of DecisionRules, read more about API calls [here](/doc/v1/regional-cloud/region-specific-api-urls.md#making-api-calls-on-region-cloud-accounts).
{% endhint %}

You can get the **correlationId** parameter from the response Header of the Rule Solver API. The correlation id is stored under the response header key **X-Correlation-Id**. It is generated by the solver upon every run unless the user specifies their own correlation id in the request header.

{% hint style="info" %}
Note that console logs are only generated in **debug mode**. If you are using Test Bench, just click the **Debug** button. If you are sending requests via the Rule Solver API, you can activate debug mode by providing your request with the **X-Debug** header set to "true".
{% endhint %}

#### Console Logs lifetime

The console logs are stored for 10 minutes at this moment.

#### Response

The logs themselves are different for each type of rule. However, the basic structure of the response is always the same. It will be similar to the following.

```
[
    {
        "_id": "637f74324713c83aa450e38b",
        "apiKey": {
            "created": "2022-05-13T08:44:34.950Z",
            "type": "SOLVER",
            "key": "QyjvIdGhdDgUP6_Leko2DOyYaoSIA0axZlVcRrxbJzHazTOMn03GA5kiuIzgIw5z",
            "id": "6d4153a3-a215-e8e2-17bf-cd77534d07ff",
            "name": "S"
        },
        "id": "bdb5ac23-970c-146e-efe7-d49511f14b82",
        "time": "2022-11-24T13:40:02.184Z",
        "logs": [...],
        "baseId": "086233c6-8e45-0d88-328e-5e20fa544d2c",
        "input": {
            "productType": "basic",
            "period": "month",
            "promoCode": "SUMMER SALE"
        },
        "output": [
            {
                "prices": {
                    "finalPrice": 5.6,
                    "crudePrice": 8
                },
                "message": "30% discount"
            }
        ],
        "correlationId": "efc66cc4-e942-c687-74dc-67b0b1fdde49"
    }
]
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.decisionrules.io/doc/v1/api/console-logs-api.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
