API Guide: Working with RUAL APIs

Every cluster serves REST APIs under /api/v1. Sign in at /auth/login for an access_token, send it as a bearer header, and read errors from the error field of the JSON answer. This page covers the rules that hold for all of them.

This guide covers how to call the APIs correctly. The API reference lists every endpoint with its parameters and example responses.

A scope decides whether an API is public

Public (*public) Private (*loggedin / custom scopes)
Authentication None: anyone with the URL can call it A valid access_token is required
Default for Built-in cluster APIs marked public Everything else. Your own API has to name a scope to open at all.
Typical use Status pages, webhooks, public content Anything reading or writing cluster data

You set the audience per API block with its lock icon: *public, *loggedin (any valid token), or a custom scope you invent (for example billing_read) and then grant to selected users. A route without any scope answers 403 with ENDPOINT_NOT_PUBLIC. See Remote Access Control.

Authenticate with an access token

API calls authenticate with an access_token, obtained through the sign-in APIs. Tokens are valid for 14 days and automatically extend while actively used, so you do not need to log in again during normal operation.

The token is accepted in five equivalent locations. Pick one:

Location Example
Authorization header (recommended)Authorization: Bearer YOUR_TOKEN
x-authtoken headerx-authtoken: YOUR_TOKEN
x-token headerx-token: YOUR_TOKEN
CookieCookie: access_token=YOUR_TOKEN
Query parameter?access_token=YOUR_TOKEN (handy for browser downloads)

What a token may do is decided by the user's scopes: their custom_scopes plus those of their user groups. See User Roles & Permissions Explained. On clusters that enforce two-factor authentication, the login answer has verified: false and lists the available methods in 2fa; complete it through the verification endpoints such as /auth/totp/verify.

Requests follow four conventions

  • Base URL: https://<your-cluster>/api/v1. All endpoints live under it.
  • Content type: send and receive application/json unless an endpoint documents otherwise (file upload uses multipart/form-data).
  • Search endpoints accept Elasticsearch-style queries: term (exact match), terms (one of many), match (full-text), range (dates/numbers), plus limit and offset for pagination.
  • Documents: every stored object carries a _meta object with guid, created, updated and removal state.

Errors name a code and a status

An error returns JSON with a machine-readable code and the HTTP status. Some add a message or the fields that failed.

Error Response
{
  "code": 404,
  "error": "DOCUMENT_NOT_FOUND"
}
Status Meaning First thing to check
400Bad request: invalid body, params or fileValidate your JSON against the endpoint's parameter table.
401Unauthenticated: INVALID_ACCESS_TOKEN, or 2FA requiredIs the token present in an accepted location and not expired?
403Forbidden: token valid, scope insufficient, or ENDPOINT_NOT_PUBLICThe user's scopes against the endpoint's required scope (scoping).
404Not found: endpoint or document does not existA typo in the path; for custom APIs: is the blueprint saved and activated?
409Conflict: for example an update-hash mismatchRe-read the document and retry with the current update_hash.
422Unprocessable: validation failedThe response body names the failing rule.
429Rate limitedBack off and retry with jitter; see rate limits below.
500Server errorRetry once; if persistent, check the cluster logs in RUAL Studio.

Your endpoints fall under a baseline rate limit

An endpoint without a rate limit of its own is counted against the cluster baseline. Cluster settings named http_default_rate_limit_* can raise these, or set one to 0 to turn that tier off.

Caller Default budget Counted per
Anonymous1200 requests a minuteClient address, so everyone behind one NAT shares it
Signed in600 requests a minuteSession
Signed in, all sessionsFive times the session budgetAccount

A custom API can carry its own rate limit and a throttle (lock and wait), documented per block in Remote Access Control. When you receive a 429, retry with exponential backoff and jitter; do not retry in a tight loop.

Three calls you will use daily

Sign in to get a token

Sign in to get a token
curl -X POST "https://your-cluster.rual.dev/api/v1/auth/login" \
  -H "Content-Type: application/json" \
  -d '{"username": "you@example.com", "password": "..."}'

The response contains your access_token: reuse it for subsequent calls.

Search the storages of a cluster

Search storages
curl -X POST "https://your-cluster.rual.dev/api/v1/_system/storages/search" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -d '{"limit": 10}'

Call a custom blueprint API

Call a custom blueprint API
curl "https://your-cluster.rual.dev/api/v1/tasks?access_token=YOUR_TOKEN"

Your own endpoints registered with an on api get block behave like any other API on the cluster: same auth, same error shapes. See Build Your First API.

The endpoints you reach for most

Endpoint Method Purpose
/api/v1/auth/loginPOSTSign in, receive an access token
/api/v1/auth/logoutPOSTLog out the current user
/api/v1/users/meGETThe current user's profile
/api/v1/users/searchPOSTList and search cluster users
/api/v1/blueprints/searchPOSTList blueprints on the cluster
/api/v1/blueprints/update/set/active/{guid}PUTActivate a blueprint
/api/v1/blueprintactions/searchPOSTRead the blocks inside a blueprint
/api/v1/_system/storages/searchPOSTList storage collections
/api/v1/_system/assets/searchPOSTSearch uploaded assets
/api/v1/_system/systemlogs/searchPOSTRead cluster system logs
/api/v1/infoGETCluster version, flags and host info (public)

The full list with per-endpoint parameters, example responses and required scopes lives in the Cluster API reference.

apig endpoints
The API endpoints overview in RUAL Studio listing online endpoints
The API endpoints overview in RUAL Studio listing online endpoints

Next steps

Build Your First API Register an endpoint, reply in JSON, validate input, test with curl. Cluster API Reference Every endpoint with parameters, examples and required scopes. Remote Access Control Scopes, rate limits and throttling for your own APIs.

Frequently asked

How do I authenticate against the RUAL API?

Sign in through POST /api/v1/auth/signin to receive an access_token, then send it on every call, preferably as an Authorization: Bearer header. Tokens are valid for 14 days and extend automatically while actively used.

What is the difference between public and private RUAL APIs?

Public APIs (*public) need no authentication and default to 100 requests per second per endpoint. Private APIs require a valid access token, are rate limited per user, and have configurable limits per API. Your own APIs are private unless you open them.

What do RUAL API error responses look like?

A JSON object with the HTTP status, a machine-readable code and a message, for example {"error": "DOCUMENT_NOT_FOUND", "message": "The requested document does not exist."}. A 429 means rate limited: retry with exponential backoff and jitter, never in a tight loop.

How do RUAL search endpoints work?

They accept Elasticsearch-style queries: term for exact match, terms for one of many, match for full-text and range for dates and numbers, plus limit and offset for pagination.