---
title: Create a test suite for a DEM journey
description: Datadog, the leading service for cloud-scale monitoring.
breadcrumbs: Docs > API Reference > DEM
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Create a test suite for a DEM journey{% #create-a-test-suite-for-a-dem-journey %}
Copy pageCopied
{% tab title="v2" %}

| Datadog site      | API endpoint                                                                     |
| ----------------- | -------------------------------------------------------------------------------- |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v2/dem/journeys/{public_journey_id}/suite |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v2/dem/journeys/{public_journey_id}/suite |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v2/dem/journeys/{public_journey_id}/suite      |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v2/dem/journeys/{public_journey_id}/suite      |
| us2.ddog-gov.com  | POST https://api.us2.ddog-gov.com/api/v2/dem/journeys/{public_journey_id}/suite  |
| uk1.datadoghq.com | POST https://api.uk1.datadoghq.com/api/v2/dem/journeys/{public_journey_id}/suite |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v2/dem/journeys/{public_journey_id}/suite     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v2/dem/journeys/{public_journey_id}/suite |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v2/dem/journeys/{public_journey_id}/suite |

### Overview

Trigger test suite creation for a given DEM journey. This endpoint requires the `synthetics_write` permission.

### Arguments

#### Path Parameters

| Name                                | Type   | Description                                                                |
| ----------------------------------- | ------ | -------------------------------------------------------------------------- |
| public_journey_id [*required*] | string | The public identifier of the DEM journey for which to create a test suite. |

### Request

#### Body Data (required)



{% tab title="Model" %}

| Parent field | Field                               | Type    | Description                                                                                                                      |
| ------------ | ----------------------------------- | ------- | -------------------------------------------------------------------------------------------------------------------------------- |
|              | data [*required*]              | object  | Data object for a create test suite request.                                                                                     |
| data         | attributes                          | object  | Attributes for creating a test suite for a DEM journey.                                                                          |
| attributes   | include_tests_from_journey_coverage | boolean | Whether to populate the test suite based on journey coverage data.                                                               |
| attributes   | test_suite_name                     | string  | An optional custom name for the auto-created test suite.                                                                         |
| data         | type [*required*]              | enum    | The resource type for a request to create a DEM journey test suite. Allowed enum values: `create_test_suite_for_journey_request` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "include_tests_from_journey_coverage": true,
      "test_suite_name": "My Custom Suite"
    },
    "type": "create_test_suite_for_journey_request"
  }
}
```

{% /tab %}

### Response

{% tab title="201" %}
Created
{% tab title="Model" %}
Response body for a DEM journey test suite.

| Parent field | Field                        | Type      | Description                                                                                |
| ------------ | ---------------------------- | --------- | ------------------------------------------------------------------------------------------ |
|              | data [*required*]       | object    | Data object in a DEM test suite response.                                                  |
| data         | attributes [*required*] | object    | Attributes of a DEM journey test suite response.                                           |
| attributes   | created_at [*required*] | date-time | The timestamp when the test suite was created.                                             |
| attributes   | dropped_test_ids             | [string]  | Test IDs omitted because the caller lacks read access.                                     |
| attributes   | name [*required*]       | string    | The name of the test suite.                                                                |
| data         | id [*required*]         | string    | The public ID of the test suite.                                                           |
| data         | type [*required*]       | enum      | The type identifier for DEM journey test suites. Allowed enum values: `journey_test_suite` |

{% /tab %}

{% tab title="Example" %}

```json
{
  "data": {
    "attributes": {
      "created_at": "2024-01-15T10:30:00Z",
      "dropped_test_ids": [],
      "name": "Checkout Flow Suite"
    },
    "id": "suite-abc123",
    "type": "journey_test_suite"
  }
}
```

{% /tab %}

{% /tab %}

{% tab title="404" %}
Not Found
{% tab title="Model" %}
API error response.

| Parent field | Field                    | Type     | Description                                                                     |
| ------------ | ------------------------ | -------- | ------------------------------------------------------------------------------- |
|              | errors [*required*] | [object] | A list of errors.                                                               |
| errors       | detail                   | string   | A human-readable explanation specific to this occurrence of the error.          |
| errors       | meta                     | object   | Non-standard meta-information about the error                                   |
| errors       | source                   | object   | References to the source of the error.                                          |
| source       | header                   | string   | A string indicating the name of a single request header which caused the error. |
| source       | parameter                | string   | A string indicating which URI query parameter caused the error.                 |
| source       | pointer                  | string   | A JSON pointer to the value in the request document that caused the error.      |
| errors       | status                   | string   | Status code of the response.                                                    |
| errors       | title                    | string   | Short human-readable summary of the error.                                      |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    {
      "detail": "Missing required attribute in body",
      "meta": {},
      "source": {
        "header": "Authorization",
        "parameter": "limit",
        "pointer": "/data/attributes/title"
      },
      "status": "400",
      "title": "Bad Request"
    }
  ]
}
```

{% /tab %}

{% /tab %}

{% tab title="429" %}
Too many requests
{% tab title="Model" %}
API error response.

| Field                    | Type     | Description       |
| ------------------------ | -------- | ----------------- |
| errors [*required*] | [string] | A list of errors. |

{% /tab %}

{% tab title="Example" %}

```json
{
  "errors": [
    "Bad Request"
  ]
}
```

{% /tab %}

{% /tab %}

### Code Example

##### 
                  \## default
# 
 \# Path parameters export public_journey_id="journey-abc123" \# Curl command curl -X POST "https://api.datadoghq.com/api/v2/dem/journeys/${public_journey_id}/suite" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "include_tests_from_journey_coverage": true,
      "test_suite_name": "Checkout Flow Suite"
    },
    "type": "create_test_suite_for_journey_request"
  }
}
EOF 
                
{% /tab %}
