# How to use the API to create a new report

#### Configuration fields

The table below describes all the fields that are configurable when creating a new report via the API.&#x20;

*⚠️ Fields and values with \* are only available for the ACM solution*

<table data-header-hidden><thead><tr><th></th><th></th><th></th><th></th></tr></thead><tbody><tr><td><strong>Label</strong></td><td><strong>Description</strong></td><td><strong>Possible values</strong></td><td><strong>Didomi example</strong></td></tr><tr><td>name</td><td>Name of the report as it appears in the Didomi console</td><td>string</td><td>Didomi France</td></tr><tr><td>website</td><td>The website to be scanned</td><td>url starting with https://</td><td>https://www.didomi.io/</td></tr><tr><td>country</td><td>The country from which the scan will run</td><td>fr<br>de<br>gb<br>us<br>es<br>be<br>br</td><td>fr</td></tr><tr><td>schedule</td><td>Cron statement describing how often the report should run</td><td><em>daily *: 0 0 * * *</em><br><em>weekly *: 0 0 * * 0</em> <br>monthly: 0 0 1 * *<br>single run: null</td><td>0 0 1 * *</td></tr><tr><td>pages_count</td><td>Number of pages that needs to be scanned</td><td>int &#x3C;= 20</td><td>10</td></tr><tr><td>filters</td><td>A filter on the pages that will be scanned. Can use a string (eg. "/products will scan only url pages containing /products) or a regular expression (eg. ^p will scan all url pages starting with p)</td><td><pre><code>{
  "type": "string",
  "value": "string"
} 
</code></pre><pre><code>{
"type": "regex",
"value": "string"
} 
</code></pre></td><td><pre><code>{

"type": "string",

"value": "products"

}  </code></pre><p> </p></td></tr><tr><td>scenarios \*</td><td>An array of the scenarios that we will run  and the custom action within it. </td><td><pre><code>\[{
"enabled": true,
"type": "accept\_all",
"scenario\_actions": \[
{
"type": "accept",
"order": 0
}
]
},

{
"enabled": true,
"type": "refuse\_all",
"scenario\_actions": \[
{
"type": "refuse",
"order": 0
}
]
},
{
"enabled": true,
"type": "no\_actions",
"scenario\_actions": \[]
}
] </code></pre></td><td><p> </p><pre><code>
\[{
"enabled": true,
"type": "accept\_all",
"scenario\_actions": \[
{
"type": "accept",
"order": 0
}
]
},

{
"enabled": true,
"type": "refuse\_all",
"scenario\_actions": \[
{
"type": "refuse",
"order": 0
}
]
},
{
"enabled": true,
"type": "no\_actions",
"scenario\_actions": \[]
}
] </code></pre><p> </p><p> </p></td></tr><tr><td><em>user\_agent \*</em></td><td>User agent that the bot will use when scanning. </td><td>string</td><td>"my\_custom\_user\_agent"</td></tr><tr><td><em>login \*</em></td><td>Credentials and settings for running a scan on a logged in environment</td><td><pre><code>{
"enabled": true,
"selectors": {
"pathToForm": "string",
"usernameField": "string",
"passwordField": "string",
"submitButton": "string"
},
"credentials": {
"username": "string",
"password": "string"
} </code></pre></td><td><pre><code>{
"enabled": true,
"selectors": {
"pathToForm": "login.mywebsite.com"
},
"credentials": {
"username": "my\_username",
"password": "my\_password"
} </code></pre></td></tr></tbody></table>

&#x20;

#### Example for standard compliance report

This example can also be used as a template.

```
[
  {
    "name": "Didomi France",
    "website": "https://www.didomi.io/",
    "schedule": "0 0 * * *",
    "url": "https://www.didomi.io/",
    "pages_count": 10,
    "country": "fr",
    "enabled": true,
  }
]
```

#### Example for ACM compliance report

This example can also be used as a template.

```
[
    {
        "name": "Didomi France",
        "website": "https://www.didomi.io/",
        "country": "fr",
        "pages_count": 10,
        "enabled": "true",
        "filters":[{
            "type": "string",
            "value": "products"

        }],
        "schedule": "0 0 * * *",
        "userAgent": "my_custom_user_agent",
        "login":  
        {
            "enabled": true,
            "selectors":
            {
                "pathToForm": "login.mywebsite.com"
            },
            "credentials":
            {
                "username": "my_username",
                "password": "my_password"
            }
        },
        "scenarios":
        [
            {
                "enabled": true,
                "type": "accept_all",
                "scenario_actions":
                [
                    {
                        "type": "accept",
                        "order": 0
                    }
                ]
            },
            {
                "enabled": true,
                "type": "refuse_all",
                "scenario_actions":
                [
                    {
                        "type": "refuse",
                        "order": 0
                    }
                ]
            },
            {
                "enabled": true,
                "type": "no_actions",
                "scenario_actions":
                []
            }
        ]
    }
]
```

#### Using the API

More detailed documentation on how to use the didomi API can be found [here](https://developers.didomi.io/api/introduction)

When creating the payload of the request you can add one or multiple properties at the same time. The expected payload is an array that can contain one or multiple properties to insert.&#x20;

#### Endpoint

The endpoint that should be used is&#x20;

```
https://api.didomi.io/reports/compliances/properties?organization_id=<organization_id>
```

Please make sure you replace \<organization\_id> with your organization id.


---

# 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://docs.didomi.io/advanced-compliance-monitoring-acm/compliance-report-acm/how-to-use-the-api-to-create-a-new-report.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.
