Skip to content

Web Client Endpoints

All endpoints are under /api/* and use bearer auth for protected user routes. See Auth and Error Model for auth headers and common non-200 behavior.

MethodPathUsed for
GET/api/agentslist agents
POST/api/agentscreate agent
GET/api/agents/:idfetch agent detail
PATCH/api/agents/:idupdate agent fields
DELETE/api/agents/:iddelete agent
POST/api/agents/:id/provisionprovision runtime machine
POST/api/agents/:id/cloneclone existing agent
POST/api/agents/:id/startstart machine
POST/api/agents/:id/stopstop machine
GET/api/agents/:id/statusread machine state
GET/api/agents/:id/gateway-accessobtain gateway token/url
GET/api/agents/:id/runtime-update-statusruntime update decision/status
POST/api/agents/:id/runtime-update-grantissue one-time update grant
POST/api/agents/:id/connect-telegramconnect Telegram channel
POST/api/agents/:id/whatsapp-qrgenerate/retrieve WhatsApp QR
POST/api/agents/:id/whatsapp-waitwait for WhatsApp connect completion
MethodPathUsed for
GET/api/users/meload profile
PATCH/api/users/meupdate profile name/email
MethodPathUsed for
GET/api/billing/summarycurrent customer/subscription/entitlement snapshot
GET/api/billing/usage-summaryusage rollup and percentiles
POST/api/billing/checkoutopen subscription checkout
POST/api/billing/credits/checkoutbuy prepaid credits
POST/api/billing/portalopen billing portal
POST/api/billing/syncforce billing sync when billing state appears out of date
GET/api/billing/runtime-requestslist runtime spend approval requests
GET/api/billing/runtime-requests/:idget one runtime spend request
POST/api/billing/runtime-requests/:id/approveapprove runtime spend request
POST/api/billing/runtime-requests/:id/denydeny runtime spend request
GET/api/billing/runtime-spend-policies/:controllerAgentIdget controller spend policy
POST/api/billing/runtime-spend-policies/:controllerAgentIdcreate/update controller spend policy
DELETE/api/billing/runtime-spend-policies/:controllerAgentIdrevoke controller spend policy
GET/api/runtime/identitieslist owned runtime identities for delegation/update selection
GET/api/runtime/delegationslist runtime delegation grants
POST/api/runtime/delegationscreate runtime delegation grant
DELETE/api/runtime/delegations/:idrevoke runtime delegation grant

Checkout semantics:

  • Web plan changes use checkout session creation for both upgrades and downgrades.
  • The web app does not call a direct PATCH plan endpoint.
  • Success/cancel is handled by redirecting back to /settings with:
    • billing=success|cancel for subscription checkout.
    • billing=credits_success|credits_cancel for one-time credits checkout.
MethodPathUsed for
POST/api/auth/device/approveapprove CLI/MCP device code from browser
Terminal window
curl -X POST "$ROBERTO_API_URL/api/agents" \
-H "Authorization: Bearer $ROBERTO_USER_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Support Copilot",
"persona": "Helpful support specialist",
"plan": "pro"
}'

Example 201 response:

{
"id": "agent_123",
"userId": "user_123",
"name": "Support Copilot",
"persona": "Helpful support specialist",
"avatar": "",
"status": "offline",
"plan": "pro",
"flyAppName": null,
"flyMachineId": null,
"flyVolumeId": null,
"gatewayUrl": null,
"channels": {},
"capabilities": {},
"usageMessages": 0,
"usageTokensUsed": 0,
"createdAt": "2026-02-21T00:00:00.000Z",
"updatedAt": "2026-02-21T00:00:00.000Z"
}
Terminal window
curl -X POST "$ROBERTO_API_URL/api/agents/$AGENT_ID/runtime-update-grant" \
-H "Authorization: Bearer $ROBERTO_USER_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"channel": "stable",
"currentVersion": "2026.02.15"
}'

Example 200 response:

{
"ok": true,
"agentId": "agent_123",
"runtimeId": "runtime_123",
"channel": "stable",
"currentVersion": "2026.02.15",
"currentVersionSource": "runtime_identity",
"targetVersion": "2026.02.20",
"grantToken": "rtug_abc123",
"expiresAt": "2026-02-21T12:10:00.000Z",
"applyCommand": "roberto auth runtime-apply-update --approve --grant-token rtug_abc123 --target-version 2026.02.20"
}
Terminal window
curl "$ROBERTO_API_URL/api/billing/summary" \
-H "Authorization: Bearer $ROBERTO_USER_ACCESS_TOKEN"

Example 200 response:

{
"customer": {
"stripeCustomerId": "cus_123",
"defaultPaymentMethodId": "pm_123"
},
"subscription": {
"stripeSubscriptionId": "sub_123",
"stripePriceId": "price_123",
"billingMode": "standard_stripe",
"status": "active",
"currentPeriodStart": "2026-02-01T00:00:00.000Z",
"currentPeriodEnd": "2026-03-01T00:00:00.000Z",
"cancelAtPeriodEnd": false
},
"entitlement": {
"planCode": "pro",
"maxAgents": 3,
"includedMessages": 10000,
"includedTokens": 0,
"includedSearchRequestsWeekly": 2500,
"allowProvisioning": true,
"allowStartStop": true,
"updatedAt": "2026-02-21T00:00:00.000Z"
},
"credits": {
"balanceUnits": 125,
"updatedAt": "2026-02-21T00:00:00.000Z"
}
}
Terminal window
curl "$ROBERTO_API_URL/api/billing/runtime-requests?status=pending&limit=25" \
-H "Authorization: Bearer $ROBERTO_USER_ACCESS_TOKEN"

Example 200 response:

{
"requests": [
{
"id": "rsr_123",
"ownerUserId": "user_123",
"controllerAgentId": "agent_controller",
"targetAgentId": "agent_target",
"policyId": "rsp_123",
"actionType": "credits_increase",
"requestedUnits": 100,
"status": "pending",
"requestedByRuntimeId": "runtime_123",
"approvedByUserId": null,
"approvalMode": null,
"reason": "Need additional credits for escalation workflow",
"metadata": {},
"expiresAt": "2026-02-21T14:00:00.000Z",
"decidedAt": null,
"createdAt": "2026-02-21T13:00:00.000Z",
"updatedAt": "2026-02-21T13:00:00.000Z"
}
]
}
Terminal window
curl -X POST "$ROBERTO_API_URL/api/billing/runtime-spend-policies/$CONTROLLER_AGENT_ID" \
-H "Authorization: Bearer $ROBERTO_USER_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"enabled": true,
"maxSingleUnits": 200,
"maxDailyUnits": 2000,
"maxMonthlyUnits": 10000,
"allowedActionTypes": ["credits_increase"]
}'

Example 200 response:

{
"ok": true,
"policy": {
"id": "rsp_123",
"ownerUserId": "user_123",
"controllerAgentId": "agent_controller",
"enabled": true,
"maxSingleUnits": 200,
"maxDailyUnits": 2000,
"maxMonthlyUnits": 10000,
"allowedActionTypes": ["credits_increase"],
"expiresAt": null,
"createdByUserId": "user_123",
"revokedAt": null,
"createdAt": "2026-02-21T13:00:00.000Z",
"updatedAt": "2026-02-21T13:00:00.000Z"
}
}
Terminal window
curl "$ROBERTO_API_URL/api/runtime/identities?includeRevoked=false&limit=50" \
-H "Authorization: Bearer $ROBERTO_USER_ACCESS_TOKEN"

Example 200 response:

{
"identities": [
{
"id": "runtime_123",
"agentId": "agent_controller",
"status": "active",
"runtimeReleaseVersion": "2026.02.21",
"revokedAt": null,
"createdAt": "2026-02-20T10:00:00.000Z",
"updatedAt": "2026-02-21T14:45:00.000Z",
"isActive": true
}
]
}
Terminal window
curl -X POST "$ROBERTO_API_URL/api/runtime/delegations" \
-H "Authorization: Bearer $ROBERTO_USER_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"runtimeId": "runtime_123",
"ttlSeconds": 600,
"scope": {
"actions": ["runtime:billing:credits_increase"],
"targetAgentIds": ["agent_target"]
}
}'

Example 201 response:

{
"ok": true,
"delegation": {
"id": "rdg_123",
"runtimeId": "runtime_123",
"issuedByUserId": "user_123",
"scope": {
"actions": ["runtime:billing:credits_increase"],
"targetAgentIds": ["agent_target"]
},
"expiresAt": "2026-02-21T15:00:00.000Z",
"revokedAt": null,
"createdAt": "2026-02-21T14:50:00.000Z",
"isActive": true
}
}