Reports
Report generation is async. Create a job, then use jobs endpoints or SDK handles to wait/stream.
Generated from contracts in
packages/contracts/src/v1. Do not hand-edit this page.
POST /v1/reports/jobs
Create a report generation job.
Request schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"entityLabel": {
"type": "string",
"minLength": 1,
"maxLength": 64
},
"idempotencyKey": {
"type": "string"
},
"label": {
"type": "string",
"minLength": 1,
"maxLength": 64
},
"media": {
"type": "object",
"properties": {
"mediaId": {
"type": "string"
}
},
"required": [
"mediaId"
],
"additionalProperties": false
},
"output": {
"type": "object",
"properties": {
"template": {
"type": "string",
"enum": [
"sales_playbook",
"general_report"
]
},
"templateParams": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {}
}
},
"required": [
"template"
],
"additionalProperties": false
},
"target": {
"type": "object",
"properties": {
"entity_id": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 256
},
{
"type": "null"
}
]
},
"hint": {
"anyOf": [
{
"type": "string",
"minLength": 1,
"maxLength": 1024
},
{
"type": "null"
}
]
},
"on_miss": {
"default": "error",
"type": "string",
"enum": [
"fallback_dominant",
"error"
]
},
"strategy": {
"type": "string",
"enum": [
"dominant",
"timerange",
"entity_id",
"magic_hint"
]
},
"timerange": {
"anyOf": [
{
"type": "object",
"properties": {
"end_seconds": {
"anyOf": [
{
"type": "number",
"minimum": 0
},
{
"type": "null"
}
]
},
"start_seconds": {
"anyOf": [
{
"type": "number",
"minimum": 0
},
{
"type": "null"
}
]
}
},
"additionalProperties": false
},
{
"type": "null"
}
]
}
},
"required": [
"on_miss",
"strategy"
],
"additionalProperties": false
},
"webhook": {
"type": "object",
"properties": {
"headers": {
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"type": "string"
}
},
"url": {
"type": "string",
"format": "uri"
}
},
"required": [
"url"
],
"additionalProperties": false
}
},
"required": [
"media",
"output",
"target"
],
"additionalProperties": false
}
Response schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"estimatedWaitSec": {
"type": "number"
},
"jobId": {
"type": "string"
},
"stage": {
"type": "string"
},
"status": {
"type": "string",
"enum": [
"queued",
"running"
]
}
},
"required": [
"jobId",
"status"
],
"additionalProperties": false
}
GET /v1/reports/:reportId
Fetch a generated report by id.
Response schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"createdAt": {
"type": "string"
},
"entity": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"label": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
},
"required": [
"id",
"label"
],
"additionalProperties": false
},
"id": {
"type": "string"
},
"json": {
"anyOf": [
{
"type": "object",
"properties": {
"meta": {
"type": "object",
"properties": {
"prompt": {
"type": "object",
"properties": {
"labels": {
"type": "array",
"items": {
"type": "string"
}
},
"name": {
"type": "string",
"minLength": 1
},
"version": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"labels",
"name",
"version"
],
"additionalProperties": false
},
"render": {
"type": "object",
"properties": {
"attempts": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"model": {
"type": "string",
"minLength": 1
},
"provider": {
"type": "string",
"enum": [
"openai",
"anthropic"
]
}
},
"required": [
"attempts",
"model",
"provider"
],
"additionalProperties": false
}
},
"required": [
"prompt",
"render"
],
"additionalProperties": false
},
"schemaVersion": {
"type": "number",
"const": 2
},
"sections": {
"minItems": 1,
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"properties": {
"body": {
"type": "string",
"minLength": 1
},
"key": {
"type": "string",
"enum": [
"how_they_think",
"how_they_operate",
"what_drives_them",
"how_they_connect",
"how_they_handle_feedback",
"pressure_response",
"bottom_line",
"what_drives_a_yes",
"how_to_build_rapport_fast",
"buying_tendencies",
"how_they_handle_pushback_and_objections",
"how_they_deal_when_a_deal_gets_sticky"
]
},
"kind": {
"type": "string",
"const": "paragraph"
},
"title": {
"type": "string",
"minLength": 1
}
},
"required": [
"body",
"key",
"kind",
"title"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"body": {
"type": "string",
"minLength": 1
},
"key": {
"type": "string",
"const": "dominating_traits"
},
"kind": {
"type": "string",
"const": "traits"
},
"phrases": {
"type": "array",
"prefixItems": [
{
"type": "string",
"minLength": 1
},
{
"type": "string",
"minLength": 1
},
{
"type": "string",
"minLength": 1
}
]
},
"title": {
"type": "string",
"minLength": 1
}
},
"required": [
"body",
"key",
"kind",
"phrases",
"title"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"items": {
"minItems": 1,
"type": "array",
"items": {
"type": "object",
"properties": {
"context": {
"type": "string",
"minLength": 1
},
"title": {
"type": "string",
"minLength": 1
}
},
"required": [
"context",
"title"
],
"additionalProperties": false
}
},
"key": {
"type": "string",
"enum": [
"how_to_get_their_best",
"how_to_handle_the_hard_parts",
"how_to_close",
"how_to_follow_up"
]
},
"kind": {
"type": "string",
"const": "actions"
},
"title": {
"type": "string",
"minLength": 1
}
},
"required": [
"items",
"key",
"kind",
"title"
],
"additionalProperties": false
}
]
}
},
"summary": {
"type": "string",
"minLength": 1
},
"template": {
"type": "string",
"enum": [
"sales_playbook",
"general_report"
]
},
"title": {
"type": "string",
"minLength": 1
}
},
"required": [
"meta",
"schemaVersion",
"sections",
"summary",
"template",
"title"
],
"additionalProperties": false
},
{
"type": "null"
}
]
},
"jobId": {
"type": "string"
},
"label": {
"type": "string"
},
"markdown": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"media": {
"type": "object",
"properties": {
"mediaId": {
"type": "string"
},
"url": {
"type": "string"
}
},
"additionalProperties": false
},
"output": {
"type": "object",
"properties": {
"template": {
"type": "string",
"enum": [
"sales_playbook",
"general_report"
]
}
},
"required": [
"template"
],
"additionalProperties": false
}
},
"required": [
"createdAt",
"id",
"media",
"output"
],
"additionalProperties": false
}
GET /v1/reports/by-job/:jobId
Fetch a generated report by source job id.
- Returns null until job reaches terminal success.
Response schema
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"type": "object",
"properties": {
"createdAt": {
"type": "string"
},
"entity": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"label": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
}
},
"required": [
"id",
"label"
],
"additionalProperties": false
},
"id": {
"type": "string"
},
"json": {
"anyOf": [
{
"type": "object",
"properties": {
"meta": {
"type": "object",
"properties": {
"prompt": {
"type": "object",
"properties": {
"labels": {
"type": "array",
"items": {
"type": "string"
}
},
"name": {
"type": "string",
"minLength": 1
},
"version": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
}
},
"required": [
"labels",
"name",
"version"
],
"additionalProperties": false
},
"render": {
"type": "object",
"properties": {
"attempts": {
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"model": {
"type": "string",
"minLength": 1
},
"provider": {
"type": "string",
"enum": [
"openai",
"anthropic"
]
}
},
"required": [
"attempts",
"model",
"provider"
],
"additionalProperties": false
}
},
"required": [
"prompt",
"render"
],
"additionalProperties": false
},
"schemaVersion": {
"type": "number",
"const": 2
},
"sections": {
"minItems": 1,
"type": "array",
"items": {
"oneOf": [
{
"type": "object",
"properties": {
"body": {
"type": "string",
"minLength": 1
},
"key": {
"type": "string",
"enum": [
"how_they_think",
"how_they_operate",
"what_drives_them",
"how_they_connect",
"how_they_handle_feedback",
"pressure_response",
"bottom_line",
"what_drives_a_yes",
"how_to_build_rapport_fast",
"buying_tendencies",
"how_they_handle_pushback_and_objections",
"how_they_deal_when_a_deal_gets_sticky"
]
},
"kind": {
"type": "string",
"const": "paragraph"
},
"title": {
"type": "string",
"minLength": 1
}
},
"required": [
"body",
"key",
"kind",
"title"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"body": {
"type": "string",
"minLength": 1
},
"key": {
"type": "string",
"const": "dominating_traits"
},
"kind": {
"type": "string",
"const": "traits"
},
"phrases": {
"type": "array",
"prefixItems": [
{
"type": "string",
"minLength": 1
},
{
"type": "string",
"minLength": 1
},
{
"type": "string",
"minLength": 1
}
]
},
"title": {
"type": "string",
"minLength": 1
}
},
"required": [
"body",
"key",
"kind",
"phrases",
"title"
],
"additionalProperties": false
},
{
"type": "object",
"properties": {
"items": {
"minItems": 1,
"type": "array",
"items": {
"type": "object",
"properties": {
"context": {
"type": "string",
"minLength": 1
},
"title": {
"type": "string",
"minLength": 1
}
},
"required": [
"context",
"title"
],
"additionalProperties": false
}
},
"key": {
"type": "string",
"enum": [
"how_to_get_their_best",
"how_to_handle_the_hard_parts",
"how_to_close",
"how_to_follow_up"
]
},
"kind": {
"type": "string",
"const": "actions"
},
"title": {
"type": "string",
"minLength": 1
}
},
"required": [
"items",
"key",
"kind",
"title"
],
"additionalProperties": false
}
]
}
},
"summary": {
"type": "string",
"minLength": 1
},
"template": {
"type": "string",
"enum": [
"sales_playbook",
"general_report"
]
},
"title": {
"type": "string",
"minLength": 1
}
},
"required": [
"meta",
"schemaVersion",
"sections",
"summary",
"template",
"title"
],
"additionalProperties": false
},
{
"type": "null"
}
]
},
"jobId": {
"type": "string"
},
"label": {
"type": "string"
},
"markdown": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
]
},
"media": {
"type": "object",
"properties": {
"mediaId": {
"type": "string"
},
"url": {
"type": "string"
}
},
"additionalProperties": false
},
"output": {
"type": "object",
"properties": {
"template": {
"type": "string",
"enum": [
"sales_playbook",
"general_report"
]
}
},
"required": [
"template"
],
"additionalProperties": false
}
},
"required": [
"createdAt",
"id",
"media",
"output"
],
"additionalProperties": false
}