Authentication
Every request carries an API key in the Authorization header:
Authorization: Bearer ga_live_XXXXXXXX...
The Authorization: Bearer header is the only way to authenticate. A key in a query string, a cookie or any other header is not read. Browser sessions and cookies play no part: the API ignores them.
Key format
A key looks like ga_live_ or ga_test_ followed by 49 letters and digits, 57 characters in all:
| Part | Length | Meaning |
|---|---|---|
ga_live_ or ga_test_ |
8 | Prefix. ga_live_ marks a live key and ga_test_ a test key (see Test keys). |
| random part | 43 | The 32 secret bytes written in Base62 (0-9, A-Z, a-z). |
| checksum | 6 | A Base62 CRC32 of the random part. |
The checksum lets the API reject a mistyped or truncated key before it looks anything up. It is not a secret and gives no protection on its own. A key that fails the shape or checksum check answers invalid-key.
The dashboard shows the first characters of a key (for example ga_live_aB3d or ga_test_aB3d) so a key can be recognised. The full secret is shown once, at creation, and GroupApp stores only a hash of it.
What the key decides
Each key is created with:
- Bots: the bots it may reach, one bot or all bots. On the public routes, a bot outside the list answers
not-found, as if it did not exist. - Scopes:
<family>:reador<family>:write, for examplebots:readorposts:write. - Role:
viewer,manager,support_agentoradmin. The role is checked as well as the scope. A key may do something only if its scope and its role both allow it. - Mode:
live(the default) ortest. It is fixed when the key is created, and it is the prefix of the secret. - Expiry (optional) and a name.
Scopes
| Scope | Allows |
|---|---|
<family>:read |
The read routes of that family. |
<family>:write |
The write routes of that family, and also its read routes. |
A write scope includes read for the same family. A read scope never allows a write. The public routes today use the bots, groups, posts and schedules families:
| Route | Scope needed |
|---|---|
GET /v1/bots, GET /v1/bots/{botId} |
bots:read |
GET /v1/super-groups, GET /v1/super-groups/{superGroupId}, GET /v1/groups |
groups:read |
GET /v1/posts, GET /v1/posts/{postId}, GET /v1/requests/{requestId} |
posts:read |
POST /v1/posts, PATCH /v1/posts/{postId}, DELETE /v1/posts/{postId} |
posts:write |
GET /v1/schedules, GET /v1/schedules/{scheduleId} |
schedules:read |
POST /v1/schedules, PATCH /v1/schedules/{scheduleId}, DELETE /v1/schedules/{scheduleId} |
schedules:write |
A call that needs a scope the key does not have answers forbidden.
First-party routes
Two more routes exist for GroupApp's own keys only:
| Route | Does |
|---|---|
GET /v1/actions |
Lists the actions the key may call. |
POST /v1/actions/{tool} |
Calls one action with a JSON body. |
A key made for a customer or an integration is refused with 403 forbidden. These routes are not part of the public API: they are unstable, they can change or disappear without notice, and they are documented only by what GET /v1/actions lists. Do not build on them.
They also behave differently from the public routes: a bot outside the key's bots answers 403, not 404, and an action that does not exist answers 404 with the detail Unknown action.. Each call costs one read unit (see Rate limits).
Test keys
A ga_test_ key is made on the same key screen as a live key, with Mode Test. It passes through every check a live key does (scopes, role, bots, validation, idempotency, rate limits) and answers the same problems, but a send stops before it is sent: nothing reaches WhatsApp. See Test mode for what it returns.
| Live key | Test key | |
|---|---|---|
| Prefix | ga_live_ |
ga_test_ |
POST /v1/posts |
Sends | Does not send; ends succeeded with a sample result |
| Read routes | Real data | Real data |
Reserved target ids ([email protected] and the like) |
Refused | Accepted, with a fixed failure |
| Idempotency keys, rate-limit counts, requests | Its own | Its own, apart from the live keys of the same system |
A test key and a live key never see each other's requests: a request made by a test key answers not-found to a live key of the same system, and the other way round.
A key whose stored mode does not match its prefix answers invalid-key.
Authentication errors
The API checks the key in this order and stops at the first failure. All four answers are 401, carry WWW-Authenticate: Bearer, and have the usual problem body.
| Situation | Code |
|---|---|
No Authorization: Bearer header, or an empty token |
missing-key |
| Wrong shape, bad checksum, or no such key | invalid-key |
| The key was revoked | revoked-key |
| The key's expiry date has passed | expired-key |
A key whose stored settings cannot be used also answers invalid-key.
Authentication comes first. A bad key never reveals whether a bot, post or request exists.
Rotation
There is no rotation feature: a key cannot be re-issued with a new secret. To rotate:
- Ask a GroupApp admin to create a new key with the same bots, scopes and mode.
- Deploy the new secret.
- Ask the admin to revoke the old key.
Both keys work until the old one is revoked, so there is no downtime. Requests created by the old key stay readable by the new key when both belong to the same system (the "System that uses the key" name given when the keys were created) and have the same mode.
Expiry dates are set at creation and cannot be changed afterwards; create a new key before the old one expires.
Keep keys on the server
The API sets no CORS headers, so browsers cannot call it. Use a key only from server-side code. Never put it in a mobile app, a web page, a public repository or a log.
If a key leaks
- Ask a GroupApp admin to revoke the key now. The admin does this on the dashboard (Settings > API keys, "Revoke key").
- The next call with that key fails with
revoked-key. The API reads the key on every request and caches nothing, so there is no delay. - A revoked key cannot be turned back on. Create a new key with a new secret.
- Check what the key did: the dashboard shows the latest calls of each key (route, status, request id) for 30 days.