POST https://api.ap1.datadoghq.com/api/v1/graph/embedhttps://api.datadoghq.eu/api/v1/graph/embedhttps://api.ddog-gov.com/api/v1/graph/embedhttps://api.datadoghq.com/api/v1/graph/embedhttps://api.us3.datadoghq.com/api/v1/graph/embedhttps://api.us5.datadoghq.com/api/v1/graph/embed
Overview
Creates a new embeddable graph.
Note: If an embed already exists for the exact same query in a given organization,
the older embed is returned instead of creating a new embed.
If you are interested in using template variables, see
Embeddable Graphs with Template Variables.
Request
Body Data (required)
Embeddable Graph body
Expand All
The graph definition in JSON.
Same format that is available on the JSON tab of the graph editor.
The flag determining if the graph includes a legend.
Allowed enum values: yes,no
default: no
The size of the graph.
Allowed enum values: small,medium,large,xlarge
default: medium
The timeframe for the graph.
Allowed enum values: 1_hour,4_hours,1_day,2_days,1_week
default: 1_hour
Determines graph title. Must be at least 1 character.
default: Embed created through API
{
"graph_json": "",
"legend": "string",
"size": "string",
"timeframe": "string",
"title": "string"
}
Response
Payload accepted
Embeddable graph.
Expand All
Name of the dashboard the graph is on (null if none).
URL of the dashboard the graph is on (null if none).
HTML fragment for the embed (iframe).
Boolean flag for whether or not the embed is revoked.
ID of the use who shared the embed.
{
"dash_name": "string",
"dash_url": "string",
"embed_id": "string",
"graph_title": "string",
"html": "string",
"revoked": false,
"shared_by": "integer"
}
Bad Request
Error response object.
Expand All
Array of errors returned by the API.
{
"errors": [
"Bad Request"
]
}
Authentication Error
Error response object.
Expand All
Array of errors returned by the API.
{
"errors": [
"Bad Request"
]
}
Too many requests
Error response object.
Expand All
Array of errors returned by the API.
{
"errors": [
"Bad Request"
]
}
Code Example
# Curl command
curl -X POST "https://api.ap1.datadoghq.com"https://api.datadoghq.eu"https://api.ddog-gov.com"https://api.datadoghq.com"https://api.us3.datadoghq.com"https://api.us5.datadoghq.com/api/v1/graph/embed" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "DD-API-KEY: ${DD_API_KEY}" \
-H "DD-APPLICATION-KEY: ${DD_APP_KEY}" \
-d @- << EOF
{
"graph_json": ""
}
EOF