opschain api v2 call
Included from Basic tier
opschain api v2 call <Service/Method> [flags]
Calls one API v2 procedure on the targeted server — the curl-first escape
hatch with the CLI's stored credential and 401 token renewal:
the request body is sent as Connect JSON to
POST /api/v2/opschain.api.v2.<Service>/<Method> and the JSON response is
pretty-printed to stdout. Name the procedure bare (ChangeService/ListChanges
— the opschain.api.v2 package is assumed) or fully qualified.
A failing call still prints the server's typed error body — the Connect
code, message and any details (the ErrorInfo reason catalogue,
FieldViolations) — then exits non-zero naming the HTTP status.
opschain api v2 call ChangeService/ListChanges -d '{"filter":{"statusCodes":["error"]},"pageSize":20}'
opschain api v2 call ChangeService/CreateChange \
-d '{"nodePath":"/projects/demo/environments/dev","action":"deploy",
"requestMetadata":{"idempotencyKey":"deploy-2026-10-17"}}'
Flags
| Flag | Meaning |
|---|---|
--data <json>, -d <json> | The JSON request body (default {}). Field names are the protojson camelCase forms; unknown fields fail closed on the server. |
Exit codes
| Code | Meaning |
|---|---|
| 0 | The procedure answered 2xx; the response printed. |
| 1 | The call failed — the typed error printed, and the error names the HTTP status. |
| 2 | Usage error: a malformed procedure name, a non-JSON --data, or a missing server target. |