API

Endpoints

Paths are under https://app.ridgelinehost.com. {name} is a resource's name or id.

Account and projects

endpoint what it does
GET /api/v1 every endpoint, described. Needs no token
GET /api/v1/me the token's scope (project, workspace or personal) and role; the workspace, the projects this token reaches, services used and the limit across every project (plan.services; a limit of null means none) and whether resources can be created (plan.canCreateResources: branch on this one). A personal token that names nothing gets workspaces instead: each with its role and projects
GET /api/v1/projects the projects this token reaches (a personal token naming nothing: all of them, each with its workspace)
POST /api/v1/projects create one — {"name":"my-app"}; workspace tokens only (403 workspace_token_only), 409 taken on a name in use
GET /api/v1/activity?limit=50 the audit trail (a workspace token: the whole workspace; a project token: its project): who did what and when — a teammate, an API token, a push, billing — with a one-line summary per row. Values are never in it, only what changed

Resources

endpoint what it does
GET /api/v1/resources every resource with live container state
POST /api/v1/resources create one (fields below)
GET /api/v1/resources/{name} one resource, with its recent deploys
PATCH /api/v1/resources/{name} change it (fields below)
DELETE /api/v1/resources/{name} destroy it (a database keeps its volume)
POST /api/v1/resources/{name}/lifecycle {"action":"start"|"stop"|"restart"}
POST /api/v1/stacks create several at once, at most ten a call
POST /api/v1/pause / POST /api/v1/resume stop every running service of the project for a while, and start them again. Data and settings stay and billing continues. While paused, its addresses show a page saying the site is paused (503), nothing deploys (a push is skipped, not queued) and no service can be started or added (409 paused). GET /api/v1/resources carries paused: {paused, since}
GET/POST /api/v1/sync whether what runs matches what is saved (applied, error, since — GET /resources carries the same as sync), and push the saved settings again once the cause is fixed

Fields when creating (POST /api/v1/resources, and each entry of /stacks):

field what it is
name required: lowercase letters, digits and hyphens
source repo, image, database, job or empty. Left out: image if you sent an image, repo if you sent a repoUrl, otherwise empty
engine a database's engine: postgres (the default) or redis
repoUrl the repository's https URL
repoFullName owner/repo, when the repository comes through your GitHub App connection
image a prebuilt image, e.g. ghcr.io/you/app:1.4.2
branch the branch to build and track
dockerfile the Dockerfile's path, if it isn't at the root
startCommand overrides the image's CMD
registryAuth {server, username, password} for a private image; never returned
http an app: omitted or true is public at once, false is private with its address reserved
schedule / scheduleTz a job's five-field cron and IANA time zone (default UTC)
volume {"mountPath": "/app/data"}, an app's persistent folder
variables {KEY: value}, on /stacks only

Fields when changing (PATCH /api/v1/resources/{name}), each optional:

field what it does
repoUrl, repoFullName, branch, dockerfile, startCommand, image, schedule, scheduleTz as when creating
autoDeploy true or false: deploy on every push to the branch
deployToken a fine-grained token for a private repository, instead of the GitHub App; never returned
registryAuth new credentials, or null to forget them
public true puts an app online, false takes it off and keeps the address reserved (409 custom-domains while it has any)
domain rename its address: "shop" or the whole hostname (409 taken)
addressOff true answers only on its custom domains (409 no-active-domain until one is Active)
volume {"mountPath": "/app/data"} to attach or move, null to detach. The files stay

Deploys

endpoint what it does
POST /api/v1/resources/{name}/deploy build and release now — 202 {deployId, status: "queued"}. While one is already running it answers status: "waiting": it starts by itself when that one finishes, and more pushes or calls meanwhile fold into the same deploy (the branch's newest commit is built)
GET /api/v1/resources/{name}/deploys deploy history, with the error when one failed
GET /api/v1/resources/{name}/deploys/{deployId} one deploy: status (waiting · queued · building · live · failed), commitSha, error, logTail — what to poll after a deploy
POST /api/v1/resources/{name}/deploys/{deployId|current}/cancel stop a running build — the previous version keeps running; it lands in the history as failed, "Cancelled by …". current takes a waiting deploy first, cancelled at once (status: "cancelled")
POST /api/v1/resources/{name}/deploys/{deployId}/rollback put an earlier live deploy's build back, no rebuild (the host keeps the last few builds; an older one answers 202 and the new deploy then shows failed with the reason). 202 with a new deploy id; poll GET …/deploys — the new row's rollbackOf names the one it restored

Creating a repo-backed resource starts a build immediately. Its response has no deploy id, so poll GET /api/v1/resources/{name}/deploys until the newest is live or failed. After POST …/deploy, poll GET /api/v1/resources/{name}/deploys/{deployId}. Read error / logTail when one fails. A deploy asked for while another runs is waiting, not failed — don't retry it; it starts on its own. A build is only stopped by the platform after ten minutes of silence; a cold rebuild (the base image moved upstream, so every layer is rebuilt) can run well past that while still printing, and is not stuck. One build can run for 60 minutes at most. To stop one yourself, POST …/deploys/current/cancel — the previous version keeps running.

Scheduled jobs

endpoint what it does
GET /api/v1/resources/{name}/runs a job's run history (status, exit code, duration) and whether one is running now
POST /api/v1/resources/{name}/runs run it now — 202 with the run; 409 while one is in progress or before its first build
POST /api/v1/resources/{name}/runs/stop kill the run in progress
GET /api/v1/resources/{name}/runs/{runId}/log one run's output as text

Variables

endpoint what it does
GET/PUT/PATCH /api/v1/resources/{name}/variables read, replace, or merge variables: {"variables": {"KEY": "value"}}. PUT replaces the WHOLE set
DELETE /api/v1/resources/{name}/variables?key=K remove one

Custom domains

endpoint what it does
GET/POST /api/v1/resources/{name}/domains its custom domains, with the DNS records to create — or add one, {"hostname":"app.example.com"}
DELETE /api/v1/resources/{name}/domains/{hostname} remove a custom domain (a record Ridgeline moved is put back)
POST /api/v1/resources/{name}/domains/{hostname}/point move the domain's live record (in your connected Cloudflare) here now — it happens by itself once the domain is proven and the resource answers

Logs, metrics and advisories

endpoint what it does
GET /api/v1/resources/{name}/logs?tail=200 container output (the current container, live)
GET /api/v1/resources/{name}/logs/history?limit=1000&q= retained output: the host keeps ~20 MB per resource on disk across restarts and deploys, every line timestamped; q filters, oldest says how far back it reaches
GET /api/v1/resources/{name}/metrics one live sample: CPU %, memory vs limit, network + disk I/O counters, PIDs, restarts, uptime, health, database volume size
GET /api/v1/resources/{name}/metrics/history?range=6h the stored series — 1h, 6h, 24h or 7d, each bucket carrying both the average and the peak
GET /api/v1/usage the same for every resource, with the project's totals and the per-container limits
GET /api/v1/resources/{name}/advisories security advisories in the service's own dependencies, the open ones, each with fixedIn; every resource in GET /api/v1/resources carries advisories: {open, high, checkedAt}

Alerts

endpoint what it does
GET /api/v1/incidents resources that were down, crash-looping, unhealthy or not answering; open ones have closedAt null (?limit=)
GET/PUT /api/v1/alerts the project's alerts: {"webhookUrl": "https://…"} ("" clears), {"emails": ["a@x.com"]}, with {"emailsPaused": ["a@x.com"]} to keep an address listed but send it nothing (left out, what was paused stays paused), and {"rules": {"service-limit": {"threshold": 70}, "deploy-failed": {"on": false}}}, or {"rules": null} to go back to the defaults, and {"autoRestart": false} to stop restarting a service whose health check keeps failing (true turns it back on)
POST /api/v1/alerts/test send one test event to the webhook
GET/PUT /api/v1/workspace/alerts the default rules every project follows and who hears about all of them: {"rules"}, {"emails"}, {"webhookUrl"}. An owner's or admin's workspace token (403 workspace_token from a project token)

Backups

endpoint what it does
GET /api/v1/resources/{name}/backups a database's dumps, newest first, plus the last backup/restore job
POST /api/v1/resources/{name}/backups take one now; 202 with a job, poll GET until job.status is done
GET /api/v1/resources/{name}/backups/{file} download it: 302 to a single-use link good for 60 s (curl -L -o app.dump …)
POST /api/v1/resources/{name}/backups/{file}/restore put it back as the live database — body {"confirm":"<name>"}; restored into a copy and checked before the swap, the previous database kept as app_pre_restore; everything written since the dump is lost; 202 + a job

Something wrong or missing here? Tell us and a person will answer.