# 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.
