API tokens
A token is sent as a bearer token in theAuthorization header:
apiKey:
voyant login. Keep tokens on the server. They carry the scopes that authorize real actions, so they should never ship in a browser bundle.
Scopes
Tokens are scoped per service and per action. A route checks the scope it declares against the token’s scopes, and rejects the call if it is missing. Examples:| Action | Scope |
|---|---|
| Send an SMS | sms:send |
| Read a vault secret | vault:read |
| Publish a realtime message | realtime:publish |
| Read geography data | data:geo:read |
| Read SEO data | data:seo:read |
If a read comes back empty or a call is rejected, check the token’s scopes first. A missing scope is the most common cause, and for some data products an entitlement gap surfaces as empty results rather than an error.
Machine-to-machine tokens
Connect supports OAuth client credentials for machine-to-machine flows. Provision a client, then exchange its credentials for a short-lived bearer token:scope claim must include the scope the route declares.
Short-lived client tokens for browsers
Some services let a browser connect directly without your API key. Realtime is the main example: you mint a short-lived, capability-scoped client token on the server and hand it to the front end, which uses it to open a WebSocket. The API key never leaves your server. See Realtime.Base URL
Every API is served from:baseUrl on any client for testing or self-hosted environments.
CLI credentials
The CLI stores cloud credentials in~/.voyant/credentials.json (mode 0600), keyed by API URL and organization, so you can be logged into several environments and organizations at once. On every cloud command it resolves a token in this order:
- A
--token <value>flag. - The
VOYANT_CLOUD_API_KEYenvironment variable. - The stored credential for the resolved API URL and active organization.
--org → VOYANT_CLOUD_ORG → voyant org use → the sole logged-in org. See the CLI overview for login flows and organizations.