Skip to main content
POST
/
v1
/
compounding
/
trigger
Trigger compounding job
curl --request POST \
  --url https://app.nex.ai/api/developers/v1/compounding/trigger \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "job_type": "consolidation",
  "dry_run": false
}
'
{
  "job_run_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "job_type": "consolidation",
  "workspace_id": 123,
  "dry_run": true,
  "status": "accepted",
  "success": true
}
This endpoint requires the record.write scope on your API key.

Overview

Triggers an on-demand compounding intelligence job for your workspace. Use this after onboarding, file scanning, or bulk context ingestion to run intelligence pipelines immediately instead of waiting for the next scheduled cron cycle. This endpoint is asynchronous. It returns 202 Accepted immediately with a job_run_id, then the compounding job continues in the background.

Job Types

Job TypeDescription
consolidationMerge near-duplicate insights that refer to the same underlying fact
pattern_detectionDiscover recurring patterns across insights
playbook_synthesisGenerate actionable playbook rules from detected patterns
decay_sweepReduce confidence scores on stale insights that have not been reinforced recently
metricsSnapshot compounding pipeline metrics for the workspace

Dry Run

Set dry_run to true to preview what the job would do without persisting changes once the background run executes.

Polling Job Status

After calling this endpoint, poll Get compounding job status with the returned job_run_id until the status changes from accepted or running to completed or failed. Typical lifecycle:
  • accepted: the API accepted the trigger request
  • running: the background compounding worker has started
  • completed: the job finished and final counts are available
  • failed: the job failed and error_details explains why

Example

curl -X POST "https://app.nex.ai/api/developers/v1/compounding/trigger" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"job_type": "pattern_detection", "dry_run": false}'
{
  "job_run_id": "550e8400-e29b-41d4-a716-446655440000",
  "job_type": "pattern_detection",
  "workspace_id": 12345,
  "dry_run": false,
  "status": "accepted",
  "success": true
}

Authorizations

Authorization
string
header
required

API key for authentication (format: "Bearer YOUR_API_KEY")

Body

application/json

Job trigger request

job_type
enum<string>
required

The type of compounding job to run

Available options:
consolidation,
pattern_detection,
playbook_synthesis,
decay_sweep,
metrics
dry_run
boolean
default:false

If true, preview impact without persisting changes

Response

Job accepted

job_run_id
string<uuid>

Unique identifier for this job execution

job_type
enum<string>

The type of job that was executed

Available options:
consolidation,
pattern_detection,
playbook_synthesis,
decay_sweep,
metrics
workspace_id
integer

Workspace ID the job ran against

dry_run
boolean

Whether the job ran in dry-run mode

status
enum<string>

Current job status

Available options:
accepted
success
boolean

Whether the job was accepted successfully

Last modified on March 26, 2026