Every request to the Alaaqat API must carry an API key. The key tells Alaaqat which account the
request is for, which team member it acts as, and which parts of the API it may use. A request without a
valid key is refused with 401.
An API key opens your account's data to any system that holds it, so it is worth creating it with care: give each key only the abilities your integration needs, keep it out of code that runs in a browser or a mobile app, and replace it before it expires so your integration never stops.
This page shows how to create, use, rotate and revoke keys from Settings > Integrations > API.
| Requirement | Detail |
|---|---|
| Plan | A key for the whole API is available on paid plans. Every plan, including Free, can create a key for sending WhatsApp verification codes. See the plans on the pricing page. |
| Permissions | View API Keys to see your keys, Create New API Key to create and rotate them, Revoke API Key to revoke them, and View API Usage History to see the history at the bottom of the page. |
| Number of keys | Each team member can hold one general key and one verification-code key in each account. |
| Validity | 180 days from the moment the key is created. |
Alaaqat sorts keys by the abilities they carry:
| Kind | Abilities | Plan |
|---|---|---|
| Verification-code key | broadcast-send-otp, and optionally current-user. Nothing else. |
Every plan |
| General key | Any other combination of abilities. | Paid plans |
A verification-code key can only send WhatsApp verification codes and verify them, and read the current user. These sends are paid for with OTP credits, not with your plan's message allowance, which is why every plan can have one.
On a paid plan you can hold both kinds at once: for example, one key for your CRM sync and one for your sign-in page. The full list of abilities, and the endpoints each one opens, is in Permissions and Abilities.
Click the Settings icon, then go to Integrations > API.
The page lists the keys you hold in this account. Each card shows the key's name, Created At, Expires At, Status and Abilities.


On the Free plan, the dialog explains that your plan allows a key for sending verification codes, and the two abilities of a verification-code key are already selected. They are the only ones you can choose.
New Token is greyed out when you already hold every key your plan allows.
{info} You can't change a key's abilities after you create it. To add or remove one, revoke the key and create a new one, then update your integration.
As soon as the key is created, Alaaqat shows it once. Click the copy icon and store the key somewhere safe, such as your server's secret store.

{danger.fa-close} You can't see the key again after you close this dialog. If you lose it, rotate the key to get a new one. Treat the key like a password: never share it with apps or people you don't trust, and never put it in a web page or a mobile app.
Pass the key in the Authorization header as a Bearer token:
Authorization: Bearer {your-api-token}
A full request looks like this:
curl https://app.alaaqat.com/api/me \
-H "Authorization: Bearer {your-api-token}" \
-H "Accept: application/json"
The key belongs to the account you were working in when you created it. Every request made with it reads and changes that account only. If you manage several accounts, create a key in each of them.
The key also acts as you, the team member who created it. A request succeeds only when the key carries the ability the endpoint needs and your permissions in the account allow the action. A list endpoint returns the records you can see in the app, no more. See Permissions and Abilities.
A key is valid for 180 days. On its card, Expires At turns red when fewer than 30 days remain, and
Alaaqat emails you about two weeks, one week and one day before the date. Once a key expires, its
Status becomes Inactive and every request made with it is refused with 401.
To replace a key without downtime, rotate it:
The new key has the same name and abilities, and is valid for another 180 days. The old key keeps working for 30 minutes, so requests already on their way don't fail, and then stops.
Both cards now show the same name. The new key is the one with the later Expires At date. Once your integration uses the new key, revoke the old card.
{warning} Until you revoke the old card, you can't rotate that key again, and you can't create another key of the same kind: the old key still counts towards your keys, even after it stops working. Rotating shows "You can't create more tokens. Remove old ones first."
If a key has already expired, rotate it to get a new key with the same abilities, then revoke the expired one.
Revoke a key when an integration is retired, when the key may have leaked, or when a team member who created it no longer needs it.
The key stops working at once: every request made with it is refused with 401. Revoking can't be undone.
Below the keys, API Usage History lists the requests made with the account's keys over the last 7 days: the Key Name, the API URL, the Payload, the Request Method, the Request Status and Created At. Use it to check that an integration is calling what you expect, and to find the requests that failed.
The history covers the keys of every team member in the account, and is visible to anyone with the View API Usage History permission. The Payload column shows the request body as your integration sent it, so it can include personal data such as names and phone numbers. Give this permission only to the people who need it.
Entries older than 7 days are removed.
423 until the team member is active again. The same happens
while the account is scheduled for deletion.403 although the key carries the ability, check the team member's permissions.