API reference
36 endpoints. All paths are relative to your installation, for example https://app.example.com.
/api/v1/ai-subscriptions/accessWhether the signed-in user may use personal AI subscriptions/api/v1/ai-subscriptions/connectionsSubscription connection status (no credentials are returned)/api/v1/ai-subscriptions/claude/connectConnect Claude with a token from `claude setup-token`/api/v1/ai-subscriptions/codex/loginStart Codex ChatGPT sign-in (device code)/api/v1/ai-subscriptions/codex/loginCodex sign-in progress/api/v1/ai-subscriptions/codex/loginCancel a pending Codex sign-in/api/v1/ai-subscriptions/{provider}/testTest a subscription connection with a minimal real request/api/v1/ai-subscriptions/{provider}/settingsModel, concurrency, delay and pause for a subscription/api/v1/ai-subscriptions/{provider}Disconnect a subscription (removes the stored credential / signs Codex out)/api/v1/ai-workflowsList AI workflows (presets are created on first use)/api/v1/ai-workflowsCreate a workflow/api/v1/ai-workflows/{id}Get a workflow/api/v1/ai-workflows/{id}Update a workflow (stages, order, providers, instructions)/api/v1/ai-workflows/{id}Delete a workflow/api/v1/ai-workflows/{id}/duplicateDuplicate a workflow/api/v1/ai-workflows/{id}/activateMake this the workflow used by "Generate with selected workflow"/api/v1/ai-stage-templatesSaved stage templates/api/v1/ai-stage-templatesSave a stage as a reusable template/api/v1/ai-stage-templates/{id}Delete a stage template/api/v1/ai-playbookCurrent writing playbook and version history/api/v1/ai-playbookSave the playbook as a new version/api/v1/ai-playbook/versions/{id}One playbook version/api/v1/ai-playbook/versions/{id}/restoreRestore a previous playbook version (creates a new version)/api/v1/ai-queue/pausePause all AI workflow queues/api/v1/ai-queue/resumeResume all AI workflow queues/api/v1/w/{workspaceId}/ai-runsGenerate emails for a prospect with a workflow, Claude or Codex (queued; never sends)/api/v1/w/{workspaceId}/ai-runsGeneration history/api/v1/w/{workspaceId}/ai-runs/{id}Run detail: research, variants, stages and execution log/api/v1/w/{workspaceId}/ai-runs/{id}/pausePause a run/api/v1/w/{workspaceId}/ai-runs/{id}/resumeResume / retry a run, optionally choosing another provider for the paused stage/api/v1/w/{workspaceId}/ai-runs/{id}/cancelCancel a run/api/v1/w/{workspaceId}/ai-runs/{id}/variants/{index}Edit a variant subject/body/api/v1/w/{workspaceId}/ai-runs/{id}/variants/{index}/selectSelect the preferred variant/api/v1/w/{workspaceId}/ai-runs/{id}/variants/{index}/regenerateRegenerate one variant (queued)/api/v1/w/{workspaceId}/ai-runs/{id}/draftSave the selected variant as a draft (nothing is sent)/api/v1/w/{workspaceId}/ai-queueAI generation queue dashboard/api/v1/ai-subscriptions/accessWhether the signed-in user may use personal AI subscriptions
No parameters.
curl -X GET "https://app.example.com/api/v1/ai-subscriptions/access" \
-b cookies.txt -H "X-CSRF-Token: $CSRF"/api/v1/ai-subscriptions/connectionsSubscription connection status (no credentials are returned)
No parameters.
curl -X GET "https://app.example.com/api/v1/ai-subscriptions/connections" \
-b cookies.txt -H "X-CSRF-Token: $CSRF"/api/v1/ai-subscriptions/claude/connectConnect Claude with a token from `claude setup-token`
Request body (JSON)
tokenrequired | stringLength 20–500 |
curl -X POST "https://app.example.com/api/v1/ai-subscriptions/claude/connect" \
-b cookies.txt -H "X-CSRF-Token: $CSRF" \
-H "Content-Type: application/json" \
-d '{
"token": "string"
}'/api/v1/ai-subscriptions/codex/loginStart Codex ChatGPT sign-in (device code)
No parameters.
curl -X POST "https://app.example.com/api/v1/ai-subscriptions/codex/login" \
-b cookies.txt -H "X-CSRF-Token: $CSRF"/api/v1/ai-subscriptions/codex/loginCodex sign-in progress
No parameters.
curl -X GET "https://app.example.com/api/v1/ai-subscriptions/codex/login" \
-b cookies.txt -H "X-CSRF-Token: $CSRF"/api/v1/ai-subscriptions/codex/loginCancel a pending Codex sign-in
No parameters.
curl -X DELETE "https://app.example.com/api/v1/ai-subscriptions/codex/login" \
-b cookies.txt -H "X-CSRF-Token: $CSRF"/api/v1/ai-subscriptions/{provider}/testTest a subscription connection with a minimal real request
Path parameters
providerrequired | string |
curl -X POST "https://app.example.com/api/v1/ai-subscriptions/$PROVIDER/test" \
-b cookies.txt -H "X-CSRF-Token: $CSRF"/api/v1/ai-subscriptions/{provider}/settingsModel, concurrency, delay and pause for a subscription
Path parameters
providerrequired | string |
Request body (JSON)
model | string | null |
concurrency | integerRange 1–4 |
delayMs | integerRange 0–600000 |
paused | boolean |
curl -X PUT "https://app.example.com/api/v1/ai-subscriptions/$PROVIDER/settings" \
-b cookies.txt -H "X-CSRF-Token: $CSRF" \
-H "Content-Type: application/json" \
-d '{
"model": "string",
"concurrency": 1,
"delayMs": 0,
"paused": true
}'/api/v1/ai-subscriptions/{provider}Disconnect a subscription (removes the stored credential / signs Codex out)
Path parameters
providerrequired | string |
curl -X DELETE "https://app.example.com/api/v1/ai-subscriptions/$PROVIDER" \
-b cookies.txt -H "X-CSRF-Token: $CSRF"/api/v1/ai-workflowsList AI workflows (presets are created on first use)
No parameters.
curl -X GET "https://app.example.com/api/v1/ai-workflows" \
-b cookies.txt -H "X-CSRF-Token: $CSRF"/api/v1/ai-workflowsCreate a workflow
Request body (JSON)
namerequired | stringLength 1–100 |
description | string | null |
stagesrequired | object[] |
stages[].idrequired | stringPattern ^[a-z0-9-]{4,40}$ |
stages[].namerequired | stringLength 1–80 |
stages[].enabled | booleanDefault true |
stages[].providerrequired | enumOne of: CLAUDE_SUBSCRIPTION, CODEX_SUBSCRIPTION, API:OPENAI, API:ANTHROPIC, API:GOOGLE, API:OPENROUTER, API:GROQ, API:TOGETHER, API:DEEPSEEK, API:MISTRAL, API:OLLAMA, API:CUSTOM_OPENAI |
stages[].model | string | nullDefault null |
stages[].taskTyperequired | enumOne of: PROSPECT_RESEARCH, WEBSITE_ANALYSIS, SOCIAL_MEDIA_ANALYSIS, BUSINESS_ANALYSIS, PAIN_POINT_IDENTIFICATION, EMAIL_ANGLE_SELECTION, COLD_EMAIL_GENERATION, EMAIL_HUMANIZATION, GRAMMAR_REVIEW, PERSONALIZATION_REVIEW, FINAL_QUALITY_CHECK, CUSTOM |
stages[].instructions | stringLength 0–8000 · Default "" |
stages[].inputs | string[]Default ["prospect","research_evidence","playbook","previous"] |
stages[].outputFormatrequired | enumOne of: RESEARCH_JSON, ANGLES_JSON, EMAIL_VARIANTS_JSON, QUALITY_REVIEW_JSON, TEXT |
stages[].variants | integerRange 1–5 · Default 3 |
stages[].temperature | number | nullDefault null |
stages[].reasoningEffort | enum | nullOne of: minimal, low, medium, high · Default null |
stages[].allowWebResearch | booleanDefault false |
stages[].retry | objectDefault {"maxAttempts":2,"backoffSec":30} |
stages[].retry.maxAttempts | integerRange 1–5 · Default 2 |
stages[].retry.backoffSec | integerRange 1–3600 · Default 30 |
stages[].timeoutSec | integerRange 30–1800 · Default 300 |
stages[].continueOnError | booleanDefault false |
stages[].condition | enumOne of: always, if_previous_succeeded, skip_if_provider_unavailable · Default "always" |
curl -X POST "https://app.example.com/api/v1/ai-workflows" \
-b cookies.txt -H "X-CSRF-Token: $CSRF" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"description": "string",
"stages": [
{
"id": "string",
"name": "string",
"provider": "CLAUDE_SUBSCRIPTION",
"taskType": "PROSPECT_RESEARCH",
"outputFormat": "RESEARCH_JSON"
}
]
}'/api/v1/ai-workflows/{id}Get a workflow
Path parameters
idrequired | string |
curl -X GET "https://app.example.com/api/v1/ai-workflows/$ID" \
-b cookies.txt -H "X-CSRF-Token: $CSRF"/api/v1/ai-workflows/{id}Update a workflow (stages, order, providers, instructions)
Path parameters
idrequired | string |
Request body (JSON)
namerequired | stringLength 1–100 |
description | string | null |
stagesrequired | object[] |
stages[].idrequired | stringPattern ^[a-z0-9-]{4,40}$ |
stages[].namerequired | stringLength 1–80 |
stages[].enabled | booleanDefault true |
stages[].providerrequired | enumOne of: CLAUDE_SUBSCRIPTION, CODEX_SUBSCRIPTION, API:OPENAI, API:ANTHROPIC, API:GOOGLE, API:OPENROUTER, API:GROQ, API:TOGETHER, API:DEEPSEEK, API:MISTRAL, API:OLLAMA, API:CUSTOM_OPENAI |
stages[].model | string | nullDefault null |
stages[].taskTyperequired | enumOne of: PROSPECT_RESEARCH, WEBSITE_ANALYSIS, SOCIAL_MEDIA_ANALYSIS, BUSINESS_ANALYSIS, PAIN_POINT_IDENTIFICATION, EMAIL_ANGLE_SELECTION, COLD_EMAIL_GENERATION, EMAIL_HUMANIZATION, GRAMMAR_REVIEW, PERSONALIZATION_REVIEW, FINAL_QUALITY_CHECK, CUSTOM |
stages[].instructions | stringLength 0–8000 · Default "" |
stages[].inputs | string[]Default ["prospect","research_evidence","playbook","previous"] |
stages[].outputFormatrequired | enumOne of: RESEARCH_JSON, ANGLES_JSON, EMAIL_VARIANTS_JSON, QUALITY_REVIEW_JSON, TEXT |
stages[].variants | integerRange 1–5 · Default 3 |
stages[].temperature | number | nullDefault null |
stages[].reasoningEffort | enum | nullOne of: minimal, low, medium, high · Default null |
stages[].allowWebResearch | booleanDefault false |
stages[].retry | objectDefault {"maxAttempts":2,"backoffSec":30} |
stages[].retry.maxAttempts | integerRange 1–5 · Default 2 |
stages[].retry.backoffSec | integerRange 1–3600 · Default 30 |
stages[].timeoutSec | integerRange 30–1800 · Default 300 |
stages[].continueOnError | booleanDefault false |
stages[].condition | enumOne of: always, if_previous_succeeded, skip_if_provider_unavailable · Default "always" |
curl -X PUT "https://app.example.com/api/v1/ai-workflows/$ID" \
-b cookies.txt -H "X-CSRF-Token: $CSRF" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"description": "string",
"stages": [
{
"id": "string",
"name": "string",
"provider": "CLAUDE_SUBSCRIPTION",
"taskType": "PROSPECT_RESEARCH",
"outputFormat": "RESEARCH_JSON"
}
]
}'/api/v1/ai-workflows/{id}Delete a workflow
Path parameters
idrequired | string |
curl -X DELETE "https://app.example.com/api/v1/ai-workflows/$ID" \
-b cookies.txt -H "X-CSRF-Token: $CSRF"/api/v1/ai-workflows/{id}/duplicateDuplicate a workflow
Path parameters
idrequired | string |
curl -X POST "https://app.example.com/api/v1/ai-workflows/$ID/duplicate" \
-b cookies.txt -H "X-CSRF-Token: $CSRF"/api/v1/ai-workflows/{id}/activateMake this the workflow used by "Generate with selected workflow"
Path parameters
idrequired | string |
curl -X POST "https://app.example.com/api/v1/ai-workflows/$ID/activate" \
-b cookies.txt -H "X-CSRF-Token: $CSRF"/api/v1/ai-stage-templatesSaved stage templates
No parameters.
curl -X GET "https://app.example.com/api/v1/ai-stage-templates" \
-b cookies.txt -H "X-CSRF-Token: $CSRF"/api/v1/ai-stage-templatesSave a stage as a reusable template
Request body (JSON)
namerequired | stringLength 1–80 |
stagerequired | object |
stage.idrequired | stringPattern ^[a-z0-9-]{4,40}$ |
stage.namerequired | stringLength 1–80 |
stage.enabled | booleanDefault true |
stage.providerrequired | enumOne of: CLAUDE_SUBSCRIPTION, CODEX_SUBSCRIPTION, API:OPENAI, API:ANTHROPIC, API:GOOGLE, API:OPENROUTER, API:GROQ, API:TOGETHER, API:DEEPSEEK, API:MISTRAL, API:OLLAMA, API:CUSTOM_OPENAI |
stage.model | string | nullDefault null |
stage.taskTyperequired | enumOne of: PROSPECT_RESEARCH, WEBSITE_ANALYSIS, SOCIAL_MEDIA_ANALYSIS, BUSINESS_ANALYSIS, PAIN_POINT_IDENTIFICATION, EMAIL_ANGLE_SELECTION, COLD_EMAIL_GENERATION, EMAIL_HUMANIZATION, GRAMMAR_REVIEW, PERSONALIZATION_REVIEW, FINAL_QUALITY_CHECK, CUSTOM |
stage.instructions | stringLength 0–8000 · Default "" |
stage.inputs | string[]Default ["prospect","research_evidence","playbook","previous"] |
stage.outputFormatrequired | enumOne of: RESEARCH_JSON, ANGLES_JSON, EMAIL_VARIANTS_JSON, QUALITY_REVIEW_JSON, TEXT |
stage.variants | integerRange 1–5 · Default 3 |
stage.temperature | number | nullDefault null |
stage.reasoningEffort | enum | nullOne of: minimal, low, medium, high · Default null |
stage.allowWebResearch | booleanDefault false |
stage.retry | objectDefault {"maxAttempts":2,"backoffSec":30} |
stage.retry.maxAttempts | integerRange 1–5 · Default 2 |
stage.retry.backoffSec | integerRange 1–3600 · Default 30 |
stage.timeoutSec | integerRange 30–1800 · Default 300 |
stage.continueOnError | booleanDefault false |
stage.condition | enumOne of: always, if_previous_succeeded, skip_if_provider_unavailable · Default "always" |
curl -X POST "https://app.example.com/api/v1/ai-stage-templates" \
-b cookies.txt -H "X-CSRF-Token: $CSRF" \
-H "Content-Type: application/json" \
-d '{
"name": "string",
"stage": {
"id": "string",
"name": "string",
"provider": "CLAUDE_SUBSCRIPTION",
"taskType": "PROSPECT_RESEARCH",
"outputFormat": "RESEARCH_JSON"
}
}'/api/v1/ai-stage-templates/{id}Delete a stage template
Path parameters
idrequired | string |
curl -X DELETE "https://app.example.com/api/v1/ai-stage-templates/$ID" \
-b cookies.txt -H "X-CSRF-Token: $CSRF"/api/v1/ai-playbookCurrent writing playbook and version history
No parameters.
curl -X GET "https://app.example.com/api/v1/ai-playbook" \
-b cookies.txt -H "X-CSRF-Token: $CSRF"/api/v1/ai-playbookSave the playbook as a new version
Request body (JSON)
contentrequired | stringLength 20–50000 |
note | string | null |
curl -X POST "https://app.example.com/api/v1/ai-playbook" \
-b cookies.txt -H "X-CSRF-Token: $CSRF" \
-H "Content-Type: application/json" \
-d '{
"content": "string",
"note": "string"
}'/api/v1/ai-playbook/versions/{id}One playbook version
Path parameters
idrequired | string |
curl -X GET "https://app.example.com/api/v1/ai-playbook/versions/$ID" \
-b cookies.txt -H "X-CSRF-Token: $CSRF"/api/v1/ai-playbook/versions/{id}/restoreRestore a previous playbook version (creates a new version)
Path parameters
idrequired | string |
curl -X POST "https://app.example.com/api/v1/ai-playbook/versions/$ID/restore" \
-b cookies.txt -H "X-CSRF-Token: $CSRF"/api/v1/ai-queue/pausePause all AI workflow queues
No parameters.
curl -X POST "https://app.example.com/api/v1/ai-queue/pause" \
-b cookies.txt -H "X-CSRF-Token: $CSRF"/api/v1/ai-queue/resumeResume all AI workflow queues
No parameters.
curl -X POST "https://app.example.com/api/v1/ai-queue/resume" \
-b cookies.txt -H "X-CSRF-Token: $CSRF"/api/v1/w/{workspaceId}/ai-runsGenerate emails for a prospect with a workflow, Claude or Codex (queued; never sends)
Path parameters
workspaceIdrequired | string |
Request body (JSON)
leadIdrequired | string (uuid) |
campaignId | string (uuid) | null |
mode | enumOne of: workflow, claude, codex · Default "workflow" |
workflowId | string (uuid) | null |
instructions | stringLength 0–2000 |
curl -X POST "https://app.example.com/api/v1/w/$WORKSPACE_ID/ai-runs" \
-H "Authorization: Bearer $EMN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"leadId": "00000000-0000-4000-8000-000000000000",
"campaignId": "00000000-0000-4000-8000-000000000000",
"mode": "workflow",
"workflowId": "00000000-0000-4000-8000-000000000000",
"instructions": "string"
}'/api/v1/w/{workspaceId}/ai-runsGeneration history
Path parameters
workspaceIdrequired | string |
Query parameters
page | integerRange 1–9007199254740991 · Default 1 |
pageSize | integerRange 1–200 · Default 50 |
leadId | string (uuid) |
status | enumOne of: QUEUED, RUNNING, SUCCEEDED, FAILED, PAUSED, PAUSED_LIMIT, CANCELLED |
curl -X GET "https://app.example.com/api/v1/w/$WORKSPACE_ID/ai-runs" \
-H "Authorization: Bearer $EMN_API_KEY"/api/v1/w/{workspaceId}/ai-runs/{id}Run detail: research, variants, stages and execution log
Path parameters
workspaceIdrequired | string |
idrequired | string |
curl -X GET "https://app.example.com/api/v1/w/$WORKSPACE_ID/ai-runs/$ID" \
-H "Authorization: Bearer $EMN_API_KEY"/api/v1/w/{workspaceId}/ai-runs/{id}/pausePause a run
Path parameters
workspaceIdrequired | string |
idrequired | string |
curl -X POST "https://app.example.com/api/v1/w/$WORKSPACE_ID/ai-runs/$ID/pause" \
-H "Authorization: Bearer $EMN_API_KEY"/api/v1/w/{workspaceId}/ai-runs/{id}/resumeResume / retry a run, optionally choosing another provider for the paused stage
Path parameters
workspaceIdrequired | string |
idrequired | string |
Request body (JSON)
stageProvider | enumOne of: CLAUDE_SUBSCRIPTION, CODEX_SUBSCRIPTION, API:OPENAI, API:ANTHROPIC, API:GOOGLE, API:OPENROUTER, API:GROQ, API:TOGETHER, API:DEEPSEEK, API:MISTRAL, API:OLLAMA, API:CUSTOM_OPENAI |
autoResume | boolean |
curl -X POST "https://app.example.com/api/v1/w/$WORKSPACE_ID/ai-runs/$ID/resume" \
-H "Authorization: Bearer $EMN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"stageProvider": "CLAUDE_SUBSCRIPTION",
"autoResume": true
}'/api/v1/w/{workspaceId}/ai-runs/{id}/cancelCancel a run
Path parameters
workspaceIdrequired | string |
idrequired | string |
curl -X POST "https://app.example.com/api/v1/w/$WORKSPACE_ID/ai-runs/$ID/cancel" \
-H "Authorization: Bearer $EMN_API_KEY"/api/v1/w/{workspaceId}/ai-runs/{id}/variants/{index}Edit a variant subject/body
Path parameters
workspaceIdrequired | string |
idrequired | string |
indexrequired | string |
Request body (JSON)
subjectrequired | stringLength 0–300 |
bodyrequired | stringLength 1–10000 |
curl -X PUT "https://app.example.com/api/v1/w/$WORKSPACE_ID/ai-runs/$ID/variants/$INDEX" \
-H "Authorization: Bearer $EMN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"subject": "string",
"body": "string"
}'/api/v1/w/{workspaceId}/ai-runs/{id}/variants/{index}/selectSelect the preferred variant
Path parameters
workspaceIdrequired | string |
idrequired | string |
indexrequired | string |
curl -X POST "https://app.example.com/api/v1/w/$WORKSPACE_ID/ai-runs/$ID/variants/$INDEX/select" \
-H "Authorization: Bearer $EMN_API_KEY"/api/v1/w/{workspaceId}/ai-runs/{id}/variants/{index}/regenerateRegenerate one variant (queued)
Path parameters
workspaceIdrequired | string |
idrequired | string |
indexrequired | string |
curl -X POST "https://app.example.com/api/v1/w/$WORKSPACE_ID/ai-runs/$ID/variants/$INDEX/regenerate" \
-H "Authorization: Bearer $EMN_API_KEY"/api/v1/w/{workspaceId}/ai-runs/{id}/draftSave the selected variant as a draft (nothing is sent)
Path parameters
workspaceIdrequired | string |
idrequired | string |
Request body (JSON)
index | integerRange 0–9 |
curl -X POST "https://app.example.com/api/v1/w/$WORKSPACE_ID/ai-runs/$ID/draft" \
-H "Authorization: Bearer $EMN_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"index": 0
}'/api/v1/w/{workspaceId}/ai-queueAI generation queue dashboard
Path parameters
workspaceIdrequired | string |
curl -X GET "https://app.example.com/api/v1/w/$WORKSPACE_ID/ai-queue" \
-H "Authorization: Bearer $EMN_API_KEY"