Skip to content

CLI and Runtime Endpoints

See Auth and Error Model for headers, token types, and common error semantics.

MethodPathDescription
POST/api/auth/device/startcreate device code + user code + verification URL
POST/api/auth/device/pollpoll device state; returns tokens when approved
POST/api/auth/refreshrotate user access/refresh pair
POST/api/auth/logoutrevoke user refresh token
MethodPathDescription
POST/api/auth/device/approveauthenticated user approves device code
MethodPathDescription
POST/api/runtime/bootstrap/exchangeexchange bootstrap token for runtime tokens
POST/api/runtime/auth/refreshrotate runtime access/refresh pair
POST/api/runtime/auth/revokerevoke runtime refresh token
GET/api/runtime/auth/statusauthenticated runtime identity/session status

These endpoints require runtime access tokens. Self-target operations are allowed by default. Cross-agent operations require an active delegation with matching action scope.

MethodPathDescription
POST/api/runtime/agents/:id/startstart runtime target agent machine
POST/api/runtime/agents/:id/stopstop runtime target agent machine
GET/api/runtime/agents/:id/statusread runtime target agent machine status

These endpoints require runtime access tokens.

MethodPathDescription
GET/api/runtime/updates/manifestfetch release manifest overview
GET/api/runtime/updates/scripts?path=<...>fetch update script body
POST/api/runtime/updates/checkresolve update decision for current runtime
POST/api/runtime/updates/applyrequest apply payload (requires approved=true + grant token)
POST/api/runtime/updates/reportreport applied runtime version
MethodPathDescription
POST/api/agents/:id/runtime-update-grantissue one-time grant token used by runtime apply flow
Terminal window
curl -X POST "$ROBERTO_API_URL/api/auth/device/start" \
-H "Content-Type: application/json" \
-d '{"clientName":"roberto-cli"}'

Example 200 response:

{
"deviceCode": "dev_abc123",
"userCode": "F6H9-K2Q1",
"verificationUri": "https://app.robertoagent.com/auth/device",
"verificationUriComplete": "https://app.robertoagent.com/auth/device?user_code=F6H9-K2Q1",
"expiresIn": 900,
"interval": 5,
"status": "pending"
}
Terminal window
curl -X POST "$ROBERTO_API_URL/api/auth/device/poll" \
-H "Content-Type: application/json" \
-d '{"deviceCode":"dev_abc123"}'

Pending response:

{
"status": "authorization_pending",
"interval": 5
}

Authorized response:

{
"status": "authorized",
"tokenType": "Bearer",
"accessToken": "<user_access_token>",
"accessTokenExpiresAt": "2026-02-21T12:30:00.000Z",
"refreshToken": "<user_refresh_token>",
"refreshTokenExpiresAt": "2026-03-22T12:00:00.000Z",
"userId": "user_123",
"plan": "pro"
}
Terminal window
curl -X POST "$ROBERTO_API_URL/api/runtime/bootstrap/exchange" \
-H "Content-Type: application/json" \
-d '{
"runtimeId": "runtime_123",
"bootstrapToken": "<bootstrap_token>",
"runtimeVersion": "2026.02.15"
}'

Example 200 response:

{
"tokenType": "Bearer",
"runtimeId": "runtime_123",
"agentId": "agent_123",
"userId": "user_123",
"runtimeVersion": "2026.02.15",
"accessToken": "<runtime_access_token>",
"accessTokenExpiresAt": "2026-02-21T12:30:00.000Z",
"refreshToken": "<runtime_refresh_token>",
"refreshTokenExpiresAt": "2026-03-22T12:00:00.000Z"
}
Terminal window
curl -X POST "$ROBERTO_API_URL/api/runtime/updates/check" \
-H "Authorization: Bearer $ROBERTO_RUNTIME_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"currentVersion": "2026.02.15",
"channel": "stable"
}'

Example 200 response:

{
"ok": true,
"runtimeId": "runtime_123",
"agentId": "agent_123",
"userId": "user_123",
"channel": "stable",
"currentVersion": "2026.02.15",
"targetVersion": "2026.02.20",
"updateAvailable": true,
"requiresApproval": true,
"notes": "Security update",
"scripts": [
{
"id": "step_1",
"description": "Apply runtime patch",
"path": "scripts/update-2026.02.20.sh",
"sha256": "abc123...",
"url": "https://api.robertoagent.com/api/runtime/updates/scripts?path=scripts%2Fupdate-2026.02.20.sh"
}
]
}
Terminal window
curl -X POST "$ROBERTO_API_URL/api/runtime/updates/apply" \
-H "Authorization: Bearer $ROBERTO_RUNTIME_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"approved": true,
"grantToken": "rtug_abc123",
"currentVersion": "2026.02.15",
"channel": "stable",
"targetVersion": "2026.02.20"
}'

Example 200 response:

{
"ok": true,
"runtimeId": "runtime_123",
"agentId": "agent_123",
"userId": "user_123",
"channel": "stable",
"currentVersion": "2026.02.15",
"targetVersion": "2026.02.20",
"updateAvailable": true,
"requiresApproval": true,
"notes": "Security update",
"scripts": [
{
"id": "step_1",
"description": "Apply runtime patch",
"path": "scripts/update-2026.02.20.sh",
"sha256": "abc123...",
"url": "https://api.robertoagent.com/api/runtime/updates/scripts?path=scripts%2Fupdate-2026.02.20.sh"
}
],
"approved": true,
"canExecuteRemoteScripts": true
}