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-logs-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: 3.2.0
info:
title: Datadog Logs API
version: '1.0'
description: 'Operations tagged Logs across 2 of this provider''s published API definitions: datadog-api-openapi.yml, datadog-logs-openapi.yml. Each path carries the servers of the definition it was published in.'
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
- datadoghq.eu
- ddog-gov.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://api.datadoghq.com
description: Datadog API Production Server
tags:
- description: Search your logs and send them to your Datadog platform over HTTP. See the [Log Management page](https://docs.datadoghq.com/logs/) for more information.
name: Logs
paths:
/api/v2/logs:
post:
description: 'Send your logs to your Datadog platform over HTTP. Limits per HTTP request are:
- Maximum content size per payload (uncompressed): 5MB
- Maximum size for a single log: 1MB
- Maximum array size if sending multiple logs in an array: 1000 entries
Any log exceeding 1MB is accepted and truncated by Datadog:
- For a single log request, the API truncates the log at 1MB and returns a 2xx.
- For a multi-logs request, the API processes all logs, truncates only logs larger than 1MB, and returns a 2xx.
Datadog recommends sending your logs compressed.
Add the `Content-Encoding: gzip` header to the request when sending compressed logs.
Log events can be submitted with a timestamp that is up to 18 hours in the past.
The status codes answered by the HTTP API are:
- 202: Accepted: the request has been accepted for processing
- 400: Bad request (likely an issue in the payload formatting)
- 401: Unauthorized (likely a missing API Key)
- 403: Permission issue (likely using an invalid API Key)
- 408: Request Timeout, request should be retried after some time
- 413: Payload too large (batch is above 5MB uncompressed)
- 429: Too Many Requests, request should be retried after some time
- 500: Internal Server Error, the server encountered an unexpected condition that prevented it from fulfilling the request, request should be retried after some time
- 503: Service Unavailable, the server is not ready to handle the request probably because it is overloaded, request should be retried after some time'
operationId: SubmitLog
parameters:
- description: HTTP header used to compress the media-type.
in: header
name: Content-Encoding
required: false
schema:
$ref: '#/components/schemas/ContentEncoding'
example: example_value
- description: Log tags can be passed as query parameters with `text/plain` content type.
example: env:prod,user:my-user
in: query
name: ddtags
required: false
schema:
type: string
requestBody:
content:
application/json:
examples:
multi-json-messages:
description: Pass multiple log objects at once.
summary: Multi JSON Messages
value:
- ddsource: nginx
ddtags: env:staging,version:5.1
hostname: i-012345678
message: 2019-11-19T14:37:58,995 INFO [process.name][20081] Hello
service: payment
- ddsource: nginx
ddtags: env:staging,version:5.1
hostname: i-012345679
message: 2019-11-19T14:37:58,995 INFO [process.name][20081] World
service: payment
simple-json-message:
description: Log attributes can be passed as `key:value` pairs in valid JSON messages.
summary: Simple JSON Message
value:
ddsource: nginx
ddtags: env:staging,version:5.1
hostname: i-012345678
message: 2019-11-19T14:37:58,995 INFO [process.name][20081] Hello World
service: payment
schema:
$ref: '#/components/schemas/HTTPLog'
application/logplex-1:
examples:
multi-raw-message:
description: Submit log messages.
summary: Multi Logplex Messages
value: '2019-11-19T14:37:58,995 INFO [process.name][20081] Hello
2019-11-19T14:37:58,995 INFO [process.name][20081] World'
simple-logplex-message:
description: Submit log string.
summary: Simple Logplex Message
value: 2019-11-19T14:37:58,995 INFO [process.name][20081] Hello World
schema:
type: string
text/plain:
examples:
multi-raw-message:
description: Submit log string.
summary: Multi Raw Messages
value: '2019-11-19T14:37:58,995 INFO [process.name][20081] Hello
2019-11-19T14:37:58,995 INFO [process.name][20081] World
'
simple-raw-message:
description: 'Submit log string. Log attributes can be passed as query parameters in the URL. This enables the addition of tags or the source by using the `ddtags` and `ddsource` parameters: `?host=my-hostname&service=my-service&ddsource=my-source&ddtags=env:prod,user:my-user`.'
summary: Simple Raw Message
value: 2019-11-19T14:37:58,995 INFO [process.name][20081] Hello World
schema:
type: string
description: Log to send (JSON format).
required: true
responses:
'202':
content:
application/json:
schema:
type: object
description: Request accepted for processing (always 202 empty JSON).
'400':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPLogErrors'
description: Bad Request
'401':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPLogErrors'
description: Unauthorized
'403':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPLogErrors'
description: Forbidden
'408':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPLogErrors'
description: Request Timeout
'413':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPLogErrors'
description: Payload Too Large
'429':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPLogErrors'
description: Too Many Requests
'500':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPLogErrors'
description: Internal Server Error
'503':
content:
application/json:
schema:
$ref: '#/components/schemas/HTTPLogErrors'
description: Service Unavailable
security:
- apiKeyAuth: []
servers:
- url: https://{subdomain}.{site}
variables:
site:
default: datadoghq.com
description: The regional site for customers.
enum:
- datadoghq.com
- us3.datadoghq.com
- us5.datadoghq.com
- ap1.datadoghq.com
- datadoghq.eu
- ddog-gov.com
subdomain:
default: http-intake.logs
description: The subdomain where the API is deployed.
- url: '{protocol}://{name}'
variables:
name:
default: http-intake.logs.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: http-intake.logs
description: The subdomain where the API is deployed.
summary: Datadog Send Logs
tags:
- Logs
x-codegen-request-body-name: body
x-menu-order: 1
x-undo:
type: safe
x-api-evangelist-processing:
PascalCaseOperationSummaries: true
ChooseTags: true
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
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
- datadoghq.eu
- ddog-gov.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.
/api/v2/logs/events/search:
post:
description: 'List endpoint returns logs that match a log search query.
[Results are paginated][1].
Use this endpoint to search and filter your logs.
**If you are considering archiving logs for your organization,
consider use of the Datadog archive capabilities instead of the log list API.
See [Datadog Logs Archive documentation][2].**
[1]: /logs/guide/collect-multiple-logs-with-pagination
[2]: https://docs.datadoghq.com/logs/archives'
operationId: ListLogs
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/LogsListRequest'
required: false
responses:
'200':
content:
application/json:
schema:
$ref: '#/components/schemas/LogsListResponse'
description: OK
'400':
$ref: '#/components/responses/BadRequestResponse'
'403':
$ref: '#/components/responses/NotAuthorizedResponse'
'429':
$ref: '#/components/responses/TooManyRequestsResponse'
summary: Datadog Search Logs (post)
tags:
- Logs
x-codegen-request-body-name: body
x-menu-order: 3
x-pagination:
cursorParam: body.page.cursor
cursorPath: meta.page.after
limitParam: body.page.limit
resultsPath: data
x-permission:
operator: OR
permissions:
- logs_read_data
x-undo:
type: safe
x-api-evangelist-processing:
PascalCaseOperationSummaries: true
ChooseTags: true
x-microcks-operation:
delay: 0
dispatcher: FALLBACK
security:
- apiKeyAuth: []
appKeyAuth: []
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
- datadoghq.eu
- ddog-gov.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.
components:
schemas:
LogsAggregateResponseStatus:
description: The status of the response
enum:
- done
- timeout
example: done
type: string
x-enum-varnames:
- DONE
- TIMEOUT
HTTPLogErrors:
description: Invalid query performed.
properties:
errors:
description: Structured errors.
items:
$ref: '#/components/schemas/HTTPLogError'
type: array
type: object
LogsQueryOptions:
deprecated: true
description: 'Global query options that are used during the query.
Note: These fields are currently deprecated and do not affect the query results.'
properties:
timeOffset:
description: The time offset (in seconds) to apply to the query.
format: int64
type: integer
example: 42
timezone:
default: UTC
description: The timezone can be specified as GMT, UTC, an offset from UTC (like UTC+1), or as a Timezone Database identifier (like America/New_York).
example: GMT
type: string
type: object
LogsResponseMetadataPage:
description: Paging attributes.
properties:
after:
description: 'The cursor to use to get the next results, if any. To make the next request, use the same
parameters with the addition of the `page[cursor]`.'
example: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==
type: string
type: object
LogsWarning:
description: A warning message indicating something that went wrong with the query
properties:
code:
description: A unique code for this type of warning
example: unknown_index
type: string
detail:
description: A detailed explanation of this specific warning
example: 'indexes: foo, bar'
type: string
title:
description: A short human-readable summary of the warning
example: One or several indexes are missing or invalid, results hold data from the other indexes
type: string
type: object
LogsSort:
description: Sort parameters when querying logs.
enum:
- timestamp
- -timestamp
type: string
x-enum-varnames:
- TIMESTAMP_ASCENDING
- TIMESTAMP_DESCENDING
HTTPLog:
description: Structured log message.
items:
$ref: '#/components/schemas/HTTPLogItem'
type: array
LogsListRequestPage:
description: Paging attributes for listing logs.
properties:
cursor:
description: List following results with a cursor provided in the previous query.
example: eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==
type: string
limit:
default: 10
description: Maximum number of logs in the response.
example: 25
format: int32
maximum: 1000
type: integer
type: object
APIErrorResponse:
description: API error response.
properties:
errors:
description: A list of errors.
example:
- Bad Request
items:
description: A list of items.
example: Bad Request
type: string
type: array
required:
- errors
type: object
HTTPLogItem:
additionalProperties:
description: Additional log attributes.
description: Logs that are sent over HTTP.
properties:
ddsource:
description: 'The integration name associated with your log: the technology from which the log originated.
When it matches an integration name, Datadog automatically installs the corresponding parsers and facets.
See [reserved attributes](https://docs.datadoghq.com/logs/log_configuration/attributes_naming_convention/#reserved-attributes).'
example: nginx
type: string
ddtags:
description: Tags associated with your logs.
example: env:staging,version:5.1
type: string
hostname:
description: The name of the originating host of the log.
example: i-012345678
type: string
message:
description: 'The message [reserved attribute](https://docs.datadoghq.com/logs/log_configuration/attributes_naming_convention/#reserved-attributes)
of your log. By default, Datadog ingests the value of the message attribute as the body of the log entry.
That value is then highlighted and displayed in the Logstream, where it is indexed for full text search.'
example: 2019-11-19T14:37:58,995 INFO [process.name][20081] Hello World
type: string
service:
description: 'The name of the application or service generating the log events.
It is used to switch from Logs to APM, so make sure you define the same value when you use both products.
See [reserved attributes](https://docs.datadoghq.com/logs/log_configuration/attributes_naming_convention/#reserved-attributes).'
example: payment
type: string
required:
- message
type: object
LogsListRequest:
description: The request for a logs list.
properties:
filter:
$ref: '#/components/schemas/LogsQueryFilter'
options:
$ref: '#/components/schemas/LogsQueryOptions'
page:
$ref: '#/components/schemas/LogsListRequestPage'
sort:
$ref: '#/components/schemas/LogsSort'
type: object
LogType:
default: log
description: Type of the event.
enum:
- log
example: log
type: string
x-enum-varnames:
- LOG
LogAttributes:
description: JSON object containing all log attributes and their associated values.
properties:
attributes:
additionalProperties: {}
description: JSON object of attributes from your log.
example:
customAttribute: 123
duration: 2345
type: object
host:
description: Name of the machine from where the logs are being sent.
example: i-0123
type: string
message:
description: 'The message [reserved attribute](https://docs.datadoghq.com/logs/log_collection/#reserved-attributes)
of your log. By default, Datadog ingests the value of the message attribute as the body of the log entry.
That value is then highlighted and displayed in the Logstream, where it is indexed for full text search.'
example: Host connected to remote
type: string
service:
description: 'The name of the application or service generating the log events.
It is used to switch from Logs to APM, so make sure you define the same
value when you use both products.'
example: agent
type: string
status:
description: Status of the message associated with your log.
example: INFO
type: string
tags:
description: Array of tags associated with your log.
example:
- team:A
items:
description: Tag associated with your log.
type: string
type: array
timestamp:
description: Timestamp of your log.
example: '2019-01-02T09:42:36.320Z'
format: date-time
type: string
type: object
LogsListResponse:
description: Response object with all logs matching the request and pagination information.
properties:
data:
description: Array of logs matching the request.
items:
$ref: '#/components/schemas/Log'
type: array
links:
$ref: '#/components/schemas/LogsListResponseLinks'
meta:
$ref: '#/components/schemas/LogsResponseMetadata'
type: object
HTTPLogError:
description: List of errors.
properties:
detail:
description: Error message.
example: Malformed payload
type: string
status:
description: Error code.
example: '400'
type: string
title:
description: Error title.
example: Bad Request
type: string
type: object
LogsResponseMetadata:
description: The metadata associated with a request
properties:
elapsed:
description: The time elapsed in milliseconds
example: 132
format: int64
type: integer
page:
$ref: '#/components/schemas/LogsResponseMetadataPage'
request_id:
description: The identifier of the request
example: MWlFUjVaWGZTTTZPYzM0VXp1OXU2d3xLSVpEMjZKQ0VKUTI0dEYtM3RSOFVR
type: string
status:
$ref: '#/components/schemas/LogsAggregateResponseStatus'
warnings:
description: 'A list of warnings (non fatal errors) encountered, partial results might be returned if
warnings are present in the response.'
items:
$ref: '#/components/schemas/LogsWarning'
type: array
type: object
LogsStorageTier:
default: indexes
description: Specifies storage type as indexes, online-archives or flex
enum:
- indexes
- online-archives
- flex
example: indexes
type: string
x-enum-varnames:
- INDEXES
- ONLINE_ARCHIVES
- FLEX
Log:
description: Object description of a log after being processed and stored by Datadog.
properties:
attributes:
$ref: '#/components/schemas/LogAttributes'
id:
description: Unique ID of the Log.
example: AAAAAWgN8Xwgr1vKDQAAAABBV2dOOFh3ZzZobm1mWXJFYTR0OA
type: string
type:
$ref: '#/components/schemas/LogType'
type: object
LogsQueryFilter:
description: The search and filter query settings
properties:
from:
default: now-15m
description: The minimum time for the requested logs, supports date math and regular timestamps (milliseconds).
example: now-15m
type: string
indexes:
default:
- '*'
description: For customers with multiple indexes, the indexes to search. Defaults to ['*'] which means all indexes.
example:
- main
- web
items:
description: The name of a log index.
type: string
type: array
query:
default: '*'
description: The search query - following the log search syntax.
example: service:web* AND @http.status_code:[200 TO 299]
type: string
storage_tier:
$ref: '#/components/schemas/LogsStorageTier'
to:
default: now
description: The maximum time for the requested logs, supports date math and regular timestamps (milliseconds).
example: now
type: string
type: object
ContentEncoding:
description: HTTP header used to compress the media-type.
enum:
- identity
- gzip
- deflate
type: string
x-enum-varnames:
- IDENTITY
- GZIP
- DEFLATE
LogsListResponseLinks:
description: Links attributes.
properties:
next:
description: 'Link for the next set of results. Note that the request can also be made using the
POST endpoint.'
example: https://app.datadoghq.com/api/v2/logs/event?filter[query]=foo&page[cursor]=eyJzdGFydEF0IjoiQVFBQUFYS2tMS3pPbm40NGV3QUFBQUJCV0V0clRFdDZVbG8zY3pCRmNsbHJiVmxDWlEifQ==
type: string
type: object
HTTPLogItem_2:
type: object
description: A single log entry to submit to Datadog
required:
- message
properties:
message:
type: string
description: The message content of the log entry. This field is required and indexed for search.
example: CPU usage is high on {{host.name}}
hostname:
type: string
description: The name of the host that generated the log entry
example: Example Monitor
service:
type: string
description: The name of the application or service that generated the log
example: example_value
ddsource:
type: string
description: The source technology of the log (e.g., nginx, redis, java) used for automatic processing
example: example_value
ddtags:
type: string
description: Comma-separated list of tags to apply to the log entry in key:value format
example: env:production
status:
type: string
description: The severity or log level of the event (e.g., info, warning, error, critical)
enum:
- emerg
- alert
- critical
- error
- warning
- notice
- info
- debug
example: emerg
LogsListRequest_2:
type: object
description: Request body for searching log events
properties:
filter:
$ref: '#/components/schemas/LogsQueryFilter_2'
sort:
type: string
description: The sort order for log results, either ascending or descending by timestamp
enum:
- timestamp
- -timestamp
example: timestamp
page:
type: object
description: Pagination configuration for log search results
properties:
cursor:
type: string
description: A cursor token from a previous response to retrieve the next page of results
limit:
type: integer
description: The maximum number of logs to return per page (default 10, max 1000)
minimum: 1
maximum: 1000
default: 10
HTTPLogSuccess:
type: object
description: Response indicating logs were accepted for processing
properties: {}
Log_2:
type: object
description: A single log event returned from a search query
properties:
id:
type: string
description: The unique identifier of the log event
example: abc-123-def
type:
type: string
description: The type of the resource (always 'log')
example: metric alert
attributes:
$ref: '#/components/schemas/LogAttributes_2'
APIErrorResponse_2:
type: object
description: Standard API error response returned for failed requests
required:
- errors
properties:
errors:
type: array
description: List of error messages describing the failure
items:
type: string
LogsQueryFilter_2:
type: object
description: Filter criteria for log search queries
properties:
query:
type: string
description: A Datadog log search query string to filter log events (e.g., service:web status:error)
example: avg:system.cpu.user{*}
indexes:
type: array
description: List of log index names to search; if empty, all indexes are searched
items:
type: string
from:
type: string
description: The start of the time range for the search in ISO 8601 format or relative format (e.g., now-15m)
example: example_value
to:
type: string
description: The end of the time range for the search in ISO 8601 format or relative format (e.g., now)
example: example_value
LogAttributes_2:
type: object
description: The attributes of a log event returned from the search API
properties:
timestamp:
type: string
format: date-time
description: ISO 8601 timestamp when the log was generated
example: '2026-04-17T12:00:00Z'
status:
type: string
description: The log level or severity status of the event
example: OK
message:
type: string
description: The raw log message content
example: CPU usage is high on {{host.name}}
host:
type: string
description: The hostname of the machine that generated the log
example: example_value
service:
type: string
description: The name of the application or service that generated the log
example: example_value
source:
type: string
description: The technology source that generated the log (e.g., nginx, java)
example: example_value
tags:
type: array
description: List of tags associated with the log event in key:value format
items:
type: string
attributes:
type: object
description: Custom key-value attributes extracted from the log message
additionalProperties: true
LogsListResponse_2:
type: object
description: Response containing matching log events from a search query
properties:
data:
type: array
description: List of matching log events
items:
$ref: '#/components/schemas/Log_2'
meta:
type: object
description: Metadata about the search response including pagination information
properties:
page:
type: object
description: Pagination details for continuing the search
properties:
after:
type: string
description: Cursor token to retrieve the next page of results
elapsed:
type: integer
description: Time in milliseconds taken to execute the search query
status:
type: string
description: Status of the search request (done, timeout)
enum:
- done
- timeout
responses:
BadRequestResponse:
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Bad Request
NotAuthorizedResponse:
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Not Authorized
TooManyRequestsResponse:
content:
application/json:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Too many requests
securitySchemes:
AuthZ:
description: This API uses OAuth 2 with the implicit grant flow.
flows:
authorizationCode:
authorizationUrl: /oauth2/v1/authorize
scopes:
apm_api_catalog_read: View API catalog and API definitions.
apm_api_catalog_write: Add, modify, and delete API catalog definitions.
apm_read: Read and query APM and Trace Analytics.
apm_service_catalog_read: View service catalog and service definitions.
apm_service_catalog_write: Add, modify, and delete service catalog definitions when those definitions are maintained by Datadog.
appsec_vm_read: View infrastructure, applicatio
# --- truncated at 32 KB (38 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/datadog/refs/heads/main/openapi/datadog-logs-api-openapi.yml