Workers API Documentation
The cloud for autonomous workers. Start durable runs, attach resources and guardrails, and retrieve outcomes you can verify.
Manually reviewed against GrupaAI Worker API 1.0.0. The Swagger reference is the canonical staging contract; production availability can differ until a backend release is promoted.
Introduction
GrupaAI gives developers durable digital humanoid workers as cloud infrastructure. A worker can operate websites, portals, SaaS apps, credentials, cards, files, tools, and budgets to complete real work.
Use workers.run for on-demand work, workers.create for long-lived workers, and worker.mode to choose one worker, a persistent worker, or a team. Use worker.availability for on-demand, part-time, full-time, or 24/7. The primitive is simple: worker + work + resources + guardrails -> outcome.
work maps to how businesses assign people today — not a single browser step:
- Job ticket — one case or order (prior auth #4412, customer order #9921)
- Shift assignment — one account or queue for a block of time (BPO night shift, Monday RevOps reconcile)
- Function brief — a team objective for a period (grow marketplace liquidity this week)
We are currently in private beta. You will need an API key to use the SDK. Request access here.
Installation
The REST API requires no SDK. Use any HTTP client against the base URL supplied with your access. The generated staging reference uses https://api.staging.grupa.ai.
@grupaai/sdk is not distributed through the public npm registry. Run the command below only if your access instructions include private-registry credentials. Otherwise, use the REST examples on this page.
For approved SDK users:
Authentication
Every API request uses HTTP Bearer authentication. Keep keys server-side and load them from an environment variable.
In Swagger Docs, select Authorize and paste the key without a Bearer prefix; the console adds it. Approved SDK users can initialize the client as follows:
Quick Start
Start a durable worker run with a single REST request. The API accepts the run and returns 202 Accepted with a WorkerRun.
Private-beta SDK equivalent
If your account includes SDK access, the equivalent call is:
Poll GET /v1/runs/{runId}, resume the durable SSE stream at GET /v1/runs/{runId}/events, or receive a signed worker.completed webhook. The completed run can include the outcome, cost, verification, trace, recordings, and proof artifacts.
Work Runs
A Work Run is one assignment given to one worker or a team of workers — the same unit a manager would assign to a person: a job ticket, shift assignment, or function brief. Every run has an outcome contract, status, trace, metadata, resources, and optional guardrails.
- worker - role, topology mode, and availability.
- work - required. Natural-language description of the job to complete.
- resources - optional. Credentials, card, files, tools, budget, and context.
- guardrails - optional. Approvals, spend limits, submit gates, and timeouts.
- outcome - optional. What should be returned when the work is finished.
- output - optional. Recording, structured deliverable contract, and PII masking controls.
- scheduleAt - optional. Future dispatch time, up to 365 days ahead.
- idempotencyKey - optional SDK field mapped to the
Idempotency-Keyheader. - webhook - optional. URL for worker lifecycle events.
- metadata - optional. Your IDs for correlation.
Run statuses are pending, running, needs_approval, stuck, verifying, completed, failed, and canceled.
Workers
Workers are the core primitive. Choose how they are deployed with worker.mode, then choose when they run with worker.availability.
- mode: "single" - one worker, one outcome.
- mode: "persistent" - long-lived worker for repeat assignments.
- mode: "team" or "auto" - run multiple roles or let GrupaAI choose topology.
- availability: "on_demand" - spin up for one job, then done.
- availability: "part_time" - scheduled repeat work for specific windows.
- availability: "full_time" - active through business hours for a function.
- availability: "24_7" - always-on worker for autonomous operations.
Resources
Resources are what the worker can use: portal logins, payment methods, files, built-in tools, MCP servers, custom APIs, budgets, and scoped secrets. Reference credential IDs, zero-custody connection IDs, agent identities, card IDs, and uploaded file IDs instead of embedding raw secrets or file contents in a run.
Files
Upload immutable CSV, XLS/XLSX, or binary inputs up to 25 MiB using POST /v1/files and the required X-GrupaAI-File-Name header. The returned opaque file_... ID is safe to place in resources.files.
Credentials
POST /v1/credentials stores encrypted login, API-token, OAuth, or HTTP-header material and returns metadata without secret values. For zero-custody access, use credential broker manifests and credential connections; runs receive only ready connection IDs or an independently brokered agentIdentity.
The API exposes credential, credential-connection, and file endpoints, but production provisioning remains access-controlled. Request API access before connecting real systems or payment resources.
Webhooks & Lifecycle
Register an HTTPS webhook URL on a run or create an account-level subscription with POST /v1/webhook-subscriptions. Run submission returns webhookSigningSecret only when a per-run webhook is configured. Store it immediately.
worker.started- worker began executionworker.needs_approval- paused for a human gate (payments, submits)worker.verifying- outcome produced; running the independent checkworker.stuck- no progress / blocked (e.g. rate-limited); the worker paused and reported instead of loopingworker.completed- success with outcome, cost, verification, and trace URLworker.failed- terminal failure with error detail
Every delivery is signed. Verify the X-Grupa-Signature header before trusting a payload (see Production Essentials → Webhook Signing), and treat unsigned requests as hostile.
Auto Topology
If you prefer not to design worker topology, use worker.mode: "auto" on workers.run. The platform decides worker count, team roles, and sequencing from your goal.
Worker Teams & Visibility
When you run a team, GrupaAI provisions specialized workers for the work: researchers, operators, reviewers, schedulers, or custom roles you define.
Full Visibility: Unlike black-box solutions, GrupaAI provides a real-time trace of the entire worker team's activity. The onUpdate callback receives events from all workers, allowing you to show the user exactly what is happening.
Tools & Integration
Attach tools inside resources: built-in tools, MCP servers, or custom API endpoints.
Built-in Tools
These tools are always available. Pass them in resources.tools:
- web_search - Search the web for information
- email_send - Send emails with custom content
- calendar_invite - Create and manage calendar events
- file_upload - Upload and process files
- code_execution - Execute code in secure environments
MCP (Model Context Protocol) Servers
Connect standard data sources with simple connection strings:
Custom Tools
Connect your internal APIs and proprietary systems:
Approvals
Gate high-stakes actions - payments, form submits, message sends - with human-in-the-loop approval. Works on any worker mode.
If guardrails.approvals is omitted, production runs require approval for all consequential categories by default: messages, external submissions, payments, and trades. Setting preauthorizeConsequential: true explicitly bypasses that default and should be used only when authority is established elsewhere.
When approval is required, the workflow pauses and emits a signed event. List approvals at GET /v1/runs/{runId}/approvals, then approve or deny with the approval's current version. A stale version returns 409 Conflict. The private-beta SDK may expose the same flow through onApproval.
Budget & Controls
Budgets and limits are the outer guardrail — but a worker also stops on its own judgment. Like a competent person, it continuously checks whether it is actually making progress. If it hits a wall (a rate limit, a dead control, repeated no-op actions), it does not loop or invent busywork: it enters stuck, emits a worker.stuck event explaining what blocked it, and waits for input instead of burning budget. Attach budget and guardrails.timeout as the hard backstop under that judgment.
- resources.budget: Maximum spend in USD for the worker run.
- guardrails.timeout: Maximum duration in milliseconds.
- guardrails.approvals: Actions that must pause for human approval.
REST Endpoint Reference
This catalog mirrors the current OpenAPI 1.0.0 staging contract. The Swagger Docs remains canonical for request bodies, responses, limits, and newly promoted endpoints.
Runs
Submit, inspect, stream, collaborate on, and cancel durable worker runs.
/v1/workers/runStart a worker run/v1/runsList worker runs/v1/runs/live-workersList active worker desktops/v1/runs/{runId}Retrieve a worker run/v1/runs/{runId}/cost-breakdownRetrieve invoice-backed run costs/v1/runs/{runId}/eventsStream the durable run trace with SSE/v1/runs/{runId}/traceRetrieve a page of the durable trace/v1/runs/{runId}/collaborationCreate a short-lived shared-screen link/v1/runs/{runId}/live-previewStream a read-only desktop preview/v1/runs/{runId}/agentsList independently addressable run agents/v1/runs/{runId}/agents/{agentId}/live-previewPreview one agent desktop/v1/runs/{runId}/agents/{agentId}/collaborationCreate one agent collaboration link/v1/runs/{runId}/cancelCancel a worker runWorkers
Provision and assign reusable persistent workers.
/v1/workersCreate a persistent worker/v1/workersList persistent workers/v1/workers/{workerId}Retrieve a persistent worker/v1/workers/{workerId}Delete a persistent worker/v1/workers/{workerId}/assignAssign work to a persistent worker/v1/workers/{workerId}/pausePause a persistent worker/v1/workers/{workerId}/resumeResume a persistent worker/v1/workers/{workerId}/memoryInspect opt-in worker memory/v1/workers/{workerId}/memoryClear worker memory immediatelyApprovals
Resolve guarded side effects with optimistic concurrency.
/v1/runs/{runId}/approvalsList pending and resolved approvals/v1/runs/{runId}/approvals/{approvalId}/approveApprove a guarded action/v1/runs/{runId}/approvals/{approvalId}/denyDeny a guarded actionProof
Retrieve immutable screenshots, recordings, and output-file evidence.
/v1/runs/{runId}/agents/{agentId}/artifactsList proof from one agent/v1/runs/{runId}/agents/{agentId}/artifacts/{artifactId}Download agent proof/v1/runs/{runId}/artifactsList proof artifacts for a run/v1/runs/{runId}/artifacts/{artifactId}Download run proofFiles
Upload immutable run inputs and retrieve tenant files.
/v1/filesUpload an immutable input file/v1/filesList active tenant input files/v1/files/{fileId}Download an active input file/v1/files/{fileId}Revoke an input file for future runsWebhooks
Configure signed account-level lifecycle deliveries.
/v1/webhook-subscriptionsCreate a webhook subscription/v1/webhook-subscriptionsList webhook subscriptions/v1/webhook-subscriptions/{subscriptionId}Delete a webhook subscriptionCredentials
Manage encrypted vault credentials and zero-custody broker connections.
/v1/credentialsStore an encrypted execution-only credential/v1/credentialsList secret-free credential metadata/v1/credentials/{credentialId}Delete a vault credential/v1/credential-broker-manifests/resolveVerify a public broker manifest/v1/credential-connectionsRegister a credential authority/v1/credential-connectionsList credential connections/v1/credential-connections/{connectionId}/verification-challengeRotate an activation challenge/v1/credential-connections/{connectionId}/verifyActivate a credential connection/v1/credential-connections/{connectionId}Revoke a credential connection/v1/credential-authorizations/introspectConsume a runtime release authorizationSecurity
Create scoped API keys and export immutable audit events.
/v1/api-keysCreate a scoped, rotatable API key/v1/api-keysList API-key metadata/v1/api-keys/{keyId}Enable or disable an API key/v1/api-keys/{keyId}Revoke an API key/v1/api-keys/{keyId}/rotateRotate and revoke an API key/v1/audit-eventsExport immutable audit eventsBilling
Inspect balances, configure payment methods, and settle usage.
/v1/platform/organizations/{organizationID}/credit-grantsGrant organization credits (platform admin)/v1/platform/organizations/{organizationID}/credit-grantsList organization credit grants/v1/billing/credit-grantsList authenticated-organization grants/v1/billingRetrieve the tenant billing account/v1/billing/mandateAccept the service-billing mandate/v1/billing/setup-intentsInitialize hosted card setup/v1/billing/setup-intents/{setupIntentId}/syncSave verified card metadata/v1/billing/payment-methods/{paymentMethodId}Update a billing card/v1/billing/payment-methods/{paymentMethodId}Remove a billing card/v1/billing/paymentsPay the current balance/v1/billing/payments/{paymentId}/syncSynchronize a confirmed payment/v1/billing/payments/{paymentId}/resumeResume an interrupted payment/v1/billing/payments/{paymentId}/cancelCancel an open payment/v1/billing/webhooks/stripeReceive a signed Stripe billing eventRetention
Inspect memory and permanently remove run data.
/v1/data-retention/runs/{runId}Cancel and permanently delete a run treePrivate-beta SDK Reference
Convenience methods for accounts that have been granted access to @grupaai/sdk. The REST/OpenAPI contract above is canonical.
workers.run(config)
Start one on-demand worker or a worker team. Returns a run object with id, status, and eventually an outcome.
Parameters
Returns
workers.create(config)
Create a persistent worker that can receive repeated assignments. Use this for BPO operations, recurring admin work, and long-lived worker identities. Calling workers.run with worker.mode: "persistent" is shorthand that auto-creates a worker and assigns the run to it; use create() + assign() when you need to reuse one worker identity across many assignments.
Persistent Worker Parameters
Returns
Type Definitions
Selected convenience types used by the private-beta SDK examples. The generated OpenAPI schemas are canonical and include complete validation constraints.
Run & worker methods
client.workers.retrieveRun(runId)- fetch one run by idclient.workers.listRuns()- paginated list of runs (limit,cursorparams)client.workers.cancel(runId)- stop an in-flight runclient.workers.pause(workerId)/.resume(workerId)/.delete(workerId)- manage a persistent worker (this is how a worker reaches the"paused"status)
Verification & Proof
Every run returns evidence, not just an answer. Alongside outcome, a completed run returns cost (actual spend), a trace with screenshot proof of each step, and an independent verification result checked against the outcome criteria you set.
- verification.status: "passed" - an independent check confirmed the outcome against your criteria.
- "failed" - the check found the outcome does not meet the criteria. The run is flagged, never silently returned as done.
- "unverified" - the outcome could not be confirmed yet (e.g. a source is pending). The run stays in
verifyingand re-checks on a schedule until it can close or escalate.
Pass outcome as an object to set structured, checkable criteria. The screenshot trace and verification checks are retained as an audit trail for regulated workflows. Screenshots are the default proof; set output.recording = true to also get a full video replay when a person needs to watch the run back — a reviewer verifying, or a learner rewatching a session.
Use output.contract when the worker must produce validated JSON, CSV, or XLSX deliverables. Set output.piiMasking = true to de-identify screenshot proof and trace payloads before persistence. Recordings are not masked and can have independent retention.
Use the run and per-agent artifact endpoints to list and download immutable screenshots, recordings, and output files. Each artifact includes its MIME type, size, SHA-256 digest, creation time, and retention deadline.
Collaboration — Pair & Teach
A worker is not limited to solo autonomous work. Like a person, it can share an environment with a human — watch what they do, demonstrate a step, let them try, and coach as they go. These are innate abilities, not a separate mode: the worker decides whento work alone, pair, or teach from the work and role you give it, exactly as a colleague would.
- Watch - perceives the human's live actions on the shared screen, not just the page.
- Demonstrate - performs a step to show how, then holds.
- Observe & stay present - keeps watching while the human attempts it. This is continuous co-presence, never a blind pause.
- Coach - gives feedback or corrects, without seizing control.
You never set a "teaching mode." Assign work like "Train the new analyst to run month-end reconciliation" or "Pair with me on this filing", and the worker chooses co-presence on its own. The trace records demonstrated, watching, human_acted, and coached events, so the session stays fully auditable and replayable.
GET /v1/runs/{runId}/live-preview- stream a read-only worker desktop.POST /v1/runs/{runId}/collaboration- create a single-use, short-lived shared-screen link.GET /v1/runs/{runId}/agents- list addressable workers in a team run.GET /v1/runs/{runId}/agents/{agentId}/live-preview- preview one worker.POST /v1/runs/{runId}/agents/{agentId}/collaboration- collaborate with one worker.
Memory & Learning
Set memory.enabled on a worker to let it remember across assignments. Memory works at three levels, like a person's:
- Working memory - within a single run, the worker carries context across every step; the
traceis its record. - Long-term memory - a persistent worker retains what it learned across assignments (how a portal is laid out, where a control lives, what failed last time), so repeat work gets faster and more reliable.
- Learning from coaching - in a Pair & Teach session, when a human corrects or demonstrates, that feedback is retained and applied to later work. The worker improves from being taught, not only from doing.
Memory is per-worker and tenant-isolated. You can inspect and clear it, and nothing persists unless you enable it — off by default. Use GET /v1/workers/{workerId}/memory to inspect the current version and DELETE /v1/workers/{workerId}/memory to clear it immediately.
Production Essentials
Everything you need before pointing real, money-moving, form-submitting traffic at a worker.
Idempotency
Send an 8-200 character Idempotency-Key header when creating runs or financial operations. The SDK's idempotencyKey field maps to that header. An exact retry returns the original operation; reusing a key with different inputs returns 409 Conflict.
Errors & Status Codes
Errors return a non-2xx HTTP status and a typed body with an errorobject carrying code (an ErrorCode), message, and requestId.
400invalid request ·401authentication failure ·402budget or billing failure ·403forbidden ·404not found ·409conflicting state or mismatched idempotency reuse ·422invalid configuration ·429rate limited ·503temporarily unavailable
Rate Limits
Over the limit returns 429 with a Retry-After header and X-RateLimit-Remaining / X-RateLimit-Reset. Back off and retry; the SDK does this automatically with jitter. Per-plan quotas are on your dashboard.
Cancellation
POST /v1/runs/{runId}/cancel durably requests cancellation and returns 202; an already terminal run returns 200. A canceled run settles to status = "canceled". Persistent workers use pause, resume, and delete.
Environments & Versioning
The API is versioned in the base path. The Swagger reference currently targets https://api.staging.grupa.ai/v1; use the production base URL supplied with production access. Breaking changes ship under a new version. Keys prefixed grupa_test_ run in a sandbox that simulates external submits and payments — no real money moves and no real forms are filed — so you can integrate safely. Override the host by passing a baseURL option to the client.
Webhook Signing
Every webhook POST includes an X-Grupa-Signature header: an HMAC-SHA256 of the raw request body using your webhook secret. Recompute it and compare in constant time before trusting the payload; reject anything that doesn't match or is unsigned. This is what prevents a spoofed worker.completed or a forged payment approval.
Testing & Development
Test worker instructions, resources, guardrails, and expected outcomes before running in production.
Dry Run Mode
Plan and validate worker steps without executing actual external actions.
Validation Mode
Validate worker configuration and connected tools without running the full workflow.
Error Handling & Recovery
Build robust worker runs with comprehensive error handling and recovery strategies.
Mid-flight Intervention
Pause and intervene when workers need human guidance, approval, or updated instructions.
Error Recovery Strategies
Configure how workers handle failures and retry logic.
Security & Compliance
Enterprise-grade security with credential management and audit trails.
Credential Vault
Portal logins and payment methods live in the credentials vault. Reference vault IDs in worker runs — never embed raw secrets in source code. Secrets are encrypted at rest with per-tenant keys and injected only at the browser/execution layer at the moment of use: the reasoning model never receives raw credential values, and they are redacted from traces, screenshots, and logs.
Data Handling & Retention
Traces, screenshots, and recordings can contain PII/PHI by construction — a portal screen holds real data. Artifacts are encrypted at rest, access-controlled per tenant, and returned with an explicit retentionUntil. DELETE /v1/data-retention/runs/{runId} cancels a live run and permanently deletes its parent/child data. Set output.piiMasking = true to de-identify screenshot proof and trace payloads before persistence. Keep work and outcome free of unnecessary PII — treat them as logged.
Deployment & Isolation
Workers run in isolated, per-run sandboxes with tenant data separation; browser state, cookies, and cache are wiped between assignments. Single-tenant and customer-VPC deployment (with egress allowlisting) are available for regulated buyers. Approvals are enforced and recorded server-side for non-repudiation — not trusted from the client callback alone.
Access & Keys
- Scoped keys: create keys with
runs:read,runs:write,keys:manage,audit:read,vaults:use,vaults:manage, oradmin. - Sandbox: creating a key with
sandbox: truereturns agrupa_test_key that suppresses consequential external actions. - Rotation: use
POST /v1/api-keys/{keyId}/rotate; raw key material is returned only when created or rotated. - Audit:
GET /v1/audit-eventsexports immutable credential, approval, memory, and key events.
Compliance
SOC 2 and a DPA (with subprocessor list and data-residency options) are available under NDA; a BAA is available for HIPAA-covered workflows. Because workers operate consumer-data portals, FCRA roles and permissible-purpose are addressed in your agreement. Contact us for current reports and terms — we do not represent certifications we do not hold.
Examples
Each example is real work companies assign today — job tickets and shift assignments you wire into your product, plus function briefs for worker teams.
Replace ops workflows
Plug these into your app or ops stack. One API call maps to one assignment a coordinator would hand to a human today.
Job ticketOn-demand portal worker
Human parallel: RCM coordinator assigns case #4412 to a portal specialist for prior auth submission.
Shift assignmentPersistent BPO worker
Human parallel: BPO supervisor assigns overnight vendor portal queue clearing for one client account.
Shift assignmentEnterprise ops worker
Human parallel: RevOps lead assigns the Monday standup reconcile across Salesforce, HubSpot, billing, and recruiting.
Job ticketPayment with approval
Human parallel: Commerce ops fulfills wholesale order #7721 in checkout with manager approval before payment.
Run a business function
Delegate objectives teams already own. Use mode: "team" or persistent workers; GrupaAI decomposes the brief into sub-work until the outcome is met.
Function briefMarketplace worker team
Human parallel: Marketplace ops lead assigns the team — grow supply, demand, and matches this week.
Function briefMarketplace matching team
Human parallel: Ops assigns matchers to pair supply listings with buyer requests for the week.
Function briefAdvanced: automatic worker topology
Human parallel: Partner assigns analyst — find and diligence pre-seed AI infra startups this month.
Use worker.mode: "auto" when you want GrupaAI to choose whether the brief needs one worker or a team.
Use Cases
Businesses and product categories that become easier to build with autonomous workers as execution infrastructure.
Marketplaces
One worker grows supply, one worker qualifies demand, and one worker coordinates ops. Your product owns the UI; workers run the marketplace loops.
Vertical SaaS that does the work
Healthcare, insurance, real estate, logistics, and recruiting products can execute portal workflows behind their own app experience.
Tech-company operations
Revenue ops, finance ops, support ops, recruiting ops, and vendor ops can run on persistent workers supervised by humans.
AI-native BPO
Service businesses can replace manual portal labor with worker fleets, keeping humans on exceptions, QA, and relationships.
Commerce and concierge apps
Workers can order, book, cancel, reschedule, and pay on behalf of users with explicit approval gates.
Autonomous GTM systems
Workers research accounts, enrich CRMs, qualify leads, run outreach, follow up, and book meetings through real tools.
Billing
GrupaAI costs less than building worker infrastructure — and less than hiring humans to do the same work. You are billed based on:
- Worker active time: Pay for workers while they are running work.
- Availability: On-demand, part-time, full-time, and 24/7 workers can be priced by usage and volume.
- Infrastructure included: Cloud runtime, browser sessions, model routing, traces, approvals, and worker orchestration.
- Resources separate: External spend controlled by
resources.budget, card limits, and approval guardrails.
A run's cost.status is pending, partial, or reported. Retrieve invoice-backed source line items and totals from GET /v1/runs/{runId}/cost-breakdown. The response separates gross cost, credits, direct and shared cloud costs, external providers, and descendant-run costs.
GET /v1/billing returns the authoritative tenant billing account. Billing mandates, setup intents, saved payment methods, and balance payments are available through the billing endpoints in the REST catalog above.
Build autonomous businesses on GrupaAI like you build on payments or compute — call the API, attach resources, get outcomes back.
For enterprise rate cards and volume discounts, please book a call with our sales team.