Export Playbook Data
This guide explains how to export Playbook data from DealHub in JSON format. The JSON export functionality, previously available only through the DealHub UI for API-type Playbooks, is now available through the Version API, enabling automated access to Playbook export files.
You can use these endpoints to:
- Discover the Playbook structure: Retrieve the group IDs, question IDs, answers, and default answers your integration needs to build quote requests.
- Bootstrap your Headless Quote integration: Generate a ready-to-edit request template for the Generate a Quote endpoint based on the Playbook structure.
- Audit Playbook configuration: Export the Playbook metadata and question groups of a specific version.
Choosing the Right Endpoint
| Method | Best For... | Endpoint |
|---|---|---|
| Get Playbook Data | Exporting the full Playbook configuration and data: metadata, question groups, questions, answers, and defaults. | GET /api/version/{versionName}/playbook/{playbookId}/export |
| Get Generate Quote Template | Generating a preformatted request body for the Generate Quote API based on the Playbook structure. | GET /api/version/{versionId}/playbook/{playbookId}/generate-quote-template |
Identifying the PlaybookThe
playbookIdpath parameter takes the Playbook name, not the Playbook display name.
Exporting the Playbook Configuration
Use the Get Playbook Data endpoint to retrieve the details of the requested Playbook in a specific version.
curl --location 'https://api.dealhub.io/api/version/Master_v1/playbook/API/export' \
--header 'Authorization: Bearer <YOUR_TOKEN>'The response contains two top-level objects:
playbook_metadata: The Playbook configuration, including the internal and display names, allowed proposal document types, geo factor settings, and the document and product sync configuration.playbook_data: The list of question groups. Each group includes itsgroup_id,group_type(QUESTIONS_GROUPorREPEATABLE_GROUP), and the questions it contains, with their possible answers and default answers.
{
"playbook_metadata": {
"name": "API",
"display": "API",
"document_type": ["PDF"],
"geo_factors_settings": true,
"present_proposal_summary": true,
"enable_partner_support": false
},
"playbook_data": [
{
"group_id": "QG1",
"group_name": "QG1",
"group_type": "QUESTIONS_GROUP",
"question_data": [
{
"question_id": "name",
"question": "name",
"question_type": "Text list",
"answers": "1;2",
"default_answer": "1"
}
]
}
]
}The result might differ, depending on the requested features. For the complete field descriptions, see the Get Playbook Data reference page.
Date FormatsDate-type attributes and playbook questions are returned in the format
yyyy-mm-dd hh:mm:ss.
Generating a Quote Request Template
Use the Get Generate Quote Template endpoint to retrieve a preformatted JSON template for API quote generation. Instead of building the Generate Quote request body by hand from the Playbook export, you receive a template that already reflects the Playbook structure.
curl --location 'https://api.dealhub.io/api/version/Master_v1/playbook/API/generate-quote-template' \
--header 'Authorization: Bearer <YOUR_TOKEN>'The response returns the template with the quote-level fields, the quote_data groups and questions taken from the Playbook, and the line_items structure:
{
"external_opportunity_id": "",
"request_action": "draft",
"line_item_details": "basic",
"playbook": "<playbook_name>",
"document_type": "PDF",
"quote_data": [
{
"group_id": "<group_id>",
"questions": [
{
"<question_id_1>": "",
"<question_id_2>": ""
}
]
}
],
"line_items": [
{
"sku": "<SKU>",
"list_price": 0.0,
"net_price": 0.0,
"product_factors": {
"Quantity": 1,
"Duration": 1
}
}
]
}The template follows these generation rules:
- It includes all required API fields.
- It includes default values if they exist. Otherwise, it uses the first available answer.
- It excludes calculated questions.
Fill in the remaining values, such as the external_opportunity_id and your line item pricing, and send the result to the Generate a Quote endpoint. For the complete description of every template field, including mandatory fields, valid values, and length limits, see the Get Generate Quote Template reference page.
Error Handling
The API returns errors in the following format:
{
"error": "Playbook not found",
"code": 404
}| Status Code | Description |
|---|---|
| 404 | Playbook not found |
| 400 | Invalid versionId |
| 500 | Failed to generate JSON |
Next Steps
- Creating an API Playbook: Learn how to configure the API-type Playbook these endpoints export.
- Generate a Quote: Learn how to use the generated template to create a quote in DealHub.
- Manage Versions: Understand how versions contain the Playbook configuration you are exporting.
Related API ReferenceThe following API Reference pages document the endpoints used in this guide:
