API Reference

Every endpoint except /health and /setup/cloudformation-template needs an API key, sent as Authorization: Bearer YOUR_API_KEY.

Base URL

https://cloudlink-agents.onrender.com

Most endpoints have no version prefix. The /v1 endpoints are read-only views of the same data.

Authentication

Include your API key in every request:

curl -H "Authorization: Bearer YOUR_API_KEY" \
  https://cloudlink-agents.onrender.com/stats

During the pilot, API keys are issued by the Cloudlink team. Email satvikranga60@gmail.com to request one. A key only sees its own account's data.

Read-only mode

Cloudlink never changes anything in your AWS account. Endpoints that would change a resource, such as approving or running actions, AutoStop runs, and starting or stopping resources, return HTTP 403 and are not listed here.

Endpoints

MethodPathDescription
GET/healthService health check (no API key needed)
GET/setup/cloudformation-templateDownload the read-only IAM role CloudFormation template (no API key needed)
GET/statsResource count and last scan for your account
GET/credentialsList connected AWS accounts (secrets masked)
POST/credentialsAdd an AWS account: { cloud: "aws", label, role_arn, external_id, regions }
POST/credentials/:id/verifyAssume the role and return the AWS account identity
DELETE/credentials/:idRemove a connected account
POST/scanStart a scan of all connected accounts (optional body: { credential_ids: [...] })
GET/scansScan history
GET/resourcesScanned resources (?resource_type=, ?limit=, ?offset=)
POST/deploysRecord a deploy event
GET/deploysList deploy events (?service=, ?limit=)
GET/deploys/:idGet one deploy event
GET/regressionsList cost regressions (?status=open|acknowledged|resolved, ?limit=)
GET/regressions/:idGet one regression
POST/regressions/:id/acknowledgeMark an open regression as acknowledged
POST/regressions/:id/resolveMark a regression as resolved
POST/regression/runRun regression detection now
GET/cost-snapshotsHourly cost snapshots by service (?service=, ?limit=)
GET/cost-snapshots/servicesService names that have cost snapshot data
GET/budgetsList budgets with this month's spend and utilization
POST/budgetsCreate a budget: { name, monthly_limit_usd, scope, service, alert_thresholds }
PUT/budgets/:idUpdate a budget
DELETE/budgets/:idDelete a budget
GET/budgets/alertsBudget alert history (?budget_id=, ?limit=)
POST/budgets/checkCheck budgets now and send alerts (Slack, webhooks) for thresholds reached. Alerts only; nothing is blocked.
GET/webhooksList webhooks (secrets masked)
POST/webhooksRegister a webhook: { url, secret?, events? }
DELETE/webhooks/:idRemove a webhook
POST/webhooks/testSend a ping event to webhooks subscribed to ping
GET/settings/slackGet the Slack webhook setting
PUT/settings/slackSet the Slack webhook: { slack_webhook_url, enabled }
POST/settings/slack/testSend a test message to Slack
GET/v1/costsTotal cost, cost by service and daily trend from cost snapshots (?days=30)
GET/v1/regressionsRegressions (?status=)
GET/v1/resourcesScanned resources (?resource_type=)
GET/v1/deploysDeploy events (?service=, ?limit=)
GET/v1/budgetsBudgets with their most recent alerts

Response format

All responses are JSON. Successful responses return the data directly. Errors return:

{
  "detail": "Error message here"
}

Common status codes: 400 or 422 (missing or invalid field), 401 (missing or invalid API key), 403 (blocked by read-only mode), 404 (not found), 429 (rate limited).

Rate limits

These endpoints are rate-limited per Cloudlink account and return HTTP 429 when the limit is exceeded:

  • POST /scan — 5 requests per minute
  • POST /regression/run — 5 requests per minute
  • POST /credentials — 10 requests per minute

Interactive docs

Request and response schemas are in the auto-generated Swagger UI at https://cloudlink-agents.onrender.com/docs.