Getting started
- In AB Connect open Settings → API keys and issue a key. Choose “Read only” if your system only reads.
- Copy the key straight away — it is shown once; we store only a hash.
- Send it on every request as
Authorization: Bearerto the base URL:https://api.abtech.sa/api/v1
curl https://api.abtech.sa/api/v1/account -H "Authorization: Bearer $CONNECT_KEY"
Keys & access
A key belongs to the person who issued it and works with their permissions, never more: if they cannot see the inbox, their key cannot read conversations, and disabling their account stops the key at once. On top of that, two scopes:
- Read only
- Every GET endpoint.
- Read & write
- Plus creating and updating contacts, opening requests and changing their state, creating tasks and changing their state.
The workspace comes from the key alone. Any header or field that tries to name a workspace or role (such as organization_id) is rejected with 422.
Limits & paging
60 requests per minute per key. Going over returns 429 with Retry-After; every response carries X-RateLimit-Remaining. Lists are paged with page and per_page (up to 100); meta has the total.
Errors
{ "error": { "code": "read_only_key", "message": "This API key is read-only…" } }
| 401 | Missing, revoked or expired key, or the owner is disabled. |
|---|---|
| 403 | The owner lacks the permission, or a read-only key called a write endpoint. |
| 404 | Not found in your workspace — other workspaces’ records answer the same way. |
| 409 | A contact with the same phone or email exists; its id is in error.contact_id. |
| 422 | Invalid input, or the workflow refused the transition, with the reason. |
Endpoints
Full field and value details are in the OpenAPI spec — open it in Postman, Swagger or any client generator.
Account
-
GET
/accountYour workspace -
GET
/integrationsList connected integrations -
GET
/integrations/{id}Get an integration
Contacts
-
GET
/contactsList contacts -
POST
/contactsCreate a contact write -
GET
/contacts/{id}Get a contact -
PATCH
/contacts/{id}Update a contact write
Conversations & messages
-
GET
/conversationsList conversations -
GET
/conversations/{id}Get a conversation -
GET
/conversations/{id}/messagesList messages
Service requests
-
GET
/service-requestsList service requests -
POST
/service-requestsOpen a service request write -
GET
/service-requests/{id}Get a service request -
POST
/service-requests/{id}/transitionsChange request status write
Tasks
-
GET
/tasksList tasks -
POST
/tasksCreate a task write -
GET
/tasks/{id}Get a task -
POST
/tasks/{id}/transitionsChange task status write
Quotes & invoices
-
GET
/quotesList quotes -
GET
/quotes/{id}Get a quote -
GET
/invoicesList invoices
Sales
-
GET
/opportunitiesList opportunities -
GET
/opportunities/{id}Get an opportunity -
GET
/commerce-ordersList store orders -
GET
/commerce-orders/{id}Get a store order
Catalogue
-
GET
/productsList products -
GET
/products/{id}Get a product
Example: open a request from your system
curl -X POST https://api.abtech.sa/api/v1/service-requests \
-H "Authorization: Bearer $CONNECT_KEY" -H "Content-Type: application/json" \
-d '{"external_reference":"ERP-10042","phone":"0501234567",
"customer_name":"Sara","summary":"Camera maintenance","priority":"high"}'
Repeating the call with the same reference returns the existing request instead of opening a second one — safe to retry.
Webhooks
In Settings → Webhooks add an https URL in your system and pick events. Each event is a POST with a JSON body; we retry up to four times (after 1, 5 and 30 minutes) on timeouts, 408, 429 or 5xx. Every delivery shows in the log on the same screen.
message.received | A customer sent a message on any channel |
|---|---|
contact.created | A new contact, from WhatsApp, a store, accounting or the API |
service_request.created | A service request was opened |
service_request.status_changed | A request changed state; the previous state is included |
conversation.updated | A conversation changed state or priority |
POST /hooks/connect
X-AB-Event-Id: 6f1c…
X-AB-Timestamp: 1793534400
X-AB-Signature: sha256=9d2b…
{
"id": "6f1c…", "type": "service_request.status_changed", "version": "1",
"occurred_at": "2026-10-31T09:12:44+03:00",
"organization": { "id": 42 },
"data": { "service_request_id": 311, "reference": "AB-2026-0311",
"workflow_state": "scheduled", "previous_workflow_state": "assigned" }
}
Verifying signatures
The signature is HMAC-SHA256 of {timestamp}.{raw body} using the signing secret shown once when you added the destination. Compare in constant time and reject events older than five minutes.
// Node.js
const expected = 'sha256=' + crypto.createHmac('sha256', secret)
.update(`${req.headers['x-ab-timestamp']}.${rawBody}`).digest('hex');
const ok = crypto.timingSafeEqual(Buffer.from(expected),
Buffer.from(req.headers['x-ab-signature'] || ''));
# Python
expected = "sha256=" + hmac.new(secret.encode(),
f"{ts}.{raw_body}".encode(), hashlib.sha256).hexdigest()
ok = hmac.compare_digest(expected, signature)
// PHP
$expected = 'sha256=' . hash_hmac('sha256', $ts . '.' . $rawBody, $secret);
$ok = hash_equals($expected, $_SERVER['HTTP_X_AB_SIGNATURE'] ?? '');
The “Test event” button on the webhooks screen sends a webhook.test event so you can check your verification before the first real one.
Odoo integration
For Odoo 16, 17 or 18 — Odoo Online or self-hosted — a ready integration with no code to write:
- In Odoo: Settings → Users → open the user → Account Security → API Keys → create a key.
- In AB Connect: Integrations → Odoo, enter the URL, database name, login and key, then “Test and connect”.
- Contacts, products and prices, and invoices with payment state sync hourly. From a quote in AB Connect: “Send to Odoo”, then “Confirm sale order”.
Customers are matched by phone, then email, in both directions, so nobody is duplicated in AB Connect or in Odoo. We never ask for or store your password.
What the API does not do
The API does not send messages to customers on WhatsApp or any other channel. Sending goes through your team and the agent inside AB Connect, under WhatsApp Business policies — which protects your number and your customers.