The public API
Everything the dashboard, the CLI and the MCP server do is a call to this API. This page has the basics; every route, one by one, is in the groups below, generated from the OpenAPI file.
Base URL#
export KEY=chk_live_…
curl -H "Authorization: Bearer $KEY" https://api.ibel.ai/v1/whoamiEvery route is under https://api.ibel.ai/v1, except the MCP server at /mcp. Requests and responses are JSON, except where a route says otherwise (file and build uploads, the live log). Unknown fields are ignored.
Credentials#
| Credential | Form | Made by | Lifetime |
|---|---|---|---|
| API key | chk_live_<id>_<secret> · chk_test_… | the dashboard, cloudhost keys create, cloudhost login | until revoked or expired; shown once |
| Session | chs_<id>_<secret> | signing in to the dashboard | 12 hours idle, 30 days at most |
Send the credential as Authorization: Bearer …. Both kinds work on every route, except routes that need a session (403 session_only). A missing, invalid, expired or revoked credential gets 401 unauthorized.
Roles and step-up#
Every key and every team member has one role: owner, admin, developer, billing or viewer; the table is in Teams and roles. Each route in the reference says which roles may call it.
Sensitive routes called with a dashboard session need a second factor confirmed in the last 10 minutes, or they return 403 step_up_required. API keys pass.
Errors#
{"error": {"code": "not_found", "message": "no function named shop"}}code is stable and meant for programs; message is for people and may change. Another team's resources are never shown: 404 not_found, as if they did not exist.
| Status | Code | When |
|---|---|---|
| 400 | bad_json · bad_param · bad_input | the body is not JSON, a query parameter is malformed, or another value is |
| 401 | unauthorized | no valid credential |
| 403 | forbidden · session_only · step_up_required | the role cannot, a session is needed, or step-up |
| 404 | not_found | no such route, or no such resource in this team |
| 405 | method | the path exists, the method does not |
| 413 | too_large | the body is over the route's limit |
| 429 | rate_limited · resend_wait | over a limit (sign-in, step-up, invites, device login) |
| 500 | internal | an unexpected failure |
Money, times and periods#
- Every amount is integer rials (
currency: "IRR"). 1 toman = 10 rials. - Times are ISO 8601 in UTC (
2026-11-04T09:30:00.000Z). - Billing periods are Jalali months,
YYYY-MM(for example1405-08), from midnight Tehran time on the first. - Every response carries a
cloudhost-versionheader with the API version.
Lists and limits#
Lists have no cursor pagination yet: they return everything, or the newest entries up to a fixed number.
| List | Returns |
|---|---|
| versions | newest 100 |
| builds | newest 50 |
| build log | 1000 lines per call; after for more |
| logs | limit 1–1000 (default 100) |
| audit | limit 1–500 (default 100) |
| wallet transactions | newest 200 |
| alert events | newest 50 |
Names and addresses#
Functions, apps, databases, caches and branches are named with one DNS label: lowercase letters, digits and hyphens, 1–63 characters, starting and ending with a letter or digit, with no -- (it separates a branch from a name). Buckets are the same with 3–63 characters. Names are unique across the platform; a name another team holds gets 409 name_taken.
| Resource | Address |
|---|---|
| Function | https://<name>.fn.trustpage.ir |
| App | https://<name>.app.trustpage.ir |
| Preview | https://<branch>--<name>.app.trustpage.ir (or .fn.trustpage.ir) |
| Database | <db>.database.trustpage.ir:5432, user app, database <db>; a branch: <branch>--<db> |
| Cache | <name>.cache.trustpage.ir:6379 and https://<name>.cache.trustpage.ir |
| Storage | https://storage.trustpage.ir, region us-east-1 |
Reference groups
- Account and keys9 routesThe calling credential, API keys and the audit log.
- Sign-in and sessions33 routesPasswordless sign-in, sign-up, sessions, second factors, step-up and device login.
- Teams22 routesPeople, roles, invites and shared teams.
- Onboarding11 routesThe first-run flow, the team's getting-started steps and each project's production checklist.
- Functions63 routesWeb-standard functions at <name>.fn.trustpage.ir. Same routes as Apps.
- Apps58 routesStatic sites with an optional function at <name>.app.trustpage.ir. Same routes as Functions, plus static files.
- Domains5 routesCustom domains with automatic HTTPS, across the team's apps and functions.
- Databases10 routesServerless SQL databases with branches and restore to a point in time.
- Caches16 routesServerless caches for any cache client and over HTTP.
- Storage6 routesBuckets for any storage client, and the team's storage key.
- Alerts4 routesAlert rules on app and function metrics.
- Support7 routesSupport cases: ask the platform's support team, follow their answers.
- Notifications6 routesThe notification centre and each person's notification settings.
- Billing15 routesPlans, the rial wallet, top-ups, usage, invoices and tax details. Amounts in rials.
- MCP2 routesThe MCP server for AI agents.
- Queues25 routesQueues, background jobs and schedules. Send from a function binding or the REST API; a function, a URL (signed with the Standard Webhooks headers) or a pull client consumes. Retries with backoff, a dead-letter queue, cron schedules. Delivery is at least once.
- Connected repositories19 routesGitHub and GitLab connections; projects built from a repository on every push, with previews, commit statuses and pull request comments.
- Webhooks11 routesSigned POSTs to your endpoint for events of a team or project. Pro feature.
- Log export8 routesSend a project's or team's logs to your endpoint over HTTPS or syslog over TLS. Pro feature.
- Traces2 routesRequest traces: a waterfall of the function, database, cache and fetch spans of one request.
- Image resizing5 routesResize, crop and convert an app's images at /_img (and Next.js's /_next/image) from its own files or allowed https hosts; results cached per team; transformations billed per 1,000.
- Feature flags59 routesFlags per project with boolean, string, number and JSON values, variants per environment and preview branch, targeting rules, sticky percentage rollouts, a kill switch and history with rollback. Read inside a function as
env.FLAGS, or over REST with a read-only token. - Deployment protection and releases36 routesProtect previews (and production) with team sign-in or a password, shareable links and a bypass token for automation; deploy without promoting, promote, gradual releases with an automatic stop; version skew protection.
- Web analytics and speed insights13 routesWeb analytics and speed insights per project: visitors, page views, top lists and Web Vitals from real visitors, with no cookies and no personal data kept. Pro feature.
- Secrets31 routesSecrets per environment with versions and rollback, project tokens (
Bearer chsm_…), restricted projects, an audit trail, rotation reminders, usage, and links that give a function or appenv.SECRETSwith no network call. Values are encrypted at rest with a key per team. - Firewall18 routesA firewall per project, run by the edge servers before the code: always-on flood and malformed-request protection, and custom rules on address, country, method, path, host and headers that deny, allow, log or rate limit. Checks are free; stopped requests are not billed.
- Platform status9 routesThe status of the platform itself (not your projects), as on the status page; checked every minute. Incidents and maintenance, history, RSS and Atom, and subscriptions by email or SMS. No key needed.
- Access groups17 routes