RyzeAPI uses two types of token to authenticate each request. Both are sent in theDocumentation Index
Fetch the complete documentation index at: https://docs.ryzeapi.cloud/llms.txt
Use this file to discover all available pages before exploring further.
token header. Understand when to use each one and how to handle the most common errors.
Two types of token
TokenAccount
This is your main token. With it you create and administer your WhatsApp instances.Scope: your entire account, all of the instances it owns.When to use: create an instance, list all of your instances, delete an instance, or any operation in which you need to act as the “account owner”.
TokenInstance
Generated automatically when you create a new instance. Each instance has its own.Scope: only that specific instance.When to use: day-to-day operations, send a message, create a group, configure a webhook, read contacts, etc. It is the token you will use in 99% of calls.
Token lifecycle
You receive your TokenAccount
Delivered when your account is created. Store it in a safe place, it cannot be recovered later.
Create an instance
Call
POST /api/instance/new sending your TokenAccount. The response includes the data.token field, which is the TokenInstance for that instance.Use the TokenInstance day to day
From there on, every operation on that instance (sending a message, reading contacts, configuring a webhook) uses the TokenInstance.
Three ways to send the token
We recommend always using thetoken header. The other forms exist only for specific cases.
token header (recommended default)
Authorization: Bearer header (compatibility)
In case your tool only supports the Bearer standard.
?token= query string (browser WebSocket only)
Used when it is not possible to send headers, the typical case being WebSocket in browser JavaScript, since new WebSocket(...) does not accept custom headers.
Who can do what
With TokenAccount
With TokenAccount
- Create new instances (
POST /api/instance/new) - List all of your instances (
GET /api/instance/list) - Operate any
:instanceendpoint of your own instances (send a message, manage groups, etc.) - Delete one of your instances (
DELETE /api/instance/delete/:instance)
With TokenInstance
With TokenInstance
- Any
:instanceendpoint of the instance itself: send a message, read contacts, configure a webhook, create a group, etc. - Inspect the current state of the instance itself (
GET /api/instance/list) - Open a WebSocket connection to receive events in real time
Not allowed
Not allowed
- TokenInstance does not create new instances, use TokenAccount for that
- The TokenInstance of one instance does not operate another instance, each token is only valid for its own
- The TokenAccount/TokenInstance of one account does not operate instances of another account
Access protection (ownership)
RyzeAPI automatically checks, before each operation, whether the token sent has permission for that specific resource. This prevents a token from leaking access to third-party instances. Examples of what is automatically blocked:- Trying to send a message on instance
Busing the token of instanceA→403 - Trying to delete an instance that belongs to another account →
403 - TokenAccount trying to create more instances than its quota allows →
403
Authentication errors
All auth error responses come with HTTP401 (invalid token) or 403 (no permission) and follow the format:
Messages you may encounter
| HTTP | Message | Most likely cause |
|---|---|---|
| 401 | Missing token in header | You did not send the token header |
| 401 | Missing token in header, Authorization header, or query parameter | None of the 3 token forms were used |
| 401 | Invalid token | Token does not exist, is wrong, or has been revoked |
| 401 | Invalid instance token | The token does not match the instance in the path |
| 403 | Instance token does not match requested instance | You are using the TokenInstance of A on the path :instance=B |
| 403 | Instance does not belong to your account | TokenAccount trying to operate an instance of another account |
| 403 | Account instance quota exceeded | You hit the instance limit for your account |
Security: best practices
Treat every token as a credential, store it in environment variables or a secrets vault, never in the frontend or in public repositories.
Use one TokenInstance per instance, if one leaks, you only revoke that one.
Use HTTPS in production, RyzeAPI accepts only secure connections.
Use the
token header (not the query string) in most cases, headers do not end up in proxy logs.Monitor the
X-RateLimit-Remaining header to avoid being blocked for excess requests.Next
Error types
The response formats and how to interpret each HTTP code.
Rate limit
How much you can call per minute and how to react to
429.