API reference

Base URL https://api.edgetasker.com. All /v1/* routes require an Authorization: Bearer ef_live_… header. Responses are JSON; errors use { "error": { "code", "message" } }.

POST /v1/copilot/initialize

Resolves a workflow and input data into a rendered guide protocol.

Request body

{
  "workflow_id": "wf_...",
  "input_data": { "search_term": "Sardines" }
}

Response

{
  "copilot_protocol": {
    "protocolVersion": "1.0",
    "executionId": "uuid",
    "workflow": { "id", "name", "targetDomain", "version", "locale" },
    "steps": [ /* rendered steps with resolvedValue */ ],
    "missingInputKeys": [],
    "issuedAt": "ISO-8601"
  }
}

Rate limited per API key (sliding 60s window). 429 responses include a Retry-After header.

POST /v1/telemetry/log-event

Records the outcome of an execution and finalizes its ledger entry.

Request body

{
  "execution_id": "uuid",
  "workflow_id": "wf_...",
  "outcome": "completed",       // completed | manual_override | abandoned | failed
  "steps_completed": 2,
  "steps_total": 2,
  "manual_override_count": 0,
  "duration_ms": 8421,
  "observed_origin": "www.tesco.com"
}

A failed outcome triggers an operational alert email to your admins. Response: { "accepted": true }.

POST /v1/billing/checkout

Bearer-authed. Creates a Stripe Checkout Session for the authenticated tenant and returns the hosted URL to redirect to.

{ "tier": "growth" }   // free | starter | growth | scale | enterprise
// → { "url": "https://checkout.stripe.com/...", "sessionId": "cs_..." }

Returns 501 if Stripe is not configured or the tier has no real price id yet.

POST /v1/billing/webhook

Stripe-signed (not bearer-authed). Verifies the Stripe-Signature header against your webhook secret, then syncs the tenant's tier, entitlements, and status from subscription and invoice events. Point your Stripe endpoint at https://api.edgetasker.com/v1/billing/webhook.

Status codes

CodeMeaning
200Success
400Missing/invalid body fields
401Missing, malformed, or revoked key
403Tenant not active
404Workflow not found for this tenant
409Workflow not active
429Rate limit exceeded