ReferenceWhat you can callRunsrunruns.startFromLeads

runs.startFromLeads

Start a campaign from leads already pushed in with selda_add_lead, selected by the source label you gave them. No discovery, Selda writes a message per lead from the analysis that came with it, and stops at the drafts.

EndpointPOST /mcp/run
Scopepipeline
Sandbox keyrefused
Extra entitlementnone
MCP toolsselda_start_campaign_from_leads
Convex functioncampaignRunner/importLeads:startRunFromLeadsFromApiKey

A free sandbox key is refused: it runs the discovery and research engine: web search, crawls, model calls, per-lead credits.

Arguments

ArgumentTypeRequiredNotes
projectIdid<"projects">required
sourcestringrequired
sourceDisplayLabelstringoptional
campaignIdid<"campaigns">optional
campaignBriefstringoptional

What Selda fills in

You never send these. The HTTP layer overwrites them from the API key, which is what keeps one organisation’s data out of another’s reach.

ArgumentFilled in from
orgIdyour organisation, resolved from the API key

Example request

Required arguments only. Values in angle brackets are yours to fill in; the optional ones are in the table above.

curl -X POST https://api.selda.ai/mcp/run \
  -H "Authorization: Bearer sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "fn": "runs.startFromLeads", "args": { "projectId": "<projectId>", "source": "<source>" } }'
{
  "fn": "runs.startFromLeads",
  "args": {
    "projectId": "<projectId>",
    "source": "<source>"
  }
}

Example response

Every endpoint answers in the same envelope.

{
  "value": <the function's return value>,
  "request_id": "req_..."
}

The shape of value is not documented here. campaignRunner/importLeads:startRunFromLeadsFromApiKey declares no returns validator, so there is nothing to derive it from, and a shape written out by hand here is a shape that goes stale without anything noticing. Call it once against a test key and read what comes back.

On failure the body is { "error": { "type", "code", "message", "request_id" }, "request_id" } and request_id is echoed in the X-Request-Id header.


Generated from convex/lib/mcpRegistry.ts. Nothing in this reference sends: launchRun is in no registry and never will be, so a script can prepare a campaign completely and a person still presses send in the app.