---
title: "Get a list of tests events"
method: GET
path: "/api/v2/ci/tests/events"
tags: ["CI Visibility Tests"]
---

# Get a list of tests events

`GET /api/v2/ci/tests/events`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/ci/tests/events`
- 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: `ci_visibility_read`
  - OAuth 2
    - Authorization code: `/oauth2/v1/authorize`
    - Token URL: `/oauth2/v1/token` scopes: `test_optimization_read`

List endpoint returns CI Visibility test events that match a [search query](https://docs.datadoghq.com/continuous_integration/explorer/search_syntax/).
[Results are paginated similarly to logs](https://docs.datadoghq.com/logs/guide/collect-multiple-logs-with-pagination).

Use this endpoint to see your latest test events.

## Query parameters

- `filter[query]` string
- `filter[from]` string, date-time
- `filter[to]` string, date-time
- `sort` 'timestamp' | '-timestamp': Sort parameters when querying events.
- `page[cursor]` string
- `page[limit]` integer

## Response `200`

OK

- CIAppTestEventsResponse: Response object with all test events matching the request and pagination information.
  - `data` CIAppTestEvent[]: Array of events matching the request.
    - `attributes` CIAppEventAttributes: JSON object containing all event attributes and their associated values.
      - `attributes` object: JSON object of attributes from CI Visibility test events.
      - `tags` string[]: Array of tags associated with your event.
      - `test_level` 'session' | 'module' | 'suite' | 'test': Test run level.
    - `id` string: Unique ID of the event.
    - `type` 'citest': Type of the event.
  - `links` CIAppResponseLinks: Links attributes.
    - `next` string: Link for the next set of results. The request can also be made using the POST endpoint.
  - `meta` CIAppResponseMetadataWithPagination: The metadata associated with a request.
    - `elapsed` integer: The time elapsed in milliseconds.
    - `page` CIAppResponsePage: Paging attributes.
      - `after` string: The cursor to use to get the next results, if any. To make the next request, use the same parameters with the addition of `page[cursor]`.
    - `request_id` string: The identifier of the request.
    - `status` 'done' | 'timeout': The status of the response.
    - `warnings` CIAppWarning[]: A list of warnings (non-fatal errors) encountered. Partial results may return if warnings are present in the response.
      - `code` string: A unique code for this type of warning.
      - `detail` string: A detailed explanation of this specific warning.
      - `title` string: A short human-readable summary of the warning.

## Other responses

- `400`: Bad Request
- `403`: Not Authorized
- `429`: Too many requests

---

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