Datadog APM Retention Filters API

Manage configuration of [APM retention filters](https://app.datadoghq.com/apm/traces/retention-filters) for your organization. You need an API and application key with Admin rights to interact with this endpoint. See [retention filters](https://docs.datadoghq.com/tracing/trace_pipeline/trace_retention/#retention-filters) on the Trace Retention page for more information.

Business capability
Observability Management BC-4220.20

Operations 6

Each operation below carries the questions people ask an LLM about it and the instructions they give an agent to run it. Generated by API Evangelist overlay

GET /api/v2/apm/config/retention-filters List APM retention filters · List all APM retention filters #
Ask an LLM
“Which retention filters decide what spans get indexed in my Datadog org?”
“What span retention filters do we have configured today?”
Tell an agent
List all of my APM retention filters.
Show me every span retention filter configured in the organization.
POST /api/v2/apm/config/retention-filters Create a span retention filter · Create a retention filter #
Ask an LLM
“How do I start indexing a specific slice of my spans with a new retention filter?”
“Can I create my own error or AppSec sampling retention filter, or are those defaults only?”
Tell an agent
Create a new APM retention filter defined by {filter}.
Add a retention filter that indexes spans matching {filter}.
PUT /api/v2/apm/config/retention-filters-execution-order Change the execution order of retention filters · Re-order retention filters #
Ask an LLM
“Can I change the order in which my retention filters are evaluated?”
“How do I make one retention filter run before the others?”
Tell an agent
Re-order my retention filters to run in this sequence: {filters}.
Set the retention filter execution order to {filters}.
DELETE /api/v2/apm/config/retention-filters/{filter_id} Delete a span retention filter · Delete a retention filter #
Ask an LLM
“How do I stop a retention filter from indexing spans by removing it?”
“Can the default AppSec sampling retention filter be deleted?”
Tell an agent destructive · confirm first
Delete retention filter {filter_id}.
Remove the APM retention filter {filter_id} from my organization.
GET /api/v2/apm/config/retention-filters/{filter_id} Get one APM retention filter · Get a given APM retention filter #
Ask an LLM
“What query and sample rate does a particular retention filter use?”
“Can I look up a single retention filter by its ID?”
Tell an agent
Get the details of retention filter {filter_id}.
Show me how retention filter {filter_id} is configured.
PUT /api/v2/apm/config/retention-filters/{filter_id} Update a span retention filter · Update a retention filter #
Ask an LLM
“How do I change the query or rate on a retention filter I already have?”
“Can I rename one of the default error sampling retention filters?”
Tell an agent
Update retention filter {filter_id} with {changes}.
Change the existing retention filter {filter_id} so its definition becomes {changes}.

Work with this as data

Every API here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for apis

7 MCP tools reach this
  • find_apisBrowse and filter every API in the catalog.
  • get_api_artifactsOne API's artifacts, grouped by type.
  • get_openapiThe primary OpenAPI for this API.
  • find_similar_apisAPIs that look like this one.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This API
curl "https://apis.io/api/v1/apis/datadog-apm:datadog-apm-apm-retention-filters-api"
All apis
curl "https://apis.io/api/v1/apis?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.

OpenAPI Specification

datadog-apm-apm-retention-filters-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: Datadog APM — APM, Spans and Service Definitions (API v2)…
  description: The APM, retention filter, span, span-metric and service-definition surface of the Datadog API v2, extracted verbatim from the OpenAPI definition Datadog publishes for its own API clients.
  version: '1.0'
  contact:
    email: support@datadoghq.com
    name: Datadog Support
    url: https://www.datadoghq.com/support/
  x-source: https://raw.githubusercontent.com/DataDog/datadog-api-client-go/master/.generator/schemas/v2/openapi.yaml
  x-extracted: '2026-09-05'
  x-extraction-note: Path items, components and security schemes copied VERBATIM from the Datadog-published OpenAPI at x-source; only the APM-relevant subset of paths is retained. No content was authored by API Evangelist.
servers:
- url: https://{subdomain}.{site}
  variables:
    site:
      default: datadoghq.com
      description: The regional site for Datadog customers.
      enum:
      - datadoghq.com
      - us3.datadoghq.com
      - us5.datadoghq.com
      - ap1.datadoghq.com
      - ap2.datadoghq.com
      - uk1.datadoghq.com
      - datadoghq.eu
      - ddog-gov.com
      - us2.ddog-gov.com
      - uk1.datadoghq.com
    subdomain:
      default: api
      description: The subdomain where the API is deployed.
- url: '{protocol}://{name}'
  variables:
    name:
      default: api.datadoghq.com
      description: Full site DNS name.
    protocol:
      default: https
      description: The protocol for accessing the API.
- url: https://{subdomain}.{site}
  variables:
    site:
      default: datadoghq.com
      description: Any Datadog deployment.
    subdomain:
      default: api
      description: The subdomain where the API is deployed.
security:
- apiKeyAuth: []
  appKeyAuth: []
tags:


# --- truncated at 32 KB (32 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/datadog-apm/refs/heads/main/openapi/datadog-apm-apm-retention-filters-api-openapi.yml