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
| Method | Path | Description |
|---|---|---|
| GET | /health | Service health check (no API key needed) |
| GET | /setup/cloudformation-template | Download the read-only IAM role CloudFormation template (no API key needed) |
| GET | /stats | Resource count and last scan for your account |
| GET | /credentials | List connected AWS accounts (secrets masked) |
| POST | /credentials | Add an AWS account: { cloud: "aws", label, role_arn, external_id, regions } |
| POST | /credentials/:id/verify | Assume the role and return the AWS account identity |
| DELETE | /credentials/:id | Remove a connected account |
| POST | /scan | Start a scan of all connected accounts (optional body: { credential_ids: [...] }) |
| GET | /scans | Scan history |
| GET | /resources | Scanned resources (?resource_type=, ?limit=, ?offset=) |
| POST | /deploys | Record a deploy event |
| GET | /deploys | List deploy events (?service=, ?limit=) |
| GET | /deploys/:id | Get one deploy event |
| GET | /regressions | List cost regressions (?status=open|acknowledged|resolved, ?limit=) |
| GET | /regressions/:id | Get one regression |
| POST | /regressions/:id/acknowledge | Mark an open regression as acknowledged |
| POST | /regressions/:id/resolve | Mark a regression as resolved |
| POST | /regression/run | Run regression detection now |
| GET | /cost-snapshots | Hourly cost snapshots by service (?service=, ?limit=) |
| GET | /cost-snapshots/services | Service names that have cost snapshot data |
| GET | /budgets | List budgets with this month's spend and utilization |
| POST | /budgets | Create a budget: { name, monthly_limit_usd, scope, service, alert_thresholds } |
| PUT | /budgets/:id | Update a budget |
| DELETE | /budgets/:id | Delete a budget |
| GET | /budgets/alerts | Budget alert history (?budget_id=, ?limit=) |
| POST | /budgets/check | Check budgets now and send alerts (Slack, webhooks) for thresholds reached. Alerts only; nothing is blocked. |
| GET | /webhooks | List webhooks (secrets masked) |
| POST | /webhooks | Register a webhook: { url, secret?, events? } |
| DELETE | /webhooks/:id | Remove a webhook |
| POST | /webhooks/test | Send a ping event to webhooks subscribed to ping |
| GET | /settings/slack | Get the Slack webhook setting |
| PUT | /settings/slack | Set the Slack webhook: { slack_webhook_url, enabled } |
| POST | /settings/slack/test | Send a test message to Slack |
| GET | /v1/costs | Total cost, cost by service and daily trend from cost snapshots (?days=30) |
| GET | /v1/regressions | Regressions (?status=) |
| GET | /v1/resources | Scanned resources (?resource_type=) |
| GET | /v1/deploys | Deploy events (?service=, ?limit=) |
| GET | /v1/budgets | Budgets 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 minutePOST /regression/run— 5 requests per minutePOST /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.