- Log into Vayu at http://app.withvayu.com
- Navigate to the Integrations section
- Click “Connect” on the Vayu card
- Client ID - Identifies your organization on every request (
x-api-keyheader) - API Token - A long-lived token used to obtain short-lived access tokens via the
/loginendpoint
Copy the API Token immediately — it won’t be shown again after you close the pane.
How authentication works
Vayu uses a two-token model:
The SDKs handle this exchange automatically — pass your API Token when initializing the client and the SDK calls
/login and refreshes the access token as needed.
Important Notes
- You can only have one active API Token at a time
- To rotate your API Token: revoke the existing one, then generate a new one from the same place
Using Your Credentials
With the Vayu SDK
The SDKs handle the full token lifecycle — just pass your API key and start making calls.Direct API Usage
Every request needs two headers:x-api-key: <your Client ID>Authorization: Bearer <access token>(obtained fromPOST /login)
Full example — obtaining and using an access token
Access tokens expire after 1 hour. If using a raw HTTP client, re-call
/login when you receive a 401 response. The SDKs handle this automatically.Scopes
An API Token carries a set of scopes, and any access token you obtain fromPOST /login inherits them. Every endpoint requires a scope, and a request is only authorized if your token’s scopes cover it.
Scope grammar
A scope takes one of four forms:
Matching is strict.
vayu.* covers every request. vayu.<domain>.* covers both read and write on that domain. vayu.<domain>.read covers only read operations on that domain, and vayu.<domain>.write covers only write operations — a write scope does not imply read. Scopes are independent grants, so an ingest-only token can carry vayu.events.write alone, with no read access at all.
In the Vayu dashboard, you either leave the “Full access” switch on — the default — or turn it off and tick Read and/or Write per domain: for a single domain, for a whole group (Billing, Catalog, Usage, Other), or for all domains at once. Read and Write are independent ticks and at least one must be ticked; a domain with both ticked is stored as vayu.<domain>.*.
vayu.* (full access) is what a token gets when the “Full access” switch is on. Every API Token created before scopes existed also behaves as full access.
Scope domains
Which scope an endpoint needs
As a rule,GET endpoints need <domain>.read and every other method (POST, PATCH, PUT, DELETE) needs <domain>.write. The one exception is POST /v2/events/aggregation, which needs vayu.events.read since it only queries data.
If you generate clients from Vayu’s OpenAPI specification, each operation carries an x-required-scope extension naming the exact scope it needs.
Denied requests
A request whose token lacks the required scope is rejected with a403 and a permission_error:
