How AI is applied across API Evangelist and APIs.io. Read my AI disclosure →
API Evangelist API Evangelist
Discovery
Learnings
Guidance
Toolbox
Alignment
API Evangelist LLC

Datadog APM Spans API

Search, list and aggregate APM spans. Three operations covering cursor-paginated span search (POST and GET forms) and a span analytics aggregation that returns single numbers, single strings or timeseries buckets.

Datadog APM Spans API is one of 8 APIs that Datadog APM publishes on the APIs.io network, described by a machine-readable OpenAPI specification.

Tagged areas include Spans. The published artifact set on APIs.io includes an OpenAPI specification and API documentation.

This API exposes 3 operations across 3 paths, and defines 50 schemas. It is described by OpenAPI 3.2.0, at version 1.0.

Requests are made against 3 base URLs: https://{subdomain}.{site}, {protocol}://{name}, https://{subdomain}.{site}.

3 operations 3 paths 50 schemas 1 GET2 POST

Metadata

The identity and technical contract details declared by the specification.

Specification
OpenAPI 3.2.0
API Version
1.0
Base URL
https://api.datadoghq.com
Authentication
OAuth 2.0, API Key, API Key, HTTP Bearer
Resource Areas
1

Authentication & Security 4

Datadog APM Spans API declares 4 security schemes for authenticating requests. It supports OAuth 2.0 (AuthZ) using the authorizationCode flow, exposing 96 scopes. An API key is passed in the header as DD-API-KEY (apiKeyAuth). An API key is passed in the header as DD-APPLICATION-KEY (appKeyAuth). It accepts HTTP bearer tokens (bearerAuth). By default, every request must be authenticated.

  • AuthZ — This API uses OAuth 2 with the implicit grant flow.
  • apiKeyAuth — Your Datadog API Key.
  • appKeyAuth — Your Datadog APP Key.

Paths & Operations 3

Across 3 paths, the API surfaces 3 operations — 1 GET, 2 POST. Each is listed below with its method, path, parameters, and response codes.

Spans 3

Search and aggregate your spans from your Datadog platform over HTTP.

POST
/api/v2/spans/analytics/aggregate
Aggregate spans
AggregateSpans body → 200400403429
GET
/api/v2/spans/events
Get a list of spans
ListSpansGet 6 params → 200400403422429
POST
/api/v2/spans/events/search
Search spans
ListSpans body → 200400403422429

Schemas 50

The contract defines 50 schemas that model the data the API accepts and returns. The most detailed are SpansAttributes (17 properties), SpansGroupBy (6 properties), SpansListResponseMetadata (5 properties), JSONAPIErrorItem (5 properties). Each schema is shown below with its type and property counts.

SpansType
string
Type of the span.
SpansListRequestType
string
The type of resource. The value should always be searchrequest.
SpansAggregateBucketValueSingleNumber
number
A single number value.
SpansListRequestData
object
The object containing the query content.
2 properties
SpansAggregateResponseMetadata
object
The metadata associated with a request.
4 properties
SpansAggregateResponse
object
The response object for the spans aggregate API endpoint.
2 properties
SpansAggregateBucket
object
Spans aggregate.
3 properties
SpansAggregateRequest
object
The object sent with the request to retrieve a list of aggregated spans from your organization.
1 property
SpansAggregateRequestAttributes
object
The object containing all the query parameters.
4 properties
SpansQueryOptions
object
Global query options that are used during the query. Note: You should only supply timezone or time offset but not both otherwise the query will fail.
2 properties
SpansAggregateBucketAttributes
object
A bucket values.
3 properties
SpansAggregateBucketType
string
The spans aggregate bucket type.
JSONAPIErrorResponse
object
API error response.
1 property 1 required
SpansListRequest
object
The request for a spans list.
1 property
SpansAggregateSort
object
A sort rule.
4 properties
SpansGroupByTotal
A resulting object to put the given computes in over all the matching records.
SpansSortOrder
string
The order to use, ascending or descending.
SpansListRequestAttributes
object
The object containing all the query parameters.
4 properties
JSONAPIErrorItem
object
API error response body
5 properties
SpansAggregateBucketValueSingleString
string
A single string value.
SpansGroupByMissingNumber
number
The missing value to use if there is a number valued facet.
SpansAggregateBucketValue
A bucket value, can be either a timeseries or a single value.
SpansAggregationFunction
string
An aggregation function.
SpansQueryFilter
object
The search and filter query settings.
3 properties
SpansAggregateRequestType
string
The type of resource. The value should always be aggregaterequest.
SpansGroupByTotalBoolean
boolean
If set to true, creates an additional bucket labeled "$facettotal".
SpansWarning
object
A warning message indicating something that went wrong with the query.
3 properties
SpansGroupByMissingString
string
The missing value to use if there is string valued facet.
SpansResponseMetadataPage
object
Paging attributes.
1 property
SpansCompute
object
A compute rule to compute metrics or timeseries.
4 properties 1 required
SpansListResponse
object
Response object with all spans matching the request and pagination information.
3 properties
SpansAggregateBucketValueTimeseriesPoint
object
A timeseries point.
2 properties
APIErrorResponse
object
API error response.
1 property 1 required
SpansGroupByMissing
The value to use for spans that don't have the facet used to group by.
JSONAPIErrorItemSource
object
References to the source of the error.
3 properties
SpansListResponseLinks
object
Links attributes.
1 property
SpansAggregateSortType
string
The type of sorting algorithm.
SpansAggregateData
object
The object containing the query content.
2 properties
SpansSort
string
Sort parameters when querying spans.
Span
object
Object description of a spans after being processed and stored by Datadog.
3 properties
SpansListRequestPage
object
Paging attributes for listing spans.
2 properties
SpansGroupByHistogram
object
Used to perform a histogram computation (only for measure facets). Note: At most 100 buckets are allowed, the number of buckets is (max - min)/interval.
3 properties 3 required
SpansGroupByTotalNumber
number
A number to use as the key value for the total bucket.
SpansGroupBy
object
A group by rule.
6 properties 1 required
SpansAttributes
object
JSON object containing all span attributes and their associated values.
17 properties
SpansListResponseMetadata
object
The metadata associated with a request.
5 properties
SpansComputeType
string
The type of compute.
SpansAggregateBucketValueTimeseries
array
A timeseries array.
SpansGroupByTotalString
string
A string to use as the key value for the total bucket.
SpansAggregateResponseStatus
string
The status of the response.

Specification

The full machine-readable OpenAPI contract behind this narrative.

Source

datadog-apm-spans-api-openapi.yml Raw ↑

Other APIs Datadog APM publishes across the network.

Datadog APM Spans Metrics API
Datadog MCP Server
Datadog APM API
Datadog APM Retention Filters API
Datadog APM Service Definition API
Datadog APM Service Level Objective Corrections API
Datadog APM Service Level Objectives API
Where this information came from

This is an independent, third-party profile of Datadog APM Spans API, published by API Evangelist. We do not operate, host, resell, or support these APIs, and we are not affiliated with or endorsed by the company unless stated above. Everything here is built from publicly available information — the company's own site, developer portal, documentation, public repositories, and the specifications it publishes for public use. Nothing is obtained by breaching a system, defeating an access control, or using credentials.

The Kin Score and Agent Readiness rating are independently calculated assessments of a company's public API artifacts, scored against a published rubric. They are not certifications, endorsements, security assessments, or audits.

Corrections, re-scores, and removal are free — no partnership or purchase required, and you do not need to justify the request. A removed company is recorded as unrated, never scored zero for having asked. Acknowledgement within one business day; removal within two.

info@apievangelist.com · Read the full data-sourcing policy →
On a security or compliance team? Put security in the subject line and you will get a person, not a form — we will tell you exactly which public URLs this profile was built from.