# Reports

Once your property is created, you will be able to generate as much reports as you want for that property.

## Create a Report

To create a report, you will need the property ID. Create a report by calling the [POST /reports/compliances/reports](https://didomi.stoplight.io/docs/didomi-api/422138d312c88-create-a-report) endpoint.

## Retrieve Reports

Once the report is created, a scan will be triggered. A scan can take some time to finish. You can retrieve a list of reports' summary by calling the [GET /reports/compliances/reports](https://didomi.stoplight.io/docs/didomi-api/288c8fd4931d9-retrieve-a-list-of-reports) endpoint.

As mentioned in the API documentation, reports can be filtered in many ways. For example, if you want to retrieve all reports created in `January 2025` with status `success`.

```url
GET /reports/compliances/reports?organization_id={{organization_id}}&created_at[$gte]=2025-01-01&created_at[$lte]=2025-01-31&status=success
```

## Retrieve a Report

If you want to get the full report, you will need to call the [GET /reports/compliances/reports/{{report\_id}}](https://didomi.stoplight.io/docs/didomi-api/1136ef3c56ead-retrieve-a-report) endpoint along with the `$with` parameter.

```
/reports/compliances/reports/{{report_id}}?organization_id={{organization_id}}&$with[]=outputs
```

This endpoint will return the summary of the report with an `outputs` object including all necessary information. The object contains information as follow:

### reports.json

This JSON contains the summary of the report.

<table><thead><tr><th>Key</th><th width="249">Description</th><th>Value</th></tr></thead><tbody><tr><td>id</td><td>ID of the report</td><td>String</td></tr><tr><td>property_id</td><td>ID of the property</td><td>String</td></tr><tr><td>organization_id</td><td>ID of the organization</td><td>String</td></tr><tr><td>trackers_count</td><td>Number of trackers found during the scan</td><td>Integer</td></tr><tr><td>vendors_count</td><td>Number of vendors found during the scan</td><td>Integer</td></tr><tr><td>score</td><td>Compliance Score.</td><td>Integer (0 - 100)</td></tr><tr><td>errors</td><td>List of errors per scenario</td><td>Array (See below)</td></tr><tr><td>status</td><td>Status of the report</td><td>String (<code>success</code>, <code>partial</code>, <code>failed</code>, <code>queued</code>, <code>pending</code>)</td></tr><tr><td>created_at</td><td>Date of creation</td><td>Date</td></tr></tbody></table>

#### Errors for each scenario

| Key                | Description        | Value  |
| ------------------ | ------------------ | ------ |
| collect\_id        | ID of the collect  | String |
| scenario\_id       | ID of the scenario | String |
| error \_type       | Type of error      | String |
| error\_description | Description        | String |

Please find the different information type with their description:

* **Website not reachable (website\_not\_reachable)**

This error occurs when the crawler cannot access the website. Potential reasons include:

* A server error on the client’s website (e.g., 404, 500), making the website unavailable.
* An unexpected issue on our crawler’s end.

In some cases, retrying the scan may resolve the issue, such as when the website was temporarily unavailable.

* **Anti-bot system (anti\_bot\_system)**

The website is equipped with an anti-bot system which prevents us from accessing it.

* **No existing or clear CMP on the page (no\_existing\_or\_clear\_cmp)**

We could not detect a clear CMP on the page, either visually or in the code. This indicates the client may not have implemented a CMP, preventing us from interacting with an accept/refuse button.

* **No button found to accept/refuse (no\_button\_found)**

Although we detected a modal or banner resembling a CMP, there were no proper accept or refuse buttons to interact with. This is often due to websites displaying a banner to inform users about cookie usage but not providing explicit options to accept or refuse.

* **Not able to click on the button in the page (not\_able\_to\_click)**

While we identified a CMP and its buttons, we could not programmatically click them. This may result from issues on our end in locating or interacting with the buttons. We are continuously improving our logic to reduce the occurrence of this issue.

* **General Error (general\_error)**

This error is caused by an issue in our API. Such errors are rare, as our system typically handles them through retries. When they occur, rerunning the report often resolves the problem.

**Example**

```json
{
    "id": "ID",
    "property_id": "PROPERTY_ID",
    "organization_id": "ORGANIZATION_ID",
    "trackers_count": 27,
    "vendors_count": 9,
    "score": 80,
    "errors": [],
    "status": "success",
    "created_at": "2025-01-14T06:42:48.322Z"
}
```

### report\_aggregated\_trackers.json

This JSON contains the list of aggregated trackers found during the scan with added information.

| Key                    | Description                                                                                          | Value                                                   |
| ---------------------- | ---------------------------------------------------------------------------------------------------- | ------------------------------------------------------- |
| property\_id           | Property ID                                                                                          | String                                                  |
| report\_id             | Report ID                                                                                            | String                                                  |
| organization\_id       | Organization ID                                                                                      | String                                                  |
| id                     | Internal ID of the tracker                                                                           | String                                                  |
| type                   | Type of tracker                                                                                      | String (`web_storage`, `pixel`, `cookie`, `indexed_db`) |
| source                 | Source of tracker                                                                                    | String (`js_browser`, `http_request`, `other`)          |
| name                   | Name of tracker                                                                                      | String                                                  |
| host                   | Host of tracker                                                                                      | String                                                  |
| is\_http\_only         | Is the tracker HTTP Only                                                                             | Boolean                                                 |
| is\_secure\_only       | Is the tracker Secure Only                                                                           | Boolean                                                 |
| is\_persistent         | Is the tracker persistent                                                                            | Boolean                                                 |
| is\_third\_party       | Is the tracker third party                                                                           | Boolean                                                 |
| initiator              | Object containing the initiator of the tracker information                                           | Object                                                  |
| cmp                    | Object regarding CMP context under which the tracker was found                                       | Object (See below)                                      |
| page\_url              | URL of the page                                                                                      | String                                                  |
| page\_url\_host        | Host of the page                                                                                     | String                                                  |
| page\_url\_sld         | SDL of the page                                                                                      | String                                                  |
| name\_pattern          | We might group some trackers by name if they follow a similar pattern.                               | String                                                  |
| initial\_name          | Initial name of the tracker. Different from the `name` if a pattern has been used to group trackers. | String                                                  |
| sld                    | SLD of the tracker                                                                                   | String                                                  |
| vendor.id              | ID of the vendor associated to the tracker                                                           | String                                                  |
| vendor.name            | Name of the vendor associated to the tracker                                                         | String                                                  |
| max\_lifetime\_seconds | Lifetime of the tracker in seconds                                                                   | Number (-1 meaning not lifetime)                        |
| created\_at            | Date of creation                                                                                     | Date                                                    |

**CMP**

The `cmp` object contains extra information.

| Key                  | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                          | Value                                                       |
| -------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------- |
| scenario\_step.id\[] | <p>Steps in which the tracker was dropped. Didomi runs multiple scenarios (No User Choice, Consent to all, Refuse to all).</p><p>Ex: During a <code>consent\_to\_all</code> scenario, trackers are dropped before the crawler clicked on the accept button. We consider in that case the scenario step to be <code>no\_user\_choice</code>. Once the crawler successfully clicked on the accept button, the scenario step becomes <code>consent\_to\_all</code>.</p> | Array (`no_user_choice`, `consent_to_all`, `refuse_to_all`) |
| scenario.id\[]       | Scenarios in which the tracker was dropped. In opposition with the scenario step, this is the global scenario under which the crawler runs.                                                                                                                                                                                                                                                                                                                          | Array (`no_user_choice`, `consent_to_all`, `refuse_to_all`) |

{% hint style="info" %}
If you want to know under which scenario step the tracker was dropped, please follow this logic:

* If the array contains `no_user_choice`, the tracker was dropped on `No CMP choice scenario`, regardless if it contains other values.
* If the array contains `refuse_to_all`, the tracker was dropped on `Refuse to all`, regardless if it contains other values.
* If the array contains `consent_to_all`, the tracker was dropped on `Consent to all`.
* If the array is empty, the tracker was dropped on `No CMP choice scenario`.
  {% endhint %}

**Example**

```json
{
    "property_id": "PROPERTY_ID",
    "report_id": "REPORT_ID",
    "organization_id": "ORGANIZATION_ID",
    "id": "5a6e04c5-5ff3-4d84-904d-344b6046a47c",
    "type": "web_storage",
    "source": "js_browser",
    "name": "catch",
    "host": "challenges.cloudflare.com",
    "is_http_only": false,
    "is_secure_only": false,
    "is_persistent": false,
    "is_third_party": true,
    "initiator": {
        "type": "script",
        "url": "https://challenges.cloudflare.com/cdn-cgi/challenge-platform/h/b/orchestrate/chl_api/v1?ray=901ba2807fe66f19&lang=auto",
        "url_host": "challenges.cloudflare.com",
        "url_sld": "cloudflare.com",
        "vendor": {
            "id": "cloudflare",
            "name": "CloudFlare"
        }
    },
    "cmp": {
        "scenario_step": {
            "id": [
                "no_user_choice"
            ]
        },
        "scenario": {
            "id": [
                "no_user_choice"
            ]
        }
    },
    "page_url": "https://www.didomi.com",
    "page_url_host": "www.didomi.com",
    "page_url_sld": "didomi.com",
    "name_pattern": null,
    "initial_name": "catch",
    "sld": "cloudflare.com",
    "vendor": {
        "id": "cloudflare",
        "name": "CloudFlare"
    },
    "max_lifetime_seconds": -1,
    "created_at": "2025-01-14T06:42:48.282Z"
}
```

### report\_aggregated\_vendors.json

This JSON contains the list of aggregated vendors found during the scan with added information.

| Key              | Description                                                                                 | Value                      |
| ---------------- | ------------------------------------------------------------------------------------------- | -------------------------- |
| property\_id     | Property ID                                                                                 | String                     |
| report\_id       | Report ID                                                                                   | String                     |
| organization\_id | Organization ID                                                                             | String                     |
| id               | ID of the vendor or host of the request if we were not able to link the request to a vendor | String                     |
| request\_count   | Number of requests associated to the vendor during the scan                                 | String                     |
| partner          | Object containing the vendors details or a vendor was match to the request. Null otherwise  | Object (See below) \| null |
| cmp              | Object regarding CMP context under which the vendor was seen                                | Object (See below)         |
| created\_at      | Date of creation                                                                            | Date                       |

**Partner**

| Key                   | Description                                                    | Value  |
| --------------------- | -------------------------------------------------------------- | ------ |
| id                    | ID of the vendor                                               | String |
| name                  | Name of the vendor                                             | String |
| matched\_hosts        | List of hosts linked to that vendor                            | Array  |
| functional\_namespace | Functional namespace                                           | String |
| country               | Country of the vendor                                          | String |
| namespaces            | List of namespaces where the vendor can be found (IAB, etc...) | Object |
| tcf                   | Object containing purposes linked to that vendor               | Object |

**CMP**

The `cmp` object contains extra information.

| Key                  | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                  | Value                                                       |
| -------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------- |
| scenario\_step.id\[] | <p>Steps in which the vendor was seen. Didomi runs multiple scenarios (No User Choice, Consent to all, Refuse to all).</p><p>Ex: During a <code>consent\_to\_all</code> scenario, vendors are seen before the crawler clicked on the accept button. We consider in that case the scenario step to be <code>no\_user\_choice</code>. Once the crawler successfully clicked on the accept button, the scenario step becomes <code>consent\_to\_all</code>.</p> | Array (`no_user_choice`, `consent_to_all`, `refuse_to_all`) |
| scenario.id\[]       | Scenarios in which the vendor was seen. In opposition with the scenario step, this is the global scenario under which the crawler runs.                                                                                                                                                                                                                                                                                                                      | Array (`no_user_choice`, `consent_to_all`, `refuse_to_all`) |

**Example**

```json
{
    "property_id": "PROPERTY_ID",
    "report_id": "REPORT_ID",
    "organization_id": "ORGANIZATION_ID",
    "id": "cloudflare",
    "request_count": 74,
    "cmp": {
        "scenario_step": {
            "id": [
                "no_user_choice"
            ]
        },
        "scenario": {
            "id": [
                "no_user_choice"
            ]
        }
    },
    "partner": {
        "id": "cloudflare",
        "name": "CloudFlare",
        "matched_hosts": [
            {
                "host": "challenges.cloudflare.com",
                "raw_pattern": "cloudflare.com"
            }
        ],
        "functional_namespace": "google",
        "country": "us",
        "namespaces": {
            "google": 1097
        },
        "tcf": {
            "default_purposes_id": [
                "cookies",
                "create_ads_profile",
                "select_personalized_ads"
            ],
            "spi_purposes_id": [],
            "legitimate_interest_purposes_id": [
                "improve_products",
                "market_research",
                "measure_ad_performance",
                "select_basic_ads"
            ]
        }
    },
    "created_at": "2025-01-14T06:42:48.301Z"
}
```

### report\_privacy.json

This JSON contains privacy information regarding the website scanned.

| Key              | Description                          | Value              |
| ---------------- | ------------------------------------ | ------------------ |
| organization\_id | Organization ID                      | String             |
| report\_id       | Report ID                            | String             |
| property\_id     | Property ID                          | String             |
| privacy          | Object containing all privacy values | Object (See below) |
| created\_at      | Date of creation                     | Date               |

**Privacy**

| Key                              | Description                                         | Value   |
| -------------------------------- | --------------------------------------------------- | ------- |
| has\_user\_consent\_information  | Consent Information present in the page             | Boolean |
| has\_user\_consent\_choice       | CMP present in the page                             | Boolean |
| has\_short\_cookies\_lifetime    | Cookies lifetime is less than 13 months             | Boolean |
| has\_privacy\_policy             | Privacy Policy link present in at least one page    | Boolean |
| has\_privacy\_policy\_all\_pages | Privacy Policy link present in all pages scanned    | Boolean |
| has\_privacy\_policy\_opt\_out   | Privacy Policy Opt-out present in at least one page | Boolean |

**Example**

```json
{
    "organization_id": "ORGANIZATION_ID",
    "report_id": "REPORT_ID",
    "property_id": "PROPERTY_ID",
    "privacy": {
        "has_user_consent_information": true,
        "has_user_consent_choice": true,
        "has_short_cookies_lifetime": true,
        "has_privacy_policy": true,
        "has_privacy_policy_all_pages": true,
        "has_privacy_policy_opt_out": false
    },
    "created_at": "2025-01-14T06:42:48.321Z",
}
```

### {{scenario\_id}}/proof\_of\_scan.gif

When scanning the website, we record the interactions in a GIF file for each scenario.

### {{scenario\_id}}/proof\_of\_scan.har

When scanning the website, we record the HAR containing all sort of information like trackers, requests, etc...

{% hint style="info" %}
Only relevant files are described above.
{% endhint %}

{% hint style="warning" %}
Each links have a lifetime of 5 minutes. If the links have expired, please run the request again.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developers.didomi.io/api-and-platform/monitoring-and-reporting/reports.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
