Getting started

api

orc api sends authenticated HTTP requests to the Orchestor API from your terminal. It uses the same credentials as other CLI commands. Discover methods and paths in the public API contract, then make calls with queries or JSON bodies.

Use it to explore operations without dedicated commands, debug responses, or integrate calls into scripts. Before running it, sign in with orc auth login or configure the authentication used by the CLI. Requests go to the configured Orchestor API and use the current principal’s permissions. The list is a public contract catalog, not a determination of your operation permissions.

Usage

terminal
orc api list

Inspect public API methods, paths, and descriptions.

terminal
orc api request GET /v1/users/me

Retrieve the current authenticated principal’s profile.

Subcommands

list

Return HTTP methods, paths, operationId values, and descriptions from the public API contract bundled with the CLI. Authentication is required. The list is not filtered by account permissions; the server checks permissions when a request runs. orc api ls is an alias for orc api list.

terminal
orc api list [options]

Examples

terminal
orc api list --json

Return the API catalog as JSON for scripts.

request

Specify an HTTP method and an API path beginning with /. Supported methods are GET, POST, PUT, PATCH, and DELETE. The method cannot be omitted and is not inferred from the body. The path must match the public contract shown by api list. Replace path parameters such as {id} with actual resource IDs.

Put queries in a quoted path. Unknown queries and duplicate values supplied in both the path and flags cause errors. For create and update operations with JSON bodies, pass a JSON object through --stdin; it is validated against the API contract’s types and required fields.

terminal
orc api request <method> <path> [options]

Examples

Save a JSON object such as { "locale": "ja" } in profile.json. Profile changes require human account authentication and server-side permissions.

terminal
orc api request PATCH /v1/users/me --stdin < profile.json

Update a profile from saved JSON.

ls

List public contract operations; server authorization still applies

terminal
orc api ls [options]

Examples

Retrieve the current principal

Use saved authentication to return your profile in a JSON envelope.

terminal
orc api request GET /v1/users/me

Retrieve the current principal

Retrieve information for a Workspace

Set the X-Workspace-ID sent with the request using --workspace. The server checks access to the specified Workspace.

terminal
orc api request GET /v1/workspaces/<workspace-id> --workspace <workspace-id>

Retrieve information for a Workspace

Pass a request body from a JSON file

Use this for create and update operations with bodies. File redirection and piped JSON are both read as standard input.

terminal
orc api request PATCH /v1/users/me --stdin < profile.json

Pass a request body from a JSON file

Set the number of list results with a query

Append a query defined by the target API to the path. Query names, types, and requirements follow the public API contract.

terminal
orc api request GET '/v1/workspaces?limit=10'

Set the number of list results with a query

Retrieve every page of a list

For APIs with cursor pagination, output records from every page as one NDJSON record per line. This cannot be combined with --json, --pretty, or --format values such as JSON. Use --output to save a file if needed.

terminal
orc api request GET /v1/workspaces --page-all

Retrieve every page of a list

Skip deletion confirmation

Check the deletion target before running the command. --yes skips the CLI confirmation. Server authorization and deletion conditions still apply.

terminal
orc api request DELETE /v1/brands/<brand-id> --workspace <workspace-id> --yes

Skip deletion confirmation

Extract a response field

--field extracts a response field. It does not add a field to the request body.

terminal
orc api request GET /v1/users/me --field id --raw

Extract a response field

Inspect request duration

Return the response on stdout and the duration on stderr.

terminal
orc api request GET /v1/users/me --timing

Inspect request duration

How it works

  1. The CLI resolves the current authentication.
  2. It matches the method and path against the bundled public API contract and validates queries and the JSON body.
  3. It sends an authenticated request to the configured API. If a Workspace is specified, it also adds X-Workspace-ID.
  4. The server checks the current principal’s access and the CLI outputs the response.

The default output is a JSON envelope containing success, data, and metadata. Credential fields are redacted during output. Failure reasons go to stderr; scripts should use exit codes to determine success or failure.

Use orc api list for discovery. The API contract is bundled with the CLI rather than fetched on every execution. External URLs, paths beginning with //, path traversal, and internal or backend-only APIs are rejected. Redirects are not followed.

Global Options

The following global options can be used with orc api:

For details and examples, see global options.

Troubleshooting

A method or path is rejected

Check methods and paths with orc api list. Path endings, resource IDs, and methods must also match the contract. Check the CLI version if a new API is missing from the list.

Authentication or permission errors

Check authentication and sign in again with orc auth login if needed. If a Workspace is specified, check access to it as well. An operation appearing in the list does not necessarily mean the current account can use it.

JSON body validation fails

Pass a valid JSON object through --stdin and check the target API’s required fields and types. Arrays and individual strings are not accepted as resource definitions. Bodies are used for POST, PUT, and PATCH operations.

Deletion fails in a non-interactive environment

DELETE requires confirmation. In scripts, check the target and pass --yes. This does not change operation permissions.