---
title: Scenario endpoints - APIs
description: Speed Analysis Lab Scenario endpoints reference
lastUpdated: 09 May 2025
source_url:
  html: https://docs.contentsquare.com/en/api/speed-analysis-lab/scenario-endpoints/
  md: https://docs.contentsquare.com/en/api/speed-analysis-lab/scenario-endpoints/index.md
---

## Get the list of scenarios

POST /v1/speed-analysis/scenario/list

Returns the list of scenarios.

### Parameters

* #### name   string  

  String pattern to filter your scenarios and return only those that contain the pattern in their name

### Request example

```shell
curl --location --request GET 'https://api.contentsquare.com/v1/speed-analysis/scenario/list' \
--header 'Authorization: Bearer <your_access_token>'
--data '{
    "name": ""
}'
```

### Response example

```json
{
  "payload": {
    "scenarios": [
      {
        "id": 1,
        "name": ""
      }
    ]
  },
  "success": true
}
```

## Get a scenario report

POST /v1/speed-analysis/scenario/report

Returns a scenario report.

### Parameters

* #### scenarioId   number   Required

  Unique identifier of a scenario.

* #### date   number   Required

  Timestamp (in ms) indicating when the report was generated.

### Request example

```shell
curl --location --request GET 'https://api.contentsquare.com/v1/speed-analysis/scenario/report' \
--header 'Authorization: Bearer <your_access_token>'
--data '{
    "scenarioId": 0,
    "date": 1542117158294
}'
```

### Response example

```json
{
  "payload": {
    "scenarioReport": {
      "scenarioId": 0,
      "name": "",
      "resultId": 0,
      "date": 0,
      "viewOnTheWeb": "https://www.dareboost.com/scenario/[scenarioId]/report/[date]",
      "summary": {
        "fail": 0,
        "unavailableResource": 0,
        "browserError": 0,
        "sum": {
          "firstPaint": 0,
          "request": 0,
          "startRender": 0,
          "lastByte": 0,
          "weight": 0,
          "domInteractive": 0,
          "domContentLoadedEventStart": 0,
          "domComplete": 0,
          "loadEvent": 0,
          "firstContentfulPaint": 0,
          "loadTime": 0,
          "loadEventStart": 0,
          "firstConsistentlyInteractive": 0,
          "visuallyComplete": 0,
          "speedIndex": 0,
          "firstByte": 0,
          "domContentLoadedEventEnd": 0,
          "domLoading": 0,
          "largestContentfulPaint": 0,
          "totalBlockingTime": 0,
          "maxPotentialFirstInputDelay": 0,
          "totalLongTasks": 0,
          "lastLongTask": 0,
          "nbLongTasks": 0,
          "cumulativeLayoutShift": 0
        },
        "average": {
          "firstPaint": 0,
          "request": 0,
          "startRender": 0,
          "lastByte": 0,
          "weight": 0,
          "domInteractive": 0,
          "domContentLoadedEventStart": 0,
          "domComplete": 0,
          "loadEvent": 0,
          "firstContentfulPaint": 0,
          "loadTime": 0,
          "loadEventStart": 0,
          "firstConsistentlyInteractive": 0,
          "visuallyComplete": 0,
          "speedIndex": 0,
          "firstByte": 0,
          "domContentLoadedEventEnd": 0,
          "domLoading": 0,
          "largestContentfulPaint": 0,
          "totalBlockingTime": 0,
          "maxPotentialFirstInputDelay": 0,
          "totalLongTasks": 0,
          "lastLongTask": 0,
          "nbLongTasks": 0,
          "cumulativeLayoutShift": 0
        }
      },
      "steps": [
        {
          "stepId": 0,
          "stepResultId": "",
          "name": "",
          "description": "",
          "fail": 0,
          "unavailableResource": 0,
          "browserError": 0,
          "timings": {
            "navigationStart": 0,
            "firstByte": 0,
            "firstPaint": 0,
            "domInteractive": 0,
            "loadEvent": 0,
            "startRender": 0,
            "speedIndex": 0,
            "visuallyComplete": 0,
            "oldVisuallyComplete": 0,
            "loadEventStart": 0,
            "lastByte": 0,
            "domLoading": 0,
            "domContentLoadedEventStart": 0,
            "domContentLoadedEventEnd": 0,
            "domComplete": 0,
            "firstContentfulPaint": 0,
            "firstConsistentlyInteractive": 0,
            "largestContentfulPaint": 0,
            "totalBlockingTime": 0,
            "maxPotentialFirstInputDelay": 0,
            "totalLongTasks": 0,
            "lastLongTask": 0,
            "nbLongTasks": 0,
            "cumulativeLayoutShift": 0
          },
          "weight": 0,
          "requestsCount": 0,
          "loadTime": 0,
          "customTimings": [
            {
              "type": "",
              "name": "",
              "startTime": 0,
              "duration": 0
            }
          ]
        }
      ]
    }
  },
  "success": true
}
```

## Get the scenario reports

POST /v1/speed-analysis/scenario/reports

Returns the scenario reports.

### Parameters

* #### scenarioId   number   Required

  Unique identifier of a scenario.

* #### limit   number  

  Limits the number of reports to return (default: `30`). Set to `0` to get all scenario reports.

* #### lastDays   number  

  Retrieve reports from the last X days, where X is the value of this parameter.

* #### dateFrom   ISO 8601 date string  

  Retrieve audit executed after this date. Must be a date before `dateTo`.

  ISO format in UTC (for example "2021-08-13T12:32

  .000Z") or with a time zone offset ("2021-08-13T12:32+02" or "2021-08-13T12:32%2B+02" when encoded in the URL).

* #### dateTo   ISO 8601 date string  

  Retrieve audit executed before this date. Must be a date after `dateFrom`.

  ISO format in UTC (for example "2021-08-13T12:32

  .000Z") or with a time zone offset ("2021-08-13T12:32+02" or "2021-08-13T12:32%2B+02" when encoded in the URL).

* #### error   boolean  

  By default, all results are returned. Set to `false` to retrieve only executions without error. Set to `true` to retrieve only executions with error.

### Request example

```shell
curl --location --request GET 'https://api.contentsquare.com/v1/speed-analysis/scenario/reports' \
--header 'Authorization: Bearer <your_access_token>'
--data '{
    "scenarioId": 0,
    "limit": 30,
    "lastDays": 0,
    "dateFrom": "2016-03-11T00:00:00.000+0100",
    "dateTo": "2016-03-11T23:59:59.000+0100",
    "error": false
}'
```

### Response example

```json
{
  "payload": {
    "scenario": {
      "id": 0,
      "name": "",
      "reports": [
        {
          "resultId": 0,
          "date": 0,
          "viewOnTheWeb": "https://www.dareboost.com/scenario/[scenarioId]/report/[date]",
          "summary": {
            "fail": 0,
            "unavailableResource": 0,
            "browserError": 0,
            "sum": {
              "firstPaint": 0,
              "request": 0,
              "startRender": 0,
              "lastByte": 0,
              "weight": 0,
              "domInteractive": 0,
              "domContentLoadedEventStart": 0,
              "domComplete": 0,
              "loadEvent": 0,
              "firstContentfulPaint": 0,
              "loadTime": 0,
              "loadEventStart": 0,
              "firstConsistentlyInteractive": 0,
              "visuallyComplete": 0,
              "speedIndex": 0,
              "firstByte": 0,
              "domContentLoadedEventEnd": 0,
              "domLoading": 0,
              "largestContentfulPaint": 0,
              "totalBlockingTime": 0,
              "maxPotentialFirstInputDelay": 0,
              "totalLongTasks": 0,
              "lastLongTask": 0,
              "nbLongTasks": 0,
              "cumulativeLayoutShift": 0
            },
            "average": {
              "firstPaint": 0,
              "request": 0,
              "startRender": 0,
              "lastByte": 0,
              "weight": 0,
              "domInteractive": 0,
              "domContentLoadedEventStart": 0,
              "domComplete": 0,
              "loadEvent": 0,
              "firstContentfulPaint": 0,
              "loadTime": 0,
              "loadEventStart": 0,
              "firstConsistentlyInteractive": 0,
              "visuallyComplete": 0,
              "speedIndex": 0,
              "firstByte": 0,
              "domContentLoadedEventEnd": 0,
              "domLoading": 0,
              "largestContentfulPaint": 0,
              "totalBlockingTime": 0,
              "maxPotentialFirstInputDelay": 0,
              "totalLongTasks": 0,
              "lastLongTask": 0,
              "nbLongTasks": 0,
              "cumulativeLayoutShift": 0
            }
          },
          "steps": [
            {
              "stepId": 0,
              "stepResultId": "",
              "name": "",
              "description": "",
              "fail": 0,
              "unavailableResource": 0,
              "browserError": 0,
              "timings": {
                "navigationStart": 0,
                "firstByte": 0,
                "firstPaint": 0,
                "domInteractive": 0,
                "loadEvent": 0,
                "startRender": 0,
                "speedIndex": 0,
                "visuallyComplete": 0,
                "oldVisuallyComplete": 0,
                "loadEventStart": 0,
                "lastByte": 0,
                "domLoading": 0,
                "domContentLoadedEventStart": 0,
                "domContentLoadedEventEnd": 0,
                "domComplete": 0,
                "firstContentfulPaint": 0,
                "firstConsistentlyInteractive": 0,
                "largestContentfulPaint": 0,
                "totalBlockingTime": 0,
                "maxPotentialFirstInputDelay": 0,
                "totalLongTasks": 0,
                "lastLongTask": 0,
                "nbLongTasks": 0,
                "cumulativeLayoutShift": 0
              },
              "weight": 0,
              "requestsCount": 0,
              "loadTime": 0,
              "customTimings": [
                {
                  "type": "",
                  "name": "",
                  "startTime": 0,
                  "duration": 0
                }
              ]
            }
          ]
        }
      ]
    }
  },
  "success": true
}
```

## Get the scenario step report

POST /v1/speed-analysis/scenario/step/report

Returns the report of the scenario step.

### Parameters

* #### stepId   string   Required

  Unique identifier of the step result of a scenario. Refers to the `stepResultId` of `/scenario/reports` and `/scenario/report`.

### Request example

```shell
curl --location --request GET 'https://api.contentsquare.com/v1/speed-analysis/scenario/step/report' \
--header 'Authorization: Bearer <your_access_token>'
--data '{
    "stepId": ""
}'
```

### Response example

```json
{
  "payload": {
    "step": {
      "id": "",
      "previousStepId": "",
      "nextStepId": "",
      "stepResultId": 0,
      "date": 0,
      "timings": {
        "firstByte": 0,
        "firstPaint": 0,
        "domInteractive": 0,
        "loadEvent": 0,
        "startRender": 0,
        "speedIndex": 0,
        "visuallyComplete": 0,
        "oldVisuallyComplete": 0,
        "loadEventStart": 0,
        "lastByte": 0,
        "domLoading": 0,
        "domContentLoadedEventStart": 0,
        "domContentLoadedEventEnd": 0,
        "domComplete": 0,
        "firstContentfulPaint": 0,
        "firstConsistentlyInteractive": 0,
        "largestContentfulPaint": 0,
        "totalBlockingTime": 0,
        "maxPotentialFirstInputDelay": 0,
        "totalLongTasks": 0,
        "lastLongTask": 0,
        "nbLongTasks": 0,
        "cumulativeLayoutShift": 0
      },
      "browserError": "[]",
      "unavailableResource": "{}",
      "actionsResult": [
        {
          "id": 0,
          "time": 0,
          "status": "",
          "message": ""
        }
      ],
      "customTimings": [
        {
          "type": "",
          "name": "",
          "startTime": 0,
          "duration": 0
        }
      ]
    }
  },
  "success": true
}
```

## Get HAR from an analysis

POST /v1/speed-analysis/scenario/report/har

Returns the HAR from the analysis.

### Parameters

* #### scenarioStepResultId   string   Required

  Unique identifier of the scenario step result, obtained when launching a scenario execution.

### Request example

```shell
curl --location --request GET 'https://api.contentsquare.com/v1/speed-analysis/scenario/report/har' \
--header 'Authorization: Bearer <your_access_token>'
--data '{
    "scenarioStepResultId": ""
}'
```

### Response example

```json
{
  "payload": {
    "har": ""
  },
  "success": true
}
```
