API Documentation
This page documents the real, currently-live HTTP endpoints served by www.badirtech.com. There are three: an AI assistant endpoint, a trial/support request form endpoint, and a health check. No other public API endpoints exist on this domain. All endpoints are JSON over HTTPS.
POST/api/ask
Sanid AI Assistant — answers questions about Jordanian tax law/regulations (from an official legal-text library, with citations) and about BadirTech/Sanid products and services. Local sources are tried first: the exempt-entity list, previously saved answers, the legal library and the company profile. When the question is in scope but not found locally, an AI model (currently Claude by Anthropic) answers from the closest library excerpts, still scoped to the same two topics; that answer is saved, with personal data removed, and reused for similar questions.
Rate limit
Answers from local sources are not limited. Model-generated answers: 5 per IP address per day, with a site-wide daily cap; after that, the closest library excerpt is returned when one exists. Abuse protection: 120 requests per IP address per hour.
Request parameters
| Field | Type | Required | Notes |
|---|---|---|---|
| question | string | yes | 2–500 characters |
Example request
POST /api/ask
Content-Type: application/json
{"question": "كم ضريبة المبيعات على الطحينة؟"}
Example response
200 OK
{
"success": true,
"source_type": "library",
"layer": "library",
"answer": "بحسب المكتبة القانونية الرسمية: ...",
"sources": [{ "source": "...", "title": "..." }]
}
source_type is one of: library (legal library, exempt-entity list, or company profile match), learned (a previously saved model answer), ai (a new model answer), scope (question politely declined as out of scope), none (no source available).
layer names the step that answered: entities, cache, learned, library, company, scope, ai, ai-incomplete, library-fallback, ai-limit, ai-refusal, ai-failed or no-key.
Expected errors
| Status | Body | Cause |
|---|---|---|
| 400 | {"success":false,"error":"INVALID_INPUT"} | question missing or outside 2–500 chars |
| 429 | {"success":false,"error":"RATE_LIMITED","answer":"..."} | more than 120 requests per hour from one IP address |
| 200 | {"success":false,"error":"AI_LIMIT","layer":"ai-limit","answer":"..."} | daily model limit reached and no close library excerpt (includes a friendly message) |
Usage notes
Scoped strictly to Jordanian tax law and BadirTech/Sanid topics; questions about other countries or unrelated subjects are declined, not answered. All answers are informational only and are not a substitute for a certified tax, legal, or accounting advisor.
POST/api/register
Submits a Sanid trial request or opens a technical support ticket. The same endpoint handles both; a field distinguishes the two. Delivered by email to the BadirTech team — there is no server-side database storage.
Rate limit
5 requests per IP address per 10 minutes.
Request parameters
| Field | Type | Required | Notes |
|---|---|---|---|
| fullName | string | yes | 3–100 characters |
| phoneNumber | string | yes | phone-number-like pattern, 7–20 characters |
| businessSector | string | yes | 3–2000 characters (free text: sector / issue details) |
| formType | string | no | "trial" (default) or "support" |
Example request
POST /api/register
Content-Type: application/json
{
"fullName": "أحمد علي",
"phoneNumber": "+962791234567",
"businessSector": "شركة توزيع مواد غذائية بحاجة لتطبيق مبيعات ميدانية",
"formType": "trial"
}
Example response
200 OK
{"success": true}
Expected errors
| Status | Body | Cause |
|---|---|---|
| 400 | {"error":"INVALID_INPUT","fields":[...]} | one or more fields failed validation (named in fields) |
| 429 | {"error":"RATE_LIMITED"} | 5/10min rate limit exceeded |
| 500 | {"error":"MAIL_SEND_FAILED"} | outgoing email could not be delivered |
GET/api/health
Service health/uptime check. Intended for automated monitoring and load-balancer checks. No authentication, no rate limit, no sensitive data exposed.
Request parameters
None.
Example request
GET /api/health
Example response
200 OK
{
"status": "ok",
"uptime": 12345,
"timestamp": "2026-07-14T15:00:00.000Z"
}
Expected errors
None expected under normal operation.
Machine-readable catalog: /.well-known/api-catalog (RFC 9727) ·
Agent skills: /.well-known/agent-skills/index.json
Last updated: 2026-07-14
