Tawzifa Company API
Connect your HR or ERP system to Tawzifa: publish jobs, receive applicants and run interviews, offers and messages from your own system — with a free sandbox.
REST + JSON on /api/v1, scoped keys, a signature on every request, signed webhooks and an isolated sandbox with sample data.
Access: sandbox, then live
From your company dashboard → “Integrations / API”.
- Sandbox (free, instant): any company with a verified e-mail and a complete address + map pin can create twz_test_ keys right away. They run on completely separate sample data (fake jobs, applicants, interviews, offers and messages) that never reaches a real person, the website or statistics.
- Live: send the live access request once you have an approved commercial register, an approved tax card, a complete company profile (legal name, legal entity, address + map pin, representative name and title) and your system’s name and production address (https). Approval within 5 business days (Sunday–Thursday).
- twz_live_ keys work when all three hold: Tawzifa approval + an active annual plan that includes the API + payments being open on Tawzifa. The API itself is free.
- Partners: companies Tawzifa treats as partners (affiliated companies) get initial approval without documents, without an annual plan or open payments, and with no cap on published jobs. They only need an approved access request with their system’s domain declared. Only the Tawzifa team grants this, and GET /usage returns jobs.unlimited = true.
- Not available through the API: daily-worker search or contact, and bulk data exports.
Authentication and request signing
A key looks like twz_test_<id>.<secret> and is shown once, when created. Keep it on your server only (environment variable or secret manager) — never in a website or mobile app. We never store the key itself, only an HMAC fingerprint of it, so a lost key can’t be recovered: rotate it.
Every request carries:
Authorization: Bearer twz_test_ab12cd34ef56gh78.<secret>
X-Tawzifa-Timestamp: 1764000000 # Unix seconds, ±5 minutes
X-Tawzifa-Nonce: 3f9c1d2e8a7b4c6d9e0f1a2b # 16–64 chars, never reused
X-Tawzifa-Signature: v1=<hex HMAC-SHA256(secret, canonical)>
Content-Type: application/json # requests with a body
Idempotency-Key: 7d1e… # recommended on POST / PATCH / DELETE
The signed text (canonical) is these lines joined by \n:
METHOD e.g. POST
PATH e.g. /api/v1/jobs
SORTED_QUERY params sorted by name, RFC 3986 encoded (%20 for spaces), joined by & (empty if none)
TIMESTAMP same value as X-Tawzifa-Timestamp
NONCE same value as X-Tawzifa-Nonce
BODY_SHA256 hex SHA-256 of the exact raw body bytes (SHA-256 of "" when there is no body)
Why both? The secret travels only inside HTTPS and is compared with a peppered fingerprint; the signature binds each request to its exact method, path, query and body; and the timestamp + single-use nonce block replays. Plain HTTP is refused.
KEY="$TAWZIFA_API_KEY" # twz_test_xxxxxxxxxxxxxxxx.secret
SECRET="${KEY#*.}"
METHOD="GET"; PATH_="/api/v1/jobs"; QUERY="per_page=10"; BODY=""
TS=$(date +%s); NONCE=$(openssl rand -hex 16)
BODY_SHA=$(printf '%s' "$BODY" | openssl dgst -sha256 -hex | sed 's/^.* //')
SIG=$(printf '%s\n%s\n%s\n%s\n%s\n%s' "$METHOD" "$PATH_" "$QUERY" "$TS" "$NONCE" "$BODY_SHA" \
| openssl dgst -sha256 -hmac "$SECRET" -hex | sed 's/^.* //')
curl -sS "https://tawzifa.com$PATH_?$QUERY" \
-H "Authorization: Bearer $KEY" \
-H "X-Tawzifa-Timestamp: $TS" -H "X-Tawzifa-Nonce: $NONCE" \
-H "X-Tawzifa-Signature: v1=$SIG" -H "Accept: application/json"
<?php
function tawzifa(string $method, string $path, array $query = [], ?array $body = null): array
{
$key = getenv('TAWZIFA_API_KEY'); // twz_test_xxxx.secret
$secret = substr($key, strpos($key, '.') + 1);
ksort($query);
$qs = http_build_query($query, '', '&', PHP_QUERY_RFC3986);
$raw = $body === null ? '' : json_encode($body, JSON_UNESCAPED_UNICODE);
$ts = (string) time();
$nonce = bin2hex(random_bytes(16));
$canonical = implode("\n", [$method, $path, $qs, $ts, $nonce, hash('sha256', $raw)]);
$headers = [
'Authorization: Bearer '.$key,
'X-Tawzifa-Timestamp: '.$ts,
'X-Tawzifa-Nonce: '.$nonce,
'X-Tawzifa-Signature: v1='.hash_hmac('sha256', $canonical, $secret),
'Accept: application/json',
];
$ch = curl_init('https://tawzifa.com'.$path.($qs !== '' ? '?'.$qs : ''));
if ($raw !== '') {
$headers[] = 'Content-Type: application/json';
$headers[] = 'Idempotency-Key: '.bin2hex(random_bytes(16));
curl_setopt($ch, CURLOPT_POSTFIELDS, $raw);
}
curl_setopt_array($ch, [CURLOPT_CUSTOMREQUEST => $method, CURLOPT_HTTPHEADER => $headers, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 20]);
$response = curl_exec($ch);
return [curl_getinfo($ch, CURLINFO_HTTP_CODE), json_decode((string) $response, true)];
}
[$status, $jobs] = tawzifa('GET', '/api/v1/jobs', ['per_page' => 10]);
[$status, $job] = tawzifa('POST', '/api/v1/jobs', [], [
'title' => 'فني صيانة تكييفات', 'trade_id' => 12, 'area_id' => 3, 'employment_type' => 'full_time',
'openings' => 2, 'salary_min' => 9000, 'salary_period' => 'month',
'description' => 'صيانة وتركيب تكييفات سبليت في مواقع العملاء داخل القاهرة.', 'publish' => true,
]);
// Node 18+
import crypto from 'node:crypto';
const KEY = process.env.TAWZIFA_API_KEY; // twz_test_xxxx.secret
const SECRET = KEY.slice(KEY.indexOf('.') + 1);
const enc = (s) => encodeURIComponent(String(s)).replace(/[!'()*]/g, (c) => '%' + c.charCodeAt(0).toString(16).toUpperCase());
export async function tawzifa(method, path, query = {}, body = null) {
const qs = Object.keys(query).sort().map((k) => `${enc(k)}=${enc(query[k])}`).join('&');
const raw = body === null ? '' : JSON.stringify(body);
const ts = Math.floor(Date.now() / 1000).toString();
const nonce = crypto.randomBytes(16).toString('hex');
const canonical = [method, path, qs, ts, nonce, crypto.createHash('sha256').update(raw).digest('hex')].join('\n');
const headers = {
Authorization: `Bearer ${KEY}`,
'X-Tawzifa-Timestamp': ts,
'X-Tawzifa-Nonce': nonce,
'X-Tawzifa-Signature': 'v1=' + crypto.createHmac('sha256', SECRET).update(canonical).digest('hex'),
Accept: 'application/json',
};
if (raw) {
headers['Content-Type'] = 'application/json';
headers['Idempotency-Key'] = crypto.randomUUID();
}
const res = await fetch(`https://tawzifa.com${path}${qs ? '?' + qs : ''}`, { method, headers, body: raw || undefined });
return { status: res.status, data: await res.json() };
}
const { data } = await tawzifa('GET', '/api/v1/applications', { status: 'submitted', per_page: 50 });
import hashlib, hmac, json, os, secrets, time, urllib.parse, uuid
import requests
KEY = os.environ["TAWZIFA_API_KEY"] # twz_test_xxxx.secret
SECRET = KEY.split(".", 1)[1]
def tawzifa(method, path, query=None, body=None):
query = query or {}
qs = "&".join(f"{urllib.parse.quote(str(k), safe='')}={urllib.parse.quote(str(v), safe='')}" for k, v in sorted(query.items()))
raw = "" if body is None else json.dumps(body, ensure_ascii=False, separators=(",", ":"))
ts, nonce = str(int(time.time())), secrets.token_hex(16)
canonical = "\n".join([method, path, qs, ts, nonce, hashlib.sha256(raw.encode()).hexdigest()])
headers = {
"Authorization": f"Bearer {KEY}",
"X-Tawzifa-Timestamp": ts,
"X-Tawzifa-Nonce": nonce,
"X-Tawzifa-Signature": "v1=" + hmac.new(SECRET.encode(), canonical.encode(), hashlib.sha256).hexdigest(),
"Accept": "application/json",
}
if raw:
headers["Content-Type"] = "application/json"
headers["Idempotency-Key"] = str(uuid.uuid4())
url = "https://tawzifa.com" + path + (f"?{qs}" if qs else "")
r = requests.request(method, url, headers=headers, data=raw.encode() if raw else None, timeout=20)
return r.status_code, r.json()
status, body = tawzifa("POST", "/api/v1/applications/42/status", body={"status": "shortlisted"})
Conventions
- Responses are {"data": …}; lists add meta.next_cursor and meta.has_more. Send ?cursor=<next_cursor> for the next page, per_page up to 100.
- Times in responses are ISO 8601 UTC (Z). Interview and offer times you send are Cairo time, formatted like 2026-12-01T10:30.
- Amounts are in Egyptian pounds (EGP).
- Idempotency-Key on POST/PATCH/DELETE: the first response is kept for 24 hours and replayed for retries (with Idempotent-Replayed: true). The same key with a different body = 422 idempotency_key_reuse; a request still running with the same key = 409 idempotency_in_progress.
- Important: 4xx responses (such as 422 rule_violation) are stored and replayed as they are for the same key for the whole 24 hours; only 5xx responses are not stored. So: retry with the same key after a network drop or a 5xx, but once you have fixed the cause of a refusal (data or state), send with a new key. Simplest: one new key per logical attempt (for example a UUID per message or per edit).
- updated_since accepts any ISO 8601 time (such as 2026-11-24T10:00:00Z or 2026-11-24T12:00:00+02:00), compares it as an instant and returns what changed at or after it. Keep the time of your last successful sync and subtract a minute as a safety margin.
- Limits: 120 requests a minute per key, 240 per company, and a daily quota (20,000 live / 5,000 sandbox). Over it: 429 with Retry-After. X-RateLimit-Limit, X-RateLimit-Remaining and X-Quota-Remaining show what is left.
- Bodies are JSON only, at most 1 MB. Every response has X-Request-Id — quote it to support.
- The version is in the path (/api/v1). Breaking changes go to /api/v2 with notice.
Privacy — the same rules as the dashboard
- An applicant’s phone and e-mail appear only after the applicant shares them (contact.shared = true).
- Phone numbers, e-mails and handles inside messages and cover letters stay masked until then (masked = true).
- The CV is a signed link valid for 10 minutes from GET /applications/{id}/cv.
- Every call sees only your company’s data — another company’s id answers 404. Identity numbers and document files never leave through the API.
Jobs and categories
- Categories have 3 levels: main category → sub-category → specialty. GET /reference/fields returns both: parent_id = null is a main category, anything else is a sub-category under it. GET /reference/specialties?field_id= returns the specialties (trade_id).
- Creating or editing: trade_id is required and work_field_id (the sub-category) optional; if you send it, the specialty must belong to it or you get a 422. area_id comes from GET /reference/areas.
- A job in responses carries specialty (with its field_id) and category = {group_id, field_id}, so you can show the main and sub-category without extra calls.
- Publishing follows the dashboard rules: a company logo is required, and during the free launch there is a cap on jobs published at the same time (GET /usage → jobs.free_active_limit; partners have no cap). A paused job can be published again, a closed one cannot — create a new job instead.
- After closes_on a job stops taking applicants. When its free publishing period ends the job is paused and you receive job.expired; renew it with POST /jobs/{id}/publish (partners’ jobs are never paused). Closing a job sends job.closed.
Applicants, interviews and offers
- Statuses: submitted → reviewing → shortlisted → interview → hired, or rejected, or withdrawn when the applicant withdraws. Through the API you can set reviewing, shortlisted, hired or rejected (with an optional note).
- POST /applications/{id}/interviews schedules an interview (Cairo time) and moves the status to interview. The applicant’s answer (accept, decline, or up to 3 suggested times) arrives as interview.responded; confirm a suggested time with POST /interviews/{id}/confirm and the slot number.
- POST /applications/{id}/offers sends a job offer with a deadline (expires_at). The applicant accepting moves the application to hired and sends offer.accepted; there are also offer.declined and offer.expired.
- GET /applications/{id} returns the full details (cover letter, skills, languages, your notes, interview and offer ids). The CV, in Tawzifa’s design, comes from the signed GET /applications/{id}/cv link (10 minutes).
Messages
- POST /applications/{id}/conversation opens (or returns) the conversation with an applicant, and POST /conversations/{id}/messages sends a text message of up to 2000 characters. If the conversation is blocked, sending is refused (422 rule_violation).
- GET /conversations carries unread_count per conversation (applicant messages your company has not read yet), and ?unread=1 returns only conversations with something new — one call is enough for your badges. ?updated_since returns conversations with messages since a given time.
- GET /conversations/{id}/messages marks the conversation read for your company by default; send mark_read=0 in background syncs so nothing is marked read before a person actually opens it. applicant_read_at tells you when the applicant read your messages.
- Phone numbers and e-mails inside messages are masked (masked = true) until the applicant shares their details (contact_shared = true); the same messages then come back in full. Photos the applicant sends show as has_image = true and open on Tawzifa only.
- A new applicant message = webhook message.received with conversation and message.
Webhooks
Add an https address from the dashboard or POST /webhooks. The secret is shown once. We POST JSON with id, type, mode, created_at and data, plus X-Tawzifa-Event, X-Tawzifa-Event-Id, X-Tawzifa-Timestamp and X-Tawzifa-Signature.
application.created a new applicant on one of your jobs
application.status_changed an applicant’s status changed (by you, the dashboard or a withdrawal)
interview.responded the applicant accepted, declined or suggested other times, or it was cancelled
interview.reminder a reminder before the interview
offer.accepted the offer was accepted
offer.declined the offer was declined
offer.expired the offer expired unanswered
message.received a new message from an applicant
job.expired the job stopped because its period ended
job.closed the job was closed
Verify the signature: v1=hex(HMAC-SHA256(secret, timestamp + "." + raw body)), reject timestamps older than 5 minutes, and use id to ignore duplicates. Answer 2xx within 8 seconds; failures are retried after 1, 5, 30 minutes, 2, 6, 12, 24 hours (8 attempts), and an endpoint is disabled after 25 failures in a row. You can redeliver from the delivery log.
Safety: https only; internal, private, localhost and metadata addresses are refused, also after DNS resolution; redirects are not followed. Live endpoints must be on a domain declared in your approved request.
What data holds for each event:
application.created {application}
application.status_changed {previous_status, application}
interview.responded {application_id, response: accepted|declined|proposed|cancelled, interview}
interview.reminder {application_id, interview}
offer.accepted|declined|expired {application_id, offer}
message.received {conversation, message}
job.closed | job.expired {job}
Rotating the secret: add a new endpoint with the same address (up to 10 endpoints per mode), let your system accept both the old and the new secret for a short while (for example 30 minutes), then delete the old endpoint with DELETE /webhooks/{id}. Each event goes to every active endpoint, so use X-Tawzifa-Event-Id to ignore duplicates.
<?php
$payload = file_get_contents('php://input'); // raw body, before decoding
$ts = $_SERVER['HTTP_X_TAWZIFA_TIMESTAMP'] ?? '';
$expected = 'v1='.hash_hmac('sha256', $ts.'.'.$payload, getenv('TAWZIFA_WEBHOOK_SECRET'));
if (! ctype_digit($ts) || abs(time() - (int) $ts) > 300 || ! hash_equals($expected, $_SERVER['HTTP_X_TAWZIFA_SIGNATURE'] ?? '')) {
http_response_code(400);
exit;
}
$event = json_decode($payload, true); // skip if $event['id'] was already processed
http_response_code(200);
import crypto from 'node:crypto';
import express from 'express';
const app = express();
app.post('/webhooks/tawzifa', express.raw({ type: 'application/json' }), (req, res) => {
const ts = req.get('X-Tawzifa-Timestamp') || '';
const expected = 'v1=' + crypto.createHmac('sha256', process.env.TAWZIFA_WEBHOOK_SECRET).update(`${ts}.${req.body}`).digest('hex');
const given = req.get('X-Tawzifa-Signature') || '';
const fresh = Math.abs(Date.now() / 1000 - Number(ts)) <= 300;
if (!fresh || given.length !== expected.length || !crypto.timingSafeEqual(Buffer.from(given), Buffer.from(expected))) {
return res.sendStatus(400);
}
const event = JSON.parse(req.body); // skip if event.id was already processed
res.sendStatus(200);
});
import hashlib, hmac, os, time
from flask import Flask, request, abort
app = Flask(__name__)
@app.post("/webhooks/tawzifa")
def tawzifa_webhook():
ts = request.headers.get("X-Tawzifa-Timestamp", "")
payload = request.get_data() # raw bytes
expected = "v1=" + hmac.new(os.environ["TAWZIFA_WEBHOOK_SECRET"].encode(), ts.encode() + b"." + payload, hashlib.sha256).hexdigest()
if not ts.isdigit() or abs(time.time() - int(ts)) > 300 or not hmac.compare_digest(expected, request.headers.get("X-Tawzifa-Signature", "")):
abort(400)
event = request.get_json() # skip if event["id"] was already processed
return "", 200
The sandbox
- The first twz_test_ call prepares a copy of your company with a published job, a draft and 4 fake applicants (one shortlisted, one with an interview, one with an offer, one who sent a message).
- From the dashboard: “Reset the sandbox data” and “Simulate event” (application.created, interview.responded, offer.accepted, message.received) — test webhooks are really sent to your test endpoints.
- Same validation, permissions and limits as live — without e-mails, notifications or billing.
Security checklist for your system
- One key per system with the fewest scopes it needs, locked to your server IPs.
- Set an expiry and rotate regularly — the old key keeps working for the overlap you choose.
- If a key may have leaked: revoke it from the dashboard (effective immediately).
- Every call is logged (key, IP, path, result, latency) — see the audit log.
Integration guide, step by step
The reference example: Hunt ERP is connected this way — its “Job applications” screen shows the applicants to the company’s jobs on Tawzifa, and every HR action reaches the applicant in their Tawzifa account.
- 1) Sandbox: in “Integrations / API” create a twz_test_ key with only the scopes you need, and check your signing with GET /company.
- 2) Run the whole cycle on the sample data: publish a job (POST /jobs), pull applicants (GET /applications?updated_since=…), change a status, schedule an interview, send an offer, open a conversation and send a message.
- 3) Webhooks: add a test endpoint and receive events (dashboard: “Simulate event”). Verify the signature, ignore repeated Event-Ids, answer 2xx quickly and do heavy work afterwards.
- 4) Keep the mapping on your side: the Tawzifa job and application ids next to the matching records in your system, so nothing is duplicated or sent twice.
- 5) Request live access from the same screen with your system’s domain. Once approved, create a twz_live_ key (preferably locked to your server IP) and register a live webhook endpoint on the declared domain.
- 6) Run a safety-net sync every minute (updated_since + unread=1 + mark_read=0) so a missed event is caught up, and keep webhooks as the real-time path.
- 7) Monitor: GET /usage for limits, plus the audit log and the webhook delivery log in the dashboard. If a key leaks, revoke it at once and rotate the secret.
All endpoints
Base URL: https://tawzifa.com/api/v1
Company
Jobs
Applications
Interviews
Offers
Messages
Reference
Usage
Webhooks
Every request and response field is in the OpenAPI file. openapi.json
Error codes
Every error is application/problem+json (RFC 7807) with a stable code you can rely on, and a request_id.
{"type":"https://tawzifa.com/developers#error-insufficient_scope","title":"This key does not have the jobs:write permission.","status":403,"code":"insufficient_scope","request_id":"req_01j…"}
| Code | HTTP |
|---|---|
https_required | 403 |
missing_key | 401 |
invalid_key | 401 |
key_revoked | 401 |
key_expired | 401 |
stale_timestamp | 401 |
invalid_nonce | 401 |
bad_signature | 401 |
replayed_request | 401 |
company_suspended | 403 |
no_owner | 403 |
ip_not_allowed | 403 |
live_access_inactive | 403 |
insufficient_scope | 403 |
forbidden | 403 |
not_found | 404 |
method_not_allowed | 405 |
idempotency_in_progress | 409 |
payload_too_large | 413 |
unsupported_media_type | 415 |
validation_failed | 422 |
rule_violation | 422 |
invalid_idempotency_key | 422 |
idempotency_key_reuse | 422 |
unsafe_webhook_url | 422 |
webhook_domain_not_declared | 422 |
too_many_endpoints | 422 |
rate_limited | 429 |
daily_quota_exceeded | 429 |
internal_error | 500 |
api_unavailable | 503 |
sandbox_unavailable | 503 |