Skip to main content
Version: v1.0

CLI

The Sammati CLI calls the same integrator HTTP API as @sammati/server-sdk. It does not create API keys — create those in the Company Portal under API keys.

Availability: the CLI is available on request. Contact Sammati support or your account team. For production application code, use @sammati/server-sdk from npm — SDK Guide.

When @sammati/cli is published to npm, this page will document the public install command.


What you can do​

After you receive the CLI and configure an API key:

sammati auth login --api-key "$SAMMATI_API_KEY" --api-url https://api.example.com
sammati whoami
sammati policy list
sammati consent grant \
--external-user-id sample-subscriber-demo-001 \
--purpose-code SAMPLE_NEWSLETTER_SUBSCRIPTION \
--policy-ref sample-newsletter-subscription

Config file: ~/.sammati/config.json (override with SAMMATI_CONFIG). The file stores apiUrl, apiKey, and portalUrl. Permissions are 0600. whoami prints only the key prefix and checks GET /v1/policies.


Login​

CommandWhat it does
sammati auth login --api-key <key> [--api-url <url>]Saves the integrator key and base URL
sammati auth login --portalPrints where to create API keys in the portal
sammati config set api-url <url>Updates the API base URL
sammati config set portal-url <url>Updates the portal base URL
sammati apikeyShows whether a key is configured

sammati policy get <policyRef> --version <n> reads one published version.

sammati consent status needs --external-user-id and --purpose-code. grant and revoke also need --policy-ref.


Webhook verify​

sammati webhook verify --secret "$SAMMATI_WEBHOOK_SECRET" --payload @./body.json --signature "$SIG"

--payload is the raw body. A value that starts with @ is read from that file. Exit code is 0 only when the signature matches.


Next steps​