Sales Engine
API documentation
ClientsOperation documents.generate

Documents generate

Write a document on the deal: discovery_brief, sales_script, proposal, call_grade, follow_up_email or recap. Queues a job; the model defaults to the workspace's fast model. Estimate first with GET /settings/models/plan?scope=deals.

POST/api/v1/deals/{id}/documents
Scope write: Create and edit lists, research, sequences, campaigns, memory, signals and learning; queue jobs.

Parameters

Path

NameInDescription
idrequiredpathThe record's id.

Body

A JSON object, required. Fields not listed are ignored.

NameInDescription
kindrequiredbodyWhat to write. One of discovery_brief, sales_script, proposal, call_grade, follow_up_email, recap.
modelbodyOpenRouter slug, such as anthropic/claude-haiku-5.5.

Example

curl
curl -X POST "https://crm.ashwanth.dev/api/v1/deals/{id}/documents" \
  -H "Authorization: Bearer $SALES_ENGINE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "kind": "discovery_brief",
  "model": ""
}'
CLI
sales-engine documents generate <id> --kind discovery_brief

The JSON above lists every documented field with a typed placeholder; send only the ones you mean.

Response

A 200 with the result under data, on creation too. Errors come back as an error object with a stable code; see Errors.

Shape
{
  "data": { ... }
}

Run it below to see the live shape for your workspace.

Try it

Runs against this server, as the workspace behind the key.
Kept in this page while you browse the docs, gone on reload, never stored. Signed in to the app? Leave it blank and the call runs as you.
Path
required
The record's id.
Every documented field is listed above; leave out the ones you do not need.
Request
POST /api/v1/deals/%7Bid%7D/documents
Fill the path first.

Also in Clients