Skip to content

Connect your system to AB Connect.

A REST API that reads your customers, conversations and requests, and creates contacts, requests and tasks — plus signed events that reach your system the moment they happen. Every key is bound to its own workspace.

Request
curl https://api.abtech.sa/api/v1/contacts?search=0501234567 \
  -H "Authorization: Bearer abc_…"
Response 200
{
  "data": [{
    "id": 4812,
    "name": "Abdullah Al-Khalidi",
    "phone": "966501234567",
    "city": "Dammam",
    "tags": ["vip"]
  }],
  "meta": { "current_page": 1, "total": 1 }
}

Getting started

  1. In AB Connect open Settings → API keys and issue a key. Choose “Read only” if your system only reads.
  2. Copy the key straight away — it is shown once; we store only a hash.
  3. Send it on every request as Authorization: Bearer to 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…" } }
401Missing, revoked or expired key, or the owner is disabled.
403The owner lacks the permission, or a read-only key called a write endpoint.
404Not found in your workspace — other workspaces’ records answer the same way.
409A contact with the same phone or email exists; its id is in error.contact_id.
422Invalid 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 /account Your workspace
  • GET /integrations List connected integrations
  • GET /integrations/{id} Get an integration

Contacts

  • GET /contacts List contacts
  • POST /contacts Create a contact write
  • GET /contacts/{id} Get a contact
  • PATCH /contacts/{id} Update a contact write

Conversations & messages

  • GET /conversations List conversations
  • GET /conversations/{id} Get a conversation
  • GET /conversations/{id}/messages List messages

Service requests

  • GET /service-requests List service requests
  • POST /service-requests Open a service request write
  • GET /service-requests/{id} Get a service request
  • POST /service-requests/{id}/transitions Change request status write

Tasks

  • GET /tasks List tasks
  • POST /tasks Create a task write
  • GET /tasks/{id} Get a task
  • POST /tasks/{id}/transitions Change task status write

Quotes & invoices

  • GET /quotes List quotes
  • GET /quotes/{id} Get a quote
  • GET /invoices List invoices

Sales

  • GET /opportunities List opportunities
  • GET /opportunities/{id} Get an opportunity
  • GET /commerce-orders List store orders
  • GET /commerce-orders/{id} Get a store order

Catalogue

  • GET /products List 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.receivedA customer sent a message on any channel
contact.createdA new contact, from WhatsApp, a store, accounting or the API
service_request.createdA service request was opened
service_request.status_changedA request changed state; the previous state is included
conversation.updatedA 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:

  1. In Odoo: Settings → Users → open the user → Account Security → API Keys → create a key.
  2. In AB Connect: Integrations → Odoo, enter the URL, database name, login and key, then “Test and connect”.
  3. 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.

Chat with us on WhatsApp