---
title: "External Data Query"
method: POST
path: "/"
tags: ["External Query"]
---

# External Data Query

`POST /`

## Request

- Base URL: `https://your-external-system.com/api/data-query`
- URL: `https://your-external-system.com/api/data-query/`
- Auth: one of:
  - HTTP bearer
  - HTTP basic
  - none

> ❗️ Important 
>
> This is not an endpoint provided by DealHub. This page present the endpoint definition you need to make available so DealHub can call it. 

DealHub uses this endpoint to send requests that share data from the current quote’s playbook and product list. Your endpoint should process this data and return information that will be populated back into the quote’s playbook.

The specific URL for this endpoint is configured by the administrator in the DealHub UI.

> 📘 Authentication
>
> When DealHub calls your endpoint, it will include an `Authorization` header based on the configuration set by an administrator in the DealHub UI. Your endpoint must be prepared to handle one of the following methods:
> - **Token (Bearer):** DealHub sends a secret bearer token. Your endpoint should validate this token.
> - **Basic:** DealHub sends a username and password for Basic Authentication.
> - **None:** No `Authorization` header is sent. This is used when the endpoint is unsecured or uses a different security method, such as a token embedded in the URL.

## Request body

- ExternalQueryRequest
  - `playbook_data` object: A key-value map of playbook answers configured by the admin. The key is a string in the format `<group_id>.<question_id>`. The value type depends on the question type: - **Text**: a plain string (e.g., `"USD"`). - **Numeric**: an integer or floating-point number (e.g., `42.5`). - **Date (integer)**: a Unix timestamp in milliseconds as an integer (e.g., `1698418023000`). This is **not** an ISO 8601 string. - **Array**: for repeatable questions; each element can be a string, number, or date timestamp.
  - `product_data` ProductDataItem[]: An array of products and bundles currently in the quote.
    - `bundle_line_items` ProductDataItem[]: A list of child items if this item is a bundle.

## Response `200`

Successful response containing the data to be populated into the DealHub playbook.

- ExternalQueryResponse
  - `playbook_data` PlaybookResponseItem[]: An array of objects to be populated into the playbook. For a repeatable group, multiple objects can be returned. For a non-repeatable group, a single object should be returned in the array.

## Other responses

- `400`: Bad Request. An error occurred while processing the request. The response should contain a clear error message.

---

[API](https://skmtc.dev/dealhub/apis/external-query.md) - [All operations](https://skmtc.dev/dealhub/apis/external-query/llms.txt) - [OpenAPI document](https://skmtc.dev/dealhub/apis/external-query/revisions/8307f8c7faa5?raw)
