Generate Brief
curl --request POST \
--url https://api.example.com/deals/{deal_id}/brief \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"brief_type": "standard"
}
'import requests
url = "https://api.example.com/deals/{deal_id}/brief"
payload = { "brief_type": "standard" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({brief_type: 'standard'})
};
fetch('https://api.example.com/deals/{deal_id}/brief', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/deals/{deal_id}/brief",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'brief_type' => 'standard'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/deals/{deal_id}/brief"
payload := strings.NewReader("{\n \"brief_type\": \"standard\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/deals/{deal_id}/brief")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"brief_type\": \"standard\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/deals/{deal_id}/brief")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"brief_type\": \"standard\"\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Deals
Generate a Deal Brief
POST
/
deals
/
{deal_id}
/
brief
Generate Brief
curl --request POST \
--url https://api.example.com/deals/{deal_id}/brief \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"brief_type": "standard"
}
'import requests
url = "https://api.example.com/deals/{deal_id}/brief"
payload = { "brief_type": "standard" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({brief_type: 'standard'})
};
fetch('https://api.example.com/deals/{deal_id}/brief', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/deals/{deal_id}/brief",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'brief_type' => 'standard'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/deals/{deal_id}/brief"
payload := strings.NewReader("{\n \"brief_type\": \"standard\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/deals/{deal_id}/brief")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"brief_type\": \"standard\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/deals/{deal_id}/brief")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"brief_type\": \"standard\"\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Gated by the Payload shape (once complete, in
ai.deal_brief config feature flag — a 403 names the flag when disabled.
Follows the same async placeholder pattern as Generate a Competitive Brief — writes a placeholder, kicks off a background job, and returns 202 immediately.
Auth
Requires a CRM manage scope and an active organization on the token. Any*:manage scope qualifies — in practice contacts:manage, deals:manage, companies:manage, or activities:manage.
Flow
- Already generating (
deals.latest_brief.model_used == "deal_brief_generating") →202 {accepted: true, already_running: true, message}. - Otherwise → deletes any stuck placeholder
deal_briefsrows, inserts a new placeholder row + placeholderdeals.latest_brief, schedules a background job, returns202 {accepted: true, already_running: false, id, latest_brief: <placeholder>, message}immediately.
force flag or “return existing if already generated” short-circuit — every call (when not already running) starts a fresh generation.
The background job calls an LLM (Anthropic) to produce a structured executive brief grounded in the deal’s contacts, activities, health factors, and open tasks, then PATCHes both the deal_briefs row and deals.latest_brief. A failure persists an error brief instead (model_used: "deal_brief_error").
Payload shape (once complete, in latest_brief / via Get a Deal)
{summary, summary_evidence: [{ref_type, ref_id, excerpt}], stakeholders: [{name, role, sentiment, last_contact_summary, risk_flag, recommended_action, evidence}], risks: [{title, description, severity, mitigation, evidence}], opportunities: [{title, description, impact, action, evidence}], strategy, next_actions: [{action, priority, owner, due_timing}], forecast_assessment: {confidence, reasoning, adjusted_close_date, adjusted_value}, model_used, brief_type}
Poll Get a Deal and read .brief until model_used is no longer "deal_brief_generating".
Errors
| Status | Cause |
|---|---|
400 | No active organization. |
403 | ai.deal_brief feature disabled. |
404 | Deal not found. |
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The deal's id.
Body
application/json
Brief style: standard, board_ready, or qbr.
Response
Successful Response