---
title: 임베드 생성하기
description: "임베드 가능한 그래프를 새로 만듭니다. 참고: 특정 조직 내에서 동일한 쿼리에 대한 임베드가 이미 존재하는 경우, 새 임베드를 생성하는 대신 이전 임베드가 반환됩니다. 템플릿 변수 사용에 관심이 있다면 템플릿 변수가 있는 임베드 가능한 그래프."
breadcrumbs: 문서 > API > 임베드 생성하기
---

> For the complete documentation index, see [llms.txt](https://dnd37xeb23o8n.cloudfront.net/stefon.simmons/docs-astro-web-10435/llms.txt).

# 임베드 생성하기

## v1 (latest)

| Datadog site      | API endpoint                                          |
| ----------------- | ----------------------------------------------------- |
| app.datadoghq.com | POST https://api.datadoghq.com/api/v1/graph/embed     |
| us3.datadoghq.com | POST https://api.us3.datadoghq.com/api/v1/graph/embed |
| us5.datadoghq.com | POST https://api.us5.datadoghq.com/api/v1/graph/embed |
| app.datadoghq.eu  | POST https://api.datadoghq.eu/api/v1/graph/embed      |
| ap1.datadoghq.com | POST https://api.ap1.datadoghq.com/api/v1/graph/embed |
| ap2.datadoghq.com | POST https://api.ap2.datadoghq.com/api/v1/graph/embed |
| uk1.datadoghq.com | POST https://api.uk1.datadoghq.com/api/v1/graph/embed |
| app.ddog-gov.com  | POST https://api.ddog-gov.com/api/v1/graph/embed      |
| us2.ddog-gov.com  | POST https://api.us2.ddog-gov.com/api/v1/graph/embed  |

### Overview

임베드 가능한 그래프를 새로 만듭니다.

참고: 특정 조직 내에서 동일한 쿼리에 대한 임베드가 이미 존재하는 경우,
새 임베드를 생성하는 대신 이전 임베드가 반환됩니다.

템플릿 변수 사용에 관심이 있다면
[템플릿 변수가 있는 임베드 가능한 그래프](https://docs.datadoghq.com/dashboards/faq/embeddable-graphs-with-template-variables.md).

This endpoint requires the `embeddable_graphs_share` permission.

### Request

#### Body Data (required)

임베드 가능한 그래프 본문

{% tabs %}
{% tab label="Model" %}
| Field                   | Type   | Description                                                                                                            |
| ----------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------- |
| graph_json [*required*] | string | 임베드 가능한 그래프를 새로 생성하기 위한 페이로드입니다.                                                                                       |
| legend                  | enum   | The flag determining if the graph includes a legend. Allowed enum values: `yes`, `no`. Default: `no`.                  |
| size                    | enum   | The size of the graph. Allowed enum values: `small`, `medium`, `large`, `xlarge`. Default: `medium`.                   |
| timeframe               | enum   | The timeframe for the graph. Allowed enum values: `1_hour`, `4_hours`, `1_day`, `2_days`, `1_week`. Default: `1_hour`. |
| title                   | string | Determines graph title. Must be at least 1 character. Default: `Embed created through API`.                            |
{% /tab %}

{% tab label="Example" %}
```json
{
  "graph_json": "",
  "legend": "string",
  "size": "string",
  "timeframe": "string",
  "title": "string"
}
```
{% /tab %}
{% /tabs %}

### Response

{% tabs %}
{% tab label="200" %}
Payload accepted

{% tabs %}
{% tab label="Model" %}
Embeddable graph.

| Field       | Type    | Description                                           |
| ----------- | ------- | ----------------------------------------------------- |
| dash_name   | string  | Name of the dashboard the graph is on (null if none). |
| dash_url    | string  | URL of the dashboard the graph is on (null if none).  |
| embed_id    | string  | ID of the embed.                                      |
| graph_title | string  | Title of the graph.                                   |
| html        | string  | HTML fragment for the embed (iframe).                 |
| revoked     | boolean | Boolean flag for whether or not the embed is revoked. |
| shared_by   | int64   | ID of the use who shared the embed.                   |
{% /tab %}

{% tab label="Example" %}
```json
{
  "dash_name": "string",
  "dash_url": "string",
  "embed_id": "string",
  "graph_title": "string",
  "html": "string",
  "revoked": false,
  "shared_by": "integer"
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="400" %}
Bad Request

{% tabs %}
{% tab label="Model" %}
Error response object.

| Field               | Type     | Description                          |
| ------------------- | -------- | ------------------------------------ |
| errors [*required*] | [string] | Array of errors returned by the API. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="403" %}
Authentication Error

{% tabs %}
{% tab label="Model" %}
Error response object.

| Field               | Type     | Description                          |
| ------------------- | -------- | ------------------------------------ |
| errors [*required*] | [string] | Array of errors returned by the API. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}

{% tab label="429" %}
Too many requests

{% tabs %}
{% tab label="Model" %}
Error response object.

| Field               | Type     | Description                          |
| ------------------- | -------- | ------------------------------------ |
| errors [*required*] | [string] | Array of errors returned by the API. |
{% /tab %}

{% tab label="Example" %}
```json
{
  "errors": [
    "Bad Request"
  ]
}
```
{% /tab %}
{% /tabs %}
{% /tab %}
{% /tabs %}

### Code Example

{% tabs %}
{% tab label="Curl" %}
```bash
# Set your Datadog site and credentials
export DD_SITE="datadoghq.com" # Or us3.datadoghq.com, us5.datadoghq.com, datadoghq.eu, ap1.datadoghq.com, ap2.datadoghq.com, uk1.datadoghq.com, ddog-gov.com, us2.ddog-gov.com
# Use a Personal Access Token or Service Access Token
export DD_BEARER_TOKEN="<PERSONAL_ACCESS_TOKEN OR SERVICE_ACCESS_TOKEN>"

curl -X POST "https://api.${DD_SITE}/api/v1/graph/embed" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "graph_json": "{\"viz\":\"timeseries\",\"requests\":[{\"q\":\"avg:system.load.1{*}\",\"type\":\"line\"}]}",
  "legend": "yes",
  "size": "medium",
  "timeframe": "1_hour",
  "title": "System Load Average"
}
EOF
```
{% /tab %}
{% /tabs %}
