API Documentation

RESTful API for managing documents and approvals programmatically

Overview

The WAQTUM API provides full programmatic access to all platform features. All requests and responses use JSON format.

Base URL: https://waqtum.qantrah.com/api/v1
Health Check: GET /api/v1/health Public

Authentication

All protected endpoints require your API key and secret in the Authorization header:

Authorization: Bearer YOUR_API_KEY:YOUR_API_SECRET
Content-Type: application/json
Accept: application/json
You can generate API keys from your dashboard at /admin/api

Rate Limiting

Requests are rate-limited per API key based on your plan:

Plan Limit
Basic100 requests/minute
Business300 requests/minute
Enterprise1000 requests/minute

When exceeded, a 429 (Too Many Requests) error is returned.

Documents

GET /documents List documents

Optional parameters:

statusdraft, pending, in_progress, approved, rejected, expired, voided
pagePage number
per_pageResults per page (default: 15)
GET /documents/{id} Get document

Returns document details with approvers and status.

POST /documents Create document

Required fields:

title_arstringArabic title
title_enstringEnglish title
filefile (PDF)PDF file (max 20MB)
departmentstringDepartment
workflow_typestringsequential | parallel
PUT /documents/{id} Update document

Update document (only documents in draft status).

DELETE /documents/{id} Delete document

Delete document (only documents in draft status).

POST /documents/{id}/send Send for approval

Send document to approval workflow and notify approvers.

POST /documents/{id}/void Void document

Void a sent document (notifies approvers).

GET /documents/{id}/status Document status

Returns current document status and approval progress.

GET /documents/{id}/download Download document

Download the final approved file (PDF).

Approvers

GET /documents/{documentId}/approvers List approvers
POST /documents/{documentId}/approvers Add approver
name_arstringArabic name
name_enstringEnglish name
phonestringPhone number (WhatsApp)
role_arstringJob title (Arabic)
role_enstringJob title (English)
action_typestringsign | stamp | approve_only | review_only
order_indexintegerApproval order (for sequential)
PUT /approvers/{id} Update approver
DELETE /approvers/{id} Delete approver
POST /approvers/{id}/remind Send reminder

Resend WhatsApp notification to the approver.

Webhooks

Receive real-time notifications when events occur in the system.

Available Events
Event Description
document.createdWhen a new document is created
document.sentWhen a document is sent for approval
document.approvedWhen a document is fully approved
document.rejectedWhen a document is rejected
approver.completedWhen an approver completes their action
Webhook Management
GET /webhooks/events Available events
GET /webhooks List webhooks
POST /webhooks Create webhook
urlstringURL to receive notifications
eventsarrayList of events to subscribe to
POST /webhooks/{id}/test Test webhook
POST /webhooks/{id}/rotate-secret Rotate secret
Signature Verification

An HMAC-SHA256 signature is sent in the header of each webhook request:

X-Waqtum-Signature: sha256=HMAC_HASH

// Verification (PHP):
$hash = hash_hmac('sha256', $payload, $webhookSecret);
$valid = hash_equals($hash, $signatureFromHeader);

Error Codes

Code Description
400Bad Request — check parameters
401Unauthorized — invalid API key
403Forbidden — no permission for this action
404Not Found — resource does not exist
422Validation Error — invalid data
429Too Many Requests — rate limit exceeded
500Server Error — contact support
Response Format
{
    "success": false,
    "error": {
        "code": 422,
        "message": "Validation failed",
        "details": {
            "title_ar": ["The title_ar field is required."]
        }
    }
}

Ready to get started?

Sign up now and start integrating with the WAQTUM API