Skip to content

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)
🚀 Early Access

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.

Private-beta JavaScript SDK

@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:

BASH
npm install @grupaai/sdk

Authentication

Every API request uses HTTP Bearer authentication. Keep keys server-side and load them from an environment variable.

HTTP
Authorization: Bearer $GRUPA_API_KEY

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:

JAVASCRIPT
import { GrupaAI } from '@grupaai/sdk';

const client = new GrupaAI(process.env.GRUPA_API_KEY);

Quick Start

Start a durable worker run with a single REST request. The API accepts the run and returns 202 Accepted with a WorkerRun.

CURL
curl -X POST "$GRUPA_API_BASE_URL/v1/workers/run" \
  -H "Authorization: Bearer $GRUPA_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: marketplace-run-8842" \
  -d '{
    "work": "Grow liquidity on our AI talent marketplace tonight",
    "worker": { "mode": "team", "availability": "24_7" },
    "resources": { "credentials": "vault_marketplace_ops", "budget": 300 },
    "guardrails": { "approvals": ["messages", "external_submit"] },
    "outcome": "Return supply added, demand qualified, and matches made"
  }'

Private-beta SDK equivalent

If your account includes SDK access, the equivalent call is:

JAVASCRIPT
import { GrupaAI } from '@grupaai/sdk';

const client = new GrupaAI(process.env.GRUPA_API_KEY);

const run = await client.workers.run({
worker: {
role: "Marketplace Operator",
mode: "team",
availability: "24_7",
},
work: "Grow liquidity on our AI talent marketplace tonight",
resources: {
credentials: "vault_marketplace_ops",
budget: 300,
},
guardrails: {
approvals: ["messages", "external_submit"],
},
outcome: "Return supply added, demand qualified, matches made",
webhook: "https://you.com/grupa/events",
});
What happens next

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-Key header.
  • webhook - optional. URL for worker lifecycle events.
  • metadata - optional. Your IDs for correlation.
JAVASCRIPT
const run = await client.workers.retrieveRun(runId);
console.log(run.status, run.outcome, run.outputCheckpoint, run.trace);

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.
JAVASCRIPT
const worker = await client.workers.create({
name: "Night Shift Ops",
mode: "persistent",
availability: "24_7",
resources: {
credentials: "vault_vendor_prod",
},
});

await worker.assign({
work: "Process overnight ticket queue in vendor portal",
});

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.

JAVASCRIPT
resources: {
  credentials: "vault_healthcare_prod",
  credentialConnections: ["ccn_payer_browser"],
  agentIdentity: "ops@your-company.com",
  card: "card_vault_xxx",
  budget: 250,
  files: ["file_0123456789abcdef0123456789abcdef"],
  scopes: ["payer_portal", "prior_auth"]
}

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.

🔐 Early Access

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 execution
  • worker.needs_approval - paused for a human gate (payments, submits)
  • worker.verifying - outcome produced; running the independent check
  • worker.stuck - no progress / blocked (e.g. rate-limited); the worker paused and reported instead of looping
  • worker.completed - success with outcome, cost, verification, and trace URL
  • worker.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.

JSON
{
  "type": "worker.completed",
  "run_id": "run_abc123",
  "event_id": "evt_abc123",
  "timestamp": "2026-09-21T20:15:00Z",
  "outcome": { ... },
  "cost": { "total_usd": 0.42 },
  "verification": { "status": "passed" },
  "trace_url": "/v1/runs/run_abc123/trace"
}

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.

JAVASCRIPT
const run = await client.workers.run({
  work: "Research new AI infrastructure companies and update our CRM",
  worker: { mode: "auto" },
  resources: { budget: 50 }
});

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.

JAVASCRIPT
onUpdate: (trace) => {
  if (trace.type === "worker_thinking") {
    console.log(`Worker is thinking...`);
  } else if (trace.type === "tool_used") {
    console.log(`Used tool successfully`);
  }
}

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:

JAVASCRIPT
const run = await client.workers.run({
work: "Analyze customer data and generate insights",
resources: {
mcp: {
postgres: "postgresql://user:pass@host/crm_db",
notion: "notion://workspace-id",
google_drive: "gdrive://folder-id",
},
},
});

Custom Tools

Connect your internal APIs and proprietary systems:

JAVASCRIPT
const run = await client.workers.run({
work: "Update CRM and billing system",
resources: {
customTools: [{
name: "company_crm",
endpoint: "https://api.company.com/leads",
auth: process.env.CRM_API_KEY,
}],
},
});

Approvals

Gate high-stakes actions - payments, form submits, message sends - with human-in-the-loop approval. Works on any worker mode.

Safe production default

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.

JAVASCRIPT
const run = await client.workers.run({
worker: {
role: "Commerce Operator",
mode: "persistent",
},
work: "Place DoorDash order for customer order #9921",
resources: {
credentials: "vault_doordash",
card: "card_vault_xxx",
budget: 75,
},
guardrails: {
approvals: ["payments"],
},
webhook: "https://you.com/grupa/events",
});
🔔 Approval Notifications

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.

CURL
curl -X POST "$GRUPA_API_BASE_URL/v1/runs/$RUN_ID/approvals/$APPROVAL_ID/approve" \
  -H "Authorization: Bearer $GRUPA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "version": 3, "reason": "Approved by operator" }'

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.

POST/v1/workers/runStart a worker run
GET/v1/runsList worker runs
GET/v1/runs/live-workersList active worker desktops
GET/v1/runs/{runId}Retrieve a worker run
GET/v1/runs/{runId}/cost-breakdownRetrieve invoice-backed run costs
GET/v1/runs/{runId}/eventsStream the durable run trace with SSE
GET/v1/runs/{runId}/traceRetrieve a page of the durable trace
POST/v1/runs/{runId}/collaborationCreate a short-lived shared-screen link
GET/v1/runs/{runId}/live-previewStream a read-only desktop preview
GET/v1/runs/{runId}/agentsList independently addressable run agents
GET/v1/runs/{runId}/agents/{agentId}/live-previewPreview one agent desktop
POST/v1/runs/{runId}/agents/{agentId}/collaborationCreate one agent collaboration link
POST/v1/runs/{runId}/cancelCancel a worker run

Workers

Provision and assign reusable persistent workers.

POST/v1/workersCreate a persistent worker
GET/v1/workersList persistent workers
GET/v1/workers/{workerId}Retrieve a persistent worker
DELETE/v1/workers/{workerId}Delete a persistent worker
POST/v1/workers/{workerId}/assignAssign work to a persistent worker
POST/v1/workers/{workerId}/pausePause a persistent worker
POST/v1/workers/{workerId}/resumeResume a persistent worker
GET/v1/workers/{workerId}/memoryInspect opt-in worker memory
DELETE/v1/workers/{workerId}/memoryClear worker memory immediately

Approvals

Resolve guarded side effects with optimistic concurrency.

GET/v1/runs/{runId}/approvalsList pending and resolved approvals
POST/v1/runs/{runId}/approvals/{approvalId}/approveApprove a guarded action
POST/v1/runs/{runId}/approvals/{approvalId}/denyDeny a guarded action

Proof

Retrieve immutable screenshots, recordings, and output-file evidence.

GET/v1/runs/{runId}/agents/{agentId}/artifactsList proof from one agent
GET/v1/runs/{runId}/agents/{agentId}/artifacts/{artifactId}Download agent proof
GET/v1/runs/{runId}/artifactsList proof artifacts for a run
GET/v1/runs/{runId}/artifacts/{artifactId}Download run proof

Files

Upload immutable run inputs and retrieve tenant files.

POST/v1/filesUpload an immutable input file
GET/v1/filesList active tenant input files
GET/v1/files/{fileId}Download an active input file
DELETE/v1/files/{fileId}Revoke an input file for future runs

Webhooks

Configure signed account-level lifecycle deliveries.

POST/v1/webhook-subscriptionsCreate a webhook subscription
GET/v1/webhook-subscriptionsList webhook subscriptions
DELETE/v1/webhook-subscriptions/{subscriptionId}Delete a webhook subscription

Credentials

Manage encrypted vault credentials and zero-custody broker connections.

POST/v1/credentialsStore an encrypted execution-only credential
GET/v1/credentialsList secret-free credential metadata
DELETE/v1/credentials/{credentialId}Delete a vault credential
POST/v1/credential-broker-manifests/resolveVerify a public broker manifest
POST/v1/credential-connectionsRegister a credential authority
GET/v1/credential-connectionsList credential connections
POST/v1/credential-connections/{connectionId}/verification-challengeRotate an activation challenge
POST/v1/credential-connections/{connectionId}/verifyActivate a credential connection
DELETE/v1/credential-connections/{connectionId}Revoke a credential connection
POST/v1/credential-authorizations/introspectConsume a runtime release authorization

Security

Create scoped API keys and export immutable audit events.

POST/v1/api-keysCreate a scoped, rotatable API key
GET/v1/api-keysList API-key metadata
PATCH/v1/api-keys/{keyId}Enable or disable an API key
DELETE/v1/api-keys/{keyId}Revoke an API key
POST/v1/api-keys/{keyId}/rotateRotate and revoke an API key
GET/v1/audit-eventsExport immutable audit events

Billing

Inspect balances, configure payment methods, and settle usage.

POST/v1/platform/organizations/{organizationID}/credit-grantsGrant organization credits (platform admin)
GET/v1/platform/organizations/{organizationID}/credit-grantsList organization credit grants
GET/v1/billing/credit-grantsList authenticated-organization grants
GET/v1/billingRetrieve the tenant billing account
POST/v1/billing/mandateAccept the service-billing mandate
POST/v1/billing/setup-intentsInitialize hosted card setup
POST/v1/billing/setup-intents/{setupIntentId}/syncSave verified card metadata
PATCH/v1/billing/payment-methods/{paymentMethodId}Update a billing card
DELETE/v1/billing/payment-methods/{paymentMethodId}Remove a billing card
POST/v1/billing/paymentsPay the current balance
POST/v1/billing/payments/{paymentId}/syncSynchronize a confirmed payment
POST/v1/billing/payments/{paymentId}/resumeResume an interrupted payment
POST/v1/billing/payments/{paymentId}/cancelCancel an open payment
POST/v1/billing/webhooks/stripeReceive a signed Stripe billing event

Retention

Inspect memory and permanently remove run data.

DELETE/v1/data-retention/runs/{runId}Cancel and permanently delete a run tree

Private-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

TYPESCRIPT
interface WorkerRunConfig {
  worker?: {
    role?: string;
    roles?: string[];
    availability?: "on_demand" | "part_time" | "full_time" | "24_7";
    mode?: "single" | "persistent" | "team" | "auto";
    count?: number;
    profile?: string;
    size?: number;
  };
  work: string;
  resources?: {
    credentials?: string;
    credentialConnections?: string[];
    agentIdentity?: string;
    card?: string;
    budget?: number;
    files?: string[];
    tools?: string[];
    scopes?: string[];
    mcp?: Record<string, string>;
    customTools?: CustomTool[];
  };
  guardrails?: { approvals?: ApprovalCategory[]; preauthorizeConsequential?: boolean; timeout?: number };
  outcome?: string | Object;
  output?: { recording?: boolean; piiMasking?: boolean; contract?: OutputContract };
  idempotencyKey?: string;
  errorHandling?: { retryPolicy?: "exponential_backoff" | "fixed" | "none"; maxRetries?: number; fallbackStrategy?: string; partialFailureHandling?: string };
  dryRun?: boolean;
  validateOnly?: boolean;
  returnPlan?: boolean;
  estimateCosts?: boolean;
  scheduleAt?: string;
  onUpdate?: (event: TraceEvent) => void;
  onApproval?: (req: ApprovalRequest) => Promise<{ approved: boolean; modifiedContext?: unknown }>;
  webhook?: string;
  metadata?: Record<string, string>;
}

Returns

TYPESCRIPT
interface WorkerRun {
  id: string;
  status: "pending" | "running" | "needs_approval" | "stuck" | "verifying" | "completed" | "failed" | "canceled";
  work?: string;
  createdAt?: string; updatedAt?: string; startedAt?: string; finishedAt?: string; scheduledAt?: string;
  outcome?: unknown;
  outputCheckpoint?: OutputCheckpoint;
  cost?: RunCost;
  verification?: { status: "passed" | "failed" | "unverified"; method: "self" | "independent"; checks: VerificationCheck[] };
  trace?: TraceEvent[];
  recording?: { url: string; duration_ms: number };
  recordings?: Recording[];
  error?: { code: ErrorCode; message: string; blockedReason?: string };
  plan?: unknown; costEstimate?: { total_usd: number };
  metadata?: Record<string, string>;
  webhookSigningSecret?: string;
}

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

TYPESCRIPT
interface WorkerCreateConfig {
  name: string;
  role?: string; roles?: string[];
  mode?: "persistent";
  availability?: "on_demand" | "part_time" | "full_time" | "24_7";
  count?: number; size?: number;
  profile?: string;
  resources?: Resources;
  memory?: { enabled?: boolean };
  guardrails?: Guardrails;
  metadata?: Record<string, string>;
}

Returns

TYPESCRIPT
interface Worker {
  id: string;
  name: string;
  status: "ready" | "running" | "paused";
  assign: (config: WorkerAssignment) => Promise<WorkerRun>;
}

Type Definitions

Selected convenience types used by the private-beta SDK examples. The generated OpenAPI schemas are canonical and include complete validation constraints.

TYPESCRIPT
type ApprovalCategory = "messages" | "external_submit" | "payments" | "trades";
type WebhookEventType = "worker.started" | "worker.needs_approval" | "worker.verifying" | "worker.stuck" | "worker.completed" | "worker.failed";
type ErrorCode = "invalid_request" | "authentication_error" | "budget_exceeded" | "rate_limited" | "blocked" | "timeout" | "worker_unavailable";

interface TraceEvent {
  type: "worker_thinking" | "browser_runtime_recovery" | "browser_runtime_recovered" |
    "decision_started" | "decision_ready" | "action_review_started" | "action_review_ready" |
    "freshness_check_started" | "freshness_check_ready" | "continuity_check_started" |
    "continuity_check_ready" | "action_committed" | "action_started" | "action_withheld" |
    "observation_started" | "observation_ready" | "tool_used" | "screenshot" |
    "demonstrated" | "watching" | "human_acted" | "coached" |
    "proof_artifact_ready" | "proof_artifact_failed" | "output_progress";
  ts: string;
  workerId?: string;
  screenshotUrl?: string;
  payload?: unknown;
}

interface VerificationCheck { name: string; passed: boolean; evidence?: string }

interface ApprovalRequest { runId: string; category: ApprovalCategory; action: string; details: unknown }

interface CustomTool { name: string; endpoint: string; auth?: string }

interface WorkerAssignment { work: string; outcome?: string | Object; resources?: Resources; guardrails?: Guardrails; output?: object; idempotencyKey?: string; errorHandling?: ErrorHandling; webhook?: string; metadata?: Record<string, string> }

interface WebhookPayload { type: WebhookEventType; run_id: string; event_id: string; timestamp: string; data?: object; outcome?: unknown; cost?: RunCost; verification?: Verification; trace_url?: string; error?: RunError }

interface OutputContract { version: "output_v1"; description: string; deliverables?: OutputDeliverable[] }

Run & worker methods

  • client.workers.retrieveRun(runId) - fetch one run by id
  • client.workers.listRuns() - paginated list of runs (limit, cursor params)
  • client.workers.cancel(runId) - stop an in-flight run
  • client.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 verifying and 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.

JSON
"output": {
  "recording": true,
  "piiMasking": true,
  "contract": {
    "version": "output_v1",
    "description": "Return the completed reconciliation as XLSX",
    "deliverables": [{ "id": "report", "filename": "reconciliation.xlsx", "format": "xlsx", "shape": "array", "record_schema": { "type": "object" } }]
  }
}

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 trace is 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.

  • 400 invalid request · 401 authentication failure · 402 budget or billing failure · 403 forbidden · 404 not found · 409 conflicting state or mismatched idempotency reuse · 422 invalid configuration · 429 rate limited · 503 temporarily 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.

JAVASCRIPT
const plan = await client.workers.run({
  work: "Research top 5 autonomous worker platforms",
  dryRun: true,
  returnPlan: true,
  estimateCosts: true
});

console.log("Execution plan:", plan.plan);
console.log("Estimated cost:", plan.costEstimate);

Validation Mode

Validate worker configuration and connected tools without running the full workflow.

JAVASCRIPT
const result = await client.workers.run({
  work: "Analyze Q3 sales data",
  validateOnly: true,
  resources: {
    mcp: { postgres: "postgresql://..." }
  }
});

if (result.success) {
  console.log("Configuration is valid!");
} else {
  console.log("Validation errors:", result.errors);
}

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.

JAVASCRIPT
const run = await client.workers.run({
  work: "Negotiate enterprise partnership terms in vendor portal",
  guardrails: { approvals: ["external_submit"] },
  onApproval: async (request) => {
    
    const decision = await showApprovalUI(request);
    
    if (decision.action === "modify_strategy") {
      
      return {
        approved: true,
        modifiedContext: decision.newStrategy
      };
    }
    
    return { approved: decision.approved };
  },
  resources: { budget: 500 }
});

Error Recovery Strategies

Configure how workers handle failures and retry logic.

JAVASCRIPT
const run = await client.workers.run({
  work: "Process customer data and generate insights",
  errorHandling: {
    retryPolicy: "exponential_backoff",
    maxRetries: 3,
    fallbackStrategy: "use_alternative_tools",
    partialFailureHandling: "continue_with_available_data"
  },
  resources: { budget: 100 }
});

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.

JAVASCRIPT
await client.workers.run({
  work: "Update records in CRM portal",
  resources: { credentials: "vault_crm_prod" }
});

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, or admin.
  • Sandbox: creating a key with sandbox: true returns a grupa_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-events exports 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.

JAVASCRIPT
await client.workers.run({
work: "Submit prior auth for patient case #4412 in payer portal",
worker: {
availability: "on_demand",
},
resources: {
credentials: "vault_payer_prod",
budget: 75,
},
});

Shift assignmentPersistent BPO worker

Human parallel: BPO supervisor assigns overnight vendor portal queue clearing for one client account.

JAVASCRIPT
const worker = await client.workers.create({
name: "BPO Night Shift",
mode: "persistent",
availability: "24_7",
});

await worker.assign({
work: "Clear overnight vendor portal queues for Acme account and escalate exceptions",
outcome: "Return queue completed, exceptions, and client-ready report",
});

Shift assignmentEnterprise ops worker

Human parallel: RevOps lead assigns the Monday standup reconcile across Salesforce, HubSpot, billing, and recruiting.

JAVASCRIPT
const worker = await client.workers.create({
name: "Revenue Ops Worker",
mode: "persistent",
resources: {
credentials: "vault_revops_prod",
budget: 250,
},
guardrails: {
approvals: ["external_submit"],
},
});

await worker.assign({
  work: "Reconcile Salesforce, HubSpot, and billing records for new enterprise accounts",
  outcome: "Return records updated, conflicts found, and approvals needed"
});

Job ticketPayment with approval

Human parallel: Commerce ops fulfills wholesale order #7721 in checkout with manager approval before payment.

JAVASCRIPT
await client.workers.run({
work: "Complete checkout for wholesale order #7721",
resources: {
card: "card_vault_xxx",
budget: 500,
},
guardrails: {
approvals: ["payments"],
},
webhook: "https://you.com/grupa/events",
});

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.

JAVASCRIPT
await client.workers.run({
work: "Grow liquidity for our AI engineer talent marketplace this week",
worker: {
mode: "team",
roles: ["supply", "demand", "ops"],
},
resources: {
credentials: "vault_marketplace_ops",
budget: 300,
},
outcome: "Return sourced candidates, qualified buyers, matches made, and next actions",
});

Function briefMarketplace matching team

Human parallel: Ops assigns matchers to pair supply listings with buyer requests for the week.

JAVASCRIPT
await client.workers.run({
work: "Match supply listings with buyer requests this week",
worker: {
mode: "team",
size: 3,
},
});

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.

JAVASCRIPT
const run = await client.workers.run({
work: "Find and diligence the top AI infra startups raising pre-seed this month",
worker: { mode: "auto" },
resources: { budget: 500 },
outcome: "Return ranked companies, diligence memo, and warm intro paths",
});

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.

JAVASCRIPT
roles: ["supply", "demand", "ops"]

Vertical SaaS that does the work

Healthcare, insurance, real estate, logistics, and recruiting products can execute portal workflows behind their own app experience.

JAVASCRIPT
work: "Submit case through external portal..."

Tech-company operations

Revenue ops, finance ops, support ops, recruiting ops, and vendor ops can run on persistent workers supervised by humans.

JAVASCRIPT
worker: { mode: "persistent" }

AI-native BPO

Service businesses can replace manual portal labor with worker fleets, keeping humans on exceptions, QA, and relationships.

JAVASCRIPT
outcome: "Return queue completed and exceptions"

Commerce and concierge apps

Workers can order, book, cancel, reschedule, and pay on behalf of users with explicit approval gates.

JAVASCRIPT
guardrails: { approvals: ["payments"] }

Autonomous GTM systems

Workers research accounts, enrich CRMs, qualify leads, run outreach, follow up, and book meetings through real tools.

JAVASCRIPT
work: "Qualify leads and book meetings..."

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.