/healthzPublicHealth check
Returns API health, version, and contract counts. No authentication required.
Example request
curl https://api.patchr.co/healthz
Response shape
{ "ok": true, "version": "...", "contractCount": 178 }API Reference
REST · JSON · BearerEvery Patchr surface is available over HTTP. This reference covers authentication, orchestration, all seven domains, events, schemas, and the sandbox.
Base URL
https://api.patchr.coAll requests go to this base. Public routes work without a token. Protected routes require Authorization: Bearer <token>.
Authentication
Create an API token from the dashboard. Pass it as a bearer token on every request that requires authentication.
Authorization: Bearer pk_live_your_token_here
Rate limits
Builder plan: 500 orchestration runs/month. Team plan: unlimited. Burst limit: 60 requests/minute per token. Responses include X-RateLimit-Remaining.
All protected routes require a bearer token in the Authorization header. Tokens are scoped to a builder account and can be rotated from the dashboard.
/healthzPublicHealth check
Returns API health, version, and contract counts. No authentication required.
Example request
curl https://api.patchr.co/healthz
Response shape
{ "ok": true, "version": "...", "contractCount": 178 }/v1/manifestPublicIntegration manifest
Returns the public integration manifest: available domains, transports, schema refs, and version info. Read this before building.
Example request
curl https://api.patchr.co/v1/manifest
Response shape
{ "domains": ["hunt","resolve","bridge","proxy","pay"], "transports": ["http","mcp","a2a"], "version": "..." }/v1/protocol-mapPublicProtocol map
Returns the full route map: every public endpoint, its domain, method, auth requirement, and schema refs.
Example request
curl https://api.patchr.co/v1/protocol-map
/v1/profilesPublicCreate developer profile
Create a developer profile, return a starter API token, and send an email activation link. Starter tokens for unactivated email addresses are limited to 5 workflow requests.
Request body
emailstringDeveloper email address that receives the activation link.requirednamestringDeveloper or team name.requiredpasswordstringProfile password, minimum 8 characters.requiredExample request
curl -X POST https://api.patchr.co/v1/profiles \
-H "Content-Type: application/json" \
-d '{"email":"dev@example.com","name":"Dev Example","password":"use-a-real-password"}'Response shape
{ "ok": true, "token": "patchr_...", "tokenStatus": "limited", "unverifiedRequestLimit": 5, "activation": { "required": true } }/v1/profiles/activatePublicActivate starter token
Activate a starter token after the emailed activation link is opened or after a local/debug activation token is supplied.
Request body
activationTokenstringActivation token from the email link or local/debug profile response.requiredExample request
curl -X POST https://api.patchr.co/v1/profiles/activate \
-H "Content-Type: application/json" \
-d '{"activationToken":"act_..."}'Response shape
{ "ok": true, "status": "activated", "tokenStatus": "unlimited" }/v1/handshakeBearer tokenIntegration handshake
Validate that your client is compatible with the requested domain surfaces before registering or delegating.
Request body
domainsstring[]Domains your integration will use, e.g. ["resolve","proxy"].requiredclientIdstringOptional stable identifier for your integration.transportstring"http" | "mcp" | "a2a". Defaults to "http".Example request
curl -X POST https://api.patchr.co/v1/handshake \
-H "Authorization: Bearer $PATCHR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"domains":["resolve","proxy"]}'Response shape
{ "ok": true, "compatible": true, "domains": [...], "contractRef": "..." }The orchestrator is the unified entry point for executed work. An always-on planner routes engineering requests to the owning developer domain (environment, cicd, kubernetes, incident, migration, security, delivery) and consumer requests across Hunt, Resolve, Bridge, Proxy, and Pay — or you can force a sequence with domainRoute.
/v1/orchestrator/runBearer tokenRun orchestration
Submit a natural-language request or structured payload. The orchestrator classifies engineering intent, activates the relevant domains, and returns a proof card with evidence status, confidence, open questions, and recommended next action.
Request body
requeststringNatural-language request or goal, e.g. "Validate this repository for production readiness".requiredconversationIdstringStable ID to group follow-up turns into one conversation thread.domainRoutestring[]Force a specific domain sequence, e.g. ["resolve","proxy"]. Skips NLP routing.clientIdstringCalling client or user identifier.metadataobjectArbitrary key/value context forwarded to every domain handler.streambooleanSet true to receive domain events as SSE before the final response.actionstringResume action for follow-up turns: "buy" | "contact" | "proxyOutcome".itemIdstringCandidate ID selected by the user in a NEEDS_INPUT(choice) response.Example request
curl -X POST https://api.patchr.co/v1/orchestrator/run \
-H "Authorization: Bearer $PATCHR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"request": "Audit disputed claim #4821",
"conversationId": "conv_abc123",
"domainRoute": ["resolve","proxy"]
}'Response shape
{
"ok": true,
"status": "ready" | "NEEDS_INPUT" | "awaitingProxy",
"route": ["resolve","proxy"],
"results": { "resolve": {...}, "proxy": {...} },
"proofCard": { "evidenceStatus": "sourceBound", "confidence": 0.87, ... },
"agentConversation": ["[Resolve] Checked evidence...", ...],
"trace": [...]
}/v1/orchestrator/runBearer tokenStream orchestration progress
Set stream=true to receive NDJSON trace, conversation, domainStream, handoff, progress, and final events. Human-facing handoff steps include plain messages such as contacting a mechanic for availability, calling a clinic for an appointment, reaching customer service, or preparing case documents. If a domain step is quiet for 10 seconds, Patchr emits a humanized progress message so client apps can show that the run is still active.
Request body
requeststringNatural-language request or goal.requiredstreambooleanSet to true for application/x-ndjson streaming.requiredExample request
curl -N -X POST https://api.patchr.co/v1/orchestrator/run \
-H "Authorization: Bearer $PATCHR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"request":"Find a mechanic in Lekki, Lagos","stream":true}'Response shape
{"type":"trace","event":{...}}
{"type":"handoff","phase":"proxy","name":"mission.callAvailability","status":"calling","message":"Contacting the mechanic for availability."}
{"type":"progress","status":"running","elapsedSec":10.0,"message":"I am still checking source-bound options and marketplace or map evidence."}
{"type":"final","result":{...}}Software-delivery engines: configure environments, evaluate release readiness, triage clusters and incidents, gate migrations, scan for secrets, and run the delivery pipeline. Deterministic and human-gated by default; run them autonomously under an explicit mandate.
/v1/environment/configureBearer tokenConfigure environment
Analyse repository files to detect runtimes, dependencies, backing services, required secrets, and ordered setup steps. Returns a readiness verdict; no commands are executed.
Request body
filesobjectMap of {path: contents} — manifests, lockfiles, Dockerfiles, compose files, .env.example. Use filesFromLocalRepo() in the SDK.requiredrepoUrlstringOptional repository URL for provenance.Example request
curl -X POST https://api.patchr.co/v1/environment/configure \
-H "Authorization: Bearer $PATCHR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"files":{"package.json":"{...}","docker-compose.yml":"..."}}'Response shape
{ "ok": true, "readiness": "ready|needsInput|blocked",
"runtimes": [...], "services": [...], "secrets": [...], "setupSteps": [...] }/v1/cicd/planBearer tokenPlan deployment / release readiness
Evaluate release gates (build, tests, security, approval, health) and produce an ordered deployment plan with a rollback strategy per deploy strategy (rolling, blue-green, canary, recreate).
Request body
servicestringService name.requiredenvironmentstringTarget environment, e.g. prod.requiredversionstringVersion to release.requiredstrategystringrolling | blue-green | canary | recreate.artifactsobjectGate statuses, e.g. {"build":"pass","tests":"pass"}.Example request
curl -X POST https://api.patchr.co/v1/cicd/plan \
-H "Authorization: Bearer $PATCHR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"service":"web","environment":"prod","version":"v2.0.0","strategy":"rolling","artifacts":{"build":"pass","tests":"pass"}}'Response shape
{ "ok": true, "verdict": "ready|needsApproval|blocked", "gates": [...], "steps": [...], "rollback": {...} }/v1/kubernetes/repairBearer tokenTriage & repair Kubernetes
Triage a kubectl snapshot (pods + events) for CrashLoopBackOff, OOMKilled, ImagePullBackOff, and scheduling failures, and propose approval-gated remediations. Never mutates a live cluster.
Request body
podsarraykubectl get pods -o json items.requiredeventsarraykubectl get events -o json items.Example request
curl -X POST https://api.patchr.co/v1/kubernetes/repair \
-H "Authorization: Bearer $PATCHR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"pods":[...],"events":[...]}'Response shape
{ "ok": true, "verdict": "...", "findings": [...], "remediations": [...], "approvals": [...] }/v1/incident/respondBearer tokenIncident triage
Correlate active alerts (and optional signals such as recent deploys) into a triaged incident with a probable cause and safe next actions. Mutating responses are approval-gated.
Request body
alertsarrayActive alert objects.requiredsignalsobjectCorrelation context, e.g. recentDeploys.Example request
curl -X POST https://api.patchr.co/v1/incident/respond \
-H "Authorization: Bearer $PATCHR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"alerts":[{"name":"HighErrorRate","severity":"critical","service":"web"}],"signals":{"recentDeploys":[{"service":"web","version":"v2.0.0"}]}}'Response shape
{ "ok": true, "incident": {...}, "actions": [...], "approvals": [...], "timeline": [...] }/v1/database/migration/validateBearer tokenValidate DB migration
Classify migration operations, check ordering, assess lock/downtime risk and reversibility, gate on backup readiness, and return post-migration checks. Validates and gates — it does not run migrations.
Request body
migrationsarrayMigration objects: {id, sql}.requiredbackupobjectBackup readiness context.dialectstringpostgres (default), mysql, ...Example request
curl -X POST https://api.patchr.co/v1/database/migration/validate \
-H "Authorization: Bearer $PATCHR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"migrations":[{"id":"0002_drop_legacy","sql":"DROP TABLE legacy_orders;"}],"backup":{"recentBackup":false}}'Response shape
{ "ok": true, "verdict": "...", "migrations": [...], "orderingIssues": [...], "postChecks": [...] }/v1/security/validateBearer tokenSecurity validation
Scan provided file contents for exposed secrets, insecure configuration, and risky permissions. Findings carry severity and redacted evidence, plus a release-gate verdict. Deterministic and offline.
Request body
filesobjectMap of {path: contents} to scan.requiredExample request
curl -X POST https://api.patchr.co/v1/security/validate \
-H "Authorization: Bearer $PATCHR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"files":{"config.js":"const key = \"AKIAIOSFODNN7EXAMPLE\";"}}'Response shape
{ "ok": false, "verdict": "block", "findings": [...] }/v1/delivery/runBearer tokenRun delivery pipeline
Chain configure → validate → deploy → monitor → repair. Staging delivers end-to-end; production pauses at the deploy gate (status awaitingApproval) until resumed. Live deploys dispatch through a configured CI connector with idempotency.
Request body
servicestringService name.requiredenvironmentstringstaging | prod.requiredversionstringVersion to deploy.requiredstrategystringrolling | blue-green | canary | recreate.artifactsobjectGate statuses.filesobjectRepository files for the configure/validate stages.Example request
curl -X POST https://api.patchr.co/v1/delivery/run \
-H "Authorization: Bearer $PATCHR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"service":"web","environment":"prod","version":"v2.0.0","strategy":"rolling","artifacts":{"build":"pass","tests":"pass"},"files":{...}}'Response shape
{ "runId": "run_...", "status": "delivered|awaitingApproval|blocked", "stages": [...], "handoff": {...} }/v1/delivery/runs/{runId}/resumeBearer tokenResume delivery run
Resume a paused delivery run with a human approval decision. Approve to continue into deploy/repair; reject to block.
Path / query parameters
runIdstringThe runId from the paused run.requiredRequest body
approvedbooleantrue to approve, false to reject.requiredExample request
curl -X POST https://api.patchr.co/v1/delivery/runs/run_abc123/resume \
-H "Authorization: Bearer $PATCHR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"approved":true}'Response shape
{ "runId": "run_abc123", "status": "delivered", "stages": [...] }/v1/orchestrator/autonomousBearer tokenRun autonomously (mandate)
Run a developer flow (delivery or environment) without a human, under an explicit autonomy mandate. Auto-approves the gates the mandate grants within an action budget and runs allow-listed setup commands through a guarded executor. Off unless autonomy.enabled is true (and the PICUX_AUTONOMY_ENABLED kill switch is not disabled); ungranted gates or an exhausted budget leave the run awaitingApproval (fail-closed).
Request body
modestringdelivery | environment (inferred from the payload when omitted).autonomyobjectThe grant: {enabled, allowedActions, allowCommands, maxActions, dryRun, workdir, requireApproval}.required…objectPlus the delivery/environment fields for the chosen mode (service, version, artifacts, files, ...).Example request
curl -X POST https://api.patchr.co/v1/orchestrator/autonomous \
-H "Authorization: Bearer $PATCHR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"mode":"delivery","service":"web","environment":"prod","version":"v2.0.0",
"strategy":"rolling","artifacts":{"build":"pass","tests":"pass"},"files":{...},
"autonomy":{"enabled":true,"allowedActions":["delivery.deploy","delivery.rollback"],"maxActions":6}
}'Response shape
{ "ok": true, "status": "delivered",
"autonomy": { "autonomousToCompletion": true, "budgetUsed": 1,
"actions": [{"action":"delivery.deploy","decision":"autoApproved","status":"delivered"}] },
"result": {...} }Pre-packaged domain sequences for common work execution use cases. Each template returns evidence status, confidence, open questions, and a proof card.
/v1/workflows/templatesPublicList templates
Returns all published workflow templates with their IDs, domains, descriptions, and schema refs.
Example request
curl https://api.patchr.co/v1/workflows/templates
/v1/workflows/templates/{templateId}/runBearer tokenRun a template
Execute a named template. Returns the same shape as /v1/orchestrator/run but with template-specific defaults applied.
Request body
templateIdstringe.g. "vendorDueDiligence" | "auditDisputedClaim" | "findBestFit" | "coordinateHumanProcess".requiredrequeststringOverride the default request prompt.conversationIdstringStable conversation ID for multi-turn flows.metadataobjectContext forwarded to every domain handler.Example request
curl -X POST https://api.patchr.co/v1/workflows/templates/vendorDueDiligence/run \
-H "Authorization: Bearer $PATCHR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{"vendorName":"Acme Supply Co.","documents":["att_price_list","att_compliance_cert"],"policyRules":["priceVarianceUnder5pct","certificationCurrent"]}'Audit, contradiction detection, evidence mapping, and reviewable case records.
/v1/resolve/scamTriageBearer tokenRun scam triage
Submit a claim and optional evidence references. Returns risk classification, evidence map, contradictions, missing evidence, confidence, recommended restraint, and next action.
Request body
claimstringThe claim text to audit.requireddocumentsstring[]Evidence references or attachment IDs.taskIdstringAttach to an existing task.Example request
curl -X POST https://api.patchr.co/v1/resolve/scamTriage \
-H "Authorization: Bearer $PATCHR_API_TOKEN" \
-d '{"claim":"Offer seems fake, documents don'"'"'t match","documents":["att_123"]}'Response shape
{
"triage": {
"risk": { "label": "scamTriage", "severity": "critical" },
"evidenceMap": [...],
"contradictions": [...],
"confidence": 0.74,
"recommendedRestraint": "escalateBeforeActing",
"nextAction": "requestHumanReview"
}
}/v1/audit/proofPacks/{packId}Bearer tokenFetch proof pack
Retrieve a saved proof pack by ID. Proof packs contain source snapshots, evidence hashes, contradiction records, decision logs, and receipts.
Path / query parameters
packIdstringProof pack identifier.requiredExample request
curl https://api.patchr.co/v1/audit/proofPacks/pack_abc123 \ -H "Authorization: Bearer $PATCHR_API_TOKEN"
Source-bound discovery across markets, local places, lead sources, and evidence candidates.
/v1/hunt/searchBearer tokenDiscovery search
Run a structured discovery search. Returns source-bound candidates ranked by eligibility, price, evidence, and user constraints.
Request body
querystringNatural-language search request.requiredsourcesstring[]Limit search to specific sources, e.g. ["blocket","ebay"].budgetobject{ maxUsd: number } spend cap for filtering.locationstringGeographic context for local searches.taskIdstringAttach results to an existing task.Example request
curl -X POST https://api.patchr.co/v1/hunt/search \
-H "Authorization: Bearer $PATCHR_API_TOKEN" \
-d '{"query":"iPhone 7 under $550","sources":["blocket","ebay"],"budget":{"maxUsd":550}}'Response shape
{
"ok": true,
"candidates": [
{ "candidateId": "...", "title": "...", "netUsd": 480, "source": "blocket", "eligible": true }
],
"sourceTelemetry": { ... }
}/v1/tools/mapBearer tokenLocal place search
Search for local service providers via Google Places. Returns place candidates with name, address, rating, and distance.
Request body
querystringEntity + location query, e.g. "mechanic near Hisingen, Gothenburg".requiredradiusKmnumberSearch radius in kilometres. Default 10.googlePlacesApiKeystringCaller-supplied key. Omit to use the server-configured key.Example request
curl -X POST https://api.patchr.co/v1/tools/map \
-H "Authorization: Bearer $PATCHR_API_TOKEN" \
-d '{"query":"mechanic near Hisingen, Gothenburg","radiusKm":5}'Connector registration, preflight checks, and scoped external channel access.
/v1/bridge/connectorsBearer tokenList connectors
Returns all registered connectors for the current client, including capability flags, status, and preflight readiness.
Example request
curl https://api.patchr.co/v1/bridge/connectors \ -H "Authorization: Bearer $PATCHR_API_TOKEN"
/v1/bridge/connectorsBearer tokenRegister a connector
Register a new external connector. Connectors represent communication channels, APIs, or services that agents can route work through.
Request body
connectorIdstringStable identifier, e.g. "clientTwilioVoice".requiredkindstring"custom" | "webhook" | "oauth" | "basicRef".requiredcapsstring[]Capability list, e.g. ["voice.call","identity.verify","consent.capture"].requiredendpointstringTarget URL or bridge URI.requiredcredentialobject{ type, tokenRef } — tokenRef uses env: prefix for secret resolution.scopesobject[]Fine-grained access scopes with actions, resources, and tokenRefs.Example request
curl -X POST https://api.patchr.co/v1/bridge/connectors \
-H "Authorization: Bearer $PATCHR_API_TOKEN" \
-d '{
"connectorId": "clientTwilioVoice",
"kind": "custom",
"caps": ["voice.call","identity.verify","consent.capture"],
"endpoint": "bridge://client/twilio-voice",
"credential": { "type": "basicRef", "tokenRef": "env:TWILIO_AUTH_TOKEN" }
}'/v1/bridge/connectors/{connectorId}/preflightBearer tokenConnector preflight
Validate that a connector is operational before routing live traffic through it. Returns ok, status, and any blocking errors.
Request body
actionstringIntended action to validate, e.g. "call.create".requiredresourcestringTarget resource identifier.Example request
curl -X POST https://api.patchr.co/v1/bridge/connectors/clientTwilioVoice/preflight \
-H "Authorization: Bearer $PATCHR_API_TOKEN" \
-d '{"action":"call.create","resource":"voice.call"}'Response shape
{ "ok": true, "status": "ready", "connectorId": "clientTwilioVoice", "errors": [] }Human mission coordination — suspend autonomous work, collect verified outcomes, and resume with proof.
/v1/proxy/missionsBearer tokenCreate a mission
Open a human coordination mission. The orchestrator suspends until the mission receives an outcome callback with proof.
Request body
taskIdstringParent task identifier.requiredkindstring"call" | "message" | "review" | "logistics".requiredreasonstring"localServiceAvailability" | "identityVerificationAndConsent" | "humanReviewerNeeded".requiredtaskstringHuman-readable mission description.requiredcontextobjectMission context: selectedProvider, logisticsBrief, decisionFork.voiceCallobject{ phone, prompt, connectorId } for voice-directed missions.channelMsgobject{ channel, to, text, connectorId } for message-directed missions.proofReqstring[]Required proof items, e.g. ["callTranscript","consentRecord"].resumeobject{ conversationId, candidateId, action } resume hint for the orchestrator.Example request
curl -X POST https://api.patchr.co/v1/proxy/missions \
-H "Authorization: Bearer $PATCHR_API_TOKEN" \
-d '{
"taskId": "task_abc123",
"kind": "call",
"reason": "identityVerificationAndConsent",
"task": "Contact Hisingen Auto Repair to confirm availability.",
"voiceCall": { "phone": "...", "prompt": "Verify availability for...", "connectorId": "clientTwilioVoice" },
"proofReq": ["callTranscript","consentRecord"],
"resume": { "conversationId": "conv_abc", "action": "proxyOutcome" }
}'Response shape
{ "ok": true, "proxyId": "proxy_xyz", "status": "open", "mission": {...} }/v1/proxy/missions/{proxyId}/outcomeBearer tokenSubmit mission outcome
Record the human outcome for a mission. If the reason was localServiceAvailability or identityVerificationAndConsent and status is confirmedSuccess, the provider is upgraded to verified in the local provider book.
Request body
statusstring"confirmedSuccess" | "providerUnavailable" | "failed".requirednotestringHuman-written outcome summary.availabilityobject{ status, availableAt, providerName }.proofobjectProof artifacts collected during the mission.Example request
curl -X POST https://api.patchr.co/v1/proxy/missions/proxy_xyz/outcome \
-H "Authorization: Bearer $PATCHR_API_TOKEN" \
-d '{
"status": "confirmedSuccess",
"note": "Confirmed available today at 15:00.",
"availability": { "status": "available", "availableAt": "today 15:00", "providerName": "Hisingen Auto Repair" }
}'Response shape
{ "ok": true, "verifiedProvider": { "name": "...", "providerId": "...", "availability": {...} } }/v1/proxy/missions/{proxyId}Bearer tokenGet mission
Fetch a proxy mission by ID including status, context, outcome, and proof artifacts.
Example request
curl https://api.patchr.co/v1/proxy/missions/proxy_xyz \ -H "Authorization: Bearer $PATCHR_API_TOKEN"
Payment mandates, settlement requests, escrow, receipts, and proof-of-value.
/v1/pay/mandatesBearer tokenCreate a mandate
Issue a payment intent mandate with spend constraints, allowed vendors, and resolve rules. The mandate gates settlement — the pay domain will not execute without it.
Request body
taskIdstringParent task for this mandate.requiredconstraintsobject{ maxSpend: { amount, currency }, allowedVendors, resolveRules }.requiredissuerobject{ entityId, publicKey }.Example request
curl -X POST https://api.patchr.co/v1/pay/mandates \
-H "Authorization: Bearer $PATCHR_API_TOKEN" \
-d '{
"taskId": "task_abc123",
"constraints": {
"maxSpend": { "amount": 550, "currency": "USD" },
"resolveRules": ["inventoryVerified","hiddenFeeClear"]
}
}'/v1/pay/settleBearer tokenExecute settlement
Attempt settlement against a validated mandate. Returns a receipt with status, amount, proof-of-value ref, and any errors.
Request body
mandateIdstringMandate to settle against.requiredtaskIdstringParent task.requiredvendorIdstringWinning vendor from the Resolve decision tree.requiredamountnumberSettlement amount in USD.requiredpovRefstringProof-of-value reference from the vendor.Example request
curl -X POST https://api.patchr.co/v1/pay/settle \
-H "Authorization: Bearer $PATCHR_API_TOKEN" \
-d '{"mandateId":"mandate_abc","taskId":"task_abc","vendorId":"vendorA","amount":480}'Response shape
{ "ok": true, "receipt": { "receiptId": "...", "status": "settled", "amount": 480 } }Create, track, and manage protocol task lifecycle across all domains.
/v1/tasksBearer tokenCreate task
Create an auditable task record. Tasks are the durable unit of work that spans domain handoffs.
Request body
domainstringStarting domain: "hunt" | "resolve" | "bridge" | "proxy" | "pay".requiredinDataobjectInitial task input data.requireduserIdstringRequesting user or agent ID.channelstringOriginating channel: "api" | "mcp" | "sdk" | "sandbox".Example request
curl -X POST https://api.patchr.co/v1/tasks \
-H "Authorization: Bearer $PATCHR_API_TOKEN" \
-d '{"domain":"resolve","inData":{"claim":"Audit this dispute"},"channel":"api"}'/v1/tasks/{taskId}Bearer tokenGet task
Fetch task state, status, domain, input/output data, and audit trail.
Example request
curl https://api.patchr.co/v1/tasks/task_abc123 \ -H "Authorization: Bearer $PATCHR_API_TOKEN"
Subscribe to domain events, delivery status, and integration callbacks.
/v1/events/subscriptionsBearer tokenCreate subscription
Subscribe a webhook endpoint to one or more event types. Patchr will POST signed event payloads to your endpoint.
Request body
endpointstringHTTPS URL to deliver events to.requiredeventsstring[]Event type list, e.g. ["task.completed","proxy.outcome","pay.settled"].requiredsecretstringHMAC signing secret for payload verification.Example request
curl -X POST https://api.patchr.co/v1/events/subscriptions \
-H "Authorization: Bearer $PATCHR_API_TOKEN" \
-d '{"endpoint":"https://yourapp.com/hooks/patchr","events":["task.completed","proxy.outcome"]}'/v1/events/subscriptionsBearer tokenList subscriptions
Returns all active event subscriptions for the current client.
Example request
curl https://api.patchr.co/v1/events/subscriptions \ -H "Authorization: Bearer $PATCHR_API_TOKEN"
Machine-readable contract surfaces for validation, discovery, and integration-readable policy.
/v1/schemasPublicSchema catalog
Returns all published JSON Schemas keyed by schema ID. Use these to validate request and response payloads before sending.
Example request
curl https://api.patchr.co/v1/schemas
/openapi.jsonPublicOpenAPI spec
Full OpenAPI 3.1 specification for all Patchr HTTP routes. Compatible with Swagger UI, Redoc, and code-generation tools.
Example request
curl https://api.patchr.co/openapi.json
/v1/security/policyPublicIntegration-readable policy map
Returns the machine-readable policy map: allowed capabilities per domain, mandate requirements, and preflight rules.
Example request
curl https://api.patchr.co/v1/security/policy
/v1/security/policy/evaluateBearer tokenEvaluate policy
Test whether a specific action is permitted under the current policy for a given domain and connector.
Request body
domainstringDomain to check: "bridge" | "proxy" | "pay".requiredactionstringAction to evaluate, e.g. "call.create".requiredconnectorIdstringConnector ID for bridge/proxy actions.Example request
curl -X POST https://api.patchr.co/v1/security/policy/evaluate \
-H "Authorization: Bearer $PATCHR_API_TOKEN" \
-d '{"domain":"bridge","action":"voice.call","connectorId":"clientTwilioVoice"}'Deterministic benchmarks and orchestrator playgrounds — no side effects, no production API key required.
/v1/sandbox/midnight-arbitragePublicMidnight Arbitrage benchmark
Run the deterministic HUNT → RESOLVE → PAY benchmark. Returns vendor telemetry, decision tree, mandate, receipt, and full trace. Supports chaos injection.
Request body
chaosstring"" | "latency" | "modelError" | "unauthorizedSpend" | "freeze". Default empty (happy path).Example request
curl -X POST https://api.patchr.co/v1/sandbox/midnight-arbitrage \
-d '{"chaos":""}'Response shape
{
"ok": true, "status": "settled", "chaos": "",
"receipt": { "receiptId": "...", "status": "settled", "amount": 80 },
"decisionTree": { "selected": "vendorA", "paths": [...] },
"trace": [...]
}/v1/orchestrator/runBearer tokenLive orchestration (sandbox mode)
Run the full orchestrator against the sandbox. Use conversationId "sandbox_*" and omit sensitive inputs.
Request body
requeststringAny natural-language request.requiredconversationIdstringUse a sandbox-prefixed ID to avoid mixing with production conversations.Example request
curl -X POST https://api.patchr.co/v1/orchestrator/run \
-H "Authorization: Bearer $PATCHR_API_TOKEN" \
-d '{"request":"Find me an iPhone 7 under $550","conversationId":"sandbox_test_1"}'SDK Scenarios
These scenarios were run through the Patchr SDK against the public orchestrator contract. Use them as copy-ready starting points for shopping, claims, service calls, support disputes, and property lead discovery.
Route: hunt
Request JSON
{
"clientId": "storefront_demo",
"channel": "sdk",
"conversationId": "conv_sdk_shopping",
"request": "Buy used iPhone 12 in Sweden under 350 dollar",
"country": "SE",
"urls": ["https://marketplace.example.test/iphone-12"]
}Response JSON
{
"status": "NEEDS_INPUT",
"route": ["hunt"],
"results": {
"hunt": {
"inputKind": "choice",
"choices": [{ "title": "Blocket iPhone 12 listing", "price": 320.0, "currency": "USD" }]
}
}
}Route: resolve -> bridge
Request JSON
{
"clientId": "claims_demo",
"channel": "sdk",
"conversationId": "conv_sdk_damage_claim",
"request": "My newly purchased TV got damaged in transit from Example Electronics and support has not followed up.",
"attachments": [{ "name": "damaged-tv-photo.jpg", "mime": "image/jpeg" }]
}Response JSON
{
"status": "ready",
"route": ["resolve", "bridge"],
"results": {
"resolve": { "triage": { "risk": { "label": "damagedGoodsClaim", "severity": "medium" } } },
"bridge": { "connectorCount": 9 }
}
}Route: hunt -> bridge -> proxy
Request JSON
{
"clientId": "field_service_demo",
"channel": "sdk",
"conversationId": "conv_sdk_lekki_mechanic",
"action": "contact",
"itemId": "place_b0f2f11efc4bffe9a67db991",
"consentToCall": true
}Response JSON
{
"status": "awaitingProxy",
"route": ["hunt", "bridge", "proxy"],
"results": {
"bridge": { "status": "proxyHandoffReady", "mode": "proxyContact" },
"proxy": { "mission": { "voiceCall": { "status": "readyToCall", "connectorId": "clientTwilioVoice" } } }
}
}Route: resolve -> bridge
Request JSON
{
"clientId": "support_ops_demo",
"channel": "sdk",
"conversationId": "conv_sdk_ticket_dispute",
"request": "Dispute support ticket ZD-44291: airline charged me twice after cancellation."
}Response JSON
{
"status": "ready",
"route": ["resolve", "bridge"],
"results": {
"resolve": { "claimDraft": { "target": { "name": "bank", "type": "bank" } } },
"bridge": { "contactPlan": { "primary": { "type": "secureMessage" } } }
}
}Route: hunt
Request JSON
{
"clientId": "property_demo",
"channel": "sdk",
"conversationId": "conv_sdk_property_partille",
"request": "Buy abandoned property in Partille Goteborg under 2000000 SEK",
"marketplaces": ["hemnet"]
}Response JSON
{
"status": "NEEDS_INPUT",
"route": ["hunt"],
"results": {
"hunt": {
"inputKind": "choice",
"choices": [{ "title": "Partille renovation property", "price": 206353.18, "currency": "USD" }]
}
}
}All error responses use the same envelope: { "ok": false, "error": "errorCode", ... }. HTTP status follows standard semantics.
invalidPayloadRequest body failed schema validation.unauthorizedMissing or expired bearer token.forbiddenToken lacks the required scope for this route.notFoundResource (task, mission, connector) not found.conflictDuplicate resource creation or state conflict.policyViolationAction blocked by mandate or connector policy.rateLimitExceededToo many requests — check X-RateLimit-Remaining.internalErrorUnexpected server error. Retry with exponential backoff.Prefer an SDK?
SDKs handle token management, retries, and response parsing. Start there if you don't need direct HTTP control.