SimetrikDocs
Guides

Direct API access

Direct API access (api)

Goal: call any platform endpoint from the terminal — or from an agent — without waiting for a dedicated command to exist. The api command is a thin passthrough: it resolves authentication for your active profile and returns the response body as-is.

simetrik api <get|post|put|patch|delete> <path> [options]

The <path> is relative to the Simetrik API (no host). For security, api rejects absolute URLs (http://…, //host): the command carries your token, so it never sends it to an arbitrary host.

Read (GET)

simetrik api get reconciliations/recon-123

For an agent, request JSON output and chain with jq:

simetrik --output json api get reconciliations/recon-123 | jq '.data.status'

In --output json mode, stdout contains only the response body (no human-readable text), ready to parse directly.

Write (POST / PUT / PATCH)

Build the body with -d key=value pairs (repeatable):

simetrik api post sources -d name=cobros-banco -d type=csv

Or pass a raw JSON body with --data (inline, @file.json, or - for stdin):

simetrik api post sources --data '{"name":"cobros-banco","type":"csv"}'
cat payload.json | simetrik api post sources --data -

-d and --data are mutually exclusive.

Errors and exit codes

api does not swallow API errors: a 4xx/5xx returns the status and the error body, with a non-zero exit code. Useful for an agent to decide the next step.

SituationExit code
Success0
API error (e.g. 404)1
Usage error (invalid path, conflicting flags)2
Session expired or not authenticated4

Combine api with jq and xargs for complete workflows without touching the UI. For declarative, reproducible workflows, the fixtures command is coming (under construction).

api is raw access: it operates with the same permissions as your profile. Review the path and method before running write operations.

On this page