If a request carries both headers, wede uses the session token.
The API accepts cross-origin requests from any origin, because it authenticates only by these headers and never by cookies. A web app can therefore call wede from the browser with the user’s session token, for example through the JavaScript SDK. An API key never goes in a browser.
API keys
API keys start withwede_live_ (production) or wede_test_ (sandbox), followed by 32 hexadecimal characters. wede stores only a SHA-256 hash of each key, so a key is shown in full only once, when it is created or rotated.
What an API key can do
An API key is your integration credential. It covers the full integration cycle:
An API key cannot create, update or delete zones, and cannot manage teams, dispatch, missions, users, API keys or catalog entries. Those operations need a session token with the right role. With an API key they return
403 forbidden.
API key requests are limited per tenant and per minute (your tenant or plan limit, 500 by default). Every response carries x-ratelimit-limit, x-ratelimit-remaining and x-ratelimit-reset; above the limit wede returns 429 rate_limited with Retry-After. See Retries and rate limiting.
Sandbox keys
Awede_test_ key works against the sandbox:
- Every event is stored with the environment of the key that created it (
productionorsandbox), and a key reads only its own environment. - Sandbox events never reach a real recipient. wede simulates delivery with the same channel decision as production and records the result on the event and its lifecycle.
- Sandbox activity never counts toward usage or billing.
- The same
idempotency_keycan exist once in each environment. POST /v1/sandbox/simulate-connectivityworks only with a sandbox key (403 sandbox_key_requiredotherwise) and changes only the simulated state of a zone, never the real one.POST /v1/connectivity/reportwith a sandbox key also changes only the sandbox state.- Webhook deliveries carry
"environment": "sandbox"or"environment": "production".
Creating and rotating keys
Managing keys needs a session token with theapi_keys:manage permission (the company_admin role).
grace_hours defaults to 24. Deploy the new key everywhere within the grace period; after it, the previous key stops working.
Session tokens
A person signs in with email and password and receives a session token:- A token is valid for 8 hours (
expires_inis in seconds). After that the API returns401and the user signs in again. - A token stops working at once when the user is suspended or the session is revoked.
- Five consecutive failed sign-in attempts lock the account for 15 minutes. While locked, sign-in returns
429 account_lockedwithlocked_until. - A session reads production data by default. Where an endpoint supports it, pass
environment=sandboxto read sandbox data.
Roles
What a session token can do depends on the user’s role in your tenant. A request outside the role returns403 forbidden.
The API key’s integration scope works as a role of its own (
api_user), described in What an API key can do.
wede staff roles exist for operating the platform. They never see event content: not the payload, not the metadata, not your event types nor your catalog; only the vertical, priority, channel, timestamps and whether the type sends a team.
Good practice
- Keep API keys in environment variables or a secret manager, never in code.
- Use a
wede_test_key in development and CI. - Rotate keys when a person with access leaves or a key may have leaked, using the grace period to avoid downtime.
- Give each person the least powerful role that fits their work.
- All traffic to
https://api.wede.ptis encrypted in transit over HTTPS.
