---
title: "Get Test Optimization service settings"
method: POST
path: "/api/v2/ci/test-optimization/settings/service"
tags: ["Test Optimization"]
---

# Get Test Optimization service settings

`POST /api/v2/ci/test-optimization/settings/service`

## Request

- Base URL: `https://api.datadoghq.com`
- URL: `https://api.datadoghq.com/api/v2/ci/test-optimization/settings/service`
- 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: `test_optimization_read`

Retrieve Test Optimization settings for a specific service identified by repository, service name, and environment.

## Request body

- TestOptimizationGetServiceSettingsRequest: Request object for getting Test Optimization service settings.
  - `data` TestOptimizationGetServiceSettingsRequestData, required: Data object for get service settings request.
    - `attributes` TestOptimizationGetServiceSettingsRequestAttributes, required: Attributes for requesting Test Optimization service settings.
      - `env` string: The environment name. If omitted, defaults to `none`.
      - `repository_id` string, required: The repository identifier.
      - `service_name` string, required: The service name.
    - `type` 'test_optimization_get_service_settings_request', required: JSON:API type for get service settings request. The value must always be `test_optimization_get_service_settings_request`.

## Response `200`

OK

- TestOptimizationServiceSettingsResponse: Response object containing Test Optimization service settings.
  - `data` TestOptimizationServiceSettingsData: Data object for Test Optimization service settings response.
    - `attributes` TestOptimizationServiceSettingsAttributes: Attributes for Test Optimization service settings.
      - `auto_test_retries_enabled` boolean: Whether Auto Test Retries are enabled for this service.
      - `auto_test_retries_enabled_is_overridden` boolean: Whether the Auto Test Retries setting is overridden at the service level.
      - `code_coverage_enabled` boolean: Whether Code Coverage is enabled for this service.
      - `code_coverage_enabled_is_overridden` boolean: Whether the Code Coverage setting is overridden at the service level.
      - `early_flake_detection_enabled` boolean: Whether Early Flake Detection is enabled for this service.
      - `early_flake_detection_enabled_is_overridden` boolean: Whether the Early Flake Detection setting is overridden at the service level.
      - `env` string: The environment name.
      - `failed_test_replay_enabled` boolean: Whether Failed Test Replay is enabled for this service.
      - `failed_test_replay_enabled_is_overridden` boolean: Whether the Failed Test Replay setting is overridden at the service level.
      - `pr_comments_enabled` boolean: Whether PR Comments are enabled. This value reflects the repository-level setting and cannot be overridden at the service level.
      - `repository_id` string: The repository identifier.
      - `service_name` string: The service name.
      - `test_impact_analysis_enabled` boolean: Whether Test Impact Analysis is enabled for this service.
      - `test_impact_analysis_enabled_is_overridden` boolean: Whether the Test Impact Analysis setting is overridden at the service level.
    - `id` string: Unique identifier for the service settings.
    - `type` 'test_optimization_service_settings': JSON:API type for service settings response. The value must always be `test_optimization_service_settings`.

## Other responses

- `400`: Bad Request
- `403`: Not Authorized
- `404`: Not Found
- `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)
