Skip to main content

API and automation

Everything the console does, it does through the same API available to you. There is no privileged path: the interface is a client of the API, like any other.

A single surface​

That principle has a strong practical consequence: if a capability is not in the API, nothing can reach it — not the interface, not a script, not an agent. That eliminates the entire class of problems where an automation can do more than the interface would allow.

No customer receives administrative infrastructure credentials, access to the control database, or an alternative mutation path.

How the API behaves​

RuleWhat it means if you integrate
Scope from the authenticated sessionThe organization comes from your session, never from the request body
Long operations are asynchronousDeploying answers with an operation identifier; you follow the progress
Creation is protected against repetitionResending the same request with the same key returns the same response, not a second resource
Errors have one shapeA stable code, a message, and a suggested action
State has two vocabulariesThe precise state and the user-facing state come together, so no client reimplements the mapping

Following an operation​

Deploying, restoring, changing the instance size, changing the address of an already deployed project, deleting a project, provisioning Zero Git and merging a pull request create an operation. The response carries the identifier (op_…), and GET /operations/{id} returns its state; GET /operations/{id}/events follows the progress. It can be cancelled while the cancellation window is open. In the CLI, zero operations get op_… reads the outcome of an operation (starting with the next CLI release).

That is why the interface never sits with a stopped clock: it is following the operation, and shows what has happened so far.

Agent-assisted operation​

Zero was built to be operated by agents too — Imaginne, for example. The rule that makes that safe fits in one sentence:

Every agent operation goes through the same governed API, with the same permissions as the person who triggered it.

An agent can analyze a repository, explain what will be deployed, deploy, observe, diagnose, propose a fix, and roll back. What it cannot do is escape the API: there is no parallel surface.

Two additional guarantees:

  • A destructive action triggered by an agent requires human confirmation.
  • The audit trail separates human authors from agent authors, and the action's origin (interface, script, integration) is recorded separately.

Login and data in applications​

Organization sign-in and Infinite Data access are service capabilities, turned on and off through the API just like in the console (Login and data):

RouteWhat it does
GET /services/{id}/capabilitiesThe service's capabilities and the state of each one
PUT /services/{id}/capabilities/{capability}Turns on organization-iam (takes effect with the next deployment) or querymesh (takes effect immediately)
DELETE /services/{id}/capabilities/{capability}Turns it off
GET /services/{id}/capabilities/{capability}/diagnosisThe step-by-step diagnosis, saying who fixes each gap

querymesh requires organization-iam turned on: turning sign-in off while QueryMesh is on is refused with SERVICE_CAPABILITY_REQUIRES_IDENTITY. The full path is in Turn On Organization IAM and Query the Organization's QueryMesh.

Credentials and access​

API access uses the same identity as the console. For pipelines and agents, which do not sign in interactively, there is the application credential (zcred_…), self-service:

  • it is created, rotated and revoked in the console, under Credentials (by whoever manages the organization's members) — not from the CLI or by agents;
  • it belongs to the organization, not to a person: the pipeline does not stop when someone leaves the company;
  • it has its own reach (all projects, including future ones, or a closed list) and operations, two independent choices;
  • it has an explicit expiry and does not renew: rotate it before it expires. The secret is shown once, at creation and at rotation;
  • it goes in through the usual variable, ZERO_TOKEN, in the CLI and in the MCP server, and appears in the audit trail as an application credential, along with who created it.

Through the API, the routes are /organizations/{id}/credentials (create, list, change, revoke) and /organizations/{id}/credentials/{credentialId}/rotate.

Availability​

Not every resource described in the contract is exposed in this installation. The list of what exists today is in What exists today, and the console answers by capability rather than letting a screen say "not found" when it is the capability that does not exist.

To get the API contract for your installation's version, talk to the team that administers the platform.

Next steps​