Skip to main content

Vertra Cloud Python SDK

PyPI License: MIT

Official Python SDK for the Vertra Cloud public API: apps, databases, templates, stacks, snapshots, account, workspaces and billing — one typed method per route.

  • Python 3.10+, fully typed (py.typed), with TypedDict payloads.
  • Zero dependencies outside the standard library.
  • No hidden retries, caching or state: errors come back as they happened.

Installation

pip install vertracloud-api

Getting an API key

Sign in to the dashboard, open Settings → API keys and create a key with only the scopes your code needs (e.g. apps:read, apps:write). Keep it out of your source code — the examples read it from VERTRA_API_KEY.

Quick start

import os

from vertracloud import VertraClient

client = VertraClient(api_key=os.environ["VERTRA_API_KEY"])

me = client.account.get()
plan = me["plan"]
print(f"Hi {me['name']}! Plan: {plan['name'] if plan else 'none'}")

for app in me["applications"]:
    print(app["id"], app["name"], app["status"])

Documentation

Every method has a docstring with its HTTP route and the API key scope it needs.

Usage

Client options

client = VertraClient(
    api_key=os.environ["VERTRA_API_KEY"],
    timeout=10,  # seconds, default 30 per call
    # base_url, blob_base_url, user_agent and a custom transport are also accepted
)

Per-call options

Methods on apps, databases, images, templates and stacks take a keyword-only workspace_id; downloads, uploads and streams also take timeout (the limit of each request, never a total wait; the wait_timeout of the *_and_wait and wait_for_* helpers is the total):

# Act on a resource that belongs to a workspace
app = client.apps.get(app_id, workspace_id=workspace_id)

# Give one slow call more time
zip_bytes = client.apps.download(app_id, timeout=300)  # per request; the wait for the snapshot is `wait_timeout`

Nested resources are attributes: client.apps.deploys, client.apps.releases, client.apps.envs, client.workspaces.members, client.billing.orders, …

Apps

app = client.apps.get(app_id)

client.apps.restart(app_id)  # normal restart
client.apps.restart(app_id, {"reinstall_dependencies": True})

metrics = client.apps.metrics(app_id, range="24h")
logs = client.apps.logs(app_id)

Custom domains

An app can have several domains, each with its own port, path prefix or redirect. add returns the created domain and its automatic www (or root) companion; the limit depends on your plan.

domains = client.apps.domains.add(app_id, {"hostname": "example.com", "port": 8080})
main = domains[0]

for record in client.apps.domains.dns(app_id, main["id"]):
    print(record["type"], record["name"], record["value"], record["status"])

client.apps.domains.update(app_id, domains[1]["id"], {"redirect_to": main["id"], "redirect_status": 301})
client.apps.domains.remove(app_id, main["id"])

client.apps.domains.connect(app_id, domain_id) returns a link that configures the DNS records at providers that support it, or raises a 404 DOMAIN_CONNECT_UNAVAILABLE.

Releases and rollback

page = client.apps.releases.list(app_id, limit=20)  # newest first, max 50 per page
release_id = page["data"][1]["id"]

log = client.apps.releases.log(app_id, release_id)  # log["content"] is None when absent or expired

# Preview what restoring the saved environment variables would change.
# The preview returns variable names only, never values.
preview = client.apps.releases.preview_rollback(app_id, release_id)
for change in preview["environment_changes"]:
    print(change["key"], change["change"])  # added | modified | removed

# Restores the release's code and restarts the app. Variables are kept unless you ask for them.
new_release = client.apps.releases.rollback(app_id, release_id, {"restore_environment": True})

rollback needs apps:write; with restore_environment the key also needs apps:envs, as does the preview. Deploy behavior is set through update_config:

client.apps.update_config(
    app_id, {"deploy": {"zero_downtime": "auto", "auto_rollback": True, "health_check_path": "/health"}}
)
client.apps.update_config(app_id, {"deploy": {"health_check_path": None}})  # clears the path

client.apps.files.upload(..., message="...") sets the message shown in the release history.

Automatic restart is set at creation (client.apps.create({"name": "x", "auto_restart": False}, file=zip_bytes); omitted, it is on) and afterwards with update_config, applied right away without a restart or reinstall:

client.apps.update_config(app_id, {"auto_restart": False})

client.apps.files.delete answers {"space_released": "now" | "on_restart"}: on_restart means the file was still open and the space returns at the next restart.

Web Analytics

Traffic, errors, performance and the request log of an app's site (scope apps:read). Every call takes a window (start, end, ISO 8601; at most 30 days, within the plan's limits.web_analytics_history_days) and one keyword per dimension to filter by (country, edge_location, host, path as a prefix, method, status or a class such as 5xx, protocol, device, os, browser, referer, asn, ip, content_type, cache_status, bot). A value of a breakdown entry can be sent back as the filter unchanged; "(none)" filters the requests that had no value.

traffic = client.apps.analytics.traffic(
    app_id, start="2026-11-02T00:00:00Z", compare=True, breakdowns=["country", "path"], country="BR"
)
print(traffic["summary"], traffic["breakdowns"]["path"][0])

# Compare with a chosen period (same length as the window; implies compare=True).
week_before = client.apps.analytics.errors(app_id, start="2026-11-02T00:00:00Z", compare_start="2026-10-26T00:00:00Z")

errors = client.apps.analytics.errors(app_id, include_4xx=True)
perf = client.apps.analytics.performance(app_id)  # plans with web_analytics_performance
# Plans with web_analytics_requests.
page = client.apps.analytics.requests(app_id, status="5xx", order="desc", limit=100)

for request in client.apps.analytics.iter_requests(app_id, path="/api"):  # follows the cursor
    print(request["request_id"], request["status"], request["edge_time_ms"])

An app with no site published answers web_published: False and empty data. PLAN_DOES_NOT_SUPPORT_WEB_ANALYTICS_PERFORMANCE and PLAN_DOES_NOT_SUPPORT_WEB_ANALYTICS_REQUESTS (403) mean the plan does not include that route; compare_start (traffic, errors and performance, ISO 8601) compares with the period of the same length that starts there instead of the one right before the window, and shows it in previous.start/previous.end; a period that ends after the window starts is INVALID_RANGE (400). ANALYTICS_RANGE_EXCEEDS_PLAN (400) carries error.analytics_range (history_days, earliest) and ANALYTICS_BUSY (503) carries error.analytics_retry_after.

Uploading and downloading

Uploads take bytes. To download, use download_to_file, which writes to disk as the bytes arrive and keeps memory constant whatever the size; download returns bytes and holds the whole file in memory, so keep it for small files.

with open("app.zip", "rb") as f:
    app = client.apps.create({"name": "my-app", "memory": 512}, file=f.read())

written = client.apps.download_to_file(app_id, "backup.zip")  # bytes written

client.snapshots.download(resource_id, snapshot_id, scope) downloads one snapshot of an app or a database as bytes. It has no total deadline: timeout (30 s by default) is the wait of each socket operation, so a large file that keeps arriving completes however long it takes, and one that stops sending bytes fails after timeout.

apps.download downloads the whole app as a zip: it takes a manual snapshot (snapshots.create_and_wait, which waits for the job when the API answers 202) and downloads it. The snapshot stays in snapshots.list and counts on the manual snapshot quota. An API key needs the scopes snapshots:write (to take the snapshot) and snapshots:read (to download it); apps:files alone does not download. wait_timeout is the total wait for the snapshot (30 minutes by default), interval the poll interval and timeout the limit of each request; it raises what snapshots.create_and_wait raises. An account without a plan cannot take the snapshot, but can list and download the ones it has.

written = client.apps.download_to_file(
    app_id, "backup.zip", wait_timeout=900, on_progress=lambda job: print(job["status"])
)

download_to_file is the recommended form for anything that can be large (a snapshot of several GB is fine): the zip goes to a temporary file next to the destination, is renamed to the final name only when the download ends, and a failure, a stall (timeout without bytes), a connection cut before the announced Content-Length (DownloadIncompleteError, an OSError) or a KeyboardInterrupt removes the temporary file, so the destination never holds a partial file. The snapshot and app downloads take workspace_id like the rest, and send it on every call of the flow (take the snapshot, follow the job, download). client.snapshots.download_to_file(resource_id, snapshot_id, scope, path) does the same for an existing snapshot. apps.download_stream and snapshots.download_stream return an iterator of byte chunks (1 MiB at most) when you want to send the bytes somewhere other than a file; apps.download and snapshots.download return the whole zip as bytes.

Waiting for the first build

apps.create replies right away with status: "building". Wait for the build to end:

app = client.apps.create({"name": "my-app", "memory": 512}, file=data)
try:
    app = client.apps.wait_until_ready(app["id"], timeout=600, interval=2)  # status is "up"
# ended "down": e.code is app["last_build_error"] (e.g. "INSTALL_OUT_OF_MEMORY"), "APP_DOWN" if none
except vertracloud.AppBuildFailedError as e:
    print(client.apps.logs(app["id"]))
except vertracloud.WaitTimeoutError:  # still building after `timeout` seconds
    ...

While the build runs, calls that need a stopped or running app can fail with APP_BUILDING (409).

Realtime logs (SSE)

stream = client.apps.realtime(app_id)
try:
    for event in stream:
        print(event.event, event.data)
finally:
    stream.close()

Stop the stream with break or stream.close(). Pass since= to resume. There is no automatic reconnection.

event.event is logs, next_logs, system, metrics or heartbeat. On a zero-downtime deploy, next_logs carries the output of the new version while it is prepared (same format as logs); the current version keeps writing to logs. Notes that already happened are sent again when the connection starts, as <ISO 8601> <note>; live notes have no prefix. New system notes: install_note:build_oom (the build ran out of memory) and deploy_note:discarded:<release_id>[:<reason>] (the new version was dropped and the current one keeps running; the reason is optional and new values may appear).

Pass metrics=True to also receive a metrics event about every 5 seconds while the app runs, with its live CPU, memory and network:

stream = client.apps.realtime(app_id, metrics=True)
try:
    for event in stream:
        if event.event == "metrics":
            live = event.live_metrics()  # APIApplicationLiveMetrics
            print(live["cpu_percent"], live["memory_bytes"], live["net_rx_bps"])
finally:
    stream.close()

client.apps.metrics and client.databases.metrics return points with events: what happened between one point and the next (restart, auto_restart or crash, each with its at and out_of_memory).

Blob Storage

client.blob talks to the Blob Storage API (blob_base_url, default https://blob.vertracloud.app/v1) with the same API key (blob:read / blob:write). Every method accepts workspace_id.

obj = client.blob.put(
    "images/logo.png",
    "./logo.png",
    visibility="public",
    on_progress=lambda loaded, total: print(loaded, total),
)
print(obj["url"])

for o in client.blob.list(prefix="images/"):  # follows the cursor for you
    print(o["path"], o["size"])

link = client.blob.download_url(obj["id"], expires_in=600)  # {"url", "expires_at"}
client.blob.delete_many(prefix="tmp/")

data can be bytes, a file path, or a seekable binary file. Up to 5 MB it is one request; larger files go straight to storage in parts, with a retry per part. If the process dies halfway, client.blob.resume(upload_id, data) sends only the missing parts.

Custom Docker images

An image is a build context (a ZIP of up to 100 MB, or a GitHub repository) with a Dockerfile at its root. Create and rebuild reply right away with status: "building"; the build then ends as success or failed, and error says why. Whether your plan can create images is decided by the API (PLAN_DOES_NOT_SUPPORT_CUSTOM_IMAGES).

# From a ZIP: the file is passed as bytes, like apps.create
with open("projeto.zip", "rb") as f:
    image = client.images.create({"name": "meu-projeto"}, file=f.read())

# Or from GitHub: `github_branch` is optional (default: the repository's default branch). A repository in your
# GitHub App installations is linked and each push to the branch rebuilds the image; a public repository outside
# them is built once, with no link.
site = client.images.create({"name": "site", "github_repository": "acme/site", "github_branch": "main"})

# Check the Dockerfile before building; `refusals` block the build, `warnings` do not
report = client.images.check({"dockerfile": dockerfile_text, "files": ["Dockerfile", "app.py"]})

# Follow the build as lines of text; the stream repeats the history, then goes live
for line in client.images.logs(image["id"]):
    print(line)

image = client.images.get(image["id"])  # then status is "success" or "failed"

app = client.apps.create_from_image(
    {"image_id": image["id"], "name": "meu-app", "memory": 512, "web": True, "subdomain": "random"}
)

Images can belong to a workspace, like apps. list and every method that acts on an existing image take a keyword-only workspace_id; create and apps.create_from_image take it in the body ({"name": "site", "workspace_id": workspace_id, ...}). check only reads the Dockerfile you send, so it has no workspace.

images = client.images.list(workspace_id=workspace_id)
client.images.rebuild(image_id, file=zip_bytes, workspace_id=workspace_id)

create takes an optional description (up to 128 characters). update renames the image and/or changes its description without building anything; the apps keep running. Send only what changes, and None removes the description:

client.images.update(image["id"], {"name": "meu-projeto-base", "description": "Base Node 22"})
client.images.update(image["id"], {"description": None})

images.logs returns an iterator with close(), like apps.realtime. rebuild(image_id, file=...) replaces the whole build context; it never restarts the apps that run the image. rebuild_from_source(image_id) builds again without uploading anything: an image linked to GitHub uses the tip of the linked branch, any other uses the build context of the latest build, including a failed one; it counts toward the hourly deploy limit. link_github and unlink_github change the GitHub link, and versions lists the successful builds, newest first.

delete removes the image and every app created from it. The name must be typed back as confirm_name:

client.images.delete(image["id"], confirm_name="meu-projeto")  # {"deleted_apps": [...]}

Templates

A template describes what to create: one application, or a stack with applications, databases and a Blob folder. deploy returns a job right away; follow it with deploys.events (Server-Sent Events) or read deploys.get. A job that fails is undone as a whole.

page = client.templates.list(category="bots", sort="popular")

job = client.templates.deploy(
    "n8n",
    {"name": "my-n8n", "inputs": {"admin_email": "me@example.com"}},
    idempotency_key="deploy-my-n8n-1",  # repeating the call returns the same job
)

events = client.templates.deploys.events(job["id"])
for event in events:  # heartbeats are skipped; the loop ends when the API sends `end`
    print(event["status"], event["current_step"])
job = client.templates.deploys.get(job["id"])  # outputs are read here, never on the stream

idempotency_key is sent as the Idempotency-Key header and never goes in the body: the same key with the same request returns the same job, the same key with another request fails with IDEMPOTENCY_KEY_CONFLICT. Outputs marked once come back on the first read of a finished job and are empty afterwards.

Private templates: create and new_version take the manifest and one ZIP per service that runs code (sources={"web": zip_bytes}); from_app and from_stack save what you already run (read app_draft / stack_draft first to review the variables). share_links creates, lists and revokes links; share previews, uses, copies or reports what a link gives. updates reads and runs the update of an app or stack that came from a template, and detaches it. validate checks a manifest without creating anything; the findings of a refused one are in err.manifest_issues.

An application that came from an open template stops receiving versions when its code is changed. The calls that change code (apps.files.write, move, delete, upload and apps.deploys.webhook.create) fail with TEMPLATE_DETACH_CONFIRMATION_REQUIRED until you pass confirm_detach=True (in the body of move and webhook.create); err.detach_action tells which action asked for it.

Stacks

A stack groups applications, databases and Blob folders, and keeps the connection variables of each application up to date. Changes that alter variables or certificates return restart_required and apps_to_restart: an application reads them only when it starts, so the restart is yours to ask for. The same notice comes back from databases.credentials.certificate.reset and password.reset.

change = client.stacks.create(
    {
        "name": "shop",
        "members": [
            {"resource_type": "application", "resource_id": app_id},
            {"resource_type": "database", "resource_id": db_id},
        ],
        "bindings": [{"app_id": app_id, "database_id": db_id}],
    }
)
if change["restart_required"]:
    print("restart:", change["apps_to_restart"])

delete needs confirm_name equal to the stack name; mode dissolve removes only the stack (200). Mode delete_all deletes the members too. Both answer 200 right away with {"deleted_apps", "deleted_databases", "deleted_blob"} and are permanent: take a snapshot first (stacks.snapshots.create) if you may need the data again. members, bindings and snapshots group the routes of members, connections and whole-stack snapshots; connection returns code to connect an app to what it is linked to. Move a stack or a template to a workspace with workspaces.stacks and workspaces.templates. The error codes of both areas are constants in vertracloud.errcodes.

Database versions

catalog = client.databases.versions()  # keyed by engine type, as a string
db = client.databases.create({"name": "meu-db", "type": 1, "ram": 512, "version": catalog["1"]["recommended"]})
print(db["version"])  # major line, e.g. "18"
print(db["password"])  # returned only by this call

The password comes only in the databases.create response (and in stacks.add_database); afterwards databases.credentials.password.reset issues a new one.

A database with legacy_host: True still uses the previous address. Moving it to the current address (databases.credentials.certificate.reset) is done only from the dashboard: with an API key the call fails with 403 WEBSITE_ONLY.

Omit version to get the recommended one; with snapshot_id, omit it to keep the snapshot's line (an older one fails with SNAPSHOT_VERSION_NEWER, an unknown one with INVALID_DATABASE_VERSION). A database's version cannot be changed after creation; security updates are applied when it is stopped and started.

With snapshot_id the database is created first (201) and the data comes back in the background: the answer has restore_job_id, to follow with snapshot_jobs.wait(db["id"], db["restore_job_id"], "databases"). If the restore fails, the database is kept (empty, or with what you wrote to it) and the job's reason says why. apps.create with snapshot_id also answers with restore_job_id; there an app of code whose restore fails is deleted by the API, while an app on a custom image is kept as it is.

Plans and quotes

# Public route: sent without the API key. The plans for sale, their limits and the billing periods (1, 3, 6 or 12 months).
catalog = client.plans.list()
print(catalog["cycles"], [f"{p['name']} R$ {p['price']}" for p in catalog["plans"]])

# Price of a plan and period (scope `billing:read`), with an optional coupon, without creating an order. `total` is in BRL.
quote = client.billing.orders.quote({"plan": "starter-2", "months": 6, "coupon": "MYCODE"})
print(quote["total"], quote["period_discount_percent"], quote["legacy_price"])

client.billing.orders.create takes the same plan and months. plan is a PlanName: starter-1, starter-2, pro-4, pro-6, pro-8, business-12, business-16, business-24 or enterprise-32 up to enterprise-512.

Snapshots

Deleting an app (apps.delete) or a database (databases.delete), resetting a database (databases.reset) and restoring a snapshot (snapshots.restore) run right away and are permanent: they replace or remove the current data. If you may need it again, take a snapshot first. apps.delete returns None, databases.delete returns the database id, databases.reset returns {"status": "success"} and snapshots.restore returns {"job_id": ..., "warning"?: ...}.

client.snapshots.create_and_wait(db_id, "databases")
client.databases.reset(db_id)

snapshots.create can take up to 90 seconds, so its timeout is 120 s (the client's, if larger) and timeout= overrides it per call. Creating snapshots is limited: a quota over a rolling 24 hours that depends on the plan's RAM, and a wait between snapshots of the same resource (and a 5 s pause per user, answered with a plain RATE_LIMIT_EXCEEDED 429). Over a snapshot limit the call fails with SNAPSHOT_RATE_LIMITED (429) and RateLimitError.retry_after is the number of seconds to wait; err.details has the scope (resource or account) and, for account, resets_at. A manual snapshot can also answer 202 (OPERATION_IN_PROGRESS carries details.job_id when one of the same resource is already running) with {"job_id": ...} instead of a snapshot: it is still being taken. snapshots.create makes one request and returns either; snapshots.create_and_wait follows the job (below) and returns the snapshot. Other codes are constants in vertracloud.errcodes (SNAPSHOT_TOO_LARGE carries details.max_bytes).

Restore as a job

snapshots.restore answers 202: the restore runs in the background, so it returns {"job_id": ..., "warning"?: ...} and the resource is not restored yet. Follow the job with client.snapshot_jobs:

from vertracloud import SnapshotJobFailedError, SnapshotJobSkippedError, SnapshotJobTimeoutError

accepted = client.snapshots.restore(app_id, snapshot_id, "applications", restore_image_version=True)
if accepted.get("warning"):
    print(accepted["warning"])  # IMAGE_VERSION_NOT_FOUND: only the data is restored

job = client.snapshot_jobs.get(app_id, accepted["job_id"])  # one look; `scope` is optional here
print(job["status"])  # queued, running, ready, skipped or failed

# on_progress runs on every poll while the job has not ended; job["progress"] exists only while it is running
# (phase, percent?, done_bytes?, total_bytes?, eta_seconds?)
show = lambda job: print(job["status"], job.get("progress"))  # noqa: E731

try:
    job = client.snapshot_jobs.wait(
        app_id, accepted["job_id"], "applications", wait_timeout=900, interval=2, on_progress=show
    )
except (SnapshotJobFailedError, SnapshotJobSkippedError) as err:
    print(err.code, err.details)  # the job's public reason, e.g. SNAPSHOT_CORRUPTED; err.job is the last payload
except SnapshotJobTimeoutError:
    ...  # still running; the job is not cancelled

recent = client.snapshot_jobs.list(app_id, "applications", kind="restore", limit=5)  # limit 1 to 50

stacks.snapshots.create also answers 202, with {"id": ..., "jobs": [{"resource_id", "resource_type", "job_id"}, ...]}: one snapshot job per member (databases first), each a regular manual snapshot. The stack snapshot is listed as pending and becomes ready when the last job ends. Follow the jobs with snapshot_jobs, let wait_for_create do it under one wait_timeout (same outcomes as wait_for_restore) or call stacks.snapshots.create_and_wait(stack_id), which resolves with the accepted answer plus finished, the final job of each member.

stacks.snapshots.restore also answers 202, with {"jobs": [{"resource_id", "resource_type", "job_id", "warning"?}, ...]}: one job per member (warning is IMAGE_VERSION_NOT_FOUND for an application whose recorded image version is gone), restored in series by the server (databases first). The stack is back when every job is ready; when a member fails, the jobs after it end failed with STACK_RESTORE_MEMBER_FAILED. A refusal before the queue keeps the code and details of the member. Follow each job with snapshot_jobs (scope "databases" or "applications" by resource_type) let wait_for_restore do it under one wait_timeout, or call stacks.snapshots.restore_and_wait(stack_id, snapshot_id):

accepted = client.stacks.snapshots.restore(stack_id, snapshot_id)
try:
    finished = client.stacks.snapshots.wait_for_restore(accepted, wait_timeout=1800, interval=2)
except SnapshotJobFailedError as err:
    print(err.code, err.job)  # the first failed member (STACK_RESTORE_MEMBER_FAILED for the ones behind it)

wait is optional: it polls get until the job ends and returns the job when it is ready. It raises SnapshotJobFailedError or SnapshotJobSkippedError (code and reason = the job's reason, details, job = the last payload) when it ends any other way, and SnapshotJobTimeoutError (with the last job) after wait_timeout, the total wait (30 minutes by default); timeout is the limit of each request. create_and_wait, wait_for_create/wait_for_restore, restore_and_wait and apps.download behave the same. The :id of both routes is the resource the job acts on; scope is required to list and optional to get or wait for one job. While a restore runs every write to the resource fails with RESTORE_IN_PROGRESS (409); reads and deleting it still work. Before queueing, the API can refuse with SNAPSHOT_EXCEEDS_STORAGE (400; err.snapshot_exceeds_storage has required_bytes, available_bytes and, for databases, required_ram_mb), APP_BUILDING (409), RESTORE_IN_PROGRESS or RESTORE_COOLDOWN (429: the wait between restores or rollbacks, RateLimitError.retry_after, also in the Retry-After header). While a snapshot of an app is being taken, deploys, rollbacks, restarts, stops, environment changes and writes of the file manager fail with OPERATION_IN_PROGRESS (409): try again shortly.

Wait helpers

One pattern: wait_for_<x> follows something already started, <verb>_and_wait starts it and follows it. In all of them wait_timeout is the total wait (30 minutes by default), timeout the limit of each request and interval the poll interval; the work keeps running on the server after a timeout.

Start Follow Both
snapshots.create snapshot_jobs.wait(resource_id, job_id) snapshots.create_and_wait, apps.download (also downloads the zip)
snapshots.restore snapshot_jobs.wait(resource_id, job_id) none
stacks.snapshots.create stacks.snapshots.wait_for_create(accepted) stacks.snapshots.create_and_wait
stacks.snapshots.restore stacks.snapshots.wait_for_restore(accepted) stacks.snapshots.restore_and_wait

apps.wait_until_ready(app_id, timeout=...) keeps its timeout as the total wait for the build.

Errors

Every non-2xx response raises a VertraAPIError carrying the HTTP status, the API code (e.g. APP_NOT_FOUND) and details; str(err) includes the message. The API key is never part of the error, even when it is printed:

from vertracloud import NotFoundError, RateLimitError, VertraAPIError

try:
    client.apps.get(app_id)
except NotFoundError:
    ...  # 404
except RateLimitError as err:
    print("retry after", err.retry_after, "s")
except VertraAPIError as err:
    print(err.status, err.code, err)

A few errors carry a structured details; tolerant properties read them and give an empty value for any other error: err.issues (DOCKERFILE_REFUSED), err.manifest_issues (TEMPLATE_MANIFEST_INVALID), err.secret_files (TEMPLATE_SECRET_IN_SOURCE), err.update_blocked (TEMPLATE_UPDATE_BLOCKED) and err.detach_action (TEMPLATE_DETACH_CONFIRMATION_REQUIRED).

apps.files.read and apps.files.write handle files up to 10 MiB; above it the call fails with FILE_TOO_LARGE (413) and details.max_bytes is the limit.

Other subclasses: AuthenticationError (401), ScopeDeniedError (403 — including a missing key scope) and ValidationError (400/422). The error codes are listed in the API reference.

Testing your code

Pass your own vertracloud.Transport to the client to answer requests without touching the network:

client = VertraClient(api_key="test", transport=my_fake_transport)

Coverage

Domain Resource Routes
Apps client.apps (+ .deploys, .releases, .domains, .network, .envs, .files, .analytics) 47
Databases client.databases (+ .credentials) 14
Custom images client.images 13
Templates client.templates (+ .deploys, .share_links, .share, .updates) 32
Stacks client.stacks (+ .members, .bindings, .snapshots) 20
Snapshots client.snapshots, client.snapshot_jobs 5 + 2
Account client.account (+ .sessions, .folders, .favorites) 10
Workspaces client.workspaces (+ .members, .roles, .invites, .action_requests, .apps, .databases, .templates, .stacks, .folders, .favorites) 34
Billing client.billing (+ .orders, with orders.quote) 8
Plans client.plans 1 (public)
Blob Storage client.blob (+ .shares, .rules, .domains) own host

Dashboard-only features (activity log, notifications, API key management, the database Data tab, plan downgrade, creating workspace invites, card payments, saved cards, automatic renewal, coupon preview, receipts and approving action requests) are not part of the public API. See what an API key cannot do.

Versioning

The SDK follows semantic versioning. Until 1.0.0, minor releases may contain breaking changes; they are always called out in the changelog.

Contributing

Issues and pull requests are welcome. Before sending a change, run:

pip install -e ".[dev]"
ruff check . && ruff format --check . && mypy src && python -m pytest -q

License

MIT

Metadata

Release files for vertracloud-api 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vertracloud-api 0.5.0
File Size Uploaded Provenance Actions
vertracloud_api-0.5.0.tar.gz 90.4 kB With provenance Details for vertracloud_api-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for vertracloud-api 0.5.0
File Interpreter ABI Platform Actions
vertracloud_api-0.5.0-py3-none-any.whl Python 3 none any Details for vertracloud_api-0.5.0-py3-none-any.whl

Total release size: 179.7 kB

Release files / vertracloud_api-0.5.0.tar.gz

Download URL vertracloud_api-0.5.0.tar.gz
Size 90.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f4bd4ae1f9f43478cd5c030a5610cdc4f466fc2dab527290e5ccad82e5f3075e
BLAKE2b-256 checksum
How to use checksums
a2f566683080dfb2e3fb85c4d42a8fc6b54c91fb1fac067ab3f651f8fbe63026
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Release files / vertracloud_api-0.5.0-py3-none-any.whl

Download URL vertracloud_api-0.5.0-py3-none-any.whl
Size 89.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ae0f2da66599ae3908791c5a056562286f89aaefe1745e00378d3a532ab7155c
BLAKE2b-256 checksum
How to use checksums
de8988a827fde8ccce46d291f9fa264f34a3d0bac3ebcdd4bc393c1ec0dfd807
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

Security for vertracloud-api 0.5.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for vertracloud_api-0.5.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 27, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page