---
title: "Trigger tests from CI/CD pipelines"
method: POST
path: "/api/v1/synthetics/tests/trigger/ci"
tags: ["Synthetics"]
---

# Trigger tests from CI/CD pipelines

`POST /api/v1/synthetics/tests/trigger/ci`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v1/synthetics/tests/trigger/ci`
- Auth: one of:
  - API key in header `DD-API-KEY` and API key in header `DD-APPLICATION-KEY`
  - OAuth 2
    - Authorization code: `/oauth2/v1/authorize`
    - Token URL: `/oauth2/v1/token` scopes: `synthetics_write`

Trigger a set of Synthetic tests for continuous integration.

## Request body

- SyntheticsCITestBody: Object describing the synthetics tests to trigger.
  - `tests` SyntheticsCITest[]: List of Synthetic tests with overrides.
    - `allowInsecureCertificates` boolean: Disable certificate checks in API tests.
    - `basicAuth` union: Object to handle basic authentication when performing the test.
      - SyntheticsBasicAuthWeb: Object to handle basic authentication when performing the test.
        - `password` string: Password to use for the basic authentication.
        - `type` 'web': The type of basic authentication to use when performing the test.
        - `username` string: Username to use for the basic authentication.
      - SyntheticsBasicAuthSigv4: Object to handle `SIGV4` authentication when performing the test.
        - `accessKey` string, required: Access key for the `SIGV4` authentication.
        - `region` string: Region for the `SIGV4` authentication.
        - `secretKey` string, required: Secret key for the `SIGV4` authentication.
        - `serviceName` string: Service name for the `SIGV4` authentication.
        - `sessionToken` string: Session token for the `SIGV4` authentication.
        - `type` 'sigv4', required: The type of authentication to use when performing the test.
      - SyntheticsBasicAuthNTLM: Object to handle `NTLM` authentication when performing the test.
        - `domain` string: Domain for the authentication to use when performing the test.
        - `password` string: Password for the authentication to use when performing the test.
        - `type` 'ntlm', required: The type of authentication to use when performing the test.
        - `username` string: Username for the authentication to use when performing the test.
        - `workstation` string: Workstation for the authentication to use when performing the test.
      - SyntheticsBasicAuthDigest: Object to handle digest authentication when performing the test.
        - `password` string, required: Password to use for the digest authentication.
        - `type` 'digest', required: The type of basic authentication to use when performing the test.
        - `username` string, required: Username to use for the digest authentication.
      - SyntheticsBasicAuthOauthClient: Object to handle `oauth client` authentication when performing the test.
        - `accessTokenUrl` string, required: Access token URL to use when performing the authentication.
        - `audience` string: Audience to use when performing the authentication.
        - `clientId` string, required: Client ID to use when performing the authentication.
        - `clientSecret` string, required: Client secret to use when performing the authentication.
        - `resource` string: Resource to use when performing the authentication.
        - `scope` string: Scope to use when performing the authentication.
        - `tokenApiAuthentication` 'header' | 'body', required: Type of token to use when performing the authentication.
        - `type` 'oauth-client', required: The type of basic authentication to use when performing the test.
      - SyntheticsBasicAuthOauthROP: Object to handle `oauth rop` authentication when performing the test.
        - `accessTokenUrl` string, required: Access token URL to use when performing the authentication.
        - `audience` string: Audience to use when performing the authentication.
        - `clientId` string: Client ID to use when performing the authentication.
        - `clientSecret` string: Client secret to use when performing the authentication.
        - `password` string, required: Password to use when performing the authentication.
        - `resource` string: Resource to use when performing the authentication.
        - `scope` string: Scope to use when performing the authentication.
        - `tokenApiAuthentication` 'header' | 'body', required: Type of token to use when performing the authentication.
        - `type` 'oauth-rop', required: The type of basic authentication to use when performing the test.
        - `username` string, required: Username to use when performing the authentication.
      - SyntheticsBasicAuthJWT: Object to handle JWT authentication when performing the test.
        - `addClaims` SyntheticsBasicAuthJWTAddClaims: Standard JWT claims to automatically inject.
          - `exp` boolean: Whether to inject the `exp` (expiration) claim.
          - `iat` boolean: Whether to inject the `iat` (issued at) claim.
        - `algorithm` 'HS256' | 'RS256' | 'ES256', required: Algorithm to use for the JWT authentication.
        - `expiresIn` integer: Token time-to-live in seconds.
        - `header` string: Custom JWT header as a JSON string.
        - `payload` string, required: JWT claims as a JSON string.
        - `secret` string, required: Signing key for the JWT authentication. Use the shared secret for `HS256` or the private key (PEM format) for `RS256` and `ES256`.
        - `tokenPrefix` string: Prefix added before the token in the `Authorization` header. Defaults to `Bearer`.
        - `type` 'jwt', required: The type of authentication to use when performing the test.
    - `body` string: Body to include in the test.
    - `bodyType` string: Type of the data sent in a Synthetic API test.
    - `cookies` string: Cookies for the request.
    - `deviceIds` SyntheticsDeviceID[]: For browser test, array with the different device IDs used to run the test.
    - `followRedirects` boolean: For API HTTP test, whether or not the test should follow redirects.
    - `headers` SyntheticsTestHeaders: Headers to include when performing the test.
    - `locations` string[]: Array of locations used to run the test.
    - `metadata` SyntheticsCIBatchMetadata: Metadata for the Synthetic tests run.
      - `ci` SyntheticsCIBatchMetadataCI: Description of the CI provider.
        - `pipeline` SyntheticsCIBatchMetadataPipeline: Description of the CI pipeline.
          - `url` string: URL of the pipeline.
        - `provider` SyntheticsCIBatchMetadataProvider: Description of the CI provider.
          - `name` string: Name of the CI provider.
      - `git` SyntheticsCIBatchMetadataGit: Git information.
        - `branch` string: Branch name.
        - `commitSha` string: The commit SHA.
    - `public_id` string, required: The public ID of the Synthetic test to trigger.
    - `retry` SyntheticsTestOptionsRetry: Object describing the retry strategy to apply to a Synthetic test.
      - `count` integer: Number of times a test needs to be retried before marking a location as failed. Defaults to 0.
      - `interval` number, double: Time interval between retries (in milliseconds). Defaults to 300ms.
    - `startUrl` string: Starting URL for the browser test.
    - `variables` object: Variables to replace in the test.
    - `version` integer: The version number of the Synthetic test version to trigger.

## Response `200`

OK

- SyntheticsTriggerCITestsResponse: Object containing information about the tests triggered.
  - `batch_id` string, nullable: The public ID of the batch triggered.
  - `locations` SyntheticsTriggerCITestLocation[]: List of Synthetic locations.
    - `id` integer: Unique identifier of the location.
    - `name` string: Name of the location.
  - `results` SyntheticsTriggerCITestRunResult[]: Information about the tests runs.
    - `device` string: The device ID.
    - `location` integer: The location ID of the test run.
    - `public_id` string: The public ID of the Synthetic test.
    - `result_id` string: ID of the result.
  - `triggered_check_ids` string[]: The public IDs of the Synthetic test triggered.

## Other responses

- `400`: JSON format is wrong
- `429`: Too many requests

---

[API](https://skmtc.dev/datadog/apis/datadog-api-v1-collection.md) - [All operations](https://skmtc.dev/datadog/apis/datadog-api-v1-collection/llms.txt) - [OpenAPI document](https://skmtc.dev/datadog/apis/datadog-api-v1-collection/revisions/ca5871004d26?raw)
