For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/api/latest/ci-visibility-tests/get-a-list-of-tests-events.md. A documentation index is available at /llms.txt.
Language
Datadog site

Get a list of tests events

GEThttps://api.datadoghq.com/api/v2/ci/tests/eventshttps://api.us3.datadoghq.com/api/v2/ci/tests/eventshttps://api.us5.datadoghq.com/api/v2/ci/tests/eventshttps://api.datadoghq.eu/api/v2/ci/tests/eventshttps://api.ap1.datadoghq.com/api/v2/ci/tests/eventshttps://api.ap2.datadoghq.com/api/v2/ci/tests/eventshttps://api.uk1.datadoghq.com/api/v2/ci/tests/eventshttps://api.ddog-gov.com/api/v2/ci/tests/eventshttps://api.us2.ddog-gov.com/api/v2/ci/tests/events

Overview

List endpoint returns CI Visibility test events that match a search query. Results are paginated similarly to logs.

Use this endpoint to see your latest test events.

This endpoint requires any of the following permissions:

  • ci_visibility_read
  • test_optimization_read

OAuth apps require one of the following authorization scopes to access this endpoint: ci_visibility_read, test_optimization_read.

Arguments

Query Strings

Name
Type
Description
filter[query]
string

Search query following log syntax.

filter[from]
string

Minimum timestamp for requested events.

filter[to]
string

Maximum timestamp for requested events.

sort
enum

Order of events in results.

Allowed enum values: timestamp, -timestamp
page[cursor]
string

List following results with a cursor provided in the previous query.

page[limit]
integer

Maximum number of events in the response.

Default: 10

Response

OK

Response object with all test events matching the request and pagination information.

Field
Type
Description
data
[object]

Array of events matching the request.

links
object

Links attributes.

meta
object

The metadata associated with a request.

Code Example

Get a list of tests events
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/ci/tests/events" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/ci/tests/events" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/ci/tests/events" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/ci/tests/events" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/ci/tests/events" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/ci/tests/events" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/ci/tests/events" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Set your Datadog site and credentials
export DD_SITE="ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/ci/tests/events" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"
# Set your Datadog site and credentials
export DD_SITE="us2.ddog-gov.com"
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X GET "https://api.${DD_SITE}/api/v2/ci/tests/events" \
-H "Accept: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}"