API and keys

The back office, the portals and the website all use this one REST API. Outside systems get a key with only the scopes they need, and every call is logged.

Webhooks
Requests, last 24 hours
18,420
Website 61%, portals 27%, integrations 12%
Median response time
84 ms
95th percentile 310 ms
Error rate
0.3%
52 errors, 41 of them 404 from the old site
Active keys
7
1 expires in 12 days

Resources

v1

List batches

scope: batches:read

Sample payloads use the records in the finance ledger: order O-5128 (Hassan Reda, B-2612, 11 seats sold), payment PAY-5209, invoice INV-2086.

Request
Response200 OK, 71 ms
Base address https://hub.malyomar.example/v1 is a placeholder host for this prototype. Sample responses use the shared sample data.

Conventions

Format
JSON, UTF-8, dates in ISO 8601, Cairo time zone offset included
Sign-in
Authorization: Bearer with an API key, or the user's session
Paging
limit up to 100 and cursor
Filtering
Query fields, for example status=open
Money
Integer amount plus currency
Safe retries
Idempotency-Key header on every POST
Versions
Breaking changes get a new version; v1 is kept 12 months after v2

Errors

400Field missing or wrong type; the body names the field
401Key missing, expired or revoked
403Key lacks the scope, or role cannot see the record
404No such record
409Conflict, for example batch full or duplicate enrolment
423Record locked, for example ASME program content
429Rate limit reached; see Retry-After

Resource summary

ResourceOwned byReadCreateUpdateDeleteNotes
NameKeyScopesCreated byLast usedCalls, 24 hExpiresState
A key is shown in full once, when created. Creating, rotating and revoking a key are recorded in the audit log.

Scopes

ScopeAllowsSensitive
courses:readCatalog, paths, academies, instructors' public profilesNo
courses:writeCreate and edit MALYOMAR programs; ASME content stays lockedYes
batches:readDates, mode, seats leftNo
batches:writeCreate batches, change dates and capacityYes
learners:readLearner profile, company, enrolmentsPersonal data
learners:writeCreate and update learnersPersonal data
enrolments:writeEnrol, transfer, cancelYes
orders:readOrders, invoices, payment status; no card data exists in the hubYes
orders:writeCreate orders, record paymentsMoney
certificates:readVerify a certificate by number or codeNo
certificates:issueIssue or revoke; reserved for the hub's own rulesRestricted
leads:writeCreate leads from forms and chatNo
Key expiring. "Accounting sync" expires on 15 October. Rotate it before then or invoices stop posting.

Key rules

  • One key per system, named after it, with an owner on staff.
  • Smallest set of scopes. Website keys never get learners:read.
  • Keys expire after 12 months at most and can be limited to fixed IP addresses.
  • Corporate clients read their own learners through a key tied to their account; they cannot see other accounts.
  • Only admins create keys. See roles and permissions.
Insight. "Old reporting script" has not made a call in 64 days and still holds learners:read. Unused keys with personal-data scopes should be revoked.

Rate limits

CallerPer minutePer dayBurstPeak todayWhen exceeded
Public website (catalog, schedule)600200,000100
186 per minute
Serve cached catalog
Learner, instructor and corporate portals120 per userNo cap30
22 per minute, one user
429, retry after 5 s
Integration keys (default)6020,00020
49 per minute, accounting sync
429 with Retry-After
Corporate client keys305,00010
3 per minute
429 with Retry-After
Lead form and chat10 per IP300 per IP5
4 per minute, one IP
Show a human check
Certificate verification (public)20 per IP500 per IP5
3 per minute
429, retry after 60 s
Bulk export2 jobs20 jobs1
1 job running
Queue the job

Requests per hour, today

RequestsHour with 429 responses

Calls by resource, 24 hours

Slowest endpoints

GET /learners?include=enrolments410 ms
POST /orders290 ms
GET /batches/{id}/roster180 ms
GET /courses42 ms
95th percentile.
The accounting sync hit its limit at 10:00 when it retried failed invoices, among them INV-2086 for order O-5128 (customer Hassan Reda not found in the ledger). Fixing the missing customers in connectors removes the retries; the queue itself is on Accounting & ledgers. Simulated: no accounting system is chosen or connected (DEC-01).