For AI agents: A markdown version of this page is available at https://dnd37xeb23o8n.cloudfront.net/jen.gilbert/astro-base/fr/api/latest/product-analytics/compute-a-sankey-diagram.md. A documentation index is available at /llms.txt.
Language
Datadog site

Compute a Sankey diagram

WARNINGNote: This endpoint is in preview and is subject to change. If you have any feedback, contact Datadog support.
POSThttps://api.datadoghq.com/api/v2/product-analytics/sankeyhttps://api.us3.datadoghq.com/api/v2/product-analytics/sankeyhttps://api.us5.datadoghq.com/api/v2/product-analytics/sankeyhttps://api.datadoghq.eu/api/v2/product-analytics/sankeyhttps://api.ap1.datadoghq.com/api/v2/product-analytics/sankeyhttps://api.ap2.datadoghq.com/api/v2/product-analytics/sankeyhttps://api.uk1.datadoghq.com/api/v2/product-analytics/sankeyhttps://api.ddog-gov.com/api/v2/product-analytics/sankeyhttps://api.us2.ddog-gov.com/api/v2/product-analytics/sankey

Présentation

Compute a Sankey diagram of how sessions flow between the values of two facets, showing where users continue and where they drop off at each step.

This endpoint requires the rum_apps_read permission.

Requête

Body Data (required)

The Sankey diagram query.

Champ
Type
Description
data [required]
object

The single JSON:API resource carrying a Sankey query. Its attributes hold the time window to query, the search that selects the sessions, and the definition of the diagram to build.

Réponse

OK

Response for a Sankey diagram query.

Champ
Type
Description
data [required]
object

The single JSON:API resource holding a computed Sankey diagram. Its attributes contain the nodes of every column and the links that carry sessions between them.

Exemple de code

Compute a Sankey diagram
# Set your Datadog site and credentials
export DD_SITE="datadoghq.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/v2/product-analytics/sankey" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "definition": {
        "entries_per_step": 10,
        "number_of_steps": 3,
        "source": "@view.name",
        "target": "@view.name"
      },
      "search": {
        "query": "@type:view"
      },
      "time": {
        "from": 1756425600000,
        "to": 1756857600000
      }
    },
    "type": "sankey_request"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="us3.datadoghq.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/v2/product-analytics/sankey" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "definition": {
        "entries_per_step": 10,
        "number_of_steps": 3,
        "source": "@view.name",
        "target": "@view.name"
      },
      "search": {
        "query": "@type:view"
      },
      "time": {
        "from": 1756425600000,
        "to": 1756857600000
      }
    },
    "type": "sankey_request"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="us5.datadoghq.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/v2/product-analytics/sankey" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "definition": {
        "entries_per_step": 10,
        "number_of_steps": 3,
        "source": "@view.name",
        "target": "@view.name"
      },
      "search": {
        "query": "@type:view"
      },
      "time": {
        "from": 1756425600000,
        "to": 1756857600000
      }
    },
    "type": "sankey_request"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="datadoghq.eu"
# 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/v2/product-analytics/sankey" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "definition": {
        "entries_per_step": 10,
        "number_of_steps": 3,
        "source": "@view.name",
        "target": "@view.name"
      },
      "search": {
        "query": "@type:view"
      },
      "time": {
        "from": 1756425600000,
        "to": 1756857600000
      }
    },
    "type": "sankey_request"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="ap1.datadoghq.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/v2/product-analytics/sankey" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "definition": {
        "entries_per_step": 10,
        "number_of_steps": 3,
        "source": "@view.name",
        "target": "@view.name"
      },
      "search": {
        "query": "@type:view"
      },
      "time": {
        "from": 1756425600000,
        "to": 1756857600000
      }
    },
    "type": "sankey_request"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="ap2.datadoghq.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/v2/product-analytics/sankey" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "definition": {
        "entries_per_step": 10,
        "number_of_steps": 3,
        "source": "@view.name",
        "target": "@view.name"
      },
      "search": {
        "query": "@type:view"
      },
      "time": {
        "from": 1756425600000,
        "to": 1756857600000
      }
    },
    "type": "sankey_request"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="uk1.datadoghq.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/v2/product-analytics/sankey" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "definition": {
        "entries_per_step": 10,
        "number_of_steps": 3,
        "source": "@view.name",
        "target": "@view.name"
      },
      "search": {
        "query": "@type:view"
      },
      "time": {
        "from": 1756425600000,
        "to": 1756857600000
      }
    },
    "type": "sankey_request"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="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/v2/product-analytics/sankey" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "definition": {
        "entries_per_step": 10,
        "number_of_steps": 3,
        "source": "@view.name",
        "target": "@view.name"
      },
      "search": {
        "query": "@type:view"
      },
      "time": {
        "from": 1756425600000,
        "to": 1756857600000
      }
    },
    "type": "sankey_request"
  }
}
EOF
# Set your Datadog site and credentials
export DD_SITE="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/v2/product-analytics/sankey" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer ${DD_BEARER_TOKEN}" \
-d @- << EOF
{
  "data": {
    "attributes": {
      "definition": {
        "entries_per_step": 10,
        "number_of_steps": 3,
        "source": "@view.name",
        "target": "@view.name"
      },
      "search": {
        "query": "@type:view"
      },
      "time": {
        "from": 1756425600000,
        "to": 1756857600000
      }
    },
    "type": "sankey_request"
  }
}
EOF