# Dispra Docs > Guides, the API reference and the CLI for building on Dispra. Start with Dispra Cloud: deploy, scale and configure your services from your own code, CI and tools. Source: https://docs.dispralabs.com/ · index: https://docs.dispralabs.com/llms.txt --- # Dispra Docs Guides, the API reference and the CLI for building on Dispra. Start with Dispra Cloud: deploy, scale and configure your services from your own code, CI and tools. - [Quickstart](https://docs.dispralabs.com/guides/quickstart.md) - [Install the CLI](https://docs.dispralabs.com/guides/install-the-cli.md) - [API reference](https://docs.dispralabs.com/api/export-the-environment.md) API base URL: `https://devapi.dispralabs.com` ## Example: deploy.sh ### Dispra Cloud CLI ```bash dcloud deploy api dcloud logs api ``` ### cURL ```bash curl https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/deployments \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"action":"deploy"}' ``` ### Node ```typescript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/deployments", { method: "POST", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json", }, body: JSON.stringify({ action: "deploy" }), }); console.log((await res.json()).data); ``` ### Python ```python import uuid, requests res = requests.post("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/deployments", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}, json={"action": "deploy"}) print(res.json()["data"]) ``` ## Products - **[Cloud](https://docs.dispralabs.com/objects/the-apply-result-object.md)**: Dispra Cloud: deploy and run services. Projects, environments, deployments, logs, config as code, variables, networking, volumes and webhooks. ## Get started - [Quickstart](https://docs.dispralabs.com/guides/quickstart.md) - [Authentication](https://docs.dispralabs.com/guides/authentication.md) - [Environment keys](https://docs.dispralabs.com/guides/environment-keys.md) - [Install the CLI](https://docs.dispralabs.com/guides/install-the-cli.md) ## Concepts - [Requests and responses](https://docs.dispralabs.com/guides/requests-and-responses.md) - [Idempotent requests](https://docs.dispralabs.com/guides/idempotent-requests.md) - [Rate limits](https://docs.dispralabs.com/guides/rate-limits.md) - [Errors](https://docs.dispralabs.com/errors.md) ## Guides - [AI agents](https://docs.dispralabs.com/guides/use-dispra-with-ai-agents.md) - [CI and sandboxes](https://docs.dispralabs.com/guides/sign-in-from-ci-and-sandboxes.md) - [Streaming logs](https://docs.dispralabs.com/guides/streaming-logs.md) - [Webhooks](https://docs.dispralabs.com/guides/webhooks.md) - [Variables and references](https://docs.dispralabs.com/guides/variables-and-references.md) - [dispra.yaml](https://docs.dispralabs.com/guides/config-as-code-dispra-yaml.md) --- *Guides › Get started* # Quickstart 5 min · 5 steps · Languages: curl, node, python Deploy a service of your project from your own code in five minutes: create a key, check it works, start a deployment and follow it until it is live. Prefer a terminal? [Install the CLI](https://docs.dispralabs.com/guides/install-the-cli.md) and run `dcloud deploy api --wait`. ## 1. Create a key On the dashboard, open your project, then **Project settings > Developer > Keys** and create a key. Choose `deploy` access for this guide (it can read and deploy, nothing else). The secret is shown once, starting with `dsp_live_`. Keep it in your secrets manager or CI variables, never in code. Note the **project id** (`prj_...`) shown on the same page. ## 2. Check the key Read your project. Every request sends the key as a bearer token. ### cURL ```bash curl https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra", { headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); const { data } = await res.json(); console.log(data.name, data.environments); ``` ### Python ```python import requests res = requests.get("https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}) print(res.json()["data"]) ``` ## 3. Find your service List the services of an environment. The project's `environments` and **List environments** give you the environment ids. ### cURL ```bash curl https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/services \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/services", { headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); const { data } = await res.json(); for (const s of data.services) console.log(s.name, s.svc, s.dep_state); ``` ### Python ```python import requests res = requests.get("https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/services", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}) for s in res.json()["data"]["services"]: print(s["name"], s["svc"], s["dep_state"]) ``` ## 4. Deploy Start a deployment. Every write carries an `Idempotency-Key`: if the request times out, send it again with the same key and you get the first answer back, never a second deployment. ### cURL ```bash curl https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/deployments \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"action":"deploy"}' ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/deployments", { method: "POST", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json", }, body: JSON.stringify({ action: "deploy" }), }); const { data } = await res.json(); console.log(data.dep, data.state); // queued ``` ### Python ```python import uuid, requests res = requests.post("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/deployments", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}, json={"action": "deploy"}) print(res.json()["data"]["dep"]) ``` ## 5. Follow it until it is live Stream the deployment's build log. The stream ends with `event: end` and the final state: `live`, or `failed` (the version that was live keeps serving). You can also poll **Get a deployment**, or receive the `deploy.succeeded` webhook event. ### cURL ```bash curl -N https://devapi.dispralabs.com/v1/cloud/deployments/dep_01jdk4p7q9w1e3r5t7y9u1i3ob/logs/stream?kind=build \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Accept: text/event-stream" ``` ## Next steps Next: read **Authentication** to choose the right access level, and **Webhooks** to hear about deployments without polling. To let Claude Code, Codex or Cursor deploy and fix your services, read [Use Dispra with AI agents](https://docs.dispralabs.com/guides/use-dispra-with-ai-agents.md). --- *Guides › Get started* # Install the CLI 3 min · 6 steps · Languages: dcloud `dcloud` is the Dispra Cloud CLI: deploy, follow logs, set variables, manage domains and apply `dispra.yaml` from your terminal, your CI and your AI coding agents. It runs on macOS, Linux and Windows, on Intel and ARM. ## 1. Install it On macOS or Linux, use Homebrew or the install script. The script downloads the latest release for your system, checks it against the release's `checksums.txt`, and puts `dcloud` in `/usr/local/bin` (or `~/.local/bin` when that isn't writable). ### Install (Homebrew) ```bash brew install prethmhq/tap/dcloud ``` ### Install (Install script) ```bash curl -fsSL https://dispralabs.com/downloads/dcloud-cli.sh | sh ``` ### Dispra Cloud CLI ```bash brew install prethmhq/tap/dcloud ``` ## 2. Choose the version or the folder The install script reads two variables: - `DCLOUD_VERSION` installs that version instead of the latest, for example `0.2.1`. - `DCLOUD_INSTALL_DIR` installs into that folder. Make sure it is on your `PATH`. Pin the version in CI, so a new release never changes a build by surprise. ### Dispra Cloud CLI ```bash curl -fsSL https://dispralabs.com/downloads/dcloud-cli.sh | DCLOUD_VERSION=0.2.1 sh curl -fsSL https://dispralabs.com/downloads/dcloud-cli.sh | DCLOUD_INSTALL_DIR=$HOME/bin sh ``` ## 3. On Windows Download `dcloud_windows_amd64.zip` (or `dcloud_windows_arm64.zip` on ARM) from the [latest release](https://github.com/PrethmHQ/dispra-cli/releases/latest) on GitHub, unzip it, and put `dcloud.exe` in a folder on your `PATH`. Each release lists the SHA-256 of every file in `checksums.txt`. ## 4. Check it works `dcloud --version` prints the version; `dcloud help` lists every command, and `dcloud -h` shows a command's flags. ### Dispra Cloud CLI ```bash dcloud --version # dcloud 0.2.1 dcloud help ``` ## 5. Sign in and link a folder `dcloud login` opens your browser to sign in (in a terminal without a browser, it prints a code and an address to open elsewhere). Then link the folder of your code to a project and an environment: `dcloud link` writes `.dcloud/`, which keeps itself out of git. Commands run in that folder, or any folder under it, use the link; `--project` and `--env` override it. Where no one can sign in, such as CI or an agent's sandbox, set `DCLOUD_TOKEN` instead: see [Sign in from CI and sandboxes](https://docs.dispralabs.com/guides/sign-in-from-ci-and-sandboxes.md). ### Dispra Cloud CLI ```bash dcloud login dcloud link dcloud status dcloud deploy api --wait ``` ## 6. Upgrade With Homebrew, `brew upgrade dcloud`. With the script, run it again: it replaces the binary in place. On Windows, download the new zip. Releases are listed on [GitHub](https://github.com/PrethmHQ/dispra-cli/releases). ### Dispra Cloud CLI ```bash brew upgrade dcloud # or curl -fsSL https://dispralabs.com/downloads/dcloud-cli.sh | sh ``` ## Next steps Next: let your coding agent use it: [Use Dispra with AI agents](https://docs.dispralabs.com/guides/use-dispra-with-ai-agents.md). --- # Authentication Every request is authenticated with a **project key**, sent as a bearer token: ```text Authorization: Bearer dsp_live_8Kq2Xa9vT3mQ7rW1yN5bC0dF4gH6jK2p ``` **Creating a key.** A project admin creates keys on the dashboard: **Project settings > Developer > Keys**. The secret is shown once, when the key is created or regenerated; only a hash is stored, so it can't be shown again. Production keys start with `dsp_live_`; keys of the development environment of Dispra start with `dsp_dev_`. **What a key reaches.** A key belongs to **one project**, and optionally to **one environment** of it. It reaches everything inside: environments, services, deployments, logs, variables, volumes, domains, webhooks and shells. Creating and transferring projects, people, billing and workspace settings stay on the dashboard; those routes answer `404 not_available_with_key`. **Access levels.** | Access | What it can do | |---|---| | `read` | Every read in scope, including log and event streams. Revealing a secret value counts as a change, so `read` can't. | | `deploy` | Everything `read` can, plus deploying, redeploying, rolling back, cancelling, restarting, stopping and starting services. | | `full` | Everything a project admin can do in scope: create, change and delete environments, services, volumes, variables, domains and webhooks, open shells, apply dispra.yaml. | **A key acts as its creator.** Its effective rights are the lower of its access level and its creator's current role in the project. If the creator is demoted, the key can do less at once; if they leave the workspace, the key stops working (`403 key_creator_gone`). Create keys from an account that will stay. **Regenerating and revoking.** Regenerating gives a new secret and stops the old one at once. Revoking stops the key for good. When a project moves to another workspace, all its keys are revoked. > Keep keys out of source control and browser code. Use one key per system (CI, a script, an integration), so you can revoke one without breaking the others, and give each the lowest access it needs. --- # Environment keys A key can be limited to one environment when it is created. Use one for a CI job that should only ever touch staging. An environment key: - sees only its environment: **List environments** and **Get a project** show only that one; - creates services only in its environment; - gets `404 not_found` for anything in another environment: services, deployments, logs, variables, volumes, domains; - reads project logs and activity filtered to its environment. Everything else works as for a project key, with the same access levels. --- *Guides › Concepts* # Idempotent requests 3 min · 3 steps · Languages: curl, node, python Networks fail. A request can time out after the server did the work, and retrying it blindly could deploy twice or create two services. Every write (`POST`, `PUT`, `PATCH`, `DELETE`) therefore carries an **Idempotency-Key**. ## 1. Send a key with every write Use a new random value, 8 to 128 characters, for each new operation; a UUID is ideal. A write without one is refused with `400 idempotency_key_required`. ### cURL ```bash curl https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/restart \ -X POST \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: 9f1c2b7e-4a63-4d1e-8f0a-2c5b7e9d1a34" ``` ## 2. Retry with the same key Sending the same key again with the same request returns the **first answer**, status and body, without doing the work again. Keys are kept for 24 hours. - The first request is still running: `409 request_in_progress` with `Retry-After: 1`. Wait and retry. - The same key with a different request: `422 idempotency_key_reused`. Use a new key. ## 3. Retry the right errors Retry `429`, `502`, `503` and `504` with backoff, honouring `Retry-After`, and always with the same Idempotency-Key. Don't retry other `4xx` errors unchanged: they will fail the same way. --- # Requests and responses **Base URL.** `https://devapi.dispralabs.com/v1/cloud`. Every request is HTTPS. **JSON in and out.** Send JSON bodies with `Content-Type: application/json`; bodies are at most 1 MiB (`413 payload_too_large`). A success answers `{"data": ...}`. An error answers `{"error": {"code", "message", "request_id"}}`: `code` is stable and meant for your code, `message` is for people and may change. **Request ids.** Every response carries `X-Request-Id`, also in error bodies and the key's call log. Quote it when you contact support. **Ids.** Objects have short prefixed ids: `prj_` projects, `env_` environments, `svc_` services, `dep_` deployments, `vol_` volumes, `bkp_` backups, `dom_` domains and endpoints, `grp_` groups, `whk_` webhooks, `evt_` events. **Times.** Timestamps are Unix seconds or RFC 3339, as each field says. **Long operations** answer at once with the object in its current state: a deployment `queued`, a volume `creating`. Follow them by reading the object, streaming, or with webhooks. **Changing settings safely.** Service settings carry a `generation`. Send it back as `base_generation`: if someone changed the settings since you read them, the change is refused with `409 stale_generation`, so you never overwrite what you haven't seen. **Destructive routes** need `confirm: true` in the body (`400 confirm_required` without it). **Pagination.** Lists answer a page and `next_cursor`. Pass it as `cursor` for the next page; an empty `next_cursor` is the last page. `limit` sets the page size. --- # Rate limits Each key has its own bucket of requests per minute: by default 600 for `full`, 60 for `deploy` and 300 for `read`. A project admin can change it. Every answer carries: | Header | Meaning | |---|---| | `X-RateLimit-Limit` | The key's limit per minute | | `X-RateLimit-Remaining` | Requests left in the bucket | | `X-RateLimit-Reset` | Seconds until the bucket is full again | Over the limit, the answer is `429 rate_limited` with `Retry-After` in seconds: wait that long, then retry. A stream counts as one request, when it opens. Refused and rate-limited calls appear in the key's call log too, so a client stuck retrying is easy to spot. --- *Guides › Guides* # Use Dispra with AI agents 6 min · 7 steps · Languages: dcloud Claude Code, Codex, Cursor and other coding agents can deploy your services, read the logs of a failed deployment, fix the code and deploy again. They do it through `dcloud`, which is built for them: JSON output, exit codes that say when a person must act, and no prompts that would hang an agent. ## 1. Install the CLI where the agent runs On your own machine, install `dcloud` once and every agent you run there can use it (see [Install the CLI](https://docs.dispralabs.com/guides/install-the-cli.md)). In a cloud sandbox, such as Codex cloud, Claude Code on the web or a CI runner, add the install script to the environment's setup. ### Install (Homebrew) ```bash brew install prethmhq/tap/dcloud ``` ### Install (Install script) ```bash curl -fsSL https://dispralabs.com/downloads/dcloud-cli.sh | sh ``` ### Dispra Cloud CLI ```bash brew install prethmhq/tap/dcloud ``` ## 2. Sign in **On your own machine**, sign in once with `dcloud login` in your terminal, and agents you run there use your sign-in, in the projects you can reach. An agent that finds you signed out runs `dcloud login --json` itself: it answers exit code 2 with a link and a code, which the agent shows you. Open the link, allow the device, and tell the agent, which runs `dcloud login --json` again to finish. **In a sandbox without a browser**, such as Codex cloud, Claude Code on the web or CI, nobody can sign in. Make a project developer key and set it as the sandbox's `DCLOUD_TOKEN` secret. Give it the least access that works: `read` for an agent that only looks into failures, `deploy` for one that deploys, and `full` only when it must change variables, domains or `dispra.yaml`. Limit it to a non-production environment such as `staging`, so a mistake can't reach production. [Sign in from CI and sandboxes](https://docs.dispralabs.com/guides/sign-in-from-ci-and-sandboxes.md) shows how. ### Dispra Cloud CLI ```bash # your machine dcloud login # a sandbox or CI: a secret, never in the repository export DCLOUD_TOKEN=dsp_live_... dcloud link --project prj_01jdk3m9x2v7c4q8w5n6b1t0ra --env staging ``` ## 3. Write the instructions into your repository `dcloud agents` writes what an agent needs to know into the repository: how to call `dcloud`, how to read a refusal, the deploy loop, variables, domains, `dispra.yaml`, what never to run on production without asking, and the project and environment the folder is linked to. It writes a block to `AGENTS.md`, the file Codex, Cursor and most agents read. When the repository has a `CLAUDE.md`, or with `--claude`, it adds `@AGENTS.md` to it, so Claude Code reads the same block. The block sits between `` and ``: run `dcloud agents` again after linking another environment or upgrading, and it replaces the block and leaves the rest of the file alone. Commit the files. `dcloud agents --print` writes the block to stdout instead, to paste it elsewhere. ### Dispra Cloud CLI ```bash dcloud link dcloud agents # /home/me/shop/AGENTS.md: created # /home/me/shop/CLAUDE.md: updated git add AGENTS.md CLAUDE.md && git commit -m "Dispra Cloud instructions for agents" ``` ## 4. Add the Claude Code plugin With the `dcloud` plugin, Claude Code knows the Dispra workflow in every project, without a word in your `CLAUDE.md`: how to install `dcloud`, how to sign in, the deploy loop, logs, variables, domains and the safety rules. Its skill loads by itself when you ask Claude Code to deploy, read logs or set variables. It also adds two commands: `/dcloud:deploy [service]` deploys and fixes until the service is live, and `/dcloud:logs [service] [search text]` reads and explains a service's recent logs. In Claude Code, add the marketplace, then install the plugin. Update it later with `/plugin marketplace update dispra`. ### Dispra Cloud CLI ```bash /plugin marketplace add PrethmHQ/dispra-cli /plugin install dcloud@dispra # or from a terminal claude plugin marketplace add PrethmHQ/dispra-cli claude plugin install dcloud@dispra ``` ## 5. The agent contract `dcloud` behaves the same for every agent: - **`--json`** prints one JSON object per line on stdout; text for people goes to stderr. It works before or after the command: `dcloud --json status` or `dcloud status --json`. - **Exit codes**: `0` done, `1` an error, `2` a person must act. - **Refusals** are one JSON line: `{"status", "code", "message", "action", "action_url"}`. `status` is `refused` (exit 1), or `action_required` or `login_required` (exit 2). On exit 2 the agent shows the person the message and the `action_url`, and stops. - **`confirmation_required`**: a command that changes something a person should approve (stopping a service, deleting variables, applying `dispra.yaml`, removing a domain) asks first. An agent can't answer, so `dcloud` refuses with exit 2 and the agent asks you; `--yes` goes ahead. - **Agent mode**: `dcloud` never prompts and never waits for input when `CLAUDECODE=1` is set (Claude Code sets it), when `DCLOUD_AGENT=1` is set, or when stdin isn't a terminal. ### Dispra Cloud CLI ```bash dcloud stop api --json # {"action":"confirm","action_url":"","code":"confirmation_required", # "message":"Stop api in production? It stays stopped until you start it. Run again with --yes to go ahead.", # "status":"action_required"} echo $? # 2 ``` ## 6. The deploy loop This is the loop the instructions and the plugin teach: 1. `dcloud status --json`: the services of the environment and their latest deployments. 2. `dcloud deploy --wait --json`: deploy, then wait until it is `live` or failed. A service built from GitHub deploys the latest commit of its branch, so the agent commits and pushes first. A service deployed from a folder (`source: {path: .}` in `dispra.yaml`) uploads the folder. 3. If it failed: `dcloud logs --build --json` reads the build log, and `dcloud logs --no-follow -n 200 --json` the running service's log. 4. Fix the cause, and deploy again. Without `--no-follow`, `--page` or `--build`, `dcloud logs` follows the live log and never returns, so agents always add one of them. ### Dispra Cloud CLI ```bash dcloud deploy api --wait --json # its last line: # {"dep":"dep_01jdk4p7q9w1e3r5t7y9u1i3ob","error_code":"...","service":"api","state":"failed","status":"failed"} dcloud logs api --build dep_01jdk4p7q9w1e3r5t7y9u1i3ob --json dcloud logs api --no-follow -n 200 --json ``` ## 7. Keep it safe - Let agents work in a non-production environment (`dcloud env create staging --from production`), and keep production to a person, or to a key limited to staging. - Use the least access that works, and one key per sandbox or pipeline, so you can revoke one without breaking the others. - Never paste a key into a chat, a prompt or the repository: set it as the sandbox's secret. - `dcloud vars` lists names, never values. Tell agents not to read or print secret values (`dcloud vars pull` writes them to a file). - Destructive commands, such as `rollback`, `stop`, `vars unset`, `domain remove`, `apply --prune` or deleting anything, are for a person to approve. The instructions tell agents so, and `dcloud` asks for confirmation where it can. - Review what the agent changed in **Activity** on the dashboard: every change made with a key is recorded with the key's name. ## Next steps Next: [Sign in from CI and sandboxes](https://docs.dispralabs.com/guides/sign-in-from-ci-and-sandboxes.md) to make the key, and **Config as code: dispra.yaml** to let agents change an environment through a reviewed file. --- *Guides › Guides* # Sign in from CI and sandboxes 4 min · 6 steps · Languages: dcloud Where no one can sign in through a browser, such as a CI pipeline, a deploy script or an AI agent's cloud sandbox, `dcloud` uses a **project developer key** instead: set it as `DCLOUD_TOKEN`, and every command works with that key's access. ## 1. Make a key A project admin makes keys on the dashboard: open the project, then **Project settings > Developer > Keys**, and create one. Name it after where it will live (`github-actions`, `codex-sandbox`), so the activity log and the key's call log say who did what. The secret is shown once, starting with `dsp_live_`. Copy it straight into the secret store of your CI or sandbox. ## 2. Choose its access Pick the least access that does the job. A key's access can't be changed later: make a new key instead. | Access | For | `dcloud` commands it can run | |---|---|---| | `read` | An agent or job that only looks | `status`, `logs`, `vars` (names), `domains`, `volumes`, `environments`, `config export` | | `deploy` | Deploying from CI, an agent that deploys and fixes | the above, plus `deploy`, `redeploy`, `rollback`, `restart`, `stop`, `start` | | `full` | Changing the environment | everything: `vars set`, `domain add`, `plan` and `apply`, `scale`, `volume`, `env create`, `ssh` | `dcloud plan` needs `full`, because comparing the file with the environment reads secret values. A key never does more than its creator's current role in the project allows, and stops working if its creator leaves the workspace (see **Authentication**). ## 3. Limit it to an environment When you create the key, choose an environment to limit it to one, such as `staging`. It then sees only that environment, and gets `404 not_found` for everything in the others (see **Environment keys**). Give agents and preview pipelines keys limited to non-production environments; keep production keys for the pipeline that deploys production. ## 4. Set DCLOUD_TOKEN Set the key as the secret `DCLOUD_TOKEN`. With it set, `dcloud` uses the key and ignores any sign-in on the machine. A key belongs to one project, so name the project and environment: link the folder first, or pass `--project` and `--env` to each command (`.dcloud/` is never committed, so a fresh CI checkout isn't linked). ### Dispra Cloud CLI ```bash # GitHub Actions jobs: deploy: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - run: curl -fsSL https://dispralabs.com/downloads/dcloud-cli.sh | DCLOUD_VERSION=0.2.1 sh - run: dcloud link --project prj_01jdk3m9x2v7c4q8w5n6b1t0ra --env staging - run: dcloud deploy api --wait env: DCLOUD_TOKEN: ${{ secrets.DCLOUD_TOKEN }} ``` ## 5. Check it `dcloud status` lists the environment's services. A key that is wrong, revoked or regenerated is refused with `login_required` and exit code 2 (`DCLOUD_TOKEN was refused: ...`); a command above the key's access is refused with `key_access_denied`. ### Dispra Cloud CLI ```bash DCLOUD_TOKEN=dsp_live_... dcloud status --json ``` ## 6. Rotate and revoke On **Project settings > Developer > Keys**: - **Regenerate** gives the key a new secret and stops the old one at once. Update the secret in your CI or sandbox right after. - **Revoke** stops the key for good. Revoke a key as soon as it may have leaked, or when the pipeline or sandbox it was made for is gone. Each key has a call log of its recent requests, refused ones included, so you can see what a key did before you revoke it. ## Next steps Next: [Use Dispra with AI agents](https://docs.dispralabs.com/guides/use-dispra-with-ai-agents.md), and **Authentication** for everything about keys. --- *Guides › Guides* # Streaming logs 6 min · 5 steps · Languages: curl, node, python Read a project's logs in pages, or follow a service's output live with Server-Sent Events. ## 1. Search logs in pages **List logs** answers up to 750 lines per page, newest first. Filter by service, deployment, level, time and text, and page back with `next_cursor`. ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/logs?svc=svc_01jdk3n2f4g6h8j0k2l4z6x8ca&level=error&limit=200" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ## 2. Follow a service **Stream a service's logs** starts with the newest 100 lines (`tail=0` to `750` to choose), then sends each new line as it is written: ```text event: line id: 2026-12-05T10:15:02.114Z data: {"at":"2026-12-05T10:15:02.114Z","level":"info","message":"GET /healthz 200 3ms","replica":"r1"} ``` A comment line (`: ping`) comes every 15 seconds to keep the connection open. ### cURL ```bash curl -N "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/logs/stream?tail=200" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Accept: text/event-stream" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/logs/stream?tail=200", { headers: { Authorization: "Bearer dsp_live_YOUR_KEY", Accept: "text/event-stream" }, }); const decoder = new TextDecoder(); let buf = ""; for await (const chunk of res.body) { buf += decoder.decode(chunk, { stream: true }); let i; while ((i = buf.indexOf("\n\n")) >= 0) { const frame = buf.slice(0, i); buf = buf.slice(i + 2); const event = /^event: (.*)$/m.exec(frame)?.[1]; const data = /^data: (.*)$/m.exec(frame)?.[1]; if (event === "line") console.log(JSON.parse(data).message); if (event === "gap") console.warn("skipped", JSON.parse(data).skipped); } } ``` ### Python ```python import json, requests with requests.get("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/logs/stream", params={"tail": 200}, stream=True, headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Accept": "text/event-stream"}) as res: event = None for line in res.iter_lines(decode_unicode=True): if line.startswith("event: "): event = line[7:] elif line.startswith("data: ") and event == "line": print(json.loads(line[6:])["message"]) ``` ## 3. Handle bursts A read never sends more than 750 lines. If more arrive at once, the newest 750 are sent after `event: gap` with `{"skipped": n}`. Read the skipped lines from **List logs** if you need them. ## 4. Follow a build **Stream a deployment's logs** with `kind=build` sends the build output and ends with `event: end` and the deployment's final state (`live`, `failed` or `cancelled`). ## 5. Reconnect without missing lines Long connections drop. Reconnect with `since=`, or send the last `id` as `Last-Event-ID`: the stream continues after it, without repeating or missing lines. --- *Guides › Guides* # Webhooks 8 min · 4 steps · Languages: node, python, go Webhooks tell your systems when something happens in the project (a deployment went live or failed, a service crashed, a backup finished) without polling. ## 1. Add an endpoint Create a webhook with an id you choose and an HTTPS URL. Pick its events, or leave `events` empty to receive every event. Deliveries to private or local addresses are refused. ### cURL ```bash curl -X PUT https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhooks/whk_ci_notify \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"url":"https://hooks.acme.com/dispra","events":["deploy.succeeded","deploy.failed"]}' ``` ## 2. Receive deliveries Each delivery is a `POST` with a JSON body: ```json {"id":"evt_01jdk5m7n9q1w3e5r7t9y1u3io","type":"deploy.succeeded","created_at":"2026-12-05T10:16:40Z","project":{"prj":"prj_01jdk3m9x2v7c4q8w5n6b1t0ra","name":"storefront"},"data":{"svc":"svc_01jdk3n2f4g6h8j0k2l4z6x8ca","dep":"dep_01jdk4p7q9w1e3r5t7y9u1i3ob","state":"live"}} ``` Answer any `2xx` within a few seconds, then do the work. The same event can arrive more than once (a retry after your answer was lost): use `id` to ignore duplicates. Events can arrive out of order: compare `created_at` when order matters. ## 3. Verify the signature Every delivery is signed with the project's webhook secret (reveal or rotate it with the signing secret routes): ```text X-Dispra-Signature: t=1764924999,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd ``` `v1` is the lowercase hex HMAC-SHA256, keyed with the secret, of `t + "." + body`, where `body` is the raw request body exactly as received. 1. Read the **raw** body before parsing JSON: re-serialised JSON won't match. 2. Compute the HMAC and compare it with `v1` in constant time. 3. Refuse a `t` more than 5 minutes from your clock, so a captured delivery can't be replayed. ### Node ```javascript import crypto from "node:crypto"; import express from "express"; const SECRET = process.env.DISPRA_WEBHOOK_SECRET; function verify(header, rawBody) { const parts = Object.fromEntries((header || "").split(",").map((p) => p.trim().split("=", 2))); const t = Number(parts.t); if (!parts.v1 || !Number.isInteger(t)) return false; if (Math.abs(Date.now() / 1000 - t) > 300) return false; // 5 minutes const expected = crypto.createHmac("sha256", SECRET).update(`${parts.t}.`).update(rawBody).digest(); const given = Buffer.from(parts.v1, "hex"); return given.length === expected.length && crypto.timingSafeEqual(given, expected); } const app = express(); app.post("/dispra-webhook", express.raw({ type: "application/json" }), (req, res) => { if (!verify(req.get("X-Dispra-Signature"), req.body)) return res.status(400).send("bad signature"); const event = JSON.parse(req.body.toString("utf8")); res.sendStatus(204); // answer first, then work handle(event); }); app.listen(3000); ``` ### Python ```python import hashlib, hmac, os, time from flask import Flask, request, abort SECRET = os.environ["DISPRA_WEBHOOK_SECRET"].encode() app = Flask(__name__) def verify(header, body): parts = dict(p.strip().split("=", 1) for p in (header or "").split(",") if "=" in p) t, v1 = parts.get("t"), parts.get("v1") if not t or not v1 or abs(time.time() - int(t)) > 300: return False expected = hmac.new(SECRET, t.encode() + b"." + body, hashlib.sha256).hexdigest() return hmac.compare_digest(expected, v1) @app.post("/dispra-webhook") def webhook(): if not verify(request.headers.get("X-Dispra-Signature"), request.get_data()): abort(400) event = request.get_json() # dedupe on event["id"], then act return "", 204 ``` ### Go ```go func verify(secret, header string, body []byte) bool { var ts, sig string for _, part := range strings.Split(header, ",") { k, v, _ := strings.Cut(strings.TrimSpace(part), "=") switch k { case "t": ts = v case "v1": sig = v } } t, err := strconv.ParseInt(ts, 10, 64) if err != nil || sig == "" || math.Abs(time.Since(time.Unix(t, 0)).Seconds()) > 300 { return false } given, err := hex.DecodeString(sig) if err != nil { return false } mac := hmac.New(sha256.New, []byte(secret)) mac.Write([]byte(ts + ".")) mac.Write(body) return hmac.Equal(given, mac.Sum(nil)) } ``` ## 4. Retries Anything but a `2xx` in time counts as a failure and is retried 5 times over about an hour (1, 5, 10, 20 and 24 minutes later), then the delivery is marked failed. **List deliveries** with `state=failed` shows them. After rotating the secret, update your receiver right away: deliveries are signed with the new secret from then on. --- # Variables and references Every environment has **project variables**, shared by its services, and each service has its own **service variables**. A value can be plain text, or it can **reference** other variables, so a connection string, an address or a key is set once and every service that needs it stays in step. **The syntax.** A reference is `{{ owner.NAME }}`: - `owner` is `project` for a project variable, or the **name of a service** in the same environment (names are compared without case). A service may reference its own variables. - `NAME` is the variable's name: letters, digits and `_`, not starting with a digit, at most 128 characters. - Spaces just inside the braces are optional: `{{db.PGHOST}}` and `{{ db.PGHOST }}` are the same. **References inside text.** A value can hold several references, and everything around them is kept as written: ``` DATABASE_URL = postgres://{{ db.PGUSER }}:{{ db.PGPASSWORD }}@{{ db.DISPRA_PRIVATE_HOST }}:5432/app API_BASE = {{ api.DISPRA_PUBLIC_URL }}/v1 LOG_LEVEL = {{ project.LOG_LEVEL }} ``` **Built-in variables.** Every service has these, without setting them. Reference them like any other variable, for example `{{ api.DISPRA_PUBLIC_URL }}`: - `DISPRA_PRIVATE_HOST`: the service's private hostname, reachable only from the project's other services. - `DISPRA_PRIVATE_URL`: its private address, `host:port`. - `DISPRA_PUBLIC_URL`: its best public `https://` address. - `DISPRA_SERVICE_NAME`: its name. A built-in wins over a variable of the same name. A built-in a service doesn't have (no public address yet, for example) doesn't resolve: give the service an endpoint first. **Setting one.** A reference is just part of the value: ``` curl -X PUT https://devapi.dispralabs.com/v1/cloud/services/svc_.../variables/DATABASE_URL \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"value": "postgres://{{ db.PGUSER }}:{{ db.PGPASSWORD }}@{{ db.DISPRA_PRIVATE_HOST }}:5432/app"}' ``` With the CLI: `dcloud vars set DATABASE_URL='postgres://{{ db.PGUSER }}@{{ db.DISPRA_PRIVATE_HOST }}:5432/app' --service api`. A reference that doesn't resolve yet (the service it names isn't created, say) is still saved: the answer lists it in `warnings`, and a deployment refuses it until it resolves. A value that is **exactly one reference**, such as `{{ db.DATABASE_URL }}`, is stored as a link to that variable, so it always follows its source. **Linking a project variable into a service.** To give a service a project variable under its own name, with the value always following the project's, set the service variable with `kind: shared`: ``` PUT /v1/cloud/services/svc_.../variables/STRIPE_KEY {"kind": "shared", "ref_name": "STRIPE_KEY"} ``` A project variable that services link to can't be deleted until they unlink it (`409 variable_in_use`). Writing `{{ project.STRIPE_KEY }}` inside a value works too; use `shared` when the whole value is the project's. **When references resolve.** When a deployment starts: for the build (variables with scope `build` or `both`) and for the running service (`runtime` or `both`). References can chain up to 10 deep; a cycle is refused. A change to a variable reaches a service at its **next deployment**: redeploy the services that reference it (**Create a deployment** with `action: redeploy`). **When a reference doesn't resolve.** The deployment is refused with `422 variable_reference_unresolved`, and the message names the variable and the reference: an unknown service or variable, a built-in the service doesn't have, a cycle, a chain over 10. The running version keeps serving. Check before you deploy: - **Validate variables text** checks a block of `NAME=value` lines (the raw editor's format) and reports each reference that doesn't resolve, and why. - **Get the variables graph** shows every variable of the environment and which ones reference which. **Values stay secret.** Every value is sealed. Resolution happens inside Dispra Cloud: answers carry names, never resolved values, and revealing a value is its own request (**Reveal a service variable**), which is rate limited and recorded. **Writing `{{` literally.** `\{{` is a literal `{{` (the backslash is dropped). A `{{ ... }}` whose content isn't `owner.NAME` is left as written, so values that hold other template languages keep working. **In dispra.yaml.** Values in `variables:` use the same references, and `${{ secret }}` declares a variable whose value you set outside the file: ```yaml services: api: variables: DATABASE_URL: "postgres://{{ db.PGUSER }}:{{ db.PGPASSWORD }}@{{ db.DISPRA_PRIVATE_HOST }}:5432/app" PUBLIC_URL: "{{ api.DISPRA_PUBLIC_URL }}" STRIPE_KEY: "${{ secret }}" variables: LOG_LEVEL: info ``` --- # Config as code: dispra.yaml Describe an environment in one file, review what applying it would change, then apply exactly that. Keep the file in YAML in your repository, and send it as JSON to **Plan a config file** and **Apply a config file** (any YAML library converts it). ```text # dispra.yaml project: prj_01jdk3m9x2v7c4q8w5n6b1t0ra # optional: refused for another project environment: production # optional: refused for another environment groups: [web, data] variables: # the environment's shared variables NODE_ENV: production services: api: source: { repo: acme/api, branch: main } # or { image: ghcr.io/acme/api:1.4.2 } group: web build: { command: npm run build } # builder: railpack | dockerfile, dockerfile: path start: { command: npm start, port: 3000 } health: { path: /healthz, timeout_s: 5 } restart: { policy: on_failure, max: 5 } size: { cpu: 1000m, memory: 1Gi, disk: 2Gi } # per replica regions: { india: 2, us: 1 } # or replicas: 2 variables: DATABASE_URL: "{{ project.DATABASE_URL }}" STRIPE_KEY: "${{ secret }}" # declared here, its value set through the API domains: [api.acme.com] worker: source: { repo: acme/api, branch: main } start: { command: node worker.js } volumes: { uploads: /data } volumes: uploads: { size: 10Gi, backups: { every: 6h, keep: 7 } } ``` **What the file manages.** Only what it says. A service without `health` keeps its health check; a service of the environment the file doesn't name is listed as **unmanaged**, never touched. With `prune`, what the file leaves out is deleted: services, their variables, domains and regions, groups and shared variables. **Volumes are never deleted** by apply. **Secrets.** Never put secret values in the file. `${{ secret }}` declares a variable whose value you set with **Set a service variable** (or on the dashboard); the plan warns when it has no value yet. **Sizes.** CPU in cores or millicores (`1`, `0.5`, `500m`), memory and disk with a unit (`512Mi`, `1Gi`; disk in whole Gi). A service with a volume runs one replica in one region. **Plan, then apply.** 1. Plan: you get every change in order (`create service worker`, `update service api: replicas 1 → 2`), what is unmanaged, and warnings. 2. Apply with the plan's `plan_hash`. If the environment changed since, apply refuses with `409 plan_stale` and the new plan. 3. Every service that was created or changed is deployed (`deploy: false` to skip). **Start from what you have.** **Export the environment** writes the current environment as a file. Planning it changes nothing, so you can commit it and manage the environment from Git from then on. --- # Calling from a browser By default a key is **server only**: a request that carries a browser `Origin` header is refused with `403 origin_not_allowed`. To call from a web page, add the page's origin to the key (for example `https://status.acme.com`). Preflight requests are answered for any origin; the actual request is checked against the key's origins, and allowed ones get `Access-Control-Allow-Origin`. The browser's `EventSource` can't send an `Authorization` header: read streams with `fetch` instead. > Anyone who opens the page can read a key embedded in it. Use browser keys only with `read` access, a low rate limit, and an environment where that is acceptable. --- *Cloud* # The apply result object What an apply did: the steps it ran and the deployments it started. ## Attributes - `plan_hash` (string): The plan that ran. - `applied` (array): The steps that ran, in order. - `deployments` (array): Deployments started: list of {service, svc, dep}. - `unmanaged` (array): Objects the file leaves out. - `warnings` (array): Steps apply skipped, and why. ## Example ```json { "data": { "plan_hash": "pln_7c1e9a2f4b6d8e0a1c3e5f7a", "applied": [{"action":"update","kind":"service","target":"api"}], "deployments": [{"service":"api","svc":"svc_01jdk3n2f4g6h8j0k2l4z6x8ca","dep":"dep_01jdk4p7q9w1e3r5t7y9u1i3ob"}], "unmanaged": [], "warnings": [] } } ``` ## Endpoints - `POST` [Apply a config file](https://docs.dispralabs.com/api/apply-a-config-file.md) --- *Cloud* # The config plan object What applying a dispra.yaml file would change, step by step. Apply it with its plan_hash, so what you reviewed is exactly what runs. ## Attributes - `plan_hash` (string): Identifies the plan. Apply refuses it if the environment changed since. - `changes` (array): The steps, in order: list of {action, kind, target, fields}. - `unmanaged` (array): Objects of the environment the file leaves out. - `warnings` (array): What apply will not do, and why. ## Example ```json { "data": { "plan_hash": "pln_7c1e9a2f4b6d8e0a1c3e5f7a", "changes": [{"action":"update","kind":"service","target":"api","fields":[{"field":"replicas","from":1,"to":2}]}], "unmanaged": ["service legacy-worker"], "warnings": ["variables.STRIPE_KEY is a secret without a value"] } } ``` ## Endpoints - `POST` [Apply a config file](https://docs.dispralabs.com/api/apply-a-config-file.md) - `POST` [Plan a config file](https://docs.dispralabs.com/api/plan-a-config-file.md) --- *Cloud › Config as code* # Export the environment ```http GET https://devapi.dispralabs.com/v1/cloud/environments/:env/config ``` Writes the environment as a `dispra.yaml` file (as JSON): its groups, services with their settings, regions, domains and volumes. Variables are written as `${{ secret }}`: values are never exported. Planning the export changes nothing. Needs a key with `read` access or more. - **Authentication:** Secret key (send it as `Authorization: Bearer `) ## Parameters - `env` (string, required): The environment's id. Example: `env_01jdk3m9x5h2p8r4t6y1u3i0oa` ## Returns - **200**: config: the environment as dispra.yaml. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud config export > dispra.yaml ``` ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/config" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/config", { method: "GET", headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); console.log(await res.json()); ``` ### Python ```python import requests res = requests.request("GET", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/config", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("GET", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/config", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json {} ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ## Related - [Config as code](https://docs.dispralabs.com/features/config-as-code.md) --- *Cloud › Config as code* # Apply a config file ```http POST https://devapi.dispralabs.com/v1/cloud/environments/:env/config/apply ``` Makes the plan again and runs it, in order: groups, variables, volumes, then each service (create, settings, regions, variables, group, domains, volume). Pass the `plan_hash` you reviewed: if the environment changed since, the apply is refused with `plan_stale` and the new plan, so what runs is what you saw. With `deploy` (default true), every service that was created or changed is deployed. If one step is refused, the apply stops there and answers what it applied before it. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `env` (string, required): The environment's id. Example: `env_01jdk3m9x5h2p8r4t6y1u3i0oa` - `config` (object, required): dispra.yaml as JSON: groups, variables, services and volumes. See the dispra.yaml guide. Example: `{"services":{"api":{"source":{"repo":"acme/api","branch":"main"},"size":{"cpu":"1000m","memory":"1Gi"},"replicas":2}}}` - `plan_hash` (string, optional): The plan_hash of the plan you reviewed. Example: `pln_7c1e9a2f4b6d8e0a1c3e5f7a` - `deploy` (boolean, optional): Deploy what changed (default true). Example: `true` - `prune` (boolean, optional): Delete what the file leaves out (never volumes). Example: `false` ## Returns - **200** [The apply result object](https://docs.dispralabs.com/objects/the-apply-result-object.md): What ran. ## Errors | Status | Code | When | |---|---|---| | 400 | [invalid_config](https://docs.dispralabs.com/errors.md#invalid_config) | The file is not valid. The message names every problem, with its key. | | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 409 | [plan_stale](https://docs.dispralabs.com/errors.md#plan_stale) | The environment changed since the plan: the error carries the new plan. | | 409 | [apply_failed](https://docs.dispralabs.com/errors.md#apply_failed) | A step was refused. The changes before it were applied. | | 409 | [account_frozen](https://docs.dispralabs.com/errors.md#account_frozen) | The workspace is out of credits: add credits on the dashboard to create, change or deploy. | ## Request samples ### Dispra Cloud CLI ```bash dcloud apply -f dispra.yaml # shows the plan, asks, then applies exactly that plan ``` ### cURL ```bash curl -X POST "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/config/apply" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"config":{"services":{"api":{"source":{"repo":"acme/api","branch":"main"},"size":{"cpu":"1000m","memory":"1Gi"},"replicas":2}}},"plan_hash":"pln_7c1e9a2f4b6d8e0a1c3e5f7a","deploy":true,"prune":false}' ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/config/apply", { method: "POST", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" }, body: JSON.stringify({ "config": {"services":{"api":{"source":{"repo":"acme/api","branch":"main"},"size":{"cpu":"1000m","memory":"1Gi"},"replicas":2}}}, "plan_hash": "pln_7c1e9a2f4b6d8e0a1c3e5f7a", "deploy": true, "prune": false }), }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("POST", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/config/apply", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}, json={ "config": {"services":{"api":{"source":{"repo":"acme/api","branch":"main"},"size":{"cpu":"1000m","memory":"1Gi"},"replicas":2}}}, "plan_hash": "pln_7c1e9a2f4b6d8e0a1c3e5f7a", "deploy": True, "prune": False }) print(res.json()) ``` ### Go ```go body := strings.NewReader(`{"config":{"services":{"api":{"source":{"repo":"acme/api","branch":"main"},"size":{"cpu":"1000m","memory":"1Gi"},"replicas":2}}},"plan_hash":"pln_7c1e9a2f4b6d8e0a1c3e5f7a","deploy":true,"prune":false}`) req, _ := http.NewRequest("POST", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/config/apply", body) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "plan_hash": "pln_7c1e9a2f4b6d8e0a1c3e5f7a", "applied": [{"action":"update","kind":"service","target":"api"}], "deployments": [{"service":"api","svc":"svc_01jdk3n2f4g6h8j0k2l4z6x8ca","dep":"dep_01jdk4p7q9w1e3r5t7y9u1i3ob"}], "unmanaged": [], "warnings": [] } } ``` ### 400 invalid_config ```json { "error": { "code": "invalid_config", "message": "The file is not valid. The message names every problem, with its key.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 plan_stale ```json { "error": { "code": "plan_stale", "message": "The environment changed since the plan: the error carries the new plan.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 apply_failed ```json { "error": { "code": "apply_failed", "message": "A step was refused. The changes before it were applied.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 account_frozen ```json { "error": { "code": "account_frozen", "message": "The workspace is out of credits: add credits on the dashboard to create, change or deploy.", "request_id": "req_7f3a9c21d84be056" } } ``` ## Related - [config.apply](https://docs.dispralabs.com/flows/config-apply.md) --- *Cloud › Config as code* # Plan a config file ```http POST https://devapi.dispralabs.com/v1/cloud/environments/:env/config/plan ``` Shows what applying a `dispra.yaml` file to the environment would change, step by step, without changing anything. What the file leaves out is left as it is. Services, volumes and variables the file does not name are listed in `unmanaged`; pass `prune: true` to plan deleting them (volumes are never deleted). Variable values are compared on the server and never returned. Needs `full` access, because comparing reads secret values. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `env` (string, required): The environment's id. Example: `env_01jdk3m9x5h2p8r4t6y1u3i0oa` - `config` (object, required): dispra.yaml as JSON: groups, variables, services and volumes. See the dispra.yaml guide. Example: `{"services":{"api":{"source":{"repo":"acme/api","branch":"main"},"size":{"cpu":"1000m","memory":"1Gi"},"replicas":2}}}` - `prune` (boolean, optional): Plan deleting what the file leaves out. Example: `false` ## Returns - **200** [The config plan object](https://docs.dispralabs.com/objects/the-config-plan-object.md): The plan. ## Errors | Status | Code | When | |---|---|---| | 400 | [invalid_config](https://docs.dispralabs.com/errors.md#invalid_config) | The file is not valid. The message names every problem, with its key. | | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud plan -f dispra.yaml ``` ### cURL ```bash curl -X POST "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/config/plan" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"config":{"services":{"api":{"source":{"repo":"acme/api","branch":"main"},"size":{"cpu":"1000m","memory":"1Gi"},"replicas":2}}},"prune":false}' ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/config/plan", { method: "POST", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" }, body: JSON.stringify({ "config": {"services":{"api":{"source":{"repo":"acme/api","branch":"main"},"size":{"cpu":"1000m","memory":"1Gi"},"replicas":2}}}, "prune": false }), }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("POST", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/config/plan", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}, json={ "config": {"services":{"api":{"source":{"repo":"acme/api","branch":"main"},"size":{"cpu":"1000m","memory":"1Gi"},"replicas":2}}}, "prune": False }) print(res.json()) ``` ### Go ```go body := strings.NewReader(`{"config":{"services":{"api":{"source":{"repo":"acme/api","branch":"main"},"size":{"cpu":"1000m","memory":"1Gi"},"replicas":2}}},"prune":false}`) req, _ := http.NewRequest("POST", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/config/plan", body) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "plan_hash": "pln_7c1e9a2f4b6d8e0a1c3e5f7a", "changes": [{"action":"update","kind":"service","target":"api","fields":[{"field":"replicas","from":1,"to":2}]}], "unmanaged": ["service legacy-worker"], "warnings": ["variables.STRIPE_KEY is a secret without a value"] } } ``` ### 400 invalid_config ```json { "error": { "code": "invalid_config", "message": "The file is not valid. The message names every problem, with its key.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ## Related - [Config as code](https://docs.dispralabs.com/features/config-as-code.md) - [config.apply](https://docs.dispralabs.com/flows/config-apply.md) --- *Cloud › Deployments* # Create a deployment ```http POST https://devapi.dispralabs.com/v1/cloud/services/:svc/deployments ``` Starts a deployment of the service: - `deploy` builds the branch's latest commit (or runs the service's image), - `redeploy` runs the live build again, so new variables and settings apply without a build, - `rollback` goes back to an earlier deployment's build: give `rollback_to_dep`. The answer comes at once with the deployment queued. Follow it by reading the deployment, streaming its build log, or with the `deploy.succeeded` and `deploy.failed` webhook events. Needs `deploy` access. Needs a key with `deploy` access or more. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` - `action` (string, required): deploy, redeploy or rollback. Example: `deploy` - `rollback_to_dep` (string, optional): For rollback: the deployment to go back to. ## Returns - **200**: dep and status (accepted): the deployment is queued. Read it with Get a deployment. ## Errors | Status | Code | When | |---|---|---| | 400 | [invalid_request](https://docs.dispralabs.com/errors.md#invalid_request) | A field is missing or not valid. The message names it. | | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 409 | [invalid_state](https://docs.dispralabs.com/errors.md#invalid_state) | The service is stopped or being deleted. | | 409 | [account_frozen](https://docs.dispralabs.com/errors.md#account_frozen) | The workspace is out of credits: add credits on the dashboard to create, change or deploy. | ## Request samples ### Dispra Cloud CLI ```bash dcloud deploy api # or: dcloud redeploy api, dcloud rollback api [dep_...] ``` ### cURL ```bash curl -X POST "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/deployments" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"action":"deploy"}' ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/deployments", { method: "POST", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" }, body: JSON.stringify({ "action": "deploy" }), }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("POST", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/deployments", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}, json={ "action": "deploy" }) print(res.json()) ``` ### Go ```go body := strings.NewReader(`{"action":"deploy"}`) req, _ := http.NewRequest("POST", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/deployments", body) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json {} ``` ### 400 invalid_request ```json { "error": { "code": "invalid_request", "message": "A field is missing or not valid. The message names it.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 invalid_state ```json { "error": { "code": "invalid_state", "message": "The service is stopped or being deleted.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 account_frozen ```json { "error": { "code": "account_frozen", "message": "The workspace is out of credits: add credits on the dashboard to create, change or deploy.", "request_id": "req_7f3a9c21d84be056" } } ``` ## Related - [Safe retries](https://docs.dispralabs.com/features/safe-retries.md) - [deploy.lifecycle](https://docs.dispralabs.com/flows/deploy-lifecycle.md) --- *Cloud › Deployments* # List deployments ```http GET https://devapi.dispralabs.com/v1/cloud/services/:svc/deployments ``` The service's deployments, newest first. Needs a key with `read` access or more. - **Authentication:** Secret key (send it as `Authorization: Bearer `) ## Parameters - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` - `state` (string, optional): Only deployments in this state. Example: `live` - `cursor` (string, optional): The next_cursor of the previous page. - `limit` (number, optional): Items per page, 1 to 200 (default 50). Example: `50` ## Returns - **200** [The deployment object](https://docs.dispralabs.com/objects/the-deployment-object.md): A page of deployments. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api GET /v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/deployments?state=live&limit=50 ``` ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/deployments?state=live&limit=50" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/deployments?state=live&limit=50", { method: "GET", headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); console.log(await res.json()); ``` ### Python ```python import requests res = requests.request("GET", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/deployments", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}, params={"state": "live", "limit": "50"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("GET", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/deployments?state=live&limit=50", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "dep": "dep_01jdk4p7q9w1e3r5t7y9u1i3ob", "svc": "svc_01jdk3n2f4g6h8j0k2l4z6x8ca", "state": "live", "trigger": "push", "branch": "main", "sha": "3f2a9c1d8e7b6a5f4e3d2c1b0a9f8e7d6c5b4a39", "created_at": 1764324999, "finished_at": 1764325121, "error_code": "DEPLOY_HEALTH_TIMEOUT", "failure_reason": "health_check_timeout", "transitions": [{"state":"queued","at":1764324999},{"state":"live","at":1764325121}] } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Deployments* # Get a deployment ```http GET https://devapi.dispralabs.com/v1/cloud/services/:svc/deployments/:dep ``` One deployment: what it was built from, its state changes oldest first, and why it failed when it did. Needs a key with `read` access or more. - **Authentication:** Secret key (send it as `Authorization: Bearer `) ## Parameters - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` - `dep` (string, required): The deployment's id. Example: `dep_01jdk4p7q9w1e3r5t7y9u1i3ob` ## Returns - **200** [The deployment object](https://docs.dispralabs.com/objects/the-deployment-object.md): The deployment. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api GET /v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/deployments/dep_01jdk4p7q9w1e3r5t7y9u1i3ob ``` ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/deployments/dep_01jdk4p7q9w1e3r5t7y9u1i3ob" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/deployments/dep_01jdk4p7q9w1e3r5t7y9u1i3ob", { method: "GET", headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); console.log(await res.json()); ``` ### Python ```python import requests res = requests.request("GET", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/deployments/dep_01jdk4p7q9w1e3r5t7y9u1i3ob", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("GET", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/deployments/dep_01jdk4p7q9w1e3r5t7y9u1i3ob", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "dep": "dep_01jdk4p7q9w1e3r5t7y9u1i3ob", "svc": "svc_01jdk3n2f4g6h8j0k2l4z6x8ca", "state": "live", "trigger": "push", "branch": "main", "sha": "3f2a9c1d8e7b6a5f4e3d2c1b0a9f8e7d6c5b4a39", "created_at": 1764324999, "finished_at": 1764325121, "error_code": "DEPLOY_HEALTH_TIMEOUT", "failure_reason": "health_check_timeout", "transitions": [{"state":"queued","at":1764324999},{"state":"live","at":1764325121}] } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Deployments* # Cancel a deployment ```http POST https://devapi.dispralabs.com/v1/cloud/services/:svc/deployments/:dep/cancel ``` Stops a deployment that is queued, building or starting. The version that was live keeps serving. Needs a key with `deploy` access or more. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` - `dep` (string, required): The deployment's id. Example: `dep_01jdk4p7q9w1e3r5t7y9u1i3ob` ## Returns - **200**: dep and state. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 409 | [deployment_finished](https://docs.dispralabs.com/errors.md#deployment_finished) | It has already finished. | ## Request samples ### Dispra Cloud CLI ```bash dcloud api POST /v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/deployments/dep_01jdk4p7q9w1e3r5t7y9u1i3ob/cancel ``` ### cURL ```bash curl -X POST "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/deployments/dep_01jdk4p7q9w1e3r5t7y9u1i3ob/cancel" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/deployments/dep_01jdk4p7q9w1e3r5t7y9u1i3ob/cancel", { method: "POST", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID() }, }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("POST", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/deployments/dep_01jdk4p7q9w1e3r5t7y9u1i3ob/cancel", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("POST", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/deployments/dep_01jdk4p7q9w1e3r5t7y9u1i3ob/cancel", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json {} ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 deployment_finished ```json { "error": { "code": "deployment_finished", "message": "It has already finished.", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Deployments* # Restart a service ```http POST https://devapi.dispralabs.com/v1/cloud/services/:svc/restart ``` Restarts the service's replicas from the live deployment, without a build. A service with a volume stops, then starts, so two copies never run at once. Needs a key with `deploy` access or more. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` ## Returns - **202**: svc, status (restarting), stateful and already_pending. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 409 | [not_running](https://docs.dispralabs.com/errors.md#not_running) | The service isn't running. | ## Request samples ### Dispra Cloud CLI ```bash dcloud restart api ``` ### cURL ```bash curl -X POST "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/restart" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/restart", { method: "POST", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID() }, }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("POST", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/restart", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("POST", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/restart", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 202 ```json {} ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 not_running ```json { "error": { "code": "not_running", "message": "The service isn't running.", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Deployments* # Start a service ```http POST https://devapi.dispralabs.com/v1/cloud/services/:svc/start ``` Starts a service you stopped. A service Dispra stopped (the workspace ran out of credits) starts again by itself once credits are added. Needs a key with `deploy` access or more. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` ## Returns - **200**: svc and state (active). ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 409 | [not_startable](https://docs.dispralabs.com/errors.md#not_startable) | Dispra stopped this service: it starts again once that is resolved. | | 409 | [account_frozen](https://docs.dispralabs.com/errors.md#account_frozen) | The workspace is out of credits: add credits on the dashboard to create, change or deploy. | ## Request samples ### Dispra Cloud CLI ```bash dcloud start api ``` ### cURL ```bash curl -X POST "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/start" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/start", { method: "POST", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID() }, }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("POST", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/start", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("POST", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/start", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json {} ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 not_startable ```json { "error": { "code": "not_startable", "message": "Dispra stopped this service: it starts again once that is resolved.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 account_frozen ```json { "error": { "code": "account_frozen", "message": "The workspace is out of credits: add credits on the dashboard to create, change or deploy.", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Deployments* # Stop a service ```http POST https://devapi.dispralabs.com/v1/cloud/services/:svc/stop ``` Stops the service, and its copies in other regions, until you start it. Its place is kept, so starting it again needs no build. Stopping a stopped service answers the same. Needs a key with `deploy` access or more. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` ## Returns - **200**: svc and state (stopped). ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 409 | [not_running](https://docs.dispralabs.com/errors.md#not_running) | Dispra stopped this service, or it is being deleted. | ## Request samples ### Dispra Cloud CLI ```bash dcloud stop api ``` ### cURL ```bash curl -X POST "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/stop" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/stop", { method: "POST", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID() }, }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("POST", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/stop", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("POST", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/stop", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json {} ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 not_running ```json { "error": { "code": "not_running", "message": "Dispra stopped this service, or it is being deleted.", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud* # The environment object An environment is one copy of a project's services, variables and volumes: production (made with the project, never deleted), staging or any other name. ## Attributes - `env` (string): The environment's id. - `name` (string): Its name, unique in the project. - `is_production` (boolean): True for the production environment. - `service_count` (number): Services in it. - `status` (string): ok, needs_attention, deploying, stopped or empty. - `created_at` (timestamp): When it was created, Unix seconds. ## Example ```json { "data": { "env": "env_01jdk3m9x5h2p8r4t6y1u3i0oa", "name": "production", "is_production": true, "service_count": 3, "status": "ok", "created_at": 1764324999 } } ``` ## Endpoints - `POST` [Apply a config file](https://docs.dispralabs.com/api/apply-a-config-file.md) - `POST` [Change variables in bulk](https://docs.dispralabs.com/api/change-variables-in-bulk.md) - `POST` [Create a service](https://docs.dispralabs.com/api/create-a-service.md) - `POST` [Create a service group](https://docs.dispralabs.com/api/create-a-service-group.md) - `POST` [Create a volume](https://docs.dispralabs.com/api/create-a-volume.md) - `POST` [Create an environment](https://docs.dispralabs.com/api/create-an-environment.md) - `DELETE` [Delete a project variable](https://docs.dispralabs.com/api/delete-a-project-variable.md) - `DELETE` [Delete a service group](https://docs.dispralabs.com/api/delete-a-service-group.md) - `DELETE` [Delete an environment](https://docs.dispralabs.com/api/delete-an-environment.md) - `GET` [Export the environment](https://docs.dispralabs.com/api/export-the-environment.md) - `GET` [Get the variables graph](https://docs.dispralabs.com/api/get-the-variables-graph.md) - `GET` [List environments](https://docs.dispralabs.com/api/list-environments.md) - `GET` [List project activity](https://docs.dispralabs.com/api/list-project-activity.md) - `GET` [List project variables](https://docs.dispralabs.com/api/list-project-variables.md) - `GET` [List service groups](https://docs.dispralabs.com/api/list-service-groups.md) - `GET` [List services](https://docs.dispralabs.com/api/list-services.md) - `GET` [List volumes](https://docs.dispralabs.com/api/list-volumes.md) - `POST` [Plan a config file](https://docs.dispralabs.com/api/plan-a-config-file.md) - `POST` [Reveal a project variable](https://docs.dispralabs.com/api/reveal-a-project-variable.md) - `POST` [Reveal all project variables](https://docs.dispralabs.com/api/reveal-all-project-variables.md) - `PUT` [Set a project variable](https://docs.dispralabs.com/api/set-a-project-variable.md) - `PATCH` [Update a service group](https://docs.dispralabs.com/api/update-a-service-group.md) - `POST` [Validate variables text](https://docs.dispralabs.com/api/validate-variables-text.md) --- *Cloud › Environments* # Delete an environment ```http DELETE https://devapi.dispralabs.com/v1/cloud/environments/:env ``` Deletes an environment and stops its services. It can be restored for 7 days from the dashboard. The production environment can't be deleted. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `env` (string, required): The environment's id. Example: `env_01jdk3m9x5h2p8r4t6y1u3i0oa` ## Returns - **200**: status (scheduled) and recoverable_until. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 409 | [production_environment](https://docs.dispralabs.com/errors.md#production_environment) | The production environment can't be deleted. | ## Request samples ### Dispra Cloud CLI ```bash dcloud api DELETE /v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa ``` ### cURL ```bash curl -X DELETE "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa", { method: "DELETE", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID() }, }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("DELETE", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("DELETE", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json {} ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 production_environment ```json { "error": { "code": "production_environment", "message": "The production environment can't be deleted.", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Environments* # Create an environment ```http POST https://devapi.dispralabs.com/v1/cloud/projects/:prj/environments ``` Adds an environment to the project: `staging`, `preview-142`, any name. Pass `copy_from` to copy another environment's services, settings and variables (its volumes and domains are not copied). Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `prj` (string, required): The project's id. Example: `prj_01jdk3m9x2v7c4q8w5n6b1t0ra` - `name` (string, required): The new environment's name: lowercase letters, digits and dashes. Example: `staging` - `copy_from` (string, optional): An environment to copy the services and variables of. Example: `env_01jdk3m9x5h2p8r4t6y1u3i0oa` ## Returns - **200**: env and status (created). ## Errors | Status | Code | When | |---|---|---| | 400 | [invalid_request](https://docs.dispralabs.com/errors.md#invalid_request) | A field is missing or not valid. The message names it. | | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 409 | [name_taken](https://docs.dispralabs.com/errors.md#name_taken) | The project already has an environment with that name. | | 409 | [account_frozen](https://docs.dispralabs.com/errors.md#account_frozen) | The workspace is out of credits: add credits on the dashboard to create, change or deploy. | ## Request samples ### Dispra Cloud CLI ```bash dcloud env create staging --from production ``` ### cURL ```bash curl -X POST "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/environments" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"name":"staging","copy_from":"env_01jdk3m9x5h2p8r4t6y1u3i0oa"}' ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/environments", { method: "POST", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" }, body: JSON.stringify({ "name": "staging", "copy_from": "env_01jdk3m9x5h2p8r4t6y1u3i0oa" }), }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("POST", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/environments", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}, json={ "name": "staging", "copy_from": "env_01jdk3m9x5h2p8r4t6y1u3i0oa" }) print(res.json()) ``` ### Go ```go body := strings.NewReader(`{"name":"staging","copy_from":"env_01jdk3m9x5h2p8r4t6y1u3i0oa"}`) req, _ := http.NewRequest("POST", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/environments", body) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json {} ``` ### 400 invalid_request ```json { "error": { "code": "invalid_request", "message": "A field is missing or not valid. The message names it.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 name_taken ```json { "error": { "code": "name_taken", "message": "The project already has an environment with that name.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 account_frozen ```json { "error": { "code": "account_frozen", "message": "The workspace is out of credits: add credits on the dashboard to create, change or deploy.", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Environments* # List environments ```http GET https://devapi.dispralabs.com/v1/cloud/projects/:prj/environments ``` Lists the project's environments with their service counts and status. An environment key sees only its own. Needs a key with `read` access or more. - **Authentication:** Secret key (send it as `Authorization: Bearer `) ## Parameters - `prj` (string, required): The project's id. Example: `prj_01jdk3m9x2v7c4q8w5n6b1t0ra` - `cursor` (string, optional): The next_cursor of the previous page. - `limit` (number, optional): Items per page, 1 to 200 (default 50). Example: `50` ## Returns - **200** [The environment object](https://docs.dispralabs.com/objects/the-environment-object.md): A page of environments. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud environments ``` ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/environments?limit=50" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/environments?limit=50", { method: "GET", headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); console.log(await res.json()); ``` ### Python ```python import requests res = requests.request("GET", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/environments", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}, params={"limit": "50"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("GET", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/environments?limit=50", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "env": "env_01jdk3m9x5h2p8r4t6y1u3i0oa", "name": "production", "is_production": true, "service_count": 3, "status": "ok", "created_at": 1764324999 } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ## Related - [Environment keys](https://docs.dispralabs.com/features/environment-keys.md) --- *Cloud* # The API call object One request made with one of the project's keys, kept 30 days, refused and rate-limited calls included. ## Attributes - `at` (timestamp): When it was made. - `key` (string): The key's first characters. - `method` (string): The HTTP method. - `path` (string): The route. - `status` (number): The answer's status. - `latency_ms` (number): How long it took. - `request_id` (string): The request id. ## Example ```json { "data": { "at": "2026-12-05T10:15:02Z", "key": "dsp_live_8Kq2", "method": "POST", "path": "/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/deployments", "status": 201, "latency_ms": 182, "request_id": "req_0b349478236d2070" } } ``` ## Endpoints - `GET` [List API calls](https://docs.dispralabs.com/api/list-api-calls.md) --- *Cloud › Keys* # List API calls ```http GET https://devapi.dispralabs.com/v1/cloud/projects/:prj/api-calls ``` Every call made with the project's keys over the last 30 days, refused and rate-limited ones included, with a summary of the last 24 hours. Use it to debug an integration. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) ## Parameters - `prj` (string, required): The project's id. Example: `prj_01jdk3m9x2v7c4q8w5n6b1t0ra` - `key` (string, optional): Only this key's calls (its prefix). Example: `dsp_live_8Kq2` - `filter` (string, optional): errors, slow or rate_limited. Example: `errors` - `q` (string, optional): Text in the path. Example: `deployments` - `cursor` (string, optional): The next_cursor of the previous page. - `limit` (number, optional): Items per page, 1 to 200 (default 50). Example: `50` ## Returns - **200** [The API call object](https://docs.dispralabs.com/objects/the-api-call-object.md): calls and summary. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api GET /v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/api-calls?key=dsp_live_8Kq2&filter=errors&q=deployments&limit=50 ``` ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/api-calls?key=dsp_live_8Kq2&filter=errors&q=deployments&limit=50" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/api-calls?key=dsp_live_8Kq2&filter=errors&q=deployments&limit=50", { method: "GET", headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); console.log(await res.json()); ``` ### Python ```python import requests res = requests.request("GET", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/api-calls", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}, params={"key": "dsp_live_8Kq2", "filter": "errors", "q": "deployments", "limit": "50"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("GET", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/api-calls?key=dsp_live_8Kq2&filter=errors&q=deployments&limit=50", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "at": "2026-12-05T10:15:02Z", "key": "dsp_live_8Kq2", "method": "POST", "path": "/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/deployments", "status": 201, "latency_ms": 182, "request_id": "req_0b349478236d2070" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ## Related - [Developer keys](https://docs.dispralabs.com/features/developer-keys.md) - [request.check](https://docs.dispralabs.com/flows/request-check.md) --- *Cloud* # The console session object A single-use ticket for one terminal shell in a running replica. Open a WebSocket to ws_url within 5 minutes. ## Attributes - `token` (string): The ticket. Secret, single use. - `ws_url` (string): The WebSocket to open, ticket included. - `expires_at` (timestamp): When the ticket stops working. - `idle_timeout_s` (number): The shell closes after this many idle seconds. - `max_session_s` (number): The longest a shell stays open. ## Example ```json { "data": { "token": "eyJhbGciOiJFZERTQSJ9.eyJzdWIiOi4uLn0.c2ln", "ws_url": "wss://core.cloud.dispralabs.com/v1/console/connect?token=eyJ...", "expires_at": "2026-12-05T10:15:02Z", "idle_timeout_s": 600, "max_session_s": 3600 } } ``` ## Endpoints - `POST` [Open a shell](https://docs.dispralabs.com/api/open-a-shell.md) --- *Cloud* # The deployment object One build and rollout of a service. A deployment moves through queued, building, starting and live; it can also end failed, cancelled, superseded (a newer one went live) or rolled_back. ## Attributes - `dep` (string): The deployment's id. - `svc` (string): The service it deploys. - `state` (string): queued, building, starting, live, failed, superseded, rolled_back or cancelled. - `trigger` (string): manual, push (a GitHub push), redeploy, rollback or config. - `branch` (string): The branch it was built from. - `sha` (string): The commit it was built from. - `created_at` (timestamp): When it was queued, Unix seconds. - `finished_at` (timestamp): When it ended, Unix seconds, or 0 while running. - `error_code` (string): The exact error code when it failed, such as DEPLOY_HEALTH_TIMEOUT or AGENT_OOM_KILLED; null otherwise. - `failure_reason` (string): The kind of failure: health_check_timeout, crash_on_start, oom_on_start or other; null when it did not fail. - `transitions` (array): Its state changes, oldest first: list of {state, at}. ## Example ```json { "data": { "dep": "dep_01jdk4p7q9w1e3r5t7y9u1i3ob", "svc": "svc_01jdk3n2f4g6h8j0k2l4z6x8ca", "state": "live", "trigger": "push", "branch": "main", "sha": "3f2a9c1d8e7b6a5f4e3d2c1b0a9f8e7d6c5b4a39", "created_at": 1764324999, "finished_at": 1764325121, "error_code": "DEPLOY_HEALTH_TIMEOUT", "failure_reason": "health_check_timeout", "transitions": [{"state":"queued","at":1764324999},{"state":"live","at":1764325121}] } } ``` ## Endpoints - `POST` [Cancel a deployment](https://docs.dispralabs.com/api/cancel-a-deployment.md) - `POST` [Create a deployment](https://docs.dispralabs.com/api/create-a-deployment.md) - `GET` [Get a deployment](https://docs.dispralabs.com/api/get-a-deployment.md) - `GET` [List deployments](https://docs.dispralabs.com/api/list-deployments.md) - `GET` [List logs](https://docs.dispralabs.com/api/list-logs.md) - `GET` [List recent commits](https://docs.dispralabs.com/api/list-recent-commits.md) - `GET` [Stream a deployment's logs](https://docs.dispralabs.com/api/stream-a-deployment-s-logs.md) --- *Cloud* # The log page object A page of log lines, newest first, with the cursor of the page before it. ## Attributes - `items` (array): The lines: list of Log line. - `next_cursor` (string): Pass it as cursor for the older page. Empty on the last page. - `total` (number): Lines that match, exact up to total_cap. - `total_cap` (number): Counting stops here. ## Example ```json { "data": { "items": [{"id":"ln_8f2c1a","ts":"2026-12-05T10:15:02Z","level":"info","message":"GET /healthz 200 3ms"}], "next_cursor": "c_1764324999_8f2c1a", "total": 1832, "total_cap": 10000 } } ``` ## Endpoints - `GET` [List logs](https://docs.dispralabs.com/api/list-logs.md) --- *Cloud › Logs and shell* # Stream a deployment's logs ```http GET https://devapi.dispralabs.com/v1/cloud/deployments/:dep/logs/stream ``` Streams a deployment's build log (`kind=build`, the default) or its live output (`kind=live`), as Server-Sent Events. A build stream ends with `event: end` and the deployment's final state. Same lines, `tail`, gaps and resuming as the service stream. Needs a key with `read` access or more. - **Authentication:** Secret key (send it as `Authorization: Bearer `) ## Parameters - `dep` (string, required): The deployment's id. Example: `dep_01jdk4p7q9w1e3r5t7y9u1i3ob` - `kind` (string, optional): build or live (default build). Example: `build` - `tail` (number, optional): Start with the newest N lines, 0 to 750. - `since` (timestamp, optional): Continue after this line's time. ## Returns - **200**: A text/event-stream. ## Errors | Status | Code | When | |---|---|---| | 400 | [invalid_tail](https://docs.dispralabs.com/errors.md#invalid_tail) | tail is 0 to 750. | | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud logs --build dep_01jdk4p7q9w1e3r5t7y9u1i3ob ``` ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/deployments/dep_01jdk4p7q9w1e3r5t7y9u1i3ob/logs/stream?kind=build" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/deployments/dep_01jdk4p7q9w1e3r5t7y9u1i3ob/logs/stream?kind=build", { method: "GET", headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); console.log(await res.json()); ``` ### Python ```python import requests res = requests.request("GET", "https://devapi.dispralabs.com/v1/cloud/deployments/dep_01jdk4p7q9w1e3r5t7y9u1i3ob/logs/stream", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}, params={"kind": "build"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("GET", "https://devapi.dispralabs.com/v1/cloud/deployments/dep_01jdk4p7q9w1e3r5t7y9u1i3ob/logs/stream?kind=build", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json {} ``` ### 400 invalid_tail ```json { "error": { "code": "invalid_tail", "message": "tail is 0 to 750.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ## Related - [Log search and streaming](https://docs.dispralabs.com/features/log-search-and-streaming.md) - [deploy.lifecycle](https://docs.dispralabs.com/flows/deploy-lifecycle.md) --- *Cloud › Logs and shell* # List logs ```http GET https://devapi.dispralabs.com/v1/cloud/projects/:prj/logs ``` Searches the project's logs: build output and what its services write, newest first, in pages of up to 750 lines. Filter by service, deployment, level, time and text. Without `from`, the last 7 days. Page back with `next_cursor`. Needs a key with `read` access or more. - **Authentication:** Secret key (send it as `Authorization: Bearer `) ## Parameters - `prj` (string, required): The project's id. Example: `prj_01jdk3m9x2v7c4q8w5n6b1t0ra` - `svc` (string, optional): Only this service. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` - `dep` (string, optional): Only this deployment. - `level` (string, optional): Levels, comma separated. Example: `warn,error` - `q` (string, optional): Text to search for. Example: `timeout` - `from` (timestamp, optional): From this time (RFC 3339). - `to` (timestamp, optional): Until this time (RFC 3339). - `cursor` (string, optional): The next_cursor of the previous page. - `limit` (number, optional): Lines per page, 1 to 750 (default 50). Example: `200` ## Returns - **200** [The log page object](https://docs.dispralabs.com/objects/the-log-page-object.md): A page of lines. ## Errors | Status | Code | When | |---|---|---| | 400 | [invalid_limit](https://docs.dispralabs.com/errors.md#invalid_limit) | limit is 1 to 750. | | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 503 | [logs_unavailable](https://docs.dispralabs.com/errors.md#logs_unavailable) | Logs can't be read right now. Retry shortly. | ## Request samples ### Dispra Cloud CLI ```bash dcloud logs api --page --limit 200 --search timeout ``` ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/logs?svc=svc_01jdk3n2f4g6h8j0k2l4z6x8ca&level=warn%2Cerror&q=timeout&limit=200" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/logs?svc=svc_01jdk3n2f4g6h8j0k2l4z6x8ca&level=warn%2Cerror&q=timeout&limit=200", { method: "GET", headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); console.log(await res.json()); ``` ### Python ```python import requests res = requests.request("GET", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/logs", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}, params={"svc": "svc_01jdk3n2f4g6h8j0k2l4z6x8ca", "level": "warn,error", "q": "timeout", "limit": "200"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("GET", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/logs?svc=svc_01jdk3n2f4g6h8j0k2l4z6x8ca&level=warn%2Cerror&q=timeout&limit=200", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "items": [{"id":"ln_8f2c1a","ts":"2026-12-05T10:15:02Z","level":"info","message":"GET /healthz 200 3ms"}], "next_cursor": "c_1764324999_8f2c1a", "total": 1832, "total_cap": 10000 } } ``` ### 400 invalid_limit ```json { "error": { "code": "invalid_limit", "message": "limit is 1 to 750.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 503 logs_unavailable ```json { "error": { "code": "logs_unavailable", "message": "Logs can't be read right now. Retry shortly.", "request_id": "req_7f3a9c21d84be056" } } ``` ## Related - [Log search and streaming](https://docs.dispralabs.com/features/log-search-and-streaming.md) --- *Cloud › Logs and shell* # List log filters ```http GET https://devapi.dispralabs.com/v1/cloud/projects/:prj/logs/facets ``` The services, levels, environments and deployments the project's logs of the last 7 days have, for filter menus. Needs a key with `read` access or more. - **Authentication:** Secret key (send it as `Authorization: Bearer `) ## Parameters - `prj` (string, required): The project's id. Example: `prj_01jdk3m9x2v7c4q8w5n6b1t0ra` ## Returns - **200**: services, levels, environments, svcs and deployments. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api GET /v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/logs/facets ``` ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/logs/facets" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/logs/facets", { method: "GET", headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); console.log(await res.json()); ``` ### Python ```python import requests res = requests.request("GET", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/logs/facets", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("GET", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/logs/facets", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json {} ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Logs and shell* # Open a shell ```http POST https://devapi.dispralabs.com/v1/cloud/services/:svc/console ``` Mints a single-use ticket for a terminal shell in one running replica. Open a WebSocket to `ws_url` within 5 minutes, **without** an `Origin` header: binary frames carry the terminal, a text frame `{"t":"resize","cols":120,"rows":30}` resizes it. The shell closes after 10 idle minutes, or after an hour. Needs `full` access. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` ## Returns - **200** [The console session object](https://docs.dispralabs.com/objects/the-console-session-object.md): The ticket. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 409 | [not_running](https://docs.dispralabs.com/errors.md#not_running) | The service has no running replica. | | 409 | [console_unavailable](https://docs.dispralabs.com/errors.md#console_unavailable) | Shells aren't available in this region yet. | ## Request samples ### Dispra Cloud CLI ```bash dcloud ssh api ``` ### cURL ```bash curl -X POST "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/console" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/console", { method: "POST", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID() }, }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("POST", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/console", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("POST", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/console", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "token": "eyJhbGciOiJFZERTQSJ9.eyJzdWIiOi4uLn0.c2ln", "ws_url": "wss://core.cloud.dispralabs.com/v1/console/connect?token=eyJ...", "expires_at": "2026-12-05T10:15:02Z", "idle_timeout_s": 600, "max_session_s": 3600 } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 not_running ```json { "error": { "code": "not_running", "message": "The service has no running replica.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 console_unavailable ```json { "error": { "code": "console_unavailable", "message": "Shells aren't available in this region yet.", "request_id": "req_7f3a9c21d84be056" } } ``` ## Related - [Terminal shell](https://docs.dispralabs.com/features/terminal-shell.md) - [shell.session](https://docs.dispralabs.com/flows/shell-session.md) --- *Cloud › Logs and shell* # Stream a service's logs ```http GET https://devapi.dispralabs.com/v1/cloud/services/:svc/logs/stream ``` Streams what the service's live deployment writes, as Server-Sent Events. It starts with the newest 100 lines (`tail` to choose 0 to 750), then follows. Each line is `event: line` with `{at, level, message, replica}`; a comment is sent every 15 seconds. If more than 750 lines arrive at once, the newest 750 are sent after `event: gap` with how many were skipped. Reconnect with `since` or `Last-Event-ID` to continue where you left off. Needs a key with `read` access or more. - **Authentication:** Secret key (send it as `Authorization: Bearer `) ## Parameters - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` - `tail` (number, optional): Start with the newest N lines, 0 to 750 (default 100). Example: `200` - `since` (timestamp, optional): Continue after this line's time. ## Returns - **200**: A text/event-stream. ## Errors | Status | Code | When | |---|---|---| | 400 | [invalid_tail](https://docs.dispralabs.com/errors.md#invalid_tail) | tail is 0 to 750. | | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud logs api -n 200 ``` ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/logs/stream?tail=200" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/logs/stream?tail=200", { method: "GET", headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); console.log(await res.json()); ``` ### Python ```python import requests res = requests.request("GET", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/logs/stream", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}, params={"tail": "200"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("GET", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/logs/stream?tail=200", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json {} ``` ### 400 invalid_tail ```json { "error": { "code": "invalid_tail", "message": "tail is 0 to 750.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ## Related - [Log search and streaming](https://docs.dispralabs.com/features/log-search-and-streaming.md) --- *Cloud* # The custom domain object Your own domain in front of a service: a subdomain (a CNAME) or a zone apex (A records). Dispra checks the DNS records, proves you own the domain and issues its certificate. ## Attributes - `dom` (string): The domain's id. - `domain` (string): The domain name. - `svc` (string): The service it reaches. - `status` (string): pending_dns, verifying, issuing_certificate, active or failed. - `port` (number): The container port it forwards to, or null for the port the image exposes. - `records` (array): The DNS records to create, each with what the last check found. - `certificate` (string): none, issuing or active. ## Example ```json { "data": { "dom": "dom_01jdk5g7h9j1k3l5z7x9c1v3bn", "domain": "api.acme.com", "svc": "svc_01jdk3n2f4g6h8j0k2l4z6x8ca", "status": "active", "port": 3000, "records": [{"type":"CNAME","name":"api.acme.com","value":"x8ca.global.dispracloud.app","ok":true}], "certificate": "active" } } ``` ## Endpoints - `POST` [Add a custom domain](https://docs.dispralabs.com/api/add-a-custom-domain.md) - `POST` [Connect a custom domain](https://docs.dispralabs.com/api/connect-a-custom-domain.md) - `DELETE` [Delete a custom domain](https://docs.dispralabs.com/api/delete-a-custom-domain.md) - `GET` [Get a custom domain](https://docs.dispralabs.com/api/get-a-custom-domain.md) - `POST` [Preview a custom domain](https://docs.dispralabs.com/api/preview-a-custom-domain.md) - `POST` [Verify a custom domain](https://docs.dispralabs.com/api/verify-a-custom-domain.md) --- *Cloud* # The endpoint object One way into a service: a generated public HTTPS address, a public TCP port, a private address only the project's services can reach, or a custom domain. ## Attributes - `id` (string): The endpoint's id. - `type` (string): public_http, public_tcp or private. - `scope` (string): service (load balanced) or replica (one replica). - `address` (string): The host name. - `url` (string): The full address, for HTTP endpoints. - `port` (number): The container port it forwards to. - `public_port` (number): For public_tcp: the port on the public address, else null. - `custom` (boolean): True for a custom domain. ## Example ```json { "data": { "id": "dom_01jdk5t3y5u7i9o1p3a5s7d9fg", "type": "public_http", "scope": "service", "address": "api-x8ca.dispracloud.app", "url": "https://api-x8ca.dispracloud.app", "port": 3000, "public_port": 24117, "custom": false } } ``` ## Endpoints - `PATCH` [Change an endpoint's port](https://docs.dispralabs.com/api/change-an-endpoint-s-port.md) - `POST` [Create an endpoint](https://docs.dispralabs.com/api/create-an-endpoint.md) - `DELETE` [Delete an endpoint](https://docs.dispralabs.com/api/delete-an-endpoint.md) - `GET` [List endpoints](https://docs.dispralabs.com/api/list-endpoints.md) - `POST` [Regenerate an endpoint](https://docs.dispralabs.com/api/regenerate-an-endpoint.md) --- *Cloud* # The status object The short answer of a command: the object's id and the state it is now in. ## Attributes - `status` (string): What happened: applied, accepted, deleting, stopped, active, restarting or queued. - `id` (string): The object it is about. ## Example ```json { "data": { "status": "accepted", "id": "svc_01jdk3n2f4g6h8j0k2l4z6x8ca" } } ``` ## Endpoints - `DELETE` [Delete a custom domain](https://docs.dispralabs.com/api/delete-a-custom-domain.md) - `DELETE` [Delete a project](https://docs.dispralabs.com/api/delete-a-project.md) - `DELETE` [Delete a project variable](https://docs.dispralabs.com/api/delete-a-project-variable.md) - `DELETE` [Delete a service](https://docs.dispralabs.com/api/delete-a-service.md) - `DELETE` [Delete a service group](https://docs.dispralabs.com/api/delete-a-service-group.md) - `DELETE` [Delete a service variable](https://docs.dispralabs.com/api/delete-a-service-variable.md) - `DELETE` [Delete a webhook](https://docs.dispralabs.com/api/delete-a-webhook.md) - `DELETE` [Delete an endpoint](https://docs.dispralabs.com/api/delete-an-endpoint.md) - `DELETE` [Remove a region](https://docs.dispralabs.com/api/remove-a-region.md) - `PUT` [Set service limits](https://docs.dispralabs.com/api/set-service-limits.md) --- *Cloud › Networking* # Get a custom domain ```http GET https://devapi.dispralabs.com/v1/cloud/domains/:dom ``` The domain's status, its DNS records with what the last check found, and its certificate. Needs a key with `read` access or more. - **Authentication:** Secret key (send it as `Authorization: Bearer `) ## Parameters - `dom` (string, required): The custom domain's id. Example: `dom_01jdk5g7h9j1k3l5z7x9c1v3bn` ## Returns - **200** [The custom domain object](https://docs.dispralabs.com/objects/the-custom-domain-object.md): The domain. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api GET /v1/cloud/domains/dom_01jdk5g7h9j1k3l5z7x9c1v3bn ``` ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/domains/dom_01jdk5g7h9j1k3l5z7x9c1v3bn" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/domains/dom_01jdk5g7h9j1k3l5z7x9c1v3bn", { method: "GET", headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); console.log(await res.json()); ``` ### Python ```python import requests res = requests.request("GET", "https://devapi.dispralabs.com/v1/cloud/domains/dom_01jdk5g7h9j1k3l5z7x9c1v3bn", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("GET", "https://devapi.dispralabs.com/v1/cloud/domains/dom_01jdk5g7h9j1k3l5z7x9c1v3bn", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "dom": "dom_01jdk5g7h9j1k3l5z7x9c1v3bn", "domain": "api.acme.com", "svc": "svc_01jdk3n2f4g6h8j0k2l4z6x8ca", "status": "active", "port": 3000, "records": [{"type":"CNAME","name":"api.acme.com","value":"x8ca.global.dispracloud.app","ok":true}], "certificate": "active" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Networking* # Delete a custom domain ```http DELETE https://devapi.dispralabs.com/v1/cloud/domains/:dom ``` Removes the domain from the service. It stops answering, and its certificate is no longer renewed. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `dom` (string, required): The custom domain's id. Example: `dom_01jdk5g7h9j1k3l5z7x9c1v3bn` ## Returns - **200** [The status object](https://docs.dispralabs.com/objects/the-status-object.md): Deleted. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud domain remove api.acme.com ``` ### cURL ```bash curl -X DELETE "https://devapi.dispralabs.com/v1/cloud/domains/dom_01jdk5g7h9j1k3l5z7x9c1v3bn" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/domains/dom_01jdk5g7h9j1k3l5z7x9c1v3bn", { method: "DELETE", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID() }, }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("DELETE", "https://devapi.dispralabs.com/v1/cloud/domains/dom_01jdk5g7h9j1k3l5z7x9c1v3bn", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("DELETE", "https://devapi.dispralabs.com/v1/cloud/domains/dom_01jdk5g7h9j1k3l5z7x9c1v3bn", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "status": "accepted", "id": "svc_01jdk3n2f4g6h8j0k2l4z6x8ca" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Networking* # Connect a custom domain ```http POST https://devapi.dispralabs.com/v1/cloud/domains/:dom/connect ``` When the domain's DNS provider supports Domain Connect: the address where you approve the records at your provider. The domain is then checked as usual. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `dom` (string, required): The custom domain's id. Example: `dom_01jdk5g7h9j1k3l5z7x9c1v3bn` - `redirect_uri` (string, required): Where the provider sends you back. Example: `https://acme.com/domains/done` ## Returns - **200**: url, width and height. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 409 | [domain_connect_unsupported](https://docs.dispralabs.com/errors.md#domain_connect_unsupported) | The provider doesn't support Domain Connect. | ## Request samples ### Dispra Cloud CLI ```bash dcloud api POST /v1/cloud/domains/dom_01jdk5g7h9j1k3l5z7x9c1v3bn/connect --data '{"redirect_uri":"https://acme.com/domains/done"}' ``` ### cURL ```bash curl -X POST "https://devapi.dispralabs.com/v1/cloud/domains/dom_01jdk5g7h9j1k3l5z7x9c1v3bn/connect" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"redirect_uri":"https://acme.com/domains/done"}' ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/domains/dom_01jdk5g7h9j1k3l5z7x9c1v3bn/connect", { method: "POST", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" }, body: JSON.stringify({ "redirect_uri": "https://acme.com/domains/done" }), }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("POST", "https://devapi.dispralabs.com/v1/cloud/domains/dom_01jdk5g7h9j1k3l5z7x9c1v3bn/connect", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}, json={ "redirect_uri": "https://acme.com/domains/done" }) print(res.json()) ``` ### Go ```go body := strings.NewReader(`{"redirect_uri":"https://acme.com/domains/done"}`) req, _ := http.NewRequest("POST", "https://devapi.dispralabs.com/v1/cloud/domains/dom_01jdk5g7h9j1k3l5z7x9c1v3bn/connect", body) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json {} ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 domain_connect_unsupported ```json { "error": { "code": "domain_connect_unsupported", "message": "The provider doesn't support Domain Connect.", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Networking* # Verify a custom domain ```http POST https://devapi.dispralabs.com/v1/cloud/domains/:dom/verify ``` Checks the domain's DNS records now, instead of waiting for the next automatic check. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `dom` (string, required): The custom domain's id. Example: `dom_01jdk5g7h9j1k3l5z7x9c1v3bn` ## Returns - **200** [The custom domain object](https://docs.dispralabs.com/objects/the-custom-domain-object.md): The domain. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 429 | [rate_limited](https://docs.dispralabs.com/errors.md#rate_limited) | Checked less than 10 seconds ago. | ## Request samples ### Dispra Cloud CLI ```bash dcloud domain verify api.acme.com ``` ### cURL ```bash curl -X POST "https://devapi.dispralabs.com/v1/cloud/domains/dom_01jdk5g7h9j1k3l5z7x9c1v3bn/verify" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/domains/dom_01jdk5g7h9j1k3l5z7x9c1v3bn/verify", { method: "POST", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID() }, }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("POST", "https://devapi.dispralabs.com/v1/cloud/domains/dom_01jdk5g7h9j1k3l5z7x9c1v3bn/verify", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("POST", "https://devapi.dispralabs.com/v1/cloud/domains/dom_01jdk5g7h9j1k3l5z7x9c1v3bn/verify", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "dom": "dom_01jdk5g7h9j1k3l5z7x9c1v3bn", "domain": "api.acme.com", "svc": "svc_01jdk3n2f4g6h8j0k2l4z6x8ca", "status": "active", "port": 3000, "records": [{"type":"CNAME","name":"api.acme.com","value":"x8ca.global.dispracloud.app","ok":true}], "certificate": "active" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 429 rate_limited ```json { "error": { "code": "rate_limited", "message": "Checked less than 10 seconds ago.", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Networking* # Add a custom domain ```http POST https://devapi.dispralabs.com/v1/cloud/services/:svc/domains ``` Adds your domain in front of the service. The answer lists the exact DNS records to create; Dispra checks them automatically, then issues the certificate. A subdomain needs a CNAME; a zone apex needs A records. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` - `domain` (string, required): The domain. Example: `api.acme.com` - `port` (number, optional): The container port (default the image's). Example: `3000` - `preview_token` (string, optional): The preview's token, to keep the same records. ## Returns - **201** [The custom domain object](https://docs.dispralabs.com/objects/the-custom-domain-object.md): The domain, with its records. ## Errors | Status | Code | When | |---|---|---| | 400 | [invalid_domain](https://docs.dispralabs.com/errors.md#invalid_domain) | That isn't a domain you can add. | | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 409 | [domain_taken](https://docs.dispralabs.com/errors.md#domain_taken) | Another service uses that domain. | | 409 | [account_frozen](https://docs.dispralabs.com/errors.md#account_frozen) | The workspace is out of credits: add credits on the dashboard to create, change or deploy. | ## Request samples ### Dispra Cloud CLI ```bash dcloud domain add api api.acme.com ``` ### cURL ```bash curl -X POST "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/domains" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"domain":"api.acme.com","port":3000}' ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/domains", { method: "POST", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" }, body: JSON.stringify({ "domain": "api.acme.com", "port": 3000 }), }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("POST", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/domains", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}, json={ "domain": "api.acme.com", "port": 3000 }) print(res.json()) ``` ### Go ```go body := strings.NewReader(`{"domain":"api.acme.com","port":3000}`) req, _ := http.NewRequest("POST", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/domains", body) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 201 ```json { "data": { "dom": "dom_01jdk5g7h9j1k3l5z7x9c1v3bn", "domain": "api.acme.com", "svc": "svc_01jdk3n2f4g6h8j0k2l4z6x8ca", "status": "active", "port": 3000, "records": [{"type":"CNAME","name":"api.acme.com","value":"x8ca.global.dispracloud.app","ok":true}], "certificate": "active" } } ``` ### 400 invalid_domain ```json { "error": { "code": "invalid_domain", "message": "That isn't a domain you can add.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 domain_taken ```json { "error": { "code": "domain_taken", "message": "Another service uses that domain.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 account_frozen ```json { "error": { "code": "account_frozen", "message": "The workspace is out of credits: add credits on the dashboard to create, change or deploy.", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Networking* # Preview a custom domain ```http POST https://devapi.dispralabs.com/v1/cloud/services/:svc/domains/preview ``` Shows the DNS records a domain will need, its DNS provider and whether the provider can set them up automatically, before adding it. Nothing is added. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` - `domain` (string, required): The domain. Example: `api.acme.com` - `port` (number, optional): The container port (default the image's). Example: `3000` ## Returns - **200**: records, provider and preview_token. ## Errors | Status | Code | When | |---|---|---| | 400 | [invalid_domain](https://docs.dispralabs.com/errors.md#invalid_domain) | That isn't a domain you can add. | | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 409 | [domain_taken](https://docs.dispralabs.com/errors.md#domain_taken) | Another service uses that domain. | ## Request samples ### Dispra Cloud CLI ```bash dcloud api POST /v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/domains/preview --data '{"domain":"api.acme.com","port":3000}' ``` ### cURL ```bash curl -X POST "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/domains/preview" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"domain":"api.acme.com","port":3000}' ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/domains/preview", { method: "POST", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" }, body: JSON.stringify({ "domain": "api.acme.com", "port": 3000 }), }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("POST", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/domains/preview", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}, json={ "domain": "api.acme.com", "port": 3000 }) print(res.json()) ``` ### Go ```go body := strings.NewReader(`{"domain":"api.acme.com","port":3000}`) req, _ := http.NewRequest("POST", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/domains/preview", body) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json {} ``` ### 400 invalid_domain ```json { "error": { "code": "invalid_domain", "message": "That isn't a domain you can add.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 domain_taken ```json { "error": { "code": "domain_taken", "message": "Another service uses that domain.", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Networking* # Create an endpoint ```http POST https://devapi.dispralabs.com/v1/cloud/services/:svc/endpoints ``` Generates a new address for the service, forwarding to a container port: - `public_http`: `https://.dispracloud.app`, - `public_tcp`: its own public port, open to the internet, - `private`: reachable only from the project's own services. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` - `type` (string, required): public_http, public_tcp or private. Example: `public_http` - `port` (number, required): The container port. Example: `3000` - `name` (string, optional): The name to use, 3 to 40 of a-z, 0-9 and dashes (default random). Example: `acme-api` ## Returns - **201** [The endpoint object](https://docs.dispralabs.com/objects/the-endpoint-object.md): The endpoint. ## Errors | Status | Code | When | |---|---|---| | 400 | [invalid_request](https://docs.dispralabs.com/errors.md#invalid_request) | A field is missing or not valid. The message names it. | | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 409 | [name_taken](https://docs.dispralabs.com/errors.md#name_taken) | That name is taken. | | 409 | [account_frozen](https://docs.dispralabs.com/errors.md#account_frozen) | The workspace is out of credits: add credits on the dashboard to create, change or deploy. | ## Request samples ### Dispra Cloud CLI ```bash dcloud api POST /v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/endpoints --data '{"type":"public_http","port":3000,"name":"acme-api"}' ``` ### cURL ```bash curl -X POST "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/endpoints" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"type":"public_http","port":3000,"name":"acme-api"}' ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/endpoints", { method: "POST", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" }, body: JSON.stringify({ "type": "public_http", "port": 3000, "name": "acme-api" }), }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("POST", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/endpoints", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}, json={ "type": "public_http", "port": 3000, "name": "acme-api" }) print(res.json()) ``` ### Go ```go body := strings.NewReader(`{"type":"public_http","port":3000,"name":"acme-api"}`) req, _ := http.NewRequest("POST", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/endpoints", body) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 201 ```json { "data": { "id": "dom_01jdk5t3y5u7i9o1p3a5s7d9fg", "type": "public_http", "scope": "service", "address": "api-x8ca.dispracloud.app", "url": "https://api-x8ca.dispracloud.app", "port": 3000, "public_port": 24117, "custom": false } } ``` ### 400 invalid_request ```json { "error": { "code": "invalid_request", "message": "A field is missing or not valid. The message names it.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 name_taken ```json { "error": { "code": "name_taken", "message": "That name is taken.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 account_frozen ```json { "error": { "code": "account_frozen", "message": "The workspace is out of credits: add credits on the dashboard to create, change or deploy.", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Networking* # List endpoints ```http GET https://devapi.dispralabs.com/v1/cloud/services/:svc/endpoints ``` Every way into the service: generated public HTTPS addresses, public TCP ports, private addresses and custom domains. Needs a key with `read` access or more. - **Authentication:** Secret key (send it as `Authorization: Bearer `) ## Parameters - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` ## Returns - **200** [The endpoint object](https://docs.dispralabs.com/objects/the-endpoint-object.md): The endpoints. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud domains api ``` ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/endpoints" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/endpoints", { method: "GET", headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); console.log(await res.json()); ``` ### Python ```python import requests res = requests.request("GET", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/endpoints", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("GET", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/endpoints", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "id": "dom_01jdk5t3y5u7i9o1p3a5s7d9fg", "type": "public_http", "scope": "service", "address": "api-x8ca.dispracloud.app", "url": "https://api-x8ca.dispracloud.app", "port": 3000, "public_port": 24117, "custom": false } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Networking* # Change an endpoint's port ```http PATCH https://devapi.dispralabs.com/v1/cloud/services/:svc/endpoints/:id ``` Changes the container port an endpoint forwards to. It applies without a redeploy. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` - `id` (string, required): The endpoint's id. Example: `dom_01jdk5t3y5u7i9o1p3a5s7d9fg` - `port` (number, required): The container port. Example: `8080` ## Returns - **200** [The endpoint object](https://docs.dispralabs.com/objects/the-endpoint-object.md): The endpoint. ## Errors | Status | Code | When | |---|---|---| | 400 | [invalid_request](https://docs.dispralabs.com/errors.md#invalid_request) | A field is missing or not valid. The message names it. | | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 409 | [account_frozen](https://docs.dispralabs.com/errors.md#account_frozen) | The workspace is out of credits: add credits on the dashboard to create, change or deploy. | ## Request samples ### Dispra Cloud CLI ```bash dcloud api PATCH /v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/endpoints/dom_01jdk5t3y5u7i9o1p3a5s7d9fg --data '{"port":8080}' ``` ### cURL ```bash curl -X PATCH "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/endpoints/dom_01jdk5t3y5u7i9o1p3a5s7d9fg" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"port":8080}' ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/endpoints/dom_01jdk5t3y5u7i9o1p3a5s7d9fg", { method: "PATCH", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" }, body: JSON.stringify({ "port": 8080 }), }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("PATCH", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/endpoints/dom_01jdk5t3y5u7i9o1p3a5s7d9fg", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}, json={ "port": 8080 }) print(res.json()) ``` ### Go ```go body := strings.NewReader(`{"port":8080}`) req, _ := http.NewRequest("PATCH", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/endpoints/dom_01jdk5t3y5u7i9o1p3a5s7d9fg", body) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "id": "dom_01jdk5t3y5u7i9o1p3a5s7d9fg", "type": "public_http", "scope": "service", "address": "api-x8ca.dispracloud.app", "url": "https://api-x8ca.dispracloud.app", "port": 3000, "public_port": 24117, "custom": false } } ``` ### 400 invalid_request ```json { "error": { "code": "invalid_request", "message": "A field is missing or not valid. The message names it.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 account_frozen ```json { "error": { "code": "account_frozen", "message": "The workspace is out of credits: add credits on the dashboard to create, change or deploy.", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Networking* # Delete an endpoint ```http DELETE https://devapi.dispralabs.com/v1/cloud/services/:svc/endpoints/:id ``` The endpoint stops answering at once. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` - `id` (string, required): The endpoint's id. Example: `dom_01jdk5t3y5u7i9o1p3a5s7d9fg` ## Returns - **200** [The status object](https://docs.dispralabs.com/objects/the-status-object.md): Deleted. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api DELETE /v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/endpoints/dom_01jdk5t3y5u7i9o1p3a5s7d9fg ``` ### cURL ```bash curl -X DELETE "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/endpoints/dom_01jdk5t3y5u7i9o1p3a5s7d9fg" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/endpoints/dom_01jdk5t3y5u7i9o1p3a5s7d9fg", { method: "DELETE", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID() }, }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("DELETE", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/endpoints/dom_01jdk5t3y5u7i9o1p3a5s7d9fg", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("DELETE", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/endpoints/dom_01jdk5t3y5u7i9o1p3a5s7d9fg", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "status": "accepted", "id": "svc_01jdk3n2f4g6h8j0k2l4z6x8ca" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Networking* # Regenerate an endpoint ```http POST https://devapi.dispralabs.com/v1/cloud/services/:svc/endpoints/:id/regenerate ``` Gives the endpoint a new random name (and a new public port for TCP). The old address stops working at once. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` - `id` (string, required): The endpoint's id. Example: `dom_01jdk5t3y5u7i9o1p3a5s7d9fg` ## Returns - **200** [The endpoint object](https://docs.dispralabs.com/objects/the-endpoint-object.md): The endpoint. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api POST /v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/endpoints/dom_01jdk5t3y5u7i9o1p3a5s7d9fg/regenerate ``` ### cURL ```bash curl -X POST "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/endpoints/dom_01jdk5t3y5u7i9o1p3a5s7d9fg/regenerate" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/endpoints/dom_01jdk5t3y5u7i9o1p3a5s7d9fg/regenerate", { method: "POST", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID() }, }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("POST", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/endpoints/dom_01jdk5t3y5u7i9o1p3a5s7d9fg/regenerate", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("POST", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/endpoints/dom_01jdk5t3y5u7i9o1p3a5s7d9fg/regenerate", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "id": "dom_01jdk5t3y5u7i9o1p3a5s7d9fg", "type": "public_http", "scope": "service", "address": "api-x8ca.dispracloud.app", "url": "https://api-x8ca.dispracloud.app", "port": 3000, "public_port": 24117, "custom": false } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Networking* # Check an address name ```http GET https://devapi.dispralabs.com/v1/cloud/services/:svc/endpoints/name ``` Whether `.dispracloud.app` can be the service's address. Needs a key with `read` access or more. - **Authentication:** Secret key (send it as `Authorization: Bearer `) ## Parameters - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` - `name` (string, required): The name to check. Example: `acme-api` ## Returns - **200**: available, and reason when not. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api GET /v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/endpoints/name?name=acme-api ``` ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/endpoints/name?name=acme-api" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/endpoints/name?name=acme-api", { method: "GET", headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); console.log(await res.json()); ``` ### Python ```python import requests res = requests.request("GET", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/endpoints/name", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}, params={"name": "acme-api"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("GET", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/endpoints/name?name=acme-api", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json {} ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud* # The project object A project groups the environments and services of one product. Projects are created on the dashboard; everything inside one is managed through this API. A key belongs to exactly one project. ## Attributes - `prj` (string): The project's id. - `name` (string): Its name, unique in the workspace. - `description` (string): A free-text description. - `region` (string): Where its services run: india or us. - `status` (string): ok, needs_attention, stopped, empty or deleting. - `service_count` (number): Services in all its environments. - `environments` (array): Its environment names. An environment key sees only its own. - `created_at` (timestamp): When it was created, Unix seconds. - `last_deploy_at` (timestamp): When a deployment last went live, or null. ## Example ```json { "data": { "prj": "prj_01jdk3m9x2v7c4q8w5n6b1t0ra", "name": "storefront", "description": "Storefront and its workers", "region": "india", "status": "ok", "service_count": 3, "environments": ["production", "staging"], "created_at": 1764324999, "last_deploy_at": "2026-12-05T10:15:02Z" } } ``` ## Endpoints - `POST` [Create a service](https://docs.dispralabs.com/api/create-a-service.md) - `POST` [Create an environment](https://docs.dispralabs.com/api/create-an-environment.md) - `PUT` [Create or update a webhook](https://docs.dispralabs.com/api/create-or-update-a-webhook.md) - `DELETE` [Delete a project](https://docs.dispralabs.com/api/delete-a-project.md) - `DELETE` [Delete a webhook](https://docs.dispralabs.com/api/delete-a-webhook.md) - `GET` [Get a project](https://docs.dispralabs.com/api/get-a-project.md) - `GET` [Get the signing secret](https://docs.dispralabs.com/api/get-the-signing-secret.md) - `GET` [List a webhook's deliveries](https://docs.dispralabs.com/api/list-a-webhook-s-deliveries.md) - `GET` [List API calls](https://docs.dispralabs.com/api/list-api-calls.md) - `GET` [List deliveries](https://docs.dispralabs.com/api/list-deliveries.md) - `GET` [List environments](https://docs.dispralabs.com/api/list-environments.md) - `GET` [List log filters](https://docs.dispralabs.com/api/list-log-filters.md) - `GET` [List logs](https://docs.dispralabs.com/api/list-logs.md) - `GET` [List project activity](https://docs.dispralabs.com/api/list-project-activity.md) - `GET` [List webhooks](https://docs.dispralabs.com/api/list-webhooks.md) - `GET` [Preview a project deletion](https://docs.dispralabs.com/api/preview-a-project-deletion.md) - `POST` [Reveal the signing secret](https://docs.dispralabs.com/api/reveal-the-signing-secret.md) - `POST` [Rotate the signing secret](https://docs.dispralabs.com/api/rotate-the-signing-secret.md) - `POST` [Send a test event](https://docs.dispralabs.com/api/send-a-test-event.md) - `PATCH` [Update a project](https://docs.dispralabs.com/api/update-a-project.md) --- *Cloud › Projects* # Get a project ```http GET https://devapi.dispralabs.com/v1/cloud/projects/:prj ``` Returns the project the key belongs to: its name, region, status, environments and when it last deployed. An environment key sees only its own environment in `environments`. Projects are created and transferred on the dashboard. Needs a key with `read` access or more. - **Authentication:** Secret key (send it as `Authorization: Bearer `) ## Parameters - `prj` (string, required): The project's id. Example: `prj_01jdk3m9x2v7c4q8w5n6b1t0ra` ## Returns - **200** [The project object](https://docs.dispralabs.com/objects/the-project-object.md): The project. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api GET /v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra ``` ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra", { method: "GET", headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); console.log(await res.json()); ``` ### Python ```python import requests res = requests.request("GET", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("GET", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "prj": "prj_01jdk3m9x2v7c4q8w5n6b1t0ra", "name": "storefront", "description": "Storefront and its workers", "region": "india", "status": "ok", "service_count": 3, "environments": ["production", "staging"], "created_at": 1764324999, "last_deploy_at": "2026-12-05T10:15:02Z" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Projects* # Update a project ```http PATCH https://devapi.dispralabs.com/v1/cloud/projects/:prj ``` Renames the project or changes its description. Send at least one field. Needs a key with `full` access, made by a project admin. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `prj` (string, required): The project's id. Example: `prj_01jdk3m9x2v7c4q8w5n6b1t0ra` - `name` (string, optional): A new name, unique in the workspace. Example: `storefront` - `description` (string, optional): A new description. Example: `Storefront and its workers` ## Returns - **200**: prj and status (applied). Read the project for its new state. ## Errors | Status | Code | When | |---|---|---| | 400 | [invalid_request](https://docs.dispralabs.com/errors.md#invalid_request) | A field is missing or not valid. The message names it. | | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 409 | [name_taken](https://docs.dispralabs.com/errors.md#name_taken) | Another project of the workspace has that name. | ## Request samples ### Dispra Cloud CLI ```bash dcloud api PATCH /v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra --data '{"name":"storefront","description":"Storefront and its workers"}' ``` ### cURL ```bash curl -X PATCH "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"name":"storefront","description":"Storefront and its workers"}' ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra", { method: "PATCH", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" }, body: JSON.stringify({ "name": "storefront", "description": "Storefront and its workers" }), }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("PATCH", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}, json={ "name": "storefront", "description": "Storefront and its workers" }) print(res.json()) ``` ### Go ```go body := strings.NewReader(`{"name":"storefront","description":"Storefront and its workers"}`) req, _ := http.NewRequest("PATCH", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra", body) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json {} ``` ### 400 invalid_request ```json { "error": { "code": "invalid_request", "message": "A field is missing or not valid. The message names it.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 name_taken ```json { "error": { "code": "name_taken", "message": "Another project of the workspace has that name.", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Projects* # Delete a project ```http DELETE https://devapi.dispralabs.com/v1/cloud/projects/:prj ``` Deletes the project **permanently**. This cannot be undone: services stop, environments, volumes and their backups are deleted, domains are released, and every key of the project stops working, the one you call with included. The teardown runs in steps; a `project.deleted` webhook event is sent when it has finished. Send `confirm: true`. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `prj` (string, required): The project's id. Example: `prj_01jdk3m9x2v7c4q8w5n6b1t0ra` - `confirm` (boolean, required): Must be true. Example: `true` ## Returns - **200** [The status object](https://docs.dispralabs.com/objects/the-status-object.md): The teardown started. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 400 | [confirm_required](https://docs.dispralabs.com/errors.md#confirm_required) | Send confirm: true. | ## Request samples ### Dispra Cloud CLI ```bash dcloud api DELETE /v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra?confirm=true ``` ### cURL ```bash curl -X DELETE "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra?confirm=true" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra?confirm=true", { method: "DELETE", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID() }, }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("DELETE", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}, params={"confirm": "true"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("DELETE", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra?confirm=true", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "status": "accepted", "id": "svc_01jdk3n2f4g6h8j0k2l4z6x8ca" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 400 confirm_required ```json { "error": { "code": "confirm_required", "message": "Send confirm: true.", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Projects* # List project activity ```http GET https://devapi.dispralabs.com/v1/cloud/projects/:prj/activity ``` The project's activity feed, newest first: deployments, failures, crashes and out-of-memory restarts, setting changes, backups, with who did each. Pass `env` for one environment. Needs a key with `read` access or more. - **Authentication:** Secret key (send it as `Authorization: Bearer `) ## Parameters - `prj` (string, required): The project's id. Example: `prj_01jdk3m9x2v7c4q8w5n6b1t0ra` - `env` (string, optional): Only this environment's activity. Example: `env_01jdk3m9x5h2p8r4t6y1u3i0oa` - `cursor` (string, optional): The next_cursor of the previous page. - `limit` (number, optional): Items per page, 1 to 200 (default 50). Example: `50` ## Returns - **200**: A page of activity: items and next_cursor. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api GET /v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/activity?env=env_01jdk3m9x5h2p8r4t6y1u3i0oa&limit=50 ``` ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/activity?env=env_01jdk3m9x5h2p8r4t6y1u3i0oa&limit=50" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/activity?env=env_01jdk3m9x5h2p8r4t6y1u3i0oa&limit=50", { method: "GET", headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); console.log(await res.json()); ``` ### Python ```python import requests res = requests.request("GET", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/activity", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}, params={"env": "env_01jdk3m9x5h2p8r4t6y1u3i0oa", "limit": "50"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("GET", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/activity?env=env_01jdk3m9x5h2p8r4t6y1u3i0oa&limit=50", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json {} ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Projects* # Preview a project deletion ```http GET https://devapi.dispralabs.com/v1/cloud/projects/:prj/delete-preview ``` Lists what deleting the project removes: its services, volumes (with their sizes and backups), environments, custom domains, and the counts of generated addresses, variables, webhooks and keys. Nothing changes. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) ## Parameters - `prj` (string, required): The project's id. Example: `prj_01jdk3m9x2v7c4q8w5n6b1t0ra` ## Returns - **200**: What the deletion removes. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api GET /v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/delete-preview ``` ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/delete-preview" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/delete-preview", { method: "GET", headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); console.log(await res.json()); ``` ### Python ```python import requests res = requests.request("GET", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/delete-preview", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("GET", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/delete-preview", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json {} ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud* # The metrics object A service's resource use over a range: CPU, memory and network out, for the service and each replica, from one-minute windows. ## Attributes - `range` (string): 1h, 3h, 24h, 7d or 30d. - `step_s` (number): Seconds per point. - `series` (object): cpu_millis, memory_mb and network_tx_bytes, each a list of [unix, value]. - `replicas` (array): The same series per replica. - `limits` (object): The limits in force. ## Example ```json { "data": { "range": "24h", "step_s": 300, "series": {"cpu_millis":[[1764324900,412]],"memory_mb":[[1764324900,618]]}, "replicas": [{"replica":"r1","cpu_millis":[[1764324900,205]]}], "limits": {"cpu_millis":1000,"memory_mb":1024} } } ``` ## Endpoints - `GET` [Get service metrics](https://docs.dispralabs.com/api/get-service-metrics.md) --- *Cloud* # The region object Where a service runs. A service without a volume can run in several regions, behind one global address. ## Attributes - `region` (string): india or us. - `svc` (string): The service, or its copy in that region. - `primary` (boolean): True for the project's own region. - `replicas` (number): Replicas in that region. - `state` (string): active or deleting. ## Example ```json { "data": { "region": "us", "svc": "svc_01jdk3n2f4g6h8j0k2l4z6x8ca", "primary": false, "replicas": 1, "state": "active" } } ``` ## Endpoints - `POST` [Add a region](https://docs.dispralabs.com/api/add-a-region.md) - `GET` [List service regions](https://docs.dispralabs.com/api/list-service-regions.md) - `DELETE` [Remove a region](https://docs.dispralabs.com/api/remove-a-region.md) - `PATCH` [Set a region's replicas](https://docs.dispralabs.com/api/set-a-region-s-replicas.md) --- *Cloud* # The service object A service is one app that runs in an environment: built from a GitHub repository or run from a container image, on one or more replicas, in one or more regions. ## Attributes - `svc` (string): The service's id. - `name` (string): Its name, unique in the environment. - `env` (string): The environment it runs in. - `source_kind` (string): repo (built from GitHub) or image (a container image). - `dep` (string): Its latest deployment, or empty before the first. - `dep_state` (string): That deployment's state: queued, building, starting, live, failed, superseded, rolled_back or cancelled. - `cpu_millis` (number): CPU per replica in millicores (1000 = one core). - `memory_mb` (number): Memory per replica in MB. - `replicas` (number): Replicas in the project's region. - `hostname` (string): Its generated public address. - `group` (string): Its service group, or null. ## Example ```json { "data": { "svc": "svc_01jdk3n2f4g6h8j0k2l4z6x8ca", "name": "api", "env": "env_01jdk3m9x5h2p8r4t6y1u3i0oa", "source_kind": "repo", "dep": "dep_01jdk4p7q9w1e3r5t7y9u1i3ob", "dep_state": "live", "cpu_millis": 1000, "memory_mb": 1024, "replicas": 2, "hostname": "api-x8ca.in.dispracloud.app", "group": "grp_01jdk5e2r4t6y8u0i2o4p6a8sd" } } ``` ## Endpoints - `POST` [Add a custom domain](https://docs.dispralabs.com/api/add-a-custom-domain.md) - `POST` [Add a region](https://docs.dispralabs.com/api/add-a-region.md) - `POST` [Attach a volume](https://docs.dispralabs.com/api/attach-a-volume.md) - `POST` [Cancel a deployment](https://docs.dispralabs.com/api/cancel-a-deployment.md) - `PATCH` [Change an endpoint's port](https://docs.dispralabs.com/api/change-an-endpoint-s-port.md) - `GET` [Check a file on the branch](https://docs.dispralabs.com/api/check-a-file-on-the-branch.md) - `GET` [Check an address name](https://docs.dispralabs.com/api/check-an-address-name.md) - `POST` [Create a deployment](https://docs.dispralabs.com/api/create-a-deployment.md) - `POST` [Create a service](https://docs.dispralabs.com/api/create-a-service.md) - `POST` [Create an endpoint](https://docs.dispralabs.com/api/create-an-endpoint.md) - `DELETE` [Delete a service](https://docs.dispralabs.com/api/delete-a-service.md) - `DELETE` [Delete a service variable](https://docs.dispralabs.com/api/delete-a-service-variable.md) - `DELETE` [Delete an endpoint](https://docs.dispralabs.com/api/delete-an-endpoint.md) - `DELETE` [Detach a volume](https://docs.dispralabs.com/api/detach-a-volume.md) - `GET` [Get a deployment](https://docs.dispralabs.com/api/get-a-deployment.md) - `GET` [Get a service](https://docs.dispralabs.com/api/get-a-service.md) - `GET` [Get service metrics](https://docs.dispralabs.com/api/get-service-metrics.md) - `GET` [Get service settings](https://docs.dispralabs.com/api/get-service-settings.md) - `GET` [Get the image's port](https://docs.dispralabs.com/api/get-the-image-s-port.md) - `GET` [List deployments](https://docs.dispralabs.com/api/list-deployments.md) - `GET` [List endpoints](https://docs.dispralabs.com/api/list-endpoints.md) - `GET` [List logs](https://docs.dispralabs.com/api/list-logs.md) - `GET` [List recent commits](https://docs.dispralabs.com/api/list-recent-commits.md) - `GET` [List service regions](https://docs.dispralabs.com/api/list-service-regions.md) - `GET` [List service variables](https://docs.dispralabs.com/api/list-service-variables.md) - `GET` [List services](https://docs.dispralabs.com/api/list-services.md) - `PUT` [Move a service to a group](https://docs.dispralabs.com/api/move-a-service-to-a-group.md) - `POST` [Open a shell](https://docs.dispralabs.com/api/open-a-shell.md) - `POST` [Preview a custom domain](https://docs.dispralabs.com/api/preview-a-custom-domain.md) - `POST` [Regenerate an endpoint](https://docs.dispralabs.com/api/regenerate-an-endpoint.md) - `DELETE` [Remove a region](https://docs.dispralabs.com/api/remove-a-region.md) - `POST` [Restart a service](https://docs.dispralabs.com/api/restart-a-service.md) - `POST` [Reveal a service variable](https://docs.dispralabs.com/api/reveal-a-service-variable.md) - `POST` [Reveal all service variables](https://docs.dispralabs.com/api/reveal-all-service-variables.md) - `PATCH` [Set a region's replicas](https://docs.dispralabs.com/api/set-a-region-s-replicas.md) - `PUT` [Set a service variable](https://docs.dispralabs.com/api/set-a-service-variable.md) - `PUT` [Set service limits](https://docs.dispralabs.com/api/set-service-limits.md) - `POST` [Start a service](https://docs.dispralabs.com/api/start-a-service.md) - `POST` [Stop a service](https://docs.dispralabs.com/api/stop-a-service.md) - `GET` [Stream a service's logs](https://docs.dispralabs.com/api/stream-a-service-s-logs.md) - `POST` [Test a health check](https://docs.dispralabs.com/api/test-a-health-check.md) - `PATCH` [Update service settings](https://docs.dispralabs.com/api/update-service-settings.md) - `POST` [Validate variables text](https://docs.dispralabs.com/api/validate-variables-text.md) --- *Cloud* # The service group object A named section of an environment's board. Groups only organise services and volumes; they change nothing about how they run. ## Attributes - `grp` (string): The group's id. - `name` (string): Its name, unique in the environment. - `position` (number): Its place among the environment's groups, from 0. - `created_at` (timestamp): When it was created. ## Example ```json { "data": { "grp": "grp_01jdk5e2r4t6y8u0i2o4p6a8sd", "name": "Backend", "position": 0, "created_at": "2026-12-05T10:15:02Z" } } ``` ## Endpoints - `POST` [Create a service group](https://docs.dispralabs.com/api/create-a-service-group.md) - `DELETE` [Delete a service group](https://docs.dispralabs.com/api/delete-a-service-group.md) - `GET` [List service groups](https://docs.dispralabs.com/api/list-service-groups.md) - `PUT` [Move a service to a group](https://docs.dispralabs.com/api/move-a-service-to-a-group.md) - `PUT` [Move a volume to a group](https://docs.dispralabs.com/api/move-a-volume-to-a-group.md) - `PATCH` [Update a service group](https://docs.dispralabs.com/api/update-a-service-group.md) --- *Cloud* # The service settings object Everything that decides how a service is built, started and sized. Read it, change the fields you want and send base_generation back, so a change made by someone else in between is never overwritten. ## Attributes - `generation` (number): The settings' version. Send it as base_generation when you change them. - `source_kind` (string): repo or image. - `repo_id` (string): The GitHub repository, for a repo service. - `branch` (string): The branch it deploys from. - `root_dir` (string): The folder of the repository to build, relative to its root. - `watch_paths` (array): Only pushes that change these paths deploy. Empty means every push. - `image_ref` (string): The image, for an image service. - `builder` (string): railpack (detects the stack) or dockerfile. - `dockerfile_path` (string): The Dockerfile, for the dockerfile builder. - `build_cmd` (string): Overrides the build command. - `start_cmd` (string): Overrides the start command. - `restart_policy` (string): always, on_failure or never. - `max_restarts` (number): For on_failure: restarts before giving up. 0 retries forever with backoff. - `cpu_millis` (number): CPU per replica in millicores, 50 to 64000. - `memory_mb` (number): Memory per replica in MB, 64 to 262144. - `disk_mb` (number): Temporary disk per replica in MB, whole GB from 1024 to 102400. Wiped on every deploy. - `replicas` (number): Replicas a deployment runs, 1 to 10. A service with a volume runs one. - `healthcheck_path` (string): The path the platform probes before sending traffic. Empty: a TCP check. - `healthcheck_timeout_s` (number): Seconds before one check fails, or null for the default (3). - `healthcheck_interval_s` (number): Seconds between checks, or null for the default (5). - `stop_grace_s` (number): Read only: seconds a replica gets to stop. 10, or 30 with a volume. - `has_volume` (boolean): Read only: a volume is attached. ## Example ```json { "data": { "generation": 7, "source_kind": "repo", "repo_id": "gh-918273645", "branch": "main", "root_dir": "apps/api", "watch_paths": ["apps/api/**"], "image_ref": "ghcr.io/acme/api:1.4.2", "builder": "railpack", "dockerfile_path": "Dockerfile", "build_cmd": "npm run build", "start_cmd": "node dist/server.js", "restart_policy": "on_failure", "max_restarts": 5, "cpu_millis": 1000, "memory_mb": 1024, "disk_mb": 2048, "replicas": 2, "healthcheck_path": "/healthz", "healthcheck_timeout_s": 5, "healthcheck_interval_s": 10, "stop_grace_s": 10, "has_volume": false } } ``` ## Endpoints - `GET` [Check a file on the branch](https://docs.dispralabs.com/api/check-a-file-on-the-branch.md) - `POST` [Create a service](https://docs.dispralabs.com/api/create-a-service.md) - `GET` [Get service settings](https://docs.dispralabs.com/api/get-service-settings.md) - `PUT` [Set service limits](https://docs.dispralabs.com/api/set-service-limits.md) - `POST` [Test a health check](https://docs.dispralabs.com/api/test-a-health-check.md) - `PATCH` [Update service settings](https://docs.dispralabs.com/api/update-service-settings.md) --- *Cloud › Services* # Create a service group ```http POST https://devapi.dispralabs.com/v1/cloud/environments/:env/groups ``` Adds a group at the end of the environment's groups. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `env` (string, required): The environment's id. Example: `env_01jdk3m9x5h2p8r4t6y1u3i0oa` - `name` (string, required): Its name, unique in the environment. Example: `Backend` ## Returns - **201** [The service group object](https://docs.dispralabs.com/objects/the-service-group-object.md): The new group. ## Errors | Status | Code | When | |---|---|---| | 400 | [invalid_request](https://docs.dispralabs.com/errors.md#invalid_request) | A field is missing or not valid. The message names it. | | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 409 | [name_taken](https://docs.dispralabs.com/errors.md#name_taken) | The environment already has a group with that name. | ## Request samples ### Dispra Cloud CLI ```bash dcloud api POST /v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/groups --data '{"name":"Backend"}' ``` ### cURL ```bash curl -X POST "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/groups" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"name":"Backend"}' ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/groups", { method: "POST", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" }, body: JSON.stringify({ "name": "Backend" }), }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("POST", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/groups", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}, json={ "name": "Backend" }) print(res.json()) ``` ### Go ```go body := strings.NewReader(`{"name":"Backend"}`) req, _ := http.NewRequest("POST", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/groups", body) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 201 ```json { "data": { "grp": "grp_01jdk5e2r4t6y8u0i2o4p6a8sd", "name": "Backend", "position": 0, "created_at": "2026-12-05T10:15:02Z" } } ``` ### 400 invalid_request ```json { "error": { "code": "invalid_request", "message": "A field is missing or not valid. The message names it.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 name_taken ```json { "error": { "code": "name_taken", "message": "The environment already has a group with that name.", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Services* # List service groups ```http GET https://devapi.dispralabs.com/v1/cloud/environments/:env/groups ``` The environment's service groups, in order. Groups only organise the board. Needs a key with `read` access or more. - **Authentication:** Secret key (send it as `Authorization: Bearer `) ## Parameters - `env` (string, required): The environment's id. Example: `env_01jdk3m9x5h2p8r4t6y1u3i0oa` ## Returns - **200** [The service group object](https://docs.dispralabs.com/objects/the-service-group-object.md): The groups. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api GET /v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/groups ``` ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/groups" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/groups", { method: "GET", headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); console.log(await res.json()); ``` ### Python ```python import requests res = requests.request("GET", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/groups", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("GET", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/groups", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "grp": "grp_01jdk5e2r4t6y8u0i2o4p6a8sd", "name": "Backend", "position": 0, "created_at": "2026-12-05T10:15:02Z" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Services* # Update a service group ```http PATCH https://devapi.dispralabs.com/v1/cloud/environments/:env/groups/:grp ``` Renames a group, moves it to another position, or both. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `env` (string, required): The environment's id. Example: `env_01jdk3m9x5h2p8r4t6y1u3i0oa` - `grp` (string, required): The group's id. Example: `grp_01jdk5e2r4t6y8u0i2o4p6a8sd` - `name` (string, optional): A new name. Example: `Workers` - `position` (number, optional): Its new place, from 0. Example: `1` ## Returns - **200** [The service group object](https://docs.dispralabs.com/objects/the-service-group-object.md): The group. ## Errors | Status | Code | When | |---|---|---| | 400 | [invalid_request](https://docs.dispralabs.com/errors.md#invalid_request) | A field is missing or not valid. The message names it. | | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api PATCH /v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/groups/grp_01jdk5e2r4t6y8u0i2o4p6a8sd --data '{"name":"Workers","position":1}' ``` ### cURL ```bash curl -X PATCH "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/groups/grp_01jdk5e2r4t6y8u0i2o4p6a8sd" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"name":"Workers","position":1}' ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/groups/grp_01jdk5e2r4t6y8u0i2o4p6a8sd", { method: "PATCH", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" }, body: JSON.stringify({ "name": "Workers", "position": 1 }), }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("PATCH", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/groups/grp_01jdk5e2r4t6y8u0i2o4p6a8sd", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}, json={ "name": "Workers", "position": 1 }) print(res.json()) ``` ### Go ```go body := strings.NewReader(`{"name":"Workers","position":1}`) req, _ := http.NewRequest("PATCH", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/groups/grp_01jdk5e2r4t6y8u0i2o4p6a8sd", body) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "grp": "grp_01jdk5e2r4t6y8u0i2o4p6a8sd", "name": "Backend", "position": 0, "created_at": "2026-12-05T10:15:02Z" } } ``` ### 400 invalid_request ```json { "error": { "code": "invalid_request", "message": "A field is missing or not valid. The message names it.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Services* # Delete a service group ```http DELETE https://devapi.dispralabs.com/v1/cloud/environments/:env/groups/:grp ``` Deletes a group. Its services and volumes stay, ungrouped. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `env` (string, required): The environment's id. Example: `env_01jdk3m9x5h2p8r4t6y1u3i0oa` - `grp` (string, required): The group's id. Example: `grp_01jdk5e2r4t6y8u0i2o4p6a8sd` ## Returns - **200** [The status object](https://docs.dispralabs.com/objects/the-status-object.md): Deleted. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api DELETE /v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/groups/grp_01jdk5e2r4t6y8u0i2o4p6a8sd ``` ### cURL ```bash curl -X DELETE "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/groups/grp_01jdk5e2r4t6y8u0i2o4p6a8sd" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/groups/grp_01jdk5e2r4t6y8u0i2o4p6a8sd", { method: "DELETE", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID() }, }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("DELETE", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/groups/grp_01jdk5e2r4t6y8u0i2o4p6a8sd", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("DELETE", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/groups/grp_01jdk5e2r4t6y8u0i2o4p6a8sd", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "status": "accepted", "id": "svc_01jdk3n2f4g6h8j0k2l4z6x8ca" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Services* # List services ```http GET https://devapi.dispralabs.com/v1/cloud/environments/:env/services ``` Lists the environment's services, each with its latest deployment and its size. Needs a key with `read` access or more. - **Authentication:** Secret key (send it as `Authorization: Bearer `) ## Parameters - `env` (string, required): The environment's id. Example: `env_01jdk3m9x5h2p8r4t6y1u3i0oa` - `cursor` (string, optional): The next_cursor of the previous page. - `limit` (number, optional): Items per page, 1 to 200 (default 50). Example: `50` ## Returns - **200** [The service object](https://docs.dispralabs.com/objects/the-service-object.md): A page of services. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud services ``` ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/services?limit=50" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/services?limit=50", { method: "GET", headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); console.log(await res.json()); ``` ### Python ```python import requests res = requests.request("GET", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/services", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}, params={"limit": "50"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("GET", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/services?limit=50", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "svc": "svc_01jdk3n2f4g6h8j0k2l4z6x8ca", "name": "api", "env": "env_01jdk3m9x5h2p8r4t6y1u3i0oa", "source_kind": "repo", "dep": "dep_01jdk4p7q9w1e3r5t7y9u1i3ob", "dep_state": "live", "cpu_millis": 1000, "memory_mb": 1024, "replicas": 2, "hostname": "api-x8ca.in.dispracloud.app", "group": "grp_01jdk5e2r4t6y8u0i2o4p6a8sd" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Services* # Create a service ```http POST https://devapi.dispralabs.com/v1/cloud/projects/:prj/services ``` Creates a service in an environment. Give a GitHub repository and branch to build from, or create it empty and set an image with **Update service settings**. The service gets a generated address at once; nothing runs until its first deployment. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `prj` (string, required): The project's id. Example: `prj_01jdk3m9x2v7c4q8w5n6b1t0ra` - `env` (string, required): The environment to create it in. Example: `env_01jdk3m9x5h2p8r4t6y1u3i0oa` - `name` (string, required): Its name, unique in the environment. Example: `api` - `repo_id` (string, optional): A GitHub repository the workspace's GitHub app can see. Example: `gh-918273645` - `branch` (string, optional): The branch to deploy from. Example: `main` - `cpu_millis` (number, optional): CPU per replica in millicores (default 500). Example: `1000` - `memory_mb` (number, optional): Memory per replica in MB (default 512). Example: `1024` - `disk_mb` (number, optional): Temporary disk per replica in MB (default 1024). Example: `2048` ## Returns - **200**: svc, its generated hostname, and status (created). ## Errors | Status | Code | When | |---|---|---| | 400 | [invalid_request](https://docs.dispralabs.com/errors.md#invalid_request) | A field is missing or not valid. The message names it. | | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 409 | [name_taken](https://docs.dispralabs.com/errors.md#name_taken) | The environment already has a service with that name. | | 409 | [account_frozen](https://docs.dispralabs.com/errors.md#account_frozen) | The workspace is out of credits: add credits on the dashboard to create, change or deploy. | ## Request samples ### Dispra Cloud CLI ```bash dcloud api POST /v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/services --data '{"env":"env_01jdk3m9x5h2p8r4t6y1u3i0oa","name":"api","repo_id":"gh-918273645","branch":"main","cpu_millis":1000,"memory_mb":1024,"disk_mb":2048}' ``` ### cURL ```bash curl -X POST "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/services" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"env":"env_01jdk3m9x5h2p8r4t6y1u3i0oa","name":"api","repo_id":"gh-918273645","branch":"main","cpu_millis":1000,"memory_mb":1024,"disk_mb":2048}' ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/services", { method: "POST", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" }, body: JSON.stringify({ "env": "env_01jdk3m9x5h2p8r4t6y1u3i0oa", "name": "api", "repo_id": "gh-918273645", "branch": "main", "cpu_millis": 1000, "memory_mb": 1024, "disk_mb": 2048 }), }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("POST", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/services", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}, json={ "env": "env_01jdk3m9x5h2p8r4t6y1u3i0oa", "name": "api", "repo_id": "gh-918273645", "branch": "main", "cpu_millis": 1000, "memory_mb": 1024, "disk_mb": 2048 }) print(res.json()) ``` ### Go ```go body := strings.NewReader(`{"env":"env_01jdk3m9x5h2p8r4t6y1u3i0oa","name":"api","repo_id":"gh-918273645","branch":"main","cpu_millis":1000,"memory_mb":1024,"disk_mb":2048}`) req, _ := http.NewRequest("POST", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/services", body) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json {} ``` ### 400 invalid_request ```json { "error": { "code": "invalid_request", "message": "A field is missing or not valid. The message names it.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 name_taken ```json { "error": { "code": "name_taken", "message": "The environment already has a service with that name.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 account_frozen ```json { "error": { "code": "account_frozen", "message": "The workspace is out of credits: add credits on the dashboard to create, change or deploy.", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Services* # Get a service ```http GET https://devapi.dispralabs.com/v1/cloud/services/:svc ``` Returns a service with its latest deployment, its replicas and their states, its size, generated address and custom domains. Needs a key with `read` access or more. - **Authentication:** Secret key (send it as `Authorization: Bearer `) ## Parameters - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` ## Returns - **200** [The service object](https://docs.dispralabs.com/objects/the-service-object.md): The service. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud status ``` ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca", { method: "GET", headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); console.log(await res.json()); ``` ### Python ```python import requests res = requests.request("GET", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("GET", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "svc": "svc_01jdk3n2f4g6h8j0k2l4z6x8ca", "name": "api", "env": "env_01jdk3m9x5h2p8r4t6y1u3i0oa", "source_kind": "repo", "dep": "dep_01jdk4p7q9w1e3r5t7y9u1i3ob", "dep_state": "live", "cpu_millis": 1000, "memory_mb": 1024, "replicas": 2, "hostname": "api-x8ca.in.dispracloud.app", "group": "grp_01jdk5e2r4t6y8u0i2o4p6a8sd" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Services* # Delete a service ```http DELETE https://devapi.dispralabs.com/v1/cloud/services/:svc ``` Deletes a service: it stops, its addresses and custom domains stop answering, and copies in other regions go with it. Its volumes are detached and kept. Send `confirm: true`. A deleted service can be restored for 7 days. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` - `confirm` (boolean, required): Must be true. Example: `true` ## Returns - **200** [The status object](https://docs.dispralabs.com/objects/the-status-object.md): Deleting. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 400 | [confirm_required](https://docs.dispralabs.com/errors.md#confirm_required) | Send confirm: true. | ## Request samples ### Dispra Cloud CLI ```bash dcloud api DELETE /v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca?confirm=true ``` ### cURL ```bash curl -X DELETE "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca?confirm=true" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca?confirm=true", { method: "DELETE", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID() }, }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("DELETE", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}, params={"confirm": "true"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("DELETE", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca?confirm=true", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "status": "accepted", "id": "svc_01jdk3n2f4g6h8j0k2l4z6x8ca" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 400 confirm_required ```json { "error": { "code": "confirm_required", "message": "Send confirm: true.", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Services* # List recent commits ```http GET https://devapi.dispralabs.com/v1/cloud/services/:svc/commits ``` The headline and author of the commits of a repo service's deployments, read from GitHub when asked. Needs a key with `read` access or more. - **Authentication:** Secret key (send it as `Authorization: Bearer `) ## Parameters - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` - `sha` (string, optional): Commits to read, comma separated. Example: `3f2a9c1d8e7b6a5f4e3d2c1b0a9f8e7d6c5b4a39` ## Returns - **200**: commits: list of {sha, headline, author}. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api GET /v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/commits?sha=3f2a9c1d8e7b6a5f4e3d2c1b0a9f8e7d6c5b4a39 ``` ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/commits?sha=3f2a9c1d8e7b6a5f4e3d2c1b0a9f8e7d6c5b4a39" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/commits?sha=3f2a9c1d8e7b6a5f4e3d2c1b0a9f8e7d6c5b4a39", { method: "GET", headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); console.log(await res.json()); ``` ### Python ```python import requests res = requests.request("GET", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/commits", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}, params={"sha": "3f2a9c1d8e7b6a5f4e3d2c1b0a9f8e7d6c5b4a39"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("GET", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/commits?sha=3f2a9c1d8e7b6a5f4e3d2c1b0a9f8e7d6c5b4a39", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json {} ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Services* # Get the image's port ```http GET https://devapi.dispralabs.com/v1/cloud/services/:svc/detected-port ``` The TCP ports the live deployment's image exposes. `port` is the lowest one, or null when the image declares none. Needs a key with `read` access or more. - **Authentication:** Secret key (send it as `Authorization: Bearer `) ## Parameters - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` ## Returns - **200**: port and ports. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api GET /v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/detected-port ``` ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/detected-port" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/detected-port", { method: "GET", headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); console.log(await res.json()); ``` ### Python ```python import requests res = requests.request("GET", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/detected-port", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("GET", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/detected-port", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json {} ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Services* # Move a service to a group ```http PUT https://devapi.dispralabs.com/v1/cloud/services/:svc/group ``` Puts a service in a group (`grp`) or takes it out (`grp: null`). Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` - `grp` (string, optional): The group, or null for none. Example: `grp_01jdk5e2r4t6y8u0i2o4p6a8sd` - `position` (number, optional): Its place in the group, from 0 (default last). Example: `0` ## Returns - **200**: svc and grp. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api PUT /v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/group --data '{"grp":"grp_01jdk5e2r4t6y8u0i2o4p6a8sd","position":0}' ``` ### cURL ```bash curl -X PUT "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/group" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"grp":"grp_01jdk5e2r4t6y8u0i2o4p6a8sd","position":0}' ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/group", { method: "PUT", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" }, body: JSON.stringify({ "grp": "grp_01jdk5e2r4t6y8u0i2o4p6a8sd", "position": 0 }), }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("PUT", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/group", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}, json={ "grp": "grp_01jdk5e2r4t6y8u0i2o4p6a8sd", "position": 0 }) print(res.json()) ``` ### Go ```go body := strings.NewReader(`{"grp":"grp_01jdk5e2r4t6y8u0i2o4p6a8sd","position":0}`) req, _ := http.NewRequest("PUT", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/group", body) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json {} ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Services* # Test a health check ```http POST https://devapi.dispralabs.com/v1/cloud/services/:svc/health-test ``` Probes a path on one running replica the way health checks do, and answers whether it passed, its status and latency. Changes nothing. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` - `path` (string, required): The path to probe. Example: `/healthz` ## Returns - **200**: available, ok, status, latency_ms and error. ## Errors | Status | Code | When | |---|---|---| | 400 | [invalid_request](https://docs.dispralabs.com/errors.md#invalid_request) | A field is missing or not valid. The message names it. | | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api POST /v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/health-test --data '{"path":"/healthz"}' ``` ### cURL ```bash curl -X POST "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/health-test" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"path":"/healthz"}' ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/health-test", { method: "POST", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" }, body: JSON.stringify({ "path": "/healthz" }), }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("POST", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/health-test", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}, json={ "path": "/healthz" }) print(res.json()) ``` ### Go ```go body := strings.NewReader(`{"path":"/healthz"}`) req, _ := http.NewRequest("POST", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/health-test", body) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json {} ``` ### 400 invalid_request ```json { "error": { "code": "invalid_request", "message": "A field is missing or not valid. The message names it.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Services* # Set service limits ```http PUT https://devapi.dispralabs.com/v1/cloud/services/:svc/limits ``` Sets the CPU, memory and temporary disk of each replica. CPU and memory apply at the next deployment; a larger disk applies at once. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` - `cpu_millis` (number, required): CPU per replica in millicores, 50 to 64000. Example: `1000` - `memory_mb` (number, required): Memory per replica in MB, 64 to 262144. Example: `1024` - `disk_mb` (number, optional): Temporary disk per replica in MB, whole GB. Example: `2048` ## Returns - **200** [The status object](https://docs.dispralabs.com/objects/the-status-object.md): Saved. ## Errors | Status | Code | When | |---|---|---| | 400 | [invalid_request](https://docs.dispralabs.com/errors.md#invalid_request) | A field is missing or not valid. The message names it. | | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 409 | [account_frozen](https://docs.dispralabs.com/errors.md#account_frozen) | The workspace is out of credits: add credits on the dashboard to create, change or deploy. | ## Request samples ### Dispra Cloud CLI ```bash dcloud scale api --cpu 1000m --memory 1Gi --disk 2Gi ``` ### cURL ```bash curl -X PUT "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/limits" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"cpu_millis":1000,"memory_mb":1024,"disk_mb":2048}' ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/limits", { method: "PUT", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" }, body: JSON.stringify({ "cpu_millis": 1000, "memory_mb": 1024, "disk_mb": 2048 }), }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("PUT", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/limits", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}, json={ "cpu_millis": 1000, "memory_mb": 1024, "disk_mb": 2048 }) print(res.json()) ``` ### Go ```go body := strings.NewReader(`{"cpu_millis":1000,"memory_mb":1024,"disk_mb":2048}`) req, _ := http.NewRequest("PUT", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/limits", body) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "status": "accepted", "id": "svc_01jdk3n2f4g6h8j0k2l4z6x8ca" } } ``` ### 400 invalid_request ```json { "error": { "code": "invalid_request", "message": "A field is missing or not valid. The message names it.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 account_frozen ```json { "error": { "code": "account_frozen", "message": "The workspace is out of credits: add credits on the dashboard to create, change or deploy.", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Services* # Get service metrics ```http GET https://devapi.dispralabs.com/v1/cloud/services/:svc/metrics ``` Returns CPU, memory and network out for the service and each replica over a range, from one-minute windows, with the limits in force. Needs a key with `read` access or more. - **Authentication:** Secret key (send it as `Authorization: Bearer `) ## Parameters - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` - `range` (string, optional): 1h, 3h, 24h, 7d or 30d (default 24h). Example: `24h` ## Returns - **200** [The metrics object](https://docs.dispralabs.com/objects/the-metrics-object.md): The metrics. ## Errors | Status | Code | When | |---|---|---| | 400 | [invalid_range](https://docs.dispralabs.com/errors.md#invalid_range) | range is 1h, 3h, 24h, 7d or 30d. | | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api GET /v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/metrics?range=24h ``` ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/metrics?range=24h" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/metrics?range=24h", { method: "GET", headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); console.log(await res.json()); ``` ### Python ```python import requests res = requests.request("GET", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/metrics", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}, params={"range": "24h"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("GET", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/metrics?range=24h", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "range": "24h", "step_s": 300, "series": {"cpu_millis":[[1764324900,412]],"memory_mb":[[1764324900,618]]}, "replicas": [{"replica":"r1","cpu_millis":[[1764324900,205]]}], "limits": {"cpu_millis":1000,"memory_mb":1024} } } ``` ### 400 invalid_range ```json { "error": { "code": "invalid_range", "message": "range is 1h, 3h, 24h, 7d or 30d.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Services* # Add a region ```http POST https://devapi.dispralabs.com/v1/cloud/services/:svc/regions ``` Runs the service in one more region, with the same source, settings and variables, behind one global address. A service with a volume runs in one region only. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` - `region` (string, required): india or us. Example: `us` - `replicas` (number, optional): Replicas there (default 1). Example: `1` ## Returns - **201** [The region object](https://docs.dispralabs.com/objects/the-region-object.md): The new region. ## Errors | Status | Code | When | |---|---|---| | 400 | [invalid_request](https://docs.dispralabs.com/errors.md#invalid_request) | A field is missing or not valid. The message names it. | | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 409 | [region_exists](https://docs.dispralabs.com/errors.md#region_exists) | The service already runs there. | | 422 | [region_not_eligible](https://docs.dispralabs.com/errors.md#region_not_eligible) | A service with a volume runs in one region. | | 409 | [account_frozen](https://docs.dispralabs.com/errors.md#account_frozen) | The workspace is out of credits: add credits on the dashboard to create, change or deploy. | ## Request samples ### Dispra Cloud CLI ```bash dcloud api POST /v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/regions --data '{"region":"us","replicas":1}' ``` ### cURL ```bash curl -X POST "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/regions" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"region":"us","replicas":1}' ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/regions", { method: "POST", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" }, body: JSON.stringify({ "region": "us", "replicas": 1 }), }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("POST", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/regions", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}, json={ "region": "us", "replicas": 1 }) print(res.json()) ``` ### Go ```go body := strings.NewReader(`{"region":"us","replicas":1}`) req, _ := http.NewRequest("POST", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/regions", body) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 201 ```json { "data": { "region": "us", "svc": "svc_01jdk3n2f4g6h8j0k2l4z6x8ca", "primary": false, "replicas": 1, "state": "active" } } ``` ### 400 invalid_request ```json { "error": { "code": "invalid_request", "message": "A field is missing or not valid. The message names it.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 region_exists ```json { "error": { "code": "region_exists", "message": "The service already runs there.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 422 region_not_eligible ```json { "error": { "code": "region_not_eligible", "message": "A service with a volume runs in one region.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 account_frozen ```json { "error": { "code": "account_frozen", "message": "The workspace is out of credits: add credits on the dashboard to create, change or deploy.", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Services* # List service regions ```http GET https://devapi.dispralabs.com/v1/cloud/services/:svc/regions ``` The regions the service runs in, its project's region first, with the replicas in each. Needs a key with `read` access or more. - **Authentication:** Secret key (send it as `Authorization: Bearer `) ## Parameters - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` ## Returns - **200** [The region object](https://docs.dispralabs.com/objects/the-region-object.md): The regions. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api GET /v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/regions ``` ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/regions" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/regions", { method: "GET", headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); console.log(await res.json()); ``` ### Python ```python import requests res = requests.request("GET", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/regions", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("GET", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/regions", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "region": "us", "svc": "svc_01jdk3n2f4g6h8j0k2l4z6x8ca", "primary": false, "replicas": 1, "state": "active" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Services* # Set a region's replicas ```http PATCH https://devapi.dispralabs.com/v1/cloud/services/:svc/regions/:region ``` Changes how many replicas run in one region (the project's own too). Applies at the next deployment. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` - `region` (string, required): india or us. Example: `us` - `replicas` (number, required): Replicas, 1 to 10. Example: `2` ## Returns - **200** [The region object](https://docs.dispralabs.com/objects/the-region-object.md): The region. ## Errors | Status | Code | When | |---|---|---| | 400 | [invalid_request](https://docs.dispralabs.com/errors.md#invalid_request) | A field is missing or not valid. The message names it. | | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 409 | [account_frozen](https://docs.dispralabs.com/errors.md#account_frozen) | The workspace is out of credits: add credits on the dashboard to create, change or deploy. | ## Request samples ### Dispra Cloud CLI ```bash dcloud scale api --replicas 2 ``` ### cURL ```bash curl -X PATCH "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/regions/us" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"replicas":2}' ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/regions/us", { method: "PATCH", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" }, body: JSON.stringify({ "replicas": 2 }), }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("PATCH", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/regions/us", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}, json={ "replicas": 2 }) print(res.json()) ``` ### Go ```go body := strings.NewReader(`{"replicas":2}`) req, _ := http.NewRequest("PATCH", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/regions/us", body) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "region": "us", "svc": "svc_01jdk3n2f4g6h8j0k2l4z6x8ca", "primary": false, "replicas": 1, "state": "active" } } ``` ### 400 invalid_request ```json { "error": { "code": "invalid_request", "message": "A field is missing or not valid. The message names it.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 account_frozen ```json { "error": { "code": "account_frozen", "message": "The workspace is out of credits: add credits on the dashboard to create, change or deploy.", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Services* # Remove a region ```http DELETE https://devapi.dispralabs.com/v1/cloud/services/:svc/regions/:region ``` Stops running the service in a region. The last region it runs in can't be removed: delete the service instead. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` - `region` (string, required): india or us. Example: `us` ## Returns - **200** [The status object](https://docs.dispralabs.com/objects/the-status-object.md): Removing. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 409 | [region_last](https://docs.dispralabs.com/errors.md#region_last) | The service runs only there. | ## Request samples ### Dispra Cloud CLI ```bash dcloud api DELETE /v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/regions/us ``` ### cURL ```bash curl -X DELETE "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/regions/us" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/regions/us", { method: "DELETE", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID() }, }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("DELETE", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/regions/us", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("DELETE", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/regions/us", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "status": "accepted", "id": "svc_01jdk3n2f4g6h8j0k2l4z6x8ca" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 region_last ```json { "error": { "code": "region_last", "message": "The service runs only there.", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Services* # Get service settings ```http GET https://devapi.dispralabs.com/v1/cloud/services/:svc/settings ``` Returns the service's settings: its source, build and start commands, restart policy, size, replicas and health check, with the `generation` to send back when you change them. Needs a key with `read` access or more. - **Authentication:** Secret key (send it as `Authorization: Bearer `) ## Parameters - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` ## Returns - **200** [The service settings object](https://docs.dispralabs.com/objects/the-service-settings-object.md): The settings. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api GET /v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/settings ``` ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/settings" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/settings", { method: "GET", headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); console.log(await res.json()); ``` ### Python ```python import requests res = requests.request("GET", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/settings", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("GET", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/settings", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "generation": 7, "source_kind": "repo", "repo_id": "gh-918273645", "branch": "main", "root_dir": "apps/api", "watch_paths": ["apps/api/**"], "image_ref": "ghcr.io/acme/api:1.4.2", "builder": "railpack", "dockerfile_path": "Dockerfile", "build_cmd": "npm run build", "start_cmd": "node dist/server.js", "restart_policy": "on_failure", "max_restarts": 5, "cpu_millis": 1000, "memory_mb": 1024, "disk_mb": 2048, "replicas": 2, "healthcheck_path": "/healthz", "healthcheck_timeout_s": 5, "healthcheck_interval_s": 10, "stop_grace_s": 10, "has_volume": false } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Services* # Update service settings ```http PATCH https://devapi.dispralabs.com/v1/cloud/services/:svc/settings ``` Changes any of the service's settings in one step. Send `base_generation` (the `generation` you read) and only the fields you change. The answer says how it applies: `applied_now` (health check, disk raised), or `needs_redeploy` (source, build, start, size, replicas). Send `redeploy: 1` to deploy at once. If someone changed the settings since you read them, the update is refused with `stale_generation`. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` - `base_generation` (number, required): The generation you read. Example: `7` - `redeploy` (number, optional): 1 deploys after saving. Example: `1` - `name` (string, optional): A new name. Example: `api` - `source_kind` (string, optional): repo or image. Example: `image` - `image_ref` (string, optional): The image, for an image service. Example: `ghcr.io/acme/api:1.4.2` - `branch` (string, optional): The branch to deploy from. - `root_dir` (string, optional): The folder of the repository to build. - `build_cmd` (string, optional): The build command. - `start_cmd` (string, optional): The start command. Example: `node dist/server.js` - `restart_policy` (string, optional): always, on_failure or never. - `cpu_millis` (number, optional): CPU per replica in millicores. - `memory_mb` (number, optional): Memory per replica in MB. - `disk_mb` (number, optional): Temporary disk per replica, whole GB in MB. - `replicas` (number, optional): Replicas, 1 to 10. Example: `2` - `healthcheck_path` (string, optional): The health check path, or null to clear it. Example: `/healthz` - `healthcheck_timeout_s` (number, optional): Seconds before one check fails, or null for the default. ## Returns - **200**: generation, apply (applied_now or needs_redeploy) and dep when a deployment started. ## Errors | Status | Code | When | |---|---|---| | 400 | [invalid_request](https://docs.dispralabs.com/errors.md#invalid_request) | A field is missing or not valid. The message names it. | | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 409 | [stale_generation](https://docs.dispralabs.com/errors.md#stale_generation) | Someone changed it since you read it: read it again and retry. | | 409 | [service_replicas_volume](https://docs.dispralabs.com/errors.md#service_replicas_volume) | A service with a volume runs one replica. | | 409 | [account_frozen](https://docs.dispralabs.com/errors.md#account_frozen) | The workspace is out of credits: add credits on the dashboard to create, change or deploy. | ## Request samples ### Dispra Cloud CLI ```bash dcloud api PATCH /v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/settings --data '{"base_generation":7,"redeploy":1,"name":"api","source_kind":"image","image_ref":"ghcr.io/acme/api:1.4.2","start_cmd":"node dist/server.js","replicas":2,"healthcheck_path":"/healthz"}' ``` ### cURL ```bash curl -X PATCH "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/settings" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"base_generation":7,"redeploy":1,"name":"api","source_kind":"image","image_ref":"ghcr.io/acme/api:1.4.2","start_cmd":"node dist/server.js","replicas":2,"healthcheck_path":"/healthz"}' ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/settings", { method: "PATCH", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" }, body: JSON.stringify({ "base_generation": 7, "redeploy": 1, "name": "api", "source_kind": "image", "image_ref": "ghcr.io/acme/api:1.4.2", "start_cmd": "node dist/server.js", "replicas": 2, "healthcheck_path": "/healthz" }), }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("PATCH", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/settings", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}, json={ "base_generation": 7, "redeploy": 1, "name": "api", "source_kind": "image", "image_ref": "ghcr.io/acme/api:1.4.2", "start_cmd": "node dist/server.js", "replicas": 2, "healthcheck_path": "/healthz" }) print(res.json()) ``` ### Go ```go body := strings.NewReader(`{"base_generation":7,"redeploy":1,"name":"api","source_kind":"image","image_ref":"ghcr.io/acme/api:1.4.2","start_cmd":"node dist/server.js","replicas":2,"healthcheck_path":"/healthz"}`) req, _ := http.NewRequest("PATCH", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/settings", body) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json {} ``` ### 400 invalid_request ```json { "error": { "code": "invalid_request", "message": "A field is missing or not valid. The message names it.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 stale_generation ```json { "error": { "code": "stale_generation", "message": "Someone changed it since you read it: read it again and retry.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 service_replicas_volume ```json { "error": { "code": "service_replicas_volume", "message": "A service with a volume runs one replica.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 account_frozen ```json { "error": { "code": "account_frozen", "message": "The workspace is out of credits: add credits on the dashboard to create, change or deploy.", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Services* # Check a file on the branch ```http GET https://devapi.dispralabs.com/v1/cloud/services/:svc/source/file ``` Whether a file, such as a Dockerfile, is in the service's repository on a branch (default the service's own). Needs a key with `read` access or more. - **Authentication:** Secret key (send it as `Authorization: Bearer `) ## Parameters - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` - `path` (string, required): The file, relative to the repository. Example: `apps/api/Dockerfile` - `branch` (string, optional): The branch (default the service's). Example: `main` ## Returns - **200**: path, branch, found and checked. ## Errors | Status | Code | When | |---|---|---| | 400 | [invalid_request](https://docs.dispralabs.com/errors.md#invalid_request) | A field is missing or not valid. The message names it. | | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api GET /v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/source/file?path=apps%2Fapi%2FDockerfile&branch=main ``` ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/source/file?path=apps%2Fapi%2FDockerfile&branch=main" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/source/file?path=apps%2Fapi%2FDockerfile&branch=main", { method: "GET", headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); console.log(await res.json()); ``` ### Python ```python import requests res = requests.request("GET", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/source/file", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}, params={"path": "apps/api/Dockerfile", "branch": "main"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("GET", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/source/file?path=apps%2Fapi%2FDockerfile&branch=main", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json {} ``` ### 400 invalid_request ```json { "error": { "code": "invalid_request", "message": "A field is missing or not valid. The message names it.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud* # The revealed variable object A variable with its value. Only the reveal routes answer it; every reveal is audited. ## Attributes - `name` (string): Its name. - `value` (string): The value. - `version` (number): Its version. - `set_at` (timestamp): When the value was set. ## Example ```json { "data": { "name": "DATABASE_URL", "value": "postgres://app:s3cret@db.internal:5432/app", "version": 3, "set_at": "2026-12-05T10:15:02Z" } } ``` ## Endpoints - `POST` [Reveal a project variable](https://docs.dispralabs.com/api/reveal-a-project-variable.md) - `POST` [Reveal a service variable](https://docs.dispralabs.com/api/reveal-a-service-variable.md) - `POST` [Reveal all project variables](https://docs.dispralabs.com/api/reveal-all-project-variables.md) - `POST` [Reveal all service variables](https://docs.dispralabs.com/api/reveal-all-service-variables.md) --- *Cloud* # The variable object An environment variable of a service, or a project variable shared by its services. Lists never show values: reveal one to read it. A change applies at the next deployment. ## Attributes - `name` (string): Its name. - `kind` (string): value, or shared (it takes a project variable's value). - `scope` (string): runtime, build or both: when the value is given to the service. - `version` (number): +1 on every change. - `ref_name` (string): For a shared variable: the project variable it uses. - `updated_at` (timestamp): When it last changed. ## Example ```json { "data": { "name": "DATABASE_URL", "kind": "value", "scope": "runtime", "version": 3, "ref_name": "DATABASE_URL", "updated_at": "2026-12-05T10:15:02Z" } } ``` ## Endpoints - `DELETE` [Delete a project variable](https://docs.dispralabs.com/api/delete-a-project-variable.md) - `DELETE` [Delete a service variable](https://docs.dispralabs.com/api/delete-a-service-variable.md) - `GET` [List project variables](https://docs.dispralabs.com/api/list-project-variables.md) - `GET` [List service variables](https://docs.dispralabs.com/api/list-service-variables.md) - `POST` [Reveal a project variable](https://docs.dispralabs.com/api/reveal-a-project-variable.md) - `POST` [Reveal a service variable](https://docs.dispralabs.com/api/reveal-a-service-variable.md) - `PUT` [Set a project variable](https://docs.dispralabs.com/api/set-a-project-variable.md) - `PUT` [Set a service variable](https://docs.dispralabs.com/api/set-a-service-variable.md) --- *Cloud › Variables* # Reveal all project variables ```http POST https://devapi.dispralabs.com/v1/cloud/environments/:env/shared-variables/reveal ``` Returns every project variable of the environment with its value, in one call. Audited once. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `env` (string, required): The environment's id. Example: `env_01jdk3m9x5h2p8r4t6y1u3i0oa` ## Returns - **200** [The revealed variable object](https://docs.dispralabs.com/objects/the-revealed-variable-object.md): variables. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud vars pull .env ``` ### cURL ```bash curl -X POST "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/shared-variables/reveal" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/shared-variables/reveal", { method: "POST", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID() }, }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("POST", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/shared-variables/reveal", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("POST", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/shared-variables/reveal", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "name": "DATABASE_URL", "value": "postgres://app:s3cret@db.internal:5432/app", "version": 3, "set_at": "2026-12-05T10:15:02Z" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Variables* # List project variables ```http GET https://devapi.dispralabs.com/v1/cloud/environments/:env/variables ``` The environment's project variables (shared by its services): names, versions, and which services use each. Values are never listed. Needs a key with `read` access or more. - **Authentication:** Secret key (send it as `Authorization: Bearer `) ## Parameters - `env` (string, required): The environment's id. Example: `env_01jdk3m9x5h2p8r4t6y1u3i0oa` ## Returns - **200** [The variable object](https://docs.dispralabs.com/objects/the-variable-object.md): variables and links. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud vars ``` ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/variables" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/variables", { method: "GET", headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); console.log(await res.json()); ``` ### Python ```python import requests res = requests.request("GET", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/variables", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("GET", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/variables", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "name": "DATABASE_URL", "kind": "value", "scope": "runtime", "version": 3, "ref_name": "DATABASE_URL", "updated_at": "2026-12-05T10:15:02Z" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Variables* # Set a project variable ```http PUT https://devapi.dispralabs.com/v1/cloud/environments/:env/variables/:name ``` Creates or replaces a project variable. Services that use it get it at their next deployment. A value may reference other variables of the environment with `{{ owner.NAME }}` (`project` or a service's name, and built-ins such as `{{ api.DISPRA_PRIVATE_URL }}`): see **Variables and references**. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `env` (string, required): The environment's id. Example: `env_01jdk3m9x5h2p8r4t6y1u3i0oa` - `name` (string, required): The variable's name. Example: `DATABASE_URL` - `value` (string, required): The value. Example: `production` ## Returns - **200** [The variable object](https://docs.dispralabs.com/objects/the-variable-object.md): The variable. ## Errors | Status | Code | When | |---|---|---| | 400 | [invalid_request](https://docs.dispralabs.com/errors.md#invalid_request) | A field is missing or not valid. The message names it. | | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 409 | [account_frozen](https://docs.dispralabs.com/errors.md#account_frozen) | The workspace is out of credits: add credits on the dashboard to create, change or deploy. | ## Request samples ### Dispra Cloud CLI ```bash dcloud vars set NODE_ENV=production ``` ### cURL ```bash curl -X PUT "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/variables/DATABASE_URL" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"value":"production"}' ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/variables/DATABASE_URL", { method: "PUT", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" }, body: JSON.stringify({ "value": "production" }), }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("PUT", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/variables/DATABASE_URL", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}, json={ "value": "production" }) print(res.json()) ``` ### Go ```go body := strings.NewReader(`{"value":"production"}`) req, _ := http.NewRequest("PUT", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/variables/DATABASE_URL", body) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "name": "DATABASE_URL", "kind": "value", "scope": "runtime", "version": 3, "ref_name": "DATABASE_URL", "updated_at": "2026-12-05T10:15:02Z" } } ``` ### 400 invalid_request ```json { "error": { "code": "invalid_request", "message": "A field is missing or not valid. The message names it.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 account_frozen ```json { "error": { "code": "account_frozen", "message": "The workspace is out of credits: add credits on the dashboard to create, change or deploy.", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Variables* # Delete a project variable ```http DELETE https://devapi.dispralabs.com/v1/cloud/environments/:env/variables/:name ``` Removes a project variable. Refused while a service uses it. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `env` (string, required): The environment's id. Example: `env_01jdk3m9x5h2p8r4t6y1u3i0oa` - `name` (string, required): The variable's name. Example: `DATABASE_URL` ## Returns - **200** [The status object](https://docs.dispralabs.com/objects/the-status-object.md): Deleted. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 409 | [variable_in_use](https://docs.dispralabs.com/errors.md#variable_in_use) | A service still uses it. | | 409 | [account_frozen](https://docs.dispralabs.com/errors.md#account_frozen) | The workspace is out of credits: add credits on the dashboard to create, change or deploy. | ## Request samples ### Dispra Cloud CLI ```bash dcloud vars unset NODE_ENV ``` ### cURL ```bash curl -X DELETE "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/variables/DATABASE_URL" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/variables/DATABASE_URL", { method: "DELETE", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID() }, }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("DELETE", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/variables/DATABASE_URL", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("DELETE", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/variables/DATABASE_URL", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "status": "accepted", "id": "svc_01jdk3n2f4g6h8j0k2l4z6x8ca" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 variable_in_use ```json { "error": { "code": "variable_in_use", "message": "A service still uses it.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 account_frozen ```json { "error": { "code": "account_frozen", "message": "The workspace is out of credits: add credits on the dashboard to create, change or deploy.", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Variables* # Reveal a project variable ```http POST https://devapi.dispralabs.com/v1/cloud/environments/:env/variables/:name/reveal ``` Returns one project variable's value. Audited and rate limited. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `env` (string, required): The environment's id. Example: `env_01jdk3m9x5h2p8r4t6y1u3i0oa` - `name` (string, required): The variable's name. Example: `DATABASE_URL` ## Returns - **200** [The revealed variable object](https://docs.dispralabs.com/objects/the-revealed-variable-object.md): The value. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api POST /v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/variables/DATABASE_URL/reveal ``` ### cURL ```bash curl -X POST "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/variables/DATABASE_URL/reveal" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/variables/DATABASE_URL/reveal", { method: "POST", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID() }, }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("POST", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/variables/DATABASE_URL/reveal", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("POST", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/variables/DATABASE_URL/reveal", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "name": "DATABASE_URL", "value": "postgres://app:s3cret@db.internal:5432/app", "version": 3, "set_at": "2026-12-05T10:15:02Z" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Variables* # Change variables in bulk ```http POST https://devapi.dispralabs.com/v1/cloud/environments/:env/variables/batch ``` Applies 1 to 500 variable changes in one transaction, all or nothing: set, delete, or move. A change without `svc` is a project variable. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `env` (string, required): The environment's id. Example: `env_01jdk3m9x5h2p8r4t6y1u3i0oa` - `changes` (array, required): list of {svc, name, value | delete: true}. Example: `[{"svc":"svc_01jdk3n2f4g6h8j0k2l4z6x8ca","name":"LOG_LEVEL","value":"info"},{"name":"OLD_FLAG","delete":true}]` ## Returns - **200**: results and warnings. ## Errors | Status | Code | When | |---|---|---| | 400 | [invalid_request](https://docs.dispralabs.com/errors.md#invalid_request) | A field is missing or not valid. The message names it. | | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 409 | [account_frozen](https://docs.dispralabs.com/errors.md#account_frozen) | The workspace is out of credits: add credits on the dashboard to create, change or deploy. | ## Request samples ### Dispra Cloud CLI ```bash dcloud vars import .env --service api ``` ### cURL ```bash curl -X POST "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/variables/batch" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"changes":[{"svc":"svc_01jdk3n2f4g6h8j0k2l4z6x8ca","name":"LOG_LEVEL","value":"info"},{"name":"OLD_FLAG","delete":true}]}' ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/variables/batch", { method: "POST", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" }, body: JSON.stringify({ "changes": [{"svc":"svc_01jdk3n2f4g6h8j0k2l4z6x8ca","name":"LOG_LEVEL","value":"info"},{"name":"OLD_FLAG","delete":true}] }), }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("POST", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/variables/batch", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}, json={ "changes": [{"svc":"svc_01jdk3n2f4g6h8j0k2l4z6x8ca","name":"LOG_LEVEL","value":"info"},{"name":"OLD_FLAG","delete":True}] }) print(res.json()) ``` ### Go ```go body := strings.NewReader(`{"changes":[{"svc":"svc_01jdk3n2f4g6h8j0k2l4z6x8ca","name":"LOG_LEVEL","value":"info"},{"name":"OLD_FLAG","delete":true}]}`) req, _ := http.NewRequest("POST", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/variables/batch", body) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json {} ``` ### 400 invalid_request ```json { "error": { "code": "invalid_request", "message": "A field is missing or not valid. The message names it.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 account_frozen ```json { "error": { "code": "account_frozen", "message": "The workspace is out of credits: add credits on the dashboard to create, change or deploy.", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Variables* # Get the variables graph ```http GET https://devapi.dispralabs.com/v1/cloud/environments/:env/variables/graph ``` Every variable of the environment and every reference between them (`{{ owner.NAME }}`), with the references that don't resolve. Never a value. Needs a key with `read` access or more. - **Authentication:** Secret key (send it as `Authorization: Bearer `) ## Parameters - `env` (string, required): The environment's id. Example: `env_01jdk3m9x5h2p8r4t6y1u3i0oa` ## Returns - **200**: owners, edges and issues. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api GET /v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/variables/graph ``` ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/variables/graph" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/variables/graph", { method: "GET", headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); console.log(await res.json()); ``` ### Python ```python import requests res = requests.request("GET", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/variables/graph", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("GET", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/variables/graph", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json {} ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Variables* # Validate variables text ```http POST https://devapi.dispralabs.com/v1/cloud/environments/:env/variables/validate ``` Checks `.env`-style text (`NAME=value` lines) for one service, or for the project variables, and answers a diagnostic per line: invalid names, duplicates, references that don't resolve, cycles. Changes nothing. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `env` (string, required): The environment's id. Example: `env_01jdk3m9x5h2p8r4t6y1u3i0oa` - `svc` (string, optional): The service, or absent for the project variables. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` - `text` (string, required): The text. Example: `DATABASE_URL={{ project.DATABASE_URL }}` ## Returns - **200**: diagnostics and completions. ## Errors | Status | Code | When | |---|---|---| | 400 | [invalid_request](https://docs.dispralabs.com/errors.md#invalid_request) | A field is missing or not valid. The message names it. | | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api POST /v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/variables/validate --data '{"svc":"svc_01jdk3n2f4g6h8j0k2l4z6x8ca","text":"DATABASE_URL={{ project.DATABASE_URL }}"}' ``` ### cURL ```bash curl -X POST "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/variables/validate" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"svc":"svc_01jdk3n2f4g6h8j0k2l4z6x8ca","text":"DATABASE_URL={{ project.DATABASE_URL }}"}' ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/variables/validate", { method: "POST", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" }, body: JSON.stringify({ "svc": "svc_01jdk3n2f4g6h8j0k2l4z6x8ca", "text": "DATABASE_URL={{ project.DATABASE_URL }}" }), }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("POST", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/variables/validate", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}, json={ "svc": "svc_01jdk3n2f4g6h8j0k2l4z6x8ca", "text": "DATABASE_URL={{ project.DATABASE_URL }}" }) print(res.json()) ``` ### Go ```go body := strings.NewReader(`{"svc":"svc_01jdk3n2f4g6h8j0k2l4z6x8ca","text":"DATABASE_URL={{ project.DATABASE_URL }}"}`) req, _ := http.NewRequest("POST", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/variables/validate", body) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json {} ``` ### 400 invalid_request ```json { "error": { "code": "invalid_request", "message": "A field is missing or not valid. The message names it.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Variables* # List service variables ```http GET https://devapi.dispralabs.com/v1/cloud/services/:svc/variables ``` The service's variables: names, kinds, scopes and when each changed. Values are never listed. Needs a key with `read` access or more. - **Authentication:** Secret key (send it as `Authorization: Bearer `) ## Parameters - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` ## Returns - **200** [The variable object](https://docs.dispralabs.com/objects/the-variable-object.md): variables. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud vars --service api ``` ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/variables" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/variables", { method: "GET", headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); console.log(await res.json()); ``` ### Python ```python import requests res = requests.request("GET", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/variables", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("GET", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/variables", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "name": "DATABASE_URL", "kind": "value", "scope": "runtime", "version": 3, "ref_name": "DATABASE_URL", "updated_at": "2026-12-05T10:15:02Z" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Variables* # Set a service variable ```http PUT https://devapi.dispralabs.com/v1/cloud/services/:svc/variables/:name ``` Creates or replaces one variable of the service. It applies at the next deployment: redeploy to apply it now. A value can reference other variables, like `{{ project.DATABASE_URL }}`. A value may reference other variables of the environment with `{{ owner.NAME }}` (`project` or a service's name, and built-ins such as `{{ api.DISPRA_PRIVATE_URL }}`): see **Variables and references**. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` - `name` (string, required): The variable's name. Example: `DATABASE_URL` - `value` (string, required): The value. Example: `postgres://app:s3cret@db.internal:5432/app` - `scope` (string, optional): runtime, build or both (default runtime). Example: `runtime` ## Returns - **200** [The variable object](https://docs.dispralabs.com/objects/the-variable-object.md): The variable. ## Errors | Status | Code | When | |---|---|---| | 400 | [invalid_request](https://docs.dispralabs.com/errors.md#invalid_request) | A field is missing or not valid. The message names it. | | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 409 | [account_frozen](https://docs.dispralabs.com/errors.md#account_frozen) | The workspace is out of credits: add credits on the dashboard to create, change or deploy. | ## Request samples ### Dispra Cloud CLI ```bash dcloud vars set DATABASE_URL=postgres://app:s3cret@db.internal:5432/app --service api ``` ### cURL ```bash curl -X PUT "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/variables/DATABASE_URL" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"value":"postgres://app:s3cret@db.internal:5432/app","scope":"runtime"}' ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/variables/DATABASE_URL", { method: "PUT", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" }, body: JSON.stringify({ "value": "postgres://app:s3cret@db.internal:5432/app", "scope": "runtime" }), }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("PUT", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/variables/DATABASE_URL", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}, json={ "value": "postgres://app:s3cret@db.internal:5432/app", "scope": "runtime" }) print(res.json()) ``` ### Go ```go body := strings.NewReader(`{"value":"postgres://app:s3cret@db.internal:5432/app","scope":"runtime"}`) req, _ := http.NewRequest("PUT", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/variables/DATABASE_URL", body) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "name": "DATABASE_URL", "kind": "value", "scope": "runtime", "version": 3, "ref_name": "DATABASE_URL", "updated_at": "2026-12-05T10:15:02Z" } } ``` ### 400 invalid_request ```json { "error": { "code": "invalid_request", "message": "A field is missing or not valid. The message names it.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 account_frozen ```json { "error": { "code": "account_frozen", "message": "The workspace is out of credits: add credits on the dashboard to create, change or deploy.", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Variables* # Delete a service variable ```http DELETE https://devapi.dispralabs.com/v1/cloud/services/:svc/variables/:name ``` Removes a variable of the service. It applies at the next deployment. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` - `name` (string, required): The variable's name. Example: `DATABASE_URL` ## Returns - **200** [The status object](https://docs.dispralabs.com/objects/the-status-object.md): Deleted. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 409 | [account_frozen](https://docs.dispralabs.com/errors.md#account_frozen) | The workspace is out of credits: add credits on the dashboard to create, change or deploy. | ## Request samples ### Dispra Cloud CLI ```bash dcloud vars unset DATABASE_URL --service api ``` ### cURL ```bash curl -X DELETE "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/variables/DATABASE_URL" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/variables/DATABASE_URL", { method: "DELETE", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID() }, }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("DELETE", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/variables/DATABASE_URL", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("DELETE", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/variables/DATABASE_URL", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "status": "accepted", "id": "svc_01jdk3n2f4g6h8j0k2l4z6x8ca" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 account_frozen ```json { "error": { "code": "account_frozen", "message": "The workspace is out of credits: add credits on the dashboard to create, change or deploy.", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Variables* # Reveal a service variable ```http POST https://devapi.dispralabs.com/v1/cloud/services/:svc/variables/:name/reveal ``` Returns one variable's value. Every reveal is audited and rate limited. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` - `name` (string, required): The variable's name. Example: `DATABASE_URL` ## Returns - **200** [The revealed variable object](https://docs.dispralabs.com/objects/the-revealed-variable-object.md): The value. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api POST /v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/variables/DATABASE_URL/reveal ``` ### cURL ```bash curl -X POST "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/variables/DATABASE_URL/reveal" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/variables/DATABASE_URL/reveal", { method: "POST", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID() }, }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("POST", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/variables/DATABASE_URL/reveal", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("POST", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/variables/DATABASE_URL/reveal", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "name": "DATABASE_URL", "value": "postgres://app:s3cret@db.internal:5432/app", "version": 3, "set_at": "2026-12-05T10:15:02Z" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Variables* # Reveal all service variables ```http POST https://devapi.dispralabs.com/v1/cloud/services/:svc/variables/reveal ``` Returns every variable of the service with its value, in one call. Audited once. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` ## Returns - **200** [The revealed variable object](https://docs.dispralabs.com/objects/the-revealed-variable-object.md): variables. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud vars pull .env --service api ``` ### cURL ```bash curl -X POST "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/variables/reveal" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/variables/reveal", { method: "POST", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID() }, }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("POST", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/variables/reveal", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("POST", "https://devapi.dispralabs.com/v1/cloud/services/svc_01jdk3n2f4g6h8j0k2l4z6x8ca/variables/reveal", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "name": "DATABASE_URL", "value": "postgres://app:s3cret@db.internal:5432/app", "version": 3, "set_at": "2026-12-05T10:15:02Z" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud* # The backup object A point-in-time copy of a volume. Restoring one makes a new volume; the live one is never overwritten. ## Attributes - `bkp` (string): The backup's id. - `vol` (string): The volume it copies. - `state` (string): running, succeeded or failed. - `size_bytes` (number): Its size. - `trigger` (string): schedule or manual. - `taken_at` (timestamp): When it was taken. ## Example ```json { "data": { "bkp": "bkp_01jdk5c7v9b1n3m5q7w9e1r3ty", "vol": "vol_01jdk5a2s4d6f8g0h2j4k6l8zx", "state": "succeeded", "size_bytes": 1288490188, "trigger": "schedule", "taken_at": "2026-12-05T10:15:02Z" } } ``` ## Endpoints - `POST` [Create a backup](https://docs.dispralabs.com/api/create-a-backup.md) - `GET` [List backups](https://docs.dispralabs.com/api/list-backups.md) - `POST` [Restore a backup](https://docs.dispralabs.com/api/restore-a-backup.md) --- *Cloud* # The volume object Persistent, encrypted storage in an environment. It is created on its own and attached to one service at a mount path; it survives deploys, and is backed up on a schedule you choose. ## Attributes - `vol` (string): The volume's id. - `name` (string): Its name, unique in the environment. - `env` (string): Its environment. - `region` (string): Its region. - `size_bytes` (number): Its size, whole GiB from 1 GiB. - `used_bytes` (number): Space used. - `state` (string): creating, ready, restoring or soft_deleted (deleted, restorable for 7 days). - `backup_policy` (object): {enabled, interval_s, retention}. - `last_backup_at` (timestamp): When the last backup finished. - `attachments` (array): Where it is mounted: list of {svc, name, mount_path}. ## Example ```json { "data": { "vol": "vol_01jdk5a2s4d6f8g0h2j4k6l8zx", "name": "uploads", "env": "env_01jdk3m9x5h2p8r4t6y1u3i0oa", "region": "india", "size_bytes": 10737418240, "used_bytes": 1288490188, "state": "ready", "backup_policy": {"enabled":true,"interval_s":21600,"retention":7}, "last_backup_at": "2026-12-05T10:15:02Z", "attachments": [{"svc":"svc_01jdk3n2f4g6h8j0k2l4z6x8ca","name":"api","mount_path":"/data"}] } } ``` ## Endpoints - `POST` [Attach a volume](https://docs.dispralabs.com/api/attach-a-volume.md) - `POST` [Create a backup](https://docs.dispralabs.com/api/create-a-backup.md) - `POST` [Create a volume](https://docs.dispralabs.com/api/create-a-volume.md) - `DELETE` [Delete a volume](https://docs.dispralabs.com/api/delete-a-volume.md) - `DELETE` [Detach a volume](https://docs.dispralabs.com/api/detach-a-volume.md) - `GET` [Get a volume](https://docs.dispralabs.com/api/get-a-volume.md) - `GET` [Get volume metrics](https://docs.dispralabs.com/api/get-volume-metrics.md) - `GET` [List backups](https://docs.dispralabs.com/api/list-backups.md) - `GET` [List volume activity](https://docs.dispralabs.com/api/list-volume-activity.md) - `GET` [List volumes](https://docs.dispralabs.com/api/list-volumes.md) - `PUT` [Move a volume to a group](https://docs.dispralabs.com/api/move-a-volume-to-a-group.md) - `POST` [Restore a backup](https://docs.dispralabs.com/api/restore-a-backup.md) - `POST` [Restore a deleted volume](https://docs.dispralabs.com/api/restore-a-deleted-volume.md) - `GET` [Stream volume events](https://docs.dispralabs.com/api/stream-volume-events.md) - `PATCH` [Update a volume](https://docs.dispralabs.com/api/update-a-volume.md) --- *Cloud › Volumes* # Create a volume ```http POST https://devapi.dispralabs.com/v1/cloud/environments/:env/volumes ``` Creates an encrypted volume in the environment. Attach it to a service to use it. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `env` (string, required): The environment's id. Example: `env_01jdk3m9x5h2p8r4t6y1u3i0oa` - `name` (string, required): Its name, unique in the environment. Example: `uploads` - `size_bytes` (number, required): Its size, whole GiB from 1 GiB (1073741824). Example: `10737418240` ## Returns - **201** [The volume object](https://docs.dispralabs.com/objects/the-volume-object.md): The volume. ## Errors | Status | Code | When | |---|---|---| | 400 | [invalid_request](https://docs.dispralabs.com/errors.md#invalid_request) | A field is missing or not valid. The message names it. | | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 409 | [volume_name_taken](https://docs.dispralabs.com/errors.md#volume_name_taken) | The environment has a volume with that name. | | 409 | [account_frozen](https://docs.dispralabs.com/errors.md#account_frozen) | The workspace is out of credits: add credits on the dashboard to create, change or deploy. | ## Request samples ### Dispra Cloud CLI ```bash dcloud volume create uploads --size 10Gi ``` ### cURL ```bash curl -X POST "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/volumes" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"name":"uploads","size_bytes":10737418240}' ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/volumes", { method: "POST", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" }, body: JSON.stringify({ "name": "uploads", "size_bytes": 10737418240 }), }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("POST", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/volumes", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}, json={ "name": "uploads", "size_bytes": 10737418240 }) print(res.json()) ``` ### Go ```go body := strings.NewReader(`{"name":"uploads","size_bytes":10737418240}`) req, _ := http.NewRequest("POST", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/volumes", body) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 201 ```json { "data": { "vol": "vol_01jdk5a2s4d6f8g0h2j4k6l8zx", "name": "uploads", "env": "env_01jdk3m9x5h2p8r4t6y1u3i0oa", "region": "india", "size_bytes": 10737418240, "used_bytes": 1288490188, "state": "ready", "backup_policy": {"enabled":true,"interval_s":21600,"retention":7}, "last_backup_at": "2026-12-05T10:15:02Z", "attachments": [{"svc":"svc_01jdk3n2f4g6h8j0k2l4z6x8ca","name":"api","mount_path":"/data"}] } } ``` ### 400 invalid_request ```json { "error": { "code": "invalid_request", "message": "A field is missing or not valid. The message names it.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 volume_name_taken ```json { "error": { "code": "volume_name_taken", "message": "The environment has a volume with that name.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 account_frozen ```json { "error": { "code": "account_frozen", "message": "The workspace is out of credits: add credits on the dashboard to create, change or deploy.", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Volumes* # List volumes ```http GET https://devapi.dispralabs.com/v1/cloud/environments/:env/volumes ``` The environment's volumes with their size, use, attachments and last backup, deleted ones included during their 7 days. Needs a key with `read` access or more. - **Authentication:** Secret key (send it as `Authorization: Bearer `) ## Parameters - `env` (string, required): The environment's id. Example: `env_01jdk3m9x5h2p8r4t6y1u3i0oa` ## Returns - **200** [The volume object](https://docs.dispralabs.com/objects/the-volume-object.md): volumes. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud volumes ``` ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/volumes" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/volumes", { method: "GET", headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); console.log(await res.json()); ``` ### Python ```python import requests res = requests.request("GET", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/volumes", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("GET", "https://devapi.dispralabs.com/v1/cloud/environments/env_01jdk3m9x5h2p8r4t6y1u3i0oa/volumes", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "vol": "vol_01jdk5a2s4d6f8g0h2j4k6l8zx", "name": "uploads", "env": "env_01jdk3m9x5h2p8r4t6y1u3i0oa", "region": "india", "size_bytes": 10737418240, "used_bytes": 1288490188, "state": "ready", "backup_policy": {"enabled":true,"interval_s":21600,"retention":7}, "last_backup_at": "2026-12-05T10:15:02Z", "attachments": [{"svc":"svc_01jdk3n2f4g6h8j0k2l4z6x8ca","name":"api","mount_path":"/data"}] } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Volumes* # Get a volume ```http GET https://devapi.dispralabs.com/v1/cloud/volumes/:vol ``` A volume with its size, use, state, attachments and backup policy. Needs a key with `read` access or more. - **Authentication:** Secret key (send it as `Authorization: Bearer `) ## Parameters - `vol` (string, required): The volume's id. Example: `vol_01jdk5a2s4d6f8g0h2j4k6l8zx` ## Returns - **200** [The volume object](https://docs.dispralabs.com/objects/the-volume-object.md): The volume. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api GET /v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx ``` ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx", { method: "GET", headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); console.log(await res.json()); ``` ### Python ```python import requests res = requests.request("GET", "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("GET", "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "vol": "vol_01jdk5a2s4d6f8g0h2j4k6l8zx", "name": "uploads", "env": "env_01jdk3m9x5h2p8r4t6y1u3i0oa", "region": "india", "size_bytes": 10737418240, "used_bytes": 1288490188, "state": "ready", "backup_policy": {"enabled":true,"interval_s":21600,"retention":7}, "last_backup_at": "2026-12-05T10:15:02Z", "attachments": [{"svc":"svc_01jdk3n2f4g6h8j0k2l4z6x8ca","name":"api","mount_path":"/data"}] } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Volumes* # Update a volume ```http PATCH https://devapi.dispralabs.com/v1/cloud/volumes/:vol ``` Renames, resizes or changes the backup policy of a volume. Growing applies at once; shrinking needs `confirm: true` and enough free space. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `vol` (string, required): The volume's id. Example: `vol_01jdk5a2s4d6f8g0h2j4k6l8zx` - `name` (string, optional): A new name. - `size_bytes` (number, optional): A new size, whole GiB. Example: `21474836480` - `confirm` (boolean, optional): Required to shrink. - `backup_policy` (object, optional): {enabled, interval_s, retention}. Example: `{"enabled":true,"interval_s":21600,"retention":7}` ## Returns - **200** [The volume object](https://docs.dispralabs.com/objects/the-volume-object.md): The volume. ## Errors | Status | Code | When | |---|---|---| | 400 | [invalid_request](https://docs.dispralabs.com/errors.md#invalid_request) | A field is missing or not valid. The message names it. | | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 409 | [account_frozen](https://docs.dispralabs.com/errors.md#account_frozen) | The workspace is out of credits: add credits on the dashboard to create, change or deploy. | ## Request samples ### Dispra Cloud CLI ```bash dcloud api PATCH /v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx --data '{"size_bytes":21474836480,"backup_policy":{"enabled":true,"interval_s":21600,"retention":7}}' ``` ### cURL ```bash curl -X PATCH "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"size_bytes":21474836480,"backup_policy":{"enabled":true,"interval_s":21600,"retention":7}}' ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx", { method: "PATCH", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" }, body: JSON.stringify({ "size_bytes": 21474836480, "backup_policy": {"enabled":true,"interval_s":21600,"retention":7} }), }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("PATCH", "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}, json={ "size_bytes": 21474836480, "backup_policy": {"enabled":True,"interval_s":21600,"retention":7} }) print(res.json()) ``` ### Go ```go body := strings.NewReader(`{"size_bytes":21474836480,"backup_policy":{"enabled":true,"interval_s":21600,"retention":7}}`) req, _ := http.NewRequest("PATCH", "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx", body) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "vol": "vol_01jdk5a2s4d6f8g0h2j4k6l8zx", "name": "uploads", "env": "env_01jdk3m9x5h2p8r4t6y1u3i0oa", "region": "india", "size_bytes": 10737418240, "used_bytes": 1288490188, "state": "ready", "backup_policy": {"enabled":true,"interval_s":21600,"retention":7}, "last_backup_at": "2026-12-05T10:15:02Z", "attachments": [{"svc":"svc_01jdk3n2f4g6h8j0k2l4z6x8ca","name":"api","mount_path":"/data"}] } } ``` ### 400 invalid_request ```json { "error": { "code": "invalid_request", "message": "A field is missing or not valid. The message names it.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 account_frozen ```json { "error": { "code": "account_frozen", "message": "The workspace is out of credits: add credits on the dashboard to create, change or deploy.", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Volumes* # Delete a volume ```http DELETE https://devapi.dispralabs.com/v1/cloud/volumes/:vol ``` Deletes a volume. It can be restored for 7 days. Detach it from its service first. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `vol` (string, required): The volume's id. Example: `vol_01jdk5a2s4d6f8g0h2j4k6l8zx` ## Returns - **200** [The volume object](https://docs.dispralabs.com/objects/the-volume-object.md): The volume, soft deleted. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 409 | [volume_attached](https://docs.dispralabs.com/errors.md#volume_attached) | A service uses it: detach it first. | ## Request samples ### Dispra Cloud CLI ```bash dcloud api DELETE /v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx ``` ### cURL ```bash curl -X DELETE "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx", { method: "DELETE", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID() }, }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("DELETE", "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("DELETE", "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "vol": "vol_01jdk5a2s4d6f8g0h2j4k6l8zx", "name": "uploads", "env": "env_01jdk3m9x5h2p8r4t6y1u3i0oa", "region": "india", "size_bytes": 10737418240, "used_bytes": 1288490188, "state": "ready", "backup_policy": {"enabled":true,"interval_s":21600,"retention":7}, "last_backup_at": "2026-12-05T10:15:02Z", "attachments": [{"svc":"svc_01jdk3n2f4g6h8j0k2l4z6x8ca","name":"api","mount_path":"/data"}] } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 volume_attached ```json { "error": { "code": "volume_attached", "message": "A service uses it: detach it first.", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Volumes* # List volume activity ```http GET https://devapi.dispralabs.com/v1/cloud/volumes/:vol/activity ``` What happened to the volume, newest first: created, resized, attached, backed up, restored. Needs a key with `read` access or more. - **Authentication:** Secret key (send it as `Authorization: Bearer `) ## Parameters - `vol` (string, required): The volume's id. Example: `vol_01jdk5a2s4d6f8g0h2j4k6l8zx` ## Returns - **200**: events. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api GET /v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/activity ``` ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/activity" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/activity", { method: "GET", headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); console.log(await res.json()); ``` ### Python ```python import requests res = requests.request("GET", "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/activity", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("GET", "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/activity", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json {} ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Volumes* # Attach a volume ```http POST https://devapi.dispralabs.com/v1/cloud/volumes/:vol/attachments ``` Mounts the volume in a service of the same environment, from the service's next deployment. A service with a volume runs one replica, in one region. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `vol` (string, required): The volume's id. Example: `vol_01jdk5a2s4d6f8g0h2j4k6l8zx` - `svc` (string, required): The service. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` - `mount_path` (string, required): Where it is mounted, an absolute path. Example: `/data` ## Returns - **201** [The volume object](https://docs.dispralabs.com/objects/the-volume-object.md): The volume. ## Errors | Status | Code | When | |---|---|---| | 400 | [invalid_request](https://docs.dispralabs.com/errors.md#invalid_request) | A field is missing or not valid. The message names it. | | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 409 | [volume_not_eligible](https://docs.dispralabs.com/errors.md#volume_not_eligible) | The service runs more than one replica or region. | | 409 | [account_frozen](https://docs.dispralabs.com/errors.md#account_frozen) | The workspace is out of credits: add credits on the dashboard to create, change or deploy. | ## Request samples ### Dispra Cloud CLI ```bash dcloud volume attach uploads api /data ``` ### cURL ```bash curl -X POST "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/attachments" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"svc":"svc_01jdk3n2f4g6h8j0k2l4z6x8ca","mount_path":"/data"}' ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/attachments", { method: "POST", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" }, body: JSON.stringify({ "svc": "svc_01jdk3n2f4g6h8j0k2l4z6x8ca", "mount_path": "/data" }), }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("POST", "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/attachments", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}, json={ "svc": "svc_01jdk3n2f4g6h8j0k2l4z6x8ca", "mount_path": "/data" }) print(res.json()) ``` ### Go ```go body := strings.NewReader(`{"svc":"svc_01jdk3n2f4g6h8j0k2l4z6x8ca","mount_path":"/data"}`) req, _ := http.NewRequest("POST", "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/attachments", body) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 201 ```json { "data": { "vol": "vol_01jdk5a2s4d6f8g0h2j4k6l8zx", "name": "uploads", "env": "env_01jdk3m9x5h2p8r4t6y1u3i0oa", "region": "india", "size_bytes": 10737418240, "used_bytes": 1288490188, "state": "ready", "backup_policy": {"enabled":true,"interval_s":21600,"retention":7}, "last_backup_at": "2026-12-05T10:15:02Z", "attachments": [{"svc":"svc_01jdk3n2f4g6h8j0k2l4z6x8ca","name":"api","mount_path":"/data"}] } } ``` ### 400 invalid_request ```json { "error": { "code": "invalid_request", "message": "A field is missing or not valid. The message names it.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 volume_not_eligible ```json { "error": { "code": "volume_not_eligible", "message": "The service runs more than one replica or region.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 account_frozen ```json { "error": { "code": "account_frozen", "message": "The workspace is out of credits: add credits on the dashboard to create, change or deploy.", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Volumes* # Detach a volume ```http DELETE https://devapi.dispralabs.com/v1/cloud/volumes/:vol/attachments/:svc ``` Unmounts the volume from the service from its next deployment. The volume and its data stay. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `vol` (string, required): The volume's id. Example: `vol_01jdk5a2s4d6f8g0h2j4k6l8zx` - `svc` (string, required): The service's id. Example: `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` ## Returns - **200** [The volume object](https://docs.dispralabs.com/objects/the-volume-object.md): The volume. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api DELETE /v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/attachments/svc_01jdk3n2f4g6h8j0k2l4z6x8ca ``` ### cURL ```bash curl -X DELETE "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/attachments/svc_01jdk3n2f4g6h8j0k2l4z6x8ca" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/attachments/svc_01jdk3n2f4g6h8j0k2l4z6x8ca", { method: "DELETE", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID() }, }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("DELETE", "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/attachments/svc_01jdk3n2f4g6h8j0k2l4z6x8ca", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("DELETE", "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/attachments/svc_01jdk3n2f4g6h8j0k2l4z6x8ca", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "vol": "vol_01jdk5a2s4d6f8g0h2j4k6l8zx", "name": "uploads", "env": "env_01jdk3m9x5h2p8r4t6y1u3i0oa", "region": "india", "size_bytes": 10737418240, "used_bytes": 1288490188, "state": "ready", "backup_policy": {"enabled":true,"interval_s":21600,"retention":7}, "last_backup_at": "2026-12-05T10:15:02Z", "attachments": [{"svc":"svc_01jdk3n2f4g6h8j0k2l4z6x8ca","name":"api","mount_path":"/data"}] } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Volumes* # Create a backup ```http POST https://devapi.dispralabs.com/v1/cloud/volumes/:vol/backups ``` Backs up the volume now. A `volume.backup.succeeded` or `volume.backup.failed` event follows. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `vol` (string, required): The volume's id. Example: `vol_01jdk5a2s4d6f8g0h2j4k6l8zx` ## Returns - **202** [The backup object](https://docs.dispralabs.com/objects/the-backup-object.md): The backup, running. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 409 | [account_frozen](https://docs.dispralabs.com/errors.md#account_frozen) | The workspace is out of credits: add credits on the dashboard to create, change or deploy. | ## Request samples ### Dispra Cloud CLI ```bash dcloud volume backup uploads ``` ### cURL ```bash curl -X POST "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/backups" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/backups", { method: "POST", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID() }, }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("POST", "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/backups", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("POST", "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/backups", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 202 ```json { "data": { "bkp": "bkp_01jdk5c7v9b1n3m5q7w9e1r3ty", "vol": "vol_01jdk5a2s4d6f8g0h2j4k6l8zx", "state": "succeeded", "size_bytes": 1288490188, "trigger": "schedule", "taken_at": "2026-12-05T10:15:02Z" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 account_frozen ```json { "error": { "code": "account_frozen", "message": "The workspace is out of credits: add credits on the dashboard to create, change or deploy.", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Volumes* # List backups ```http GET https://devapi.dispralabs.com/v1/cloud/volumes/:vol/backups ``` The volume's backups, newest first. Needs a key with `read` access or more. - **Authentication:** Secret key (send it as `Authorization: Bearer `) ## Parameters - `vol` (string, required): The volume's id. Example: `vol_01jdk5a2s4d6f8g0h2j4k6l8zx` ## Returns - **200** [The backup object](https://docs.dispralabs.com/objects/the-backup-object.md): backups. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api GET /v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/backups ``` ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/backups" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/backups", { method: "GET", headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); console.log(await res.json()); ``` ### Python ```python import requests res = requests.request("GET", "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/backups", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("GET", "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/backups", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "bkp": "bkp_01jdk5c7v9b1n3m5q7w9e1r3ty", "vol": "vol_01jdk5a2s4d6f8g0h2j4k6l8zx", "state": "succeeded", "size_bytes": 1288490188, "trigger": "schedule", "taken_at": "2026-12-05T10:15:02Z" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Volumes* # Stream volume events ```http GET https://devapi.dispralabs.com/v1/cloud/volumes/:vol/events/stream ``` Streams the volume's backups, restores, attaches and detaches as Server-Sent Events. Needs a key with `read` access or more. - **Authentication:** Secret key (send it as `Authorization: Bearer `) ## Parameters - `vol` (string, required): The volume's id. Example: `vol_01jdk5a2s4d6f8g0h2j4k6l8zx` - `since` (timestamp, optional): Continue after this time. ## Returns - **200**: A text/event-stream. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api GET /v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/events/stream ``` ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/events/stream" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/events/stream", { method: "GET", headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); console.log(await res.json()); ``` ### Python ```python import requests res = requests.request("GET", "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/events/stream", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("GET", "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/events/stream", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json {} ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Volumes* # Move a volume to a group ```http PUT https://devapi.dispralabs.com/v1/cloud/volumes/:vol/group ``` Puts a volume in a group (`grp`) or takes it out (`grp: null`). Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `vol` (string, required): The volume's id. Example: `vol_01jdk5a2s4d6f8g0h2j4k6l8zx` - `grp` (string, optional): The group, or null for none. Example: `grp_01jdk5e2r4t6y8u0i2o4p6a8sd` - `position` (number, optional): Its place in the group, from 0. Example: `0` ## Returns - **200**: vol and grp. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api PUT /v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/group --data '{"grp":"grp_01jdk5e2r4t6y8u0i2o4p6a8sd","position":0}' ``` ### cURL ```bash curl -X PUT "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/group" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"grp":"grp_01jdk5e2r4t6y8u0i2o4p6a8sd","position":0}' ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/group", { method: "PUT", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" }, body: JSON.stringify({ "grp": "grp_01jdk5e2r4t6y8u0i2o4p6a8sd", "position": 0 }), }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("PUT", "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/group", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}, json={ "grp": "grp_01jdk5e2r4t6y8u0i2o4p6a8sd", "position": 0 }) print(res.json()) ``` ### Go ```go body := strings.NewReader(`{"grp":"grp_01jdk5e2r4t6y8u0i2o4p6a8sd","position":0}`) req, _ := http.NewRequest("PUT", "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/group", body) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json {} ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Volumes* # Get volume metrics ```http GET https://devapi.dispralabs.com/v1/cloud/volumes/:vol/metrics ``` Used and provisioned space over a range. Needs a key with `read` access or more. - **Authentication:** Secret key (send it as `Authorization: Bearer `) ## Parameters - `vol` (string, required): The volume's id. Example: `vol_01jdk5a2s4d6f8g0h2j4k6l8zx` - `range` (string, optional): 1h, 3h, 24h, 7d or 30d. Example: `7d` ## Returns - **200**: range and series. ## Errors | Status | Code | When | |---|---|---| | 400 | [invalid_range](https://docs.dispralabs.com/errors.md#invalid_range) | range is 1h, 3h, 24h, 7d or 30d. | | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api GET /v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/metrics?range=7d ``` ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/metrics?range=7d" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/metrics?range=7d", { method: "GET", headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); console.log(await res.json()); ``` ### Python ```python import requests res = requests.request("GET", "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/metrics", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}, params={"range": "7d"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("GET", "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/metrics?range=7d", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json {} ``` ### 400 invalid_range ```json { "error": { "code": "invalid_range", "message": "range is 1h, 3h, 24h, 7d or 30d.", "request_id": "req_7f3a9c21d84be056" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Volumes* # Restore a backup ```http POST https://devapi.dispralabs.com/v1/cloud/volumes/:vol/restores ``` Restores a backup (the newest by default) into a **new** volume in the same environment. The live volume is untouched. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `vol` (string, required): The volume's id. Example: `vol_01jdk5a2s4d6f8g0h2j4k6l8zx` - `bkp` (string, optional): The backup (default the newest). Example: `bkp_01jdk5c7v9b1n3m5q7w9e1r3ty` ## Returns - **201** [The volume object](https://docs.dispralabs.com/objects/the-volume-object.md): The new volume. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 409 | [account_frozen](https://docs.dispralabs.com/errors.md#account_frozen) | The workspace is out of credits: add credits on the dashboard to create, change or deploy. | ## Request samples ### Dispra Cloud CLI ```bash dcloud volume restore uploads bkp_01jdk5c7v9b1n3m5q7w9e1r3ty ``` ### cURL ```bash curl -X POST "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/restores" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"bkp":"bkp_01jdk5c7v9b1n3m5q7w9e1r3ty"}' ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/restores", { method: "POST", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" }, body: JSON.stringify({ "bkp": "bkp_01jdk5c7v9b1n3m5q7w9e1r3ty" }), }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("POST", "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/restores", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}, json={ "bkp": "bkp_01jdk5c7v9b1n3m5q7w9e1r3ty" }) print(res.json()) ``` ### Go ```go body := strings.NewReader(`{"bkp":"bkp_01jdk5c7v9b1n3m5q7w9e1r3ty"}`) req, _ := http.NewRequest("POST", "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/restores", body) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 201 ```json { "data": { "vol": "vol_01jdk5a2s4d6f8g0h2j4k6l8zx", "name": "uploads", "env": "env_01jdk3m9x5h2p8r4t6y1u3i0oa", "region": "india", "size_bytes": 10737418240, "used_bytes": 1288490188, "state": "ready", "backup_policy": {"enabled":true,"interval_s":21600,"retention":7}, "last_backup_at": "2026-12-05T10:15:02Z", "attachments": [{"svc":"svc_01jdk3n2f4g6h8j0k2l4z6x8ca","name":"api","mount_path":"/data"}] } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 account_frozen ```json { "error": { "code": "account_frozen", "message": "The workspace is out of credits: add credits on the dashboard to create, change or deploy.", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Volumes* # Restore a deleted volume ```http POST https://devapi.dispralabs.com/v1/cloud/volumes/:vol/undelete ``` Brings back a deleted volume within its 7 days. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `vol` (string, required): The volume's id. Example: `vol_01jdk5a2s4d6f8g0h2j4k6l8zx` ## Returns - **200** [The volume object](https://docs.dispralabs.com/objects/the-volume-object.md): The volume. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 409 | [account_frozen](https://docs.dispralabs.com/errors.md#account_frozen) | The workspace is out of credits: add credits on the dashboard to create, change or deploy. | ## Request samples ### Dispra Cloud CLI ```bash dcloud api POST /v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/undelete ``` ### cURL ```bash curl -X POST "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/undelete" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/undelete", { method: "POST", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID() }, }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("POST", "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/undelete", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("POST", "https://devapi.dispralabs.com/v1/cloud/volumes/vol_01jdk5a2s4d6f8g0h2j4k6l8zx/undelete", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "vol": "vol_01jdk5a2s4d6f8g0h2j4k6l8zx", "name": "uploads", "env": "env_01jdk3m9x5h2p8r4t6y1u3i0oa", "region": "india", "size_bytes": 10737418240, "used_bytes": 1288490188, "state": "ready", "backup_policy": {"enabled":true,"interval_s":21600,"retention":7}, "last_backup_at": "2026-12-05T10:15:02Z", "attachments": [{"svc":"svc_01jdk3n2f4g6h8j0k2l4z6x8ca","name":"api","mount_path":"/data"}] } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 409 account_frozen ```json { "error": { "code": "account_frozen", "message": "The workspace is out of credits: add credits on the dashboard to create, change or deploy.", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud* # The webhook object An HTTPS address that receives the project's events. Every delivery is signed with the project's webhook secret. ## Attributes - `whk` (string): The webhook's id. You choose it when you create the webhook. - `url` (string): Where deliveries go. https only; private addresses are refused. - `events` (array): The events it receives. Empty: every event. - `enabled` (boolean): False pauses deliveries. - `healthy` (boolean): False after several failed deliveries in a row. - `delivered_pct_24h` (number): Share of deliveries answered 2xx in the last 24 hours. ## Example ```json { "data": { "whk": "whk_01jdk5j2k4l6z8x0c2v4b6n8mq", "url": "https://hooks.acme.com/dispra", "events": ["deploy.succeeded", "deploy.failed"], "enabled": true, "healthy": true, "delivered_pct_24h": 100 } } ``` ## Endpoints - `PUT` [Create or update a webhook](https://docs.dispralabs.com/api/create-or-update-a-webhook.md) - `DELETE` [Delete a webhook](https://docs.dispralabs.com/api/delete-a-webhook.md) - `GET` [List a webhook's deliveries](https://docs.dispralabs.com/api/list-a-webhook-s-deliveries.md) - `GET` [List webhooks](https://docs.dispralabs.com/api/list-webhooks.md) - `POST` [Send a test event](https://docs.dispralabs.com/api/send-a-test-event.md) --- *Cloud* # The webhook delivery object One attempt to deliver an event to a webhook. Failed deliveries are retried 5 times over about an hour. ## Attributes - `evt` (string): The event's id: the same on every retry. - `whk` (string): The webhook. - `event` (string): The event type. - `state` (string): pending, delivered or failed. - `status_code` (number): Your endpoint's answer. - `attempt` (number): Attempts so far. - `at` (timestamp): When it was last attempted. ## Example ```json { "data": { "evt": "evt_01jdk5m7n9q1w3e5r7t9y1u3io", "whk": "whk_01jdk5j2k4l6z8x0c2v4b6n8mq", "event": "deploy.succeeded", "state": "delivered", "status_code": 204, "attempt": 1, "at": "2026-12-05T10:15:02Z" } } ``` ## Endpoints - `GET` [List a webhook's deliveries](https://docs.dispralabs.com/api/list-a-webhook-s-deliveries.md) - `GET` [List deliveries](https://docs.dispralabs.com/api/list-deliveries.md) --- *Cloud › Webhooks* # List deliveries ```http GET https://devapi.dispralabs.com/v1/cloud/projects/:prj/webhook-deliveries ``` Deliveries of every webhook of the project, newest first. Filter by state or event. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) ## Parameters - `prj` (string, required): The project's id. Example: `prj_01jdk3m9x2v7c4q8w5n6b1t0ra` - `state` (string, optional): pending, delivered or failed. Example: `failed` - `event` (string, optional): An event type. - `cursor` (string, optional): The next_cursor of the previous page. ## Returns - **200** [The webhook delivery object](https://docs.dispralabs.com/objects/the-webhook-delivery-object.md): deliveries. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api GET /v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhook-deliveries?state=failed ``` ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhook-deliveries?state=failed" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhook-deliveries?state=failed", { method: "GET", headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); console.log(await res.json()); ``` ### Python ```python import requests res = requests.request("GET", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhook-deliveries", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}, params={"state": "failed"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("GET", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhook-deliveries?state=failed", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "evt": "evt_01jdk5m7n9q1w3e5r7t9y1u3io", "whk": "whk_01jdk5j2k4l6z8x0c2v4b6n8mq", "event": "deploy.succeeded", "state": "delivered", "status_code": 204, "attempt": 1, "at": "2026-12-05T10:15:02Z" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ## Related - [webhook.delivery](https://docs.dispralabs.com/flows/webhook-delivery.md) --- *Cloud › Webhooks* # Get the signing secret ```http GET https://devapi.dispralabs.com/v1/cloud/projects/:prj/webhook-secret ``` The project's webhook signing secret, masked, and when it was last rotated. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) ## Parameters - `prj` (string, required): The project's id. Example: `prj_01jdk3m9x2v7c4q8w5n6b1t0ra` ## Returns - **200**: masked and rotated_at. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api GET /v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhook-secret ``` ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhook-secret" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhook-secret", { method: "GET", headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); console.log(await res.json()); ``` ### Python ```python import requests res = requests.request("GET", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhook-secret", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("GET", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhook-secret", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json {} ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Webhooks* # Reveal the signing secret ```http POST https://devapi.dispralabs.com/v1/cloud/projects/:prj/webhook-secret/reveal ``` Returns the signing secret in full, to configure your receiver. Audited. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `prj` (string, required): The project's id. Example: `prj_01jdk3m9x2v7c4q8w5n6b1t0ra` ## Returns - **200**: secret. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api POST /v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhook-secret/reveal ``` ### cURL ```bash curl -X POST "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhook-secret/reveal" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhook-secret/reveal", { method: "POST", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID() }, }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("POST", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhook-secret/reveal", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("POST", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhook-secret/reveal", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json {} ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Webhooks* # Rotate the signing secret ```http POST https://devapi.dispralabs.com/v1/cloud/projects/:prj/webhook-secret/rotate ``` Makes a new signing secret and returns it once. Every delivery is signed with it from now on: update your receiver right away. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `prj` (string, required): The project's id. Example: `prj_01jdk3m9x2v7c4q8w5n6b1t0ra` ## Returns - **200**: secret. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api POST /v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhook-secret/rotate ``` ### cURL ```bash curl -X POST "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhook-secret/rotate" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhook-secret/rotate", { method: "POST", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID() }, }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("POST", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhook-secret/rotate", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("POST", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhook-secret/rotate", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json {} ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Webhooks* # List webhooks ```http GET https://devapi.dispralabs.com/v1/cloud/projects/:prj/webhooks ``` The project's webhooks, with how their recent deliveries went. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) ## Parameters - `prj` (string, required): The project's id. Example: `prj_01jdk3m9x2v7c4q8w5n6b1t0ra` - `cursor` (string, optional): The next_cursor of the previous page. - `limit` (number, optional): Items per page, 1 to 200 (default 50). Example: `50` ## Returns - **200** [The webhook object](https://docs.dispralabs.com/objects/the-webhook-object.md): webhooks. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api GET /v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhooks?limit=50 ``` ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhooks?limit=50" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhooks?limit=50", { method: "GET", headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); console.log(await res.json()); ``` ### Python ```python import requests res = requests.request("GET", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhooks", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}, params={"limit": "50"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("GET", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhooks?limit=50", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "whk": "whk_01jdk5j2k4l6z8x0c2v4b6n8mq", "url": "https://hooks.acme.com/dispra", "events": ["deploy.succeeded", "deploy.failed"], "enabled": true, "healthy": true, "delivered_pct_24h": 100 } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Webhooks* # Create or update a webhook ```http PUT https://devapi.dispralabs.com/v1/cloud/projects/:prj/webhooks/:whk ``` Creates the webhook with the id you choose, or updates it. An empty `events` list receives every event. Deliveries are signed with the project's webhook secret. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `prj` (string, required): The project's id. Example: `prj_01jdk3m9x2v7c4q8w5n6b1t0ra` - `whk` (string, required): The webhook's id. Example: `whk_01jdk5j2k4l6z8x0c2v4b6n8mq` - `url` (string, required): Where deliveries go. https only. Example: `https://hooks.acme.com/dispra` - `events` (array, optional): The events to receive (default every event). Example: `["deploy.succeeded","deploy.failed"]` - `enabled` (boolean, optional): False pauses it. Example: `true` ## Returns - **201**: whk and status (created). - **200**: whk and status (updated). ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | | 400 | [invalid_url](https://docs.dispralabs.com/errors.md#invalid_url) | The URL is not https, or resolves to a private address. | ## Request samples ### Dispra Cloud CLI ```bash dcloud api PUT /v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhooks/whk_01jdk5j2k4l6z8x0c2v4b6n8mq --data '{"url":"https://hooks.acme.com/dispra","events":["deploy.succeeded","deploy.failed"],"enabled":true}' ``` ### cURL ```bash curl -X PUT "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhooks/whk_01jdk5j2k4l6z8x0c2v4b6n8mq" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" \ -H "Content-Type: application/json" \ -d '{"url":"https://hooks.acme.com/dispra","events":["deploy.succeeded","deploy.failed"],"enabled":true}' ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhooks/whk_01jdk5j2k4l6z8x0c2v4b6n8mq", { method: "PUT", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID(), "Content-Type": "application/json" }, body: JSON.stringify({ "url": "https://hooks.acme.com/dispra", "events": ["deploy.succeeded","deploy.failed"], "enabled": true }), }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("PUT", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhooks/whk_01jdk5j2k4l6z8x0c2v4b6n8mq", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}, json={ "url": "https://hooks.acme.com/dispra", "events": ["deploy.succeeded","deploy.failed"], "enabled": True }) print(res.json()) ``` ### Go ```go body := strings.NewReader(`{"url":"https://hooks.acme.com/dispra","events":["deploy.succeeded","deploy.failed"],"enabled":true}`) req, _ := http.NewRequest("PUT", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhooks/whk_01jdk5j2k4l6z8x0c2v4b6n8mq", body) req.Header.Set("Content-Type", "application/json") req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 201 ```json {} ``` ### 200 ```json {} ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` ### 400 invalid_url ```json { "error": { "code": "invalid_url", "message": "The URL is not https, or resolves to a private address.", "request_id": "req_7f3a9c21d84be056" } } ``` ## Related - [Webhooks](https://docs.dispralabs.com/features/webhooks.md) --- *Cloud › Webhooks* # Delete a webhook ```http DELETE https://devapi.dispralabs.com/v1/cloud/projects/:prj/webhooks/:whk ``` Removes a webhook. Deliveries stop at once. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `prj` (string, required): The project's id. Example: `prj_01jdk3m9x2v7c4q8w5n6b1t0ra` - `whk` (string, required): The webhook's id. Example: `whk_01jdk5j2k4l6z8x0c2v4b6n8mq` ## Returns - **200** [The status object](https://docs.dispralabs.com/objects/the-status-object.md): Deleted. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api DELETE /v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhooks/whk_01jdk5j2k4l6z8x0c2v4b6n8mq ``` ### cURL ```bash curl -X DELETE "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhooks/whk_01jdk5j2k4l6z8x0c2v4b6n8mq" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhooks/whk_01jdk5j2k4l6z8x0c2v4b6n8mq", { method: "DELETE", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID() }, }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("DELETE", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhooks/whk_01jdk5j2k4l6z8x0c2v4b6n8mq", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("DELETE", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhooks/whk_01jdk5j2k4l6z8x0c2v4b6n8mq", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "status": "accepted", "id": "svc_01jdk3n2f4g6h8j0k2l4z6x8ca" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Webhooks* # List a webhook's deliveries ```http GET https://devapi.dispralabs.com/v1/cloud/projects/:prj/webhooks/:whk/deliveries ``` The webhook's last deliveries: event, your endpoint's answer, attempt and when. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) ## Parameters - `prj` (string, required): The project's id. Example: `prj_01jdk3m9x2v7c4q8w5n6b1t0ra` - `whk` (string, required): The webhook's id. Example: `whk_01jdk5j2k4l6z8x0c2v4b6n8mq` - `cursor` (string, optional): The next_cursor of the previous page. - `limit` (number, optional): Items per page, 1 to 200 (default 50). Example: `50` ## Returns - **200** [The webhook delivery object](https://docs.dispralabs.com/objects/the-webhook-delivery-object.md): deliveries. ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api GET /v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhooks/whk_01jdk5j2k4l6z8x0c2v4b6n8mq/deliveries?limit=50 ``` ### cURL ```bash curl "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhooks/whk_01jdk5j2k4l6z8x0c2v4b6n8mq/deliveries?limit=50" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhooks/whk_01jdk5j2k4l6z8x0c2v4b6n8mq/deliveries?limit=50", { method: "GET", headers: { Authorization: "Bearer dsp_live_YOUR_KEY" }, }); console.log(await res.json()); ``` ### Python ```python import requests res = requests.request("GET", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhooks/whk_01jdk5j2k4l6z8x0c2v4b6n8mq/deliveries", headers={"Authorization": "Bearer dsp_live_YOUR_KEY"}, params={"limit": "50"}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("GET", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhooks/whk_01jdk5j2k4l6z8x0c2v4b6n8mq/deliveries?limit=50", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json { "data": { "evt": "evt_01jdk5m7n9q1w3e5r7t9y1u3io", "whk": "whk_01jdk5j2k4l6z8x0c2v4b6n8mq", "event": "deploy.succeeded", "state": "delivered", "status_code": 204, "attempt": 1, "at": "2026-12-05T10:15:02Z" } } ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- *Cloud › Webhooks* # Send a test event ```http POST https://devapi.dispralabs.com/v1/cloud/projects/:prj/webhooks/:whk/test ``` Queues a `webhook.test` delivery to the webhook. Needs a key with `full` access. - **Authentication:** Secret key (send it as `Authorization: Bearer `) - **Idempotency:** Safe to retry. Send an `Idempotency-Key` header and repeated calls within 24 hours return the first result. ## Parameters - `prj` (string, required): The project's id. Example: `prj_01jdk3m9x2v7c4q8w5n6b1t0ra` - `whk` (string, required): The webhook's id. Example: `whk_01jdk5j2k4l6z8x0c2v4b6n8mq` ## Returns - **200**: evt and status (queued). ## Errors | Status | Code | When | |---|---|---| | 404 | [not_found](https://docs.dispralabs.com/errors.md#not_found) | No such object in the key's project (or environment). | ## Request samples ### Dispra Cloud CLI ```bash dcloud api POST /v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhooks/whk_01jdk5j2k4l6z8x0c2v4b6n8mq/test ``` ### cURL ```bash curl -X POST "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhooks/whk_01jdk5j2k4l6z8x0c2v4b6n8mq/test" \ -H "Authorization: Bearer dsp_live_YOUR_KEY" \ -H "Idempotency-Key: $(uuidgen)" ``` ### Node ```javascript const res = await fetch("https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhooks/whk_01jdk5j2k4l6z8x0c2v4b6n8mq/test", { method: "POST", headers: { Authorization: "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": crypto.randomUUID() }, }); console.log(await res.json()); ``` ### Python ```python import uuid, requests res = requests.request("POST", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhooks/whk_01jdk5j2k4l6z8x0c2v4b6n8mq/test", headers={"Authorization": "Bearer dsp_live_YOUR_KEY", "Idempotency-Key": str(uuid.uuid4())}) print(res.json()) ``` ### Go ```go req, _ := http.NewRequest("POST", "https://devapi.dispralabs.com/v1/cloud/projects/prj_01jdk3m9x2v7c4q8w5n6b1t0ra/webhooks/whk_01jdk5j2k4l6z8x0c2v4b6n8mq/test", nil) req.Header.Set("Authorization", "Bearer dsp_live_YOUR_KEY") req.Header.Set("Idempotency-Key", uuid.NewString()) res, _ := http.DefaultClient.Do(req) ``` ## Responses ### 200 ```json {} ``` ### 404 not_found ```json { "error": { "code": "not_found", "message": "No such object in the key's project (or environment).", "request_id": "req_7f3a9c21d84be056" } } ``` --- # deploy.cancelled A deployment was cancelled before it went live. - **Level:** warn - **Emitted by:** dispra-cloud - **When:** When someone cancels a queued, building or starting deployment. - **Message:** `Deployment {dep} of {svc} was cancelled` ## Payload | Key | Type | Meaning | Example | |---|---|---|---| | `svc` | string | The service. See [The service object](https://docs.dispralabs.com/objects/the-service-object.md). | `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` | | `dep` | string | The deployment. | `dep_01jdk4p7q9w1e3r5t7y9u1i3ob` | | `env` | string | The environment. See [The environment object](https://docs.dispralabs.com/objects/the-environment-object.md). | `env_01jdk3m9x5h2p8r4t6y1u3i0oa` | ## Example ```text 17:52:48 warn deploy.cancelled svc="svc_01jdk3n2f4g6h8j0k2l4z6x8ca" dep="dep_01jdk4p7q9w1e3r5t7y9u1i3ob" env="env_01jdk3m9x5h2p8r4t6y1u3i0oa" ``` --- # deploy.failed A deployment failed; the version that was live keeps serving. - **Level:** error - **Emitted by:** dispra-cloud - **When:** When the build fails, or the new version crashes or fails its health check. - **Message:** `Deployment {dep} of {svc} failed: {error_code}` ## Payload | Key | Type | Meaning | Example | |---|---|---|---| | `svc` | string | The service. See [The service object](https://docs.dispralabs.com/objects/the-service-object.md). | `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` | | `dep` | string | The deployment. See [The deployment object](https://docs.dispralabs.com/objects/the-deployment-object.md). | `dep_01jdk4p7q9w1e3r5t7y9u1i3ob` | | `env` | string | The environment. See [The environment object](https://docs.dispralabs.com/objects/the-environment-object.md). | `env_01jdk3m9x5h2p8r4t6y1u3i0oa` | | `state` | string | failed. | `failed` | | `error_code` | string | The exact error code, such as DEPLOY_HEALTH_TIMEOUT. See [The deployment object](https://docs.dispralabs.com/objects/the-deployment-object.md). | `DEPLOY_HEALTH_TIMEOUT` | ## Example ```text 17:52:48 error deploy.failed svc="svc_01jdk3n2f4g6h8j0k2l4z6x8ca" dep="dep_01jdk4p7q9w1e3r5t7y9u1i3ob" env="env_01jdk3m9x5h2p8r4t6y1u3i0oa" state="failed" error_code="DEPLOY_HEALTH_TIMEOUT" ``` ## Related - [deploy.lifecycle](https://docs.dispralabs.com/flows/deploy-lifecycle.md) --- # deploy.started A deployment of a service began. - **Level:** info - **Emitted by:** dispra-cloud - **When:** When a deployment leaves the queue and starts building, or starts an image. - **Message:** `Deployment {dep} of {svc} started` ## Payload | Key | Type | Meaning | Example | |---|---|---|---| | `svc` | string | The service. See [The service object](https://docs.dispralabs.com/objects/the-service-object.md). | `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` | | `dep` | string | The deployment. | `dep_01jdk4p7q9w1e3r5t7y9u1i3ob` | | `env` | string | The environment. See [The environment object](https://docs.dispralabs.com/objects/the-environment-object.md). | `env_01jdk3m9x5h2p8r4t6y1u3i0oa` | ## Example ```text 17:52:48 info deploy.started svc="svc_01jdk3n2f4g6h8j0k2l4z6x8ca" dep="dep_01jdk4p7q9w1e3r5t7y9u1i3ob" env="env_01jdk3m9x5h2p8r4t6y1u3i0oa" ``` ## Related - [config.apply](https://docs.dispralabs.com/flows/config-apply.md) - [deploy.lifecycle](https://docs.dispralabs.com/flows/deploy-lifecycle.md) --- # deploy.succeeded A deployment is live and serving. - **Level:** info - **Emitted by:** dispra-cloud - **When:** When the new version passed its health check and took the traffic. - **Message:** `Deployment {dep} of {svc} is live` ## Payload | Key | Type | Meaning | Example | |---|---|---|---| | `svc` | string | The service. See [The service object](https://docs.dispralabs.com/objects/the-service-object.md). | `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` | | `dep` | string | The deployment. | `dep_01jdk4p7q9w1e3r5t7y9u1i3ob` | | `env` | string | The environment. See [The environment object](https://docs.dispralabs.com/objects/the-environment-object.md). | `env_01jdk3m9x5h2p8r4t6y1u3i0oa` | | `state` | string | live. | `live` | ## Example ```text 17:52:48 info deploy.succeeded svc="svc_01jdk3n2f4g6h8j0k2l4z6x8ca" dep="dep_01jdk4p7q9w1e3r5t7y9u1i3ob" env="env_01jdk3m9x5h2p8r4t6y1u3i0oa" state="live" ``` ## Related - [deploy.lifecycle](https://docs.dispralabs.com/flows/deploy-lifecycle.md) --- # project.deleted A project's deletion finished. This is the last event the project sends. - **Level:** warn - **Emitted by:** dispra-cloud - **When:** When the teardown of a deleted project has finished. - **Message:** `Project {prj} was deleted` ## Payload | Key | Type | Meaning | Example | |---|---|---|---| | `prj` | string | The project. See [The project object](https://docs.dispralabs.com/objects/the-project-object.md). | `prj_01jdk3m9x2v7c4q8w5n6b1t0ra` | ## Example ```text 17:52:48 warn project.deleted prj="prj_01jdk3m9x2v7c4q8w5n6b1t0ra" ``` --- # service.crashed A service crashed or ran out of memory. - **Level:** error - **Emitted by:** dispra-cloud - **When:** When a replica exits unexpectedly or is stopped for using more memory than its limit. - **Message:** `Service {svc} crashed: {reason}` ## Payload | Key | Type | Meaning | Example | |---|---|---|---| | `svc` | string | The service. See [The service object](https://docs.dispralabs.com/objects/the-service-object.md). | `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` | | `reason` | string | crash or out_of_memory. | `out_of_memory` | ## Example ```text 17:52:48 error service.crashed svc="svc_01jdk3n2f4g6h8j0k2l4z6x8ca" reason="out_of_memory" ``` --- # service.created A service was created. - **Level:** info - **Emitted by:** dispra-cloud - **When:** When a service is created, by the API, a config apply or the dashboard. - **Message:** `Service {svc} was created` ## Payload | Key | Type | Meaning | Example | |---|---|---|---| | `svc` | string | The service. See [The service object](https://docs.dispralabs.com/objects/the-service-object.md). | `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` | | `env` | string | The environment. See [The environment object](https://docs.dispralabs.com/objects/the-environment-object.md). | `env_01jdk3m9x5h2p8r4t6y1u3i0oa` | ## Example ```text 17:52:48 info service.created svc="svc_01jdk3n2f4g6h8j0k2l4z6x8ca" env="env_01jdk3m9x5h2p8r4t6y1u3i0oa" ``` --- # service.deleted A service was deleted. - **Level:** warn - **Emitted by:** dispra-cloud - **When:** When a service is deleted. - **Message:** `Service {svc} was deleted` ## Payload | Key | Type | Meaning | Example | |---|---|---|---| | `svc` | string | The service. See [The service object](https://docs.dispralabs.com/objects/the-service-object.md). | `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` | | `env` | string | The environment. See [The environment object](https://docs.dispralabs.com/objects/the-environment-object.md). | `env_01jdk3m9x5h2p8r4t6y1u3i0oa` | ## Example ```text 17:52:48 warn service.deleted svc="svc_01jdk3n2f4g6h8j0k2l4z6x8ca" env="env_01jdk3m9x5h2p8r4t6y1u3i0oa" ``` --- # service.restarted A service's replicas were restarted. - **Level:** info - **Emitted by:** dispra-cloud - **When:** When someone restarts a service. - **Message:** `Service {svc} restarted` ## Payload | Key | Type | Meaning | Example | |---|---|---|---| | `svc` | string | The service. See [The service object](https://docs.dispralabs.com/objects/the-service-object.md). | `svc_01jdk3n2f4g6h8j0k2l4z6x8ca` | ## Example ```text 17:52:48 info service.restarted svc="svc_01jdk3n2f4g6h8j0k2l4z6x8ca" ``` --- # volume.almost_full A volume is 90% full or more. - **Level:** warn - **Emitted by:** dispra-cloud - **When:** At most once a day per volume, while it stays at 90% or more. - **Message:** `Volume {vol} is {percent}% full` ## Payload | Key | Type | Meaning | Example | |---|---|---|---| | `vol` | string | The volume. See [The volume object](https://docs.dispralabs.com/objects/the-volume-object.md). | `vol_01jdk5a2s4d6f8g0h2j4k6l8zx` | | `percent` | number | How full it is. | `92` | ## Example ```text 17:52:48 warn volume.almost_full vol="vol_01jdk5a2s4d6f8g0h2j4k6l8zx" percent=92 ``` --- # volume.backup.failed A backup of a volume failed. - **Level:** error - **Emitted by:** dispra-cloud - **When:** When a backup could not be taken; the next scheduled one tries again. - **Message:** `Backup of volume {vol} failed` ## Payload | Key | Type | Meaning | Example | |---|---|---|---| | `vol` | string | The volume. See [The volume object](https://docs.dispralabs.com/objects/the-volume-object.md). | `vol_01jdk5a2s4d6f8g0h2j4k6l8zx` | ## Example ```text 17:52:48 error volume.backup.failed vol="vol_01jdk5a2s4d6f8g0h2j4k6l8zx" ``` --- # volume.backup.succeeded A backup of a volume finished. - **Level:** info - **Emitted by:** dispra-cloud - **When:** When a scheduled or manual backup finishes. - **Message:** `Backup {bkp} of volume {vol} finished` ## Payload | Key | Type | Meaning | Example | |---|---|---|---| | `vol` | string | The volume. See [The volume object](https://docs.dispralabs.com/objects/the-volume-object.md). | `vol_01jdk5a2s4d6f8g0h2j4k6l8zx` | | `bkp` | string | The backup. See [The backup object](https://docs.dispralabs.com/objects/the-backup-object.md). | `bkp_01jdk5c7v9b1n3m5q7w9e1r3ty` | ## Example ```text 17:52:48 info volume.backup.succeeded vol="vol_01jdk5a2s4d6f8g0h2j4k6l8zx" bkp="bkp_01jdk5c7v9b1n3m5q7w9e1r3ty" ``` --- # volume.created A volume was created. - **Level:** info - **Emitted by:** dispra-cloud - **When:** When a volume is created, or restored from a backup into a new volume. - **Message:** `Volume {vol} was created` ## Payload | Key | Type | Meaning | Example | |---|---|---|---| | `vol` | string | The volume. See [The volume object](https://docs.dispralabs.com/objects/the-volume-object.md). | `vol_01jdk5a2s4d6f8g0h2j4k6l8zx` | | `env` | string | The environment. See [The environment object](https://docs.dispralabs.com/objects/the-environment-object.md). | `env_01jdk3m9x5h2p8r4t6y1u3i0oa` | ## Example ```text 17:52:48 info volume.created vol="vol_01jdk5a2s4d6f8g0h2j4k6l8zx" env="env_01jdk3m9x5h2p8r4t6y1u3i0oa" ``` --- # volume.deleted A volume was deleted. - **Level:** warn - **Emitted by:** dispra-cloud - **When:** When a volume is deleted (it can be restored for 7 days). - **Message:** `Volume {vol} was deleted` ## Payload | Key | Type | Meaning | Example | |---|---|---|---| | `vol` | string | The volume. See [The volume object](https://docs.dispralabs.com/objects/the-volume-object.md). | `vol_01jdk5a2s4d6f8g0h2j4k6l8zx` | ## Example ```text 17:52:48 warn volume.deleted vol="vol_01jdk5a2s4d6f8g0h2j4k6l8zx" ``` --- # webhook.test A test delivery. - **Level:** info - **Emitted by:** dispra-cloud - **When:** When you send a test event to a webhook. - **Message:** `Test delivery` ## Example ```text 17:52:48 info webhook.test ``` --- # config.apply How a dispra.yaml file becomes the state of an environment. - **Starts when:** You change dispra.yaml - **Involved:** Your code, Dispra API - **Ends with:** The environment matches the file, and what changed is deploying - **Takes:** Seconds, plus the deployments ## Steps | Step | Who | What | Calls / logs | |---|---|---|---| | 1 | Your code | Sends the file to plan: every change it would make, in order, and a plan_hash. | calls [Plan a config file](https://docs.dispralabs.com/api/plan-a-config-file.md) | | 2 | You | Review the plan: changes, objects the file leaves out (unmanaged) and warnings. | | | 3 | Your code | Applies with the plan_hash. If the environment changed since, apply refuses with plan_stale and the new plan. | calls [Apply a config file](https://docs.dispralabs.com/api/apply-a-config-file.md) | | 4 | Dispra API | Runs the steps in order; a refused step stops the apply and reports what ran before it. | | | 5 | Dispra | Deploys every service that was created or changed. | logs [deploy.started](https://docs.dispralabs.com/events/deploy-started.md) | ## Related - [Config as code](https://docs.dispralabs.com/features/config-as-code.md) --- # deploy.lifecycle What happens from a deployment request to a new version taking the traffic. - **Starts when:** You create a deployment, push to the branch, or apply a config - **Involved:** Dispra API, builders, your service - **Ends with:** The new version is live, or the old one keeps serving - **Takes:** 1 to 5 minutes, mostly the build ## Steps | Step | Who | What | Calls / logs | |---|---|---|---| | 1 | Your code | Starts a deployment (or a push to the branch starts one). | calls [Create a deployment](https://docs.dispralabs.com/api/create-a-deployment.md) | | 2 | Dispra | Queues it and starts building: the image is built from the commit, or the service's image is used as is. | logs [deploy.started](https://docs.dispralabs.com/events/deploy-started.md) | | 3 | Dispra | Starts the new version next to the old one and runs its health check. | | | 4 | Dispra | Health check passes: the new version takes the traffic, the old one stops. | logs [deploy.succeeded](https://docs.dispralabs.com/events/deploy-succeeded.md) | | 4b | Dispra | Build or health check fails: the old version keeps serving and the deployment ends failed. | logs [deploy.failed](https://docs.dispralabs.com/events/deploy-failed.md) | | 5 | Your code | Follows it: reads the deployment, or streams the build log until event end. | calls [Stream a deployment's logs](https://docs.dispralabs.com/api/stream-a-deployment-s-logs.md) | --- # request.check How every request made with a key is checked before it reaches your project. - **Starts when:** Your code sends a request with a key - **Involved:** Your code, Dispra API - **Ends with:** The answer, or a refusal with a code - **Takes:** A few milliseconds ## Steps | Step | Who | What | Calls / logs | |---|---|---|---| | 1 | Your code | Sends the request with Authorization: Bearer dsp_live_... (and an Idempotency-Key on a write). | | | 2 | Dispra API | Checks the key: it must exist, be live and be for this environment of Dispra (dsp_live_ or dsp_dev_). Else 401 invalid_key. | | | 3 | Dispra API | Checks the key's creator is still in the workspace (else 403 key_creator_gone) and the request's browser Origin (else 403 origin_not_allowed). | | | 4 | Dispra API | Checks scope: the object must belong to the key's project, and environment when the key has one. Else 404 not_found. | | | 5 | Dispra API | Checks access: the key's level and its creator's current role must both allow the route. Else 403 key_access_denied. | | | 6 | Dispra API | Takes one token from the key's rate-limit bucket. Else 429 rate_limited with Retry-After. | | | 7 | Dispra API | Runs the route and records the call in the key's call log. | calls [List API calls](https://docs.dispralabs.com/api/list-api-calls.md) | ## Related - [Developer keys](https://docs.dispralabs.com/features/developer-keys.md) --- # shell.session How a terminal shell opens in a running replica. - **Starts when:** You ask for a shell - **Involved:** Your code, Dispra API, the replica - **Ends with:** A shell in the replica, until you exit or it is idle for 10 minutes - **Takes:** A second to connect ## Steps | Step | Who | What | Calls / logs | |---|---|---|---| | 1 | Your code | Asks for a shell: Dispra answers a single-use ticket valid 5 minutes, and ws_url. | calls [Open a shell](https://docs.dispralabs.com/api/open-a-shell.md) | | 2 | Your code | Opens a WebSocket to ws_url, without a browser Origin. | | | 3 | Dispra | Checks the ticket and connects it to one running replica of the service. | | | 4 | Your code | Sends keystrokes as binary frames and resize frames as text; the replica answers with its output. | | ## Related - [Terminal shell](https://docs.dispralabs.com/features/terminal-shell.md) --- # webhook.delivery How an event reaches your webhook, and what happens when your endpoint does not answer. - **Starts when:** Something happens in the project - **Involved:** Dispra, your endpoint - **Ends with:** Your endpoint answered 2xx, or the delivery is given up after an hour - **Takes:** Under a second, up to an hour with retries ## Steps | Step | Who | What | Calls / logs | |---|---|---|---| | 1 | Dispra | Builds the event (id, type, created_at, project, data) and signs the body with the project's webhook secret. | | | 2 | Dispra | POSTs it to every webhook subscribed to that event, with X-Dispra-Signature. | | | 3 | Your endpoint | Verifies the signature and answers 2xx within a few seconds, then does the work. | | | 4 | Dispra | No 2xx: retries 1, 5, 10, 20 and 24 minutes later, then marks the delivery failed. | calls [List deliveries](https://docs.dispralabs.com/api/list-deliveries.md) | ## Related - [Webhooks](https://docs.dispralabs.com/features/webhooks.md) --- # Config as code For: Developers, CI pipelines Describe an environment in dispra.yaml, review the plan, and apply it. ## The problem Settings changed by hand drift between environments and nobody knows why. ## How it works 1. Write the environment's services, variables and volumes in dispra.yaml, or export it. ([Export the environment](https://docs.dispralabs.com/api/export-the-environment.md)) 2. Plan the file to see every change. ([Plan a config file](https://docs.dispralabs.com/api/plan-a-config-file.md)) 3. Apply exactly that plan. ([config.apply](https://docs.dispralabs.com/flows/config-apply.md)) ## Limits - Secret values never go in the file: declare them as ${{ secret }} - Apply never deletes volumes ## Flows - [config.apply](https://docs.dispralabs.com/flows/config-apply.md) ## API - `GET` [Export the environment](https://docs.dispralabs.com/api/export-the-environment.md) - `POST` [Plan a config file](https://docs.dispralabs.com/api/plan-a-config-file.md) --- # Developer keys For: Developers, CI pipelines Project keys that let your code, scripts and CI manage everything inside a project. ## The problem Teams want to deploy, scale and configure from their own tools without sharing a person's login. ## How it works 1. A project admin creates a key on the dashboard, with an access level: read, deploy or full. 2. Your code sends it as Authorization: Bearer on every request. ([request.check](https://docs.dispralabs.com/flows/request-check.md)) 3. Every call is recorded, so you can see what a key did. ([List API calls](https://docs.dispralabs.com/api/list-api-calls.md)) ## Requirements - A project admin creates the key on the dashboard (Project settings > Developer > Keys) ## Limits - A key reaches one project, and one environment when you choose one - People, billing and workspace settings stay on the dashboard ## Flows - [request.check](https://docs.dispralabs.com/flows/request-check.md) ## API - `GET` [List API calls](https://docs.dispralabs.com/api/list-api-calls.md) --- # Environment keys For: CI pipelines Keys limited to one environment, for a CI job that should only touch staging. ## The problem A staging pipeline should never be able to change production. ## How it works 1. Choose an environment when creating the key. 2. It sees only that environment: other environments' services, logs and variables answer 404. ([List environments](https://docs.dispralabs.com/api/list-environments.md)) ## Limits - Project-wide routes show only the key's environment ## API - `GET` [List environments](https://docs.dispralabs.com/api/list-environments.md) --- # Log search and streaming For: Developers Search a project's logs in pages of up to 750 lines, or stream a service's output live. ## The problem Debugging needs both the past (search) and the present (follow). ## How it works 1. Search logs by service, deployment, level, time and text. ([List logs](https://docs.dispralabs.com/api/list-logs.md)) 2. Stream a service's output, starting from its last lines. ([Stream a service's logs](https://docs.dispralabs.com/api/stream-a-service-s-logs.md)) 3. Follow a build until it ends. ([Stream a deployment's logs](https://docs.dispralabs.com/api/stream-a-deployment-s-logs.md)) ## Limits - A stream sends at most 750 lines at once; past that it reports a gap ## API - `GET` [List logs](https://docs.dispralabs.com/api/list-logs.md) - `GET` [Stream a deployment's logs](https://docs.dispralabs.com/api/stream-a-deployment-s-logs.md) - `GET` [Stream a service's logs](https://docs.dispralabs.com/api/stream-a-service-s-logs.md) --- # Safe retries For: Developers Every write takes an Idempotency-Key, so retrying after a timeout never does a thing twice. ## The problem A network error mid-request leaves you unsure whether the deploy started. ## How it works 1. Send a new random Idempotency-Key with every write. 2. Retry with the same key: you get the first answer back instead of a second deployment. ([Create a deployment](https://docs.dispralabs.com/api/create-a-deployment.md)) ## Limits - Keys are kept for 24 hours - Reusing a key for a different request is refused (422 idempotency_key_reused) ## API - `POST` [Create a deployment](https://docs.dispralabs.com/api/create-a-deployment.md) --- # Terminal shell For: Developers A shell in a running replica, from your terminal. ## The problem Inspecting a running app should not need SSH keys or open ports. ## How it works 1. Ask for a shell ticket. ([Open a shell](https://docs.dispralabs.com/api/open-a-shell.md)) 2. Connect to it over a WebSocket from your terminal or tool. ([shell.session](https://docs.dispralabs.com/flows/shell-session.md)) ## Requirements - A key with full access, or a developer role ## Limits - Idle shells close after 10 minutes; any shell after an hour ## Flows - [shell.session](https://docs.dispralabs.com/flows/shell-session.md) ## API - `POST` [Open a shell](https://docs.dispralabs.com/api/open-a-shell.md) --- # Webhooks For: Developers Signed HTTPS callbacks when deployments, services and volumes change. ## The problem Polling for a deployment to finish is slow and wasteful. ## How it works 1. Add an endpoint and choose its events. ([Create or update a webhook](https://docs.dispralabs.com/api/create-or-update-a-webhook.md)) 2. Verify each delivery's signature and answer 2xx. ([webhook.delivery](https://docs.dispralabs.com/flows/webhook-delivery.md)) ## Limits - Deliveries are retried for about an hour, then given up ## Flows - [webhook.delivery](https://docs.dispralabs.com/flows/webhook-delivery.md) ## API - `PUT` [Create or update a webhook](https://docs.dispralabs.com/api/create-or-update-a-webhook.md) --- # Errors Errors answer `{"error": {"code", "message", "request_id"}}` with an HTTP status. Check `code` in your code: it is stable. `message` is for people and may change. Quote `request_id` when you contact support. Besides the codes of each endpoint, any request can get `401 invalid_key` (no key, or an unknown, revoked or regenerated one), `403 key_creator_gone`, `403 key_access_denied` (above the key's access or its creator's role), `403 origin_not_allowed`, `404 not_available_with_key`, `413 payload_too_large`, `429 rate_limited`, and on writes `400 idempotency_key_required`, `409 request_in_progress` and `422 idempotency_key_reused`. ## Error response ### Error response · 422 ```json { "error": { "code": "region_not_eligible", "message": "A service with a volume runs in one region.", "request_id": "req_7f3a9c21d84be056" } } ``` ## Error codes | Status | Code | Meaning | Retry | |---|---|---|---| | 400 | `confirm_required` | Send confirm: true. | no | | 400 | `invalid_config` | The file is not valid. The message names every problem, with its key. | no | | 400 | `invalid_domain` | That isn't a domain you can add. | no | | 400 | `invalid_limit` | limit is 1 to 750. | no | | 400 | `invalid_range` | range is 1h, 3h, 24h, 7d or 30d. | no | | 400 | `invalid_request` | A field is missing or not valid. The message names it. | no | | 400 | `invalid_tail` | tail is 0 to 750. | no | | 400 | `invalid_url` | The URL is not https, or resolves to a private address. | no | | 404 | `not_found` | No such object in the key's project (or environment). | no | | 409 | `account_frozen` | The workspace is out of credits: add credits on the dashboard to create, change or deploy. | no | | 409 | `apply_failed` | A step was refused. The changes before it were applied. | no | | 409 | `console_unavailable` | Shells aren't available in this region yet. | no | | 409 | `deployment_finished` | It has already finished. | no | | 409 | `domain_connect_unsupported` | The provider doesn't support Domain Connect. | no | | 409 | `domain_taken` | Another service uses that domain. | no | | 409 | `invalid_state` | The service is stopped or being deleted. | no | | 409 | `name_taken` | The environment already has a group with that name. | no | | 409 | `not_running` | The service has no running replica. | no | | 409 | `not_startable` | Dispra stopped this service: it starts again once that is resolved. | no | | 409 | `plan_stale` | The environment changed since the plan: the error carries the new plan. | no | | 409 | `production_environment` | The production environment can't be deleted. | no | | 409 | `region_exists` | The service already runs there. | no | | 409 | `region_last` | The service runs only there. | no | | 409 | `service_replicas_volume` | A service with a volume runs one replica. | no | | 409 | `stale_generation` | Someone changed it since you read it: read it again and retry. | no | | 409 | `variable_in_use` | A service still uses it. | no | | 409 | `volume_attached` | A service uses it: detach it first. | no | | 409 | `volume_name_taken` | The environment has a volume with that name. | no | | 409 | `volume_not_eligible` | The service runs more than one replica or region. | no | | 422 | `region_not_eligible` | A service with a volume runs in one region. | no | | 429 | `rate_limited` | Checked less than 10 seconds ago. | yes | | 503 | `logs_unavailable` | Logs can't be read right now. Retry shortly. | yes | ## Retries Retry 429, 502, 503 and 504 with exponential backoff, waiting at least Retry-After seconds, and always with the same Idempotency-Key so a retried write is never done twice. Don't retry other 4xx errors unchanged: fix the request first. --- *Objects* # The log line object One line a service wrote, or a build step. Log pages return lines newest first; streams send them oldest first as they arrive. ## Attributes - `id` (string): The line's id, for de-duplication. - `ts` (timestamp): When it was written. - `level` (string): debug, info, warn or error. - `message` (string): The text of the line. - `service` (string): The service that wrote it. - `env` (string): Its environment. - `tags` (object): svc, dep, replica and phase (build or run). ## Example ```json { "data": { "id": "ln_8f2c1a", "ts": "2026-12-05T10:15:02Z", "level": "info", "message": "GET /healthz 200 3ms", "service": "api", "env": "production", "tags": {"svc":"svc_01jdk3n2f4g6h8j0k2l4z6x8ca","dep":"dep_01jdk4p7q9w1e3r5t7y9u1i3ob","replica":"r1","phase":"run"} } } ``` --- *Objects* # The webhook event object The JSON body of a delivery: what happened, to which objects, and when. ## Attributes - `id` (string): The event's id. Use it to ignore a repeated delivery. - `type` (string): The event type. - `created_at` (timestamp): When it happened. - `project` (object): {prj, name}. - `data` (object): The ids involved, and state or error_code where they apply. ## Example ```json { "data": { "id": "evt_01jdk5m7n9q1w3e5r7t9y1u3io", "type": "deploy.succeeded", "created_at": "2026-12-05T10:15:02Z", "project": {"prj":"prj_01jdk3m9x2v7c4q8w5n6b1t0ra","name":"storefront"}, "data": {"svc":"svc_01jdk3n2f4g6h8j0k2l4z6x8ca","dep":"dep_01jdk4p7q9w1e3r5t7y9u1i3ob","state":"live"} } } ```