GET /api/outreaches
Browse and search outreaches.
Query parameters
| channel | Filter by channel: phone | email | linkedin |
|---|---|
| person_id | Filter by person id (format: per_xxx). |
| company_id | Filter by company id (format: com_xxx). |
| sequence_id | Filter by sequence id (format: seq_xxx). |
| status | Filter by current state (Statesman). Examples: new, starting, waiting, enrichment, ready, not_available. |
| owner | Filter by company owner user id (format: usr_xxx). |
| sort | channel | company | status | sequence | owner |
| direction | asc or desc (default overall: created_at desc when sort omitted) |
| page | 1-based page number. |
| per | Items per page. Default 50. |
Example request
curl "http://localhost:3000/api/outreaches?status=ready&sort=company&direction=asc&page=1&per=50"
Response
{
"items": [
{ "id": "out_11111", "channel": "email", "person_id": "per_22222", "sequence_id": "seq_33333", "current_state": "ready" }
],
"pagination": { "current_page": 1, "per_page": 50, "total_pages": 2, "total_count": 55 }
}
GET /api/outreaches/:id
Fetch a single outreach.
Path parameters
| id | Outreach id (format: out_xxx). |
|---|
Example
curl "http://localhost:3000/api/outreaches/out_11111"
Response
{ "id": "out_11111", "channel": "email", "person_id": "per_22222", "sequence_id": "seq_33333", "current_state": "ready" }
PATCH /api/outreaches/:id
Update an outreach (e.g., assign sequence_id).
Body params (form or JSON)
| sequence_id | Sequence id to assign (format: seq_xxx, nullable to remove). |
|---|
Example
curl -X PATCH -H "Content-Type: application/json" \
-d '{"sequence_id":"seq_33333"}' "http://localhost:3000/api/outreaches/out_11111"
Response
{ "id": "out_11111", "channel": "email", "person_id": "per_22222", "sequence_id": "seq_33333", "current_state": "ready" }
PATCH /api/outreaches/:id/start_enrichment
Transition an outreach to the enrichment state if allowed.
Example
curl -X PATCH "http://localhost:3000/api/outreaches/out_11111/start_enrichment"
Response
{ "id": "out_11111", "current_state": "enrichment" }
PATCH /api/outreaches/batch_assign
Assign a sequence to multiple outreaches.
Body params (form or JSON)
| outreach_ids | Array or comma-separated list of outreach ids. Required. |
|---|---|
| sequence_id | Sequence id to assign (format: seq_xxx). Required. |
Example
curl -X PATCH -H "Content-Type: application/json" \
-d '{"outreach_ids":["out_11111","out_22222","out_33333"],"sequence_id":"seq_33333"}' "http://localhost:3000/api/outreaches/batch_assign"
Response
{ "updated_count": 3, "sequence_name": "Welcome Sequence" }
PATCH /api/outreaches/batch_start_enrichment
Start enrichment for multiple outreaches.
Body params (form or JSON)
| outreach_ids | Array or comma-separated list of outreach ids. Required. |
|---|
Example
curl -X PATCH -H "Content-Type: application/json" \
-d '{"outreach_ids":["out_11111","out_22222","out_33333"]}' "http://localhost:3000/api/outreaches/batch_start_enrichment"
Response
{ "success_count": 3 }