Scripting the Caryvane API
Everything the MCP tools do is also plain JSON over HTTPS under /mcp/…, with the same access key as a bearer token. This is the page for the person wiring Caryvane into an RMM, a dashboard or a nightly report.
Basics #
# Every call: the key as a bearer token; JSON in, JSON out.
curl -s https://console.caryvane.com/mcp/dashboard \
-H "Authorization: Bearer <key>"
GET endpoints take parameters in the query string; POST endpoints take a JSON body. Lists page with skip and take (take up to 200 on jobs and logs, 20–50 by default) and return a total and hasMore. Errors are HTTP status codes with a JSON message: 401 bad key, 403 tier too low or outside your visibility, 404 not found, 400 with the reason for a rejected create.
Examples #
Jobs that failed last night (PowerShell)
$h = @{ Authorization = "Bearer $env:CARYVANE_KEY" }
$jobs = Invoke-RestMethod "https://console.caryvane.com/mcp/jobs?take=200" -Headers $h
$jobs.jobs | Where-Object { $_.lastStatus -in 'Failed','Warning' } |
Select-Object id, name, tenantName, lastStatus, lastRunUtc, lastErrorMessage |
Format-Table -AutoSize
A job's run history, with the failed files
curl -s "https://console.caryvane.com/mcp/jobs/14/runs?take=5" -H "Authorization: Bearer $KEY" \
| jq '.runs[] | {id, status, startedUtc, filesUploaded, filesFailed, failedFiles}'
Enrol a machine from an RMM
# 1. Create a token for the customer (Full-access key)
$tok = Invoke-RestMethod -Method Post "https://console.caryvane.com/mcp/enrollment-tokens" -Headers $h `
-ContentType 'application/json' -Body (@{ name = "RMM $env:COMPUTERNAME"; expiryHours = 1; tenantId = 11 } | ConvertTo-Json)
# 2. Run the install command it hands back
Invoke-Expression $tok.installCommand
Create a nightly files job
curl -s -X POST https://console.caryvane.com/mcp/jobs -H "Authorization: Bearer $KEY" \
-H "Content-Type: application/json" -d '{
"name": "HHSRV1 shares nightly",
"agentId": 7, "storageTargetId": 11,
"sourcePaths": ["D:\\Shares"], "backupPathPrefix": "hhsrv1",
"cronSchedule": "0 2 * * *", "backupMode": "Incremental",
"useVss": true, "keepVersions": 5
}'
An agent's own log
curl -s "https://console.caryvane.com/mcp/agents/3/logs?level=warn&take=50" -H "Authorization: Bearer $KEY"
Endpoints #
The full route table, with the tool each corresponds to and the tier it needs, is on AI assistants & API. The MCP tool descriptions are the authoritative field reference for request bodies; an OpenAPI document is planned but not published yet.
Keys for scripts #
Issue a key per integration, named for it, at the lowest tier that works (a reporting script needs Read only). Keep it in the RMM's secret store or an environment variable, never in the script. Revoke it from the same dialog when the integration is retired; every call it made is in the audit trail under the owner's name.