Start here
Modes
SDK reference
Shared reference
DocsSDK ModeWebhooks
Weev delivers work to your service the same shape as any webhook: an authenticated POST to the endpoint that createWeevMiddleware mounts. The endpoint only accepts the offer — outcomes travel back over authenticated callbacks, never in the offer response.
Cloud → your service
POST {endpoint}/.weev/run, authenticated with Authorization: Bearer <wvout_ key> — the environment's outbound key, verified timing-safely by the SDK when runToken is configured. Redirects are never followed. Protocol version: 2.jobRunId
The logical run being offered.
attemptId
The specific attempt in the ledger.
jobName
Registry lookup key — must match a registered weev.job().
batchRunId / jobId
The enclosing batch run and the job's identity.
executionToken
Single-use token, rotated per dispatch; presented back on every callback.
protocolVersion
Currently 2. The SDK rejects versions it does not support.
{ "status": "accepted" | "busy" | "not_found" | "error", "jobRunId", "message"? }Note
Fast-ack contract
Your service → Cloud
Authorization: Bearer <wvin_ key> — the environment's inbound key (the SDK's token) — and every one carries the single-use executionToken from the offer.Claim
POST /v1/job-runs/:jobRunId/startSent before any handler code runs. Grants a fenced lease with an expiry and heartbeat interval; a 409 means another claimant owns the attempt and the SDK drops the offer silently.
Heartbeat
POST /v1/job-runs/:jobRunId/heartbeatRenews the lease on an interval (default 30s) and carries the execution phase. The response can revoke the lease or request cancellation, which aborts ctx.signal.
Complete
POST /v1/job-runs/:jobRunId/completeReports success (with an optional JSON-serializable result) or failure (with an error). A lost success response is retried for up to 15 minutes and never converted into a failure.
The claim takes a fenced lease: a second claimant, an overlapping retry, or a late callback cannot execute or commit the same attempt twice. The security properties of this handshake are laid out on the Security & Architecture page.