API reference (Swagger)
Every endpoint with its request, responses and errors. Try requests right in the browser.
Postman collection
Download and import. Sign-in requests save the token, so the rest are authenticated.
OpenAPI 3 document
For code generators and API clients (Dart, TypeScript, …).
Health
Postgres up 1.8 ms·Redis up 1.8 ms
Request logs
Every recent request with its body, response, errors and timing. Look up a failing call by its X-Request-Id.
- SMS is simulated: no message is sent and every verification code is 1234.
- Email is simulated: nothing is sent and every admin password reset code is 1234.
- The AI career assistant gives sample replies (no model is called).
Base paths
| Path | Used by | Signs in with | Token |
|---|---|---|---|
/v1/employee | Employee app (job seekers) | Mobile number + SMS code | mt_emp_… |
/v1/establishment | Establishment app (employers) | Mobile number + SMS code | mt_est_… |
/v1/admin | Admin dashboard | Email + password | mt_adm_… |
Send the token as Authorization: Bearer <token>. A token only works in its own app's path.
Sign in to an app
- Request a code (use
register/otpfor a new number):curl -X POST https://motaah-api.dev-moltaqa.cloud/v1/employee/auth/login/otp \ -H 'Content-Type: application/json' \ -d '{"mobile":"0551234567"}' - Verify it to get a session token:
curl -X POST https://motaah-api.dev-moltaqa.cloud/v1/employee/auth/login \ -H 'Content-Type: application/json' \ -d '{"mobile":"0551234567","code":"1234"}' - Call the API with the token:
curl https://motaah-api.dev-moltaqa.cloud/v1/employee/profile \ -H 'Authorization: Bearer mt_emp_…'
Establishments use the same steps under /v1/establishment.
Sign in to the dashboard
curl -X POST https://motaah-api.dev-moltaqa.cloud/v1/admin/auth/login \
-H 'Content-Type: application/json' \
-d '{"email":"you@example.com","password":"…"}'
Returns { accessToken, admin }. Each admin action needs its permission (for example packages.create); see GET /v1/admin/auth/permissions.
Uploading files
Upload first with POST /v1/{app}/files?purpose=… (multipart, field file), then send the returned id to the endpoint that uses it, such as cvFileId or logoFileId.
Conventions
Language
Send Accept-Language: ar or en (or ?lang=). Arabic is the default; messages and content come back translated.
Errors
Always { code, message, details?, requestId }. Branch on code; show message. details lists field problems.
Pages
Lists take ?page=&limit= (max 100) and return { items, page, limit, total }.
Request IDs
Every response has an X-Request-Id header. Include it when reporting a problem.
Dates & money
Times are ISO 8601 in UTC. Prices are SAR with VAT included: { amount, vat, net, currency }.
Mobile numbers
Saudi numbers in any common form (05…, 5…, +9665…); responses use +9665….
Error codes
All 64 codes with their HTTP status and English message
| Code | Status | Message |
|---|---|---|
VALIDATION_FAILED | 400 | The request data is invalid |
INVALID_JSON | 400 | The request body could not be read |
UNAUTHORIZED | 401 | Please sign in to continue |
FORBIDDEN | 403 | You don't have permission to do this |
ACCOUNT_DISABLED | 403 | This account has been deactivated. Contact support for help |
NOT_FOUND | 404 | The requested item was not found |
CONFLICT | 409 | The request conflicts with existing data |
PAYLOAD_TOO_LARGE | 413 | The request is larger than allowed |
TOO_MANY_REQUESTS | 429 | Too many requests, please try again shortly |
INVALID_CREDENTIALS | 401 | The email or password is incorrect |
PASSWORD_INCORRECT | 400 | Your current password is incorrect |
RESET_TOKEN_INVALID | 400 | This password reset has expired. Start again and request a new code |
RESET_CODE_INVALID | 400 | The code is wrong or has expired. Request a new one if needed |
EMAIL_TAKEN | 409 | This email is already used by another admin |
MOBILE_TAKEN | 409 | This mobile number is already used by another admin |
ACCOUNT_MOBILE_TAKEN | 409 | Another account already uses this mobile number |
ACCOUNT_EMAIL_TAKEN | 409 | Another account already uses this email |
CONTACT_MESSAGE_REPLIED | 409 | This message has already been replied to |
ROLE_NAME_TAKEN | 409 | Another role already has this name |
ROLE_IN_USE | 409 | This role can't be deleted: {count} admins use it. Move them to another role first |
SYSTEM_ROLE_LOCKED | 409 | The Super Admin role can't be changed or deleted |
SUPER_ADMIN_PROTECTED | 409 | The super admin's account can't be edited, deactivated or deleted |
SUPER_ADMIN_ROLE_RESERVED | 409 | The Super Admin role belongs to one account. Choose another role; it can include every permission |
SELF_CHANGE_NOT_ALLOWED | 409 | You can't do this to your own account or role |
FAQ_ORDER_MISMATCH | 400 | The new order must list every FAQ exactly once. Refresh and try again |
PACKAGE_NAME_TAKEN | 409 | Another package already has this name |
PACKAGE_IN_USE | 409 | This package has subscriptions and can't be deleted. Deactivate it instead |
REPORT_REASON_IN_USE | 409 | This reason is used by reports, so it can't be deleted. Deactivate it instead |
REPORT_REASON_ORDER_MISMATCH | 400 | The order must list every report reason exactly once |
PACKAGE_ORDER_MISMATCH | 400 | The new order must list every package exactly once. Refresh and try again |
SUBSCRIPTION_QUEUE_FULL | 409 | You already have an upcoming subscription. You can subscribe again once it starts |
STATISTICS_RANGE_INVALID | 400 | Invalid range: the start must not be after the end, and it can cover at most 366 days, 104 weeks or 36 months |
CV_SECTION_FULL | 409 | This section is full (20 entries). Remove one to add another |
CITY_NOT_FOUND | 400 | Choose a city from the list |
SUBSCRIPTION_REQUIRED | 403 | Subscribe to a package to post jobs |
JOB_POST_QUOTA_REACHED | 409 | You've used all the job posts in your package. It ends on {date}; subscribe to a new package to post more |
JOB_ACTION_NOT_ALLOWED | 409 | This can't be done while the job is {status} |
APPLICATION_ACTION_NOT_ALLOWED | 409 | This can't be done with the application in its current status |
JOB_TERMS_LOCKED | 409 | The title and salary can't change once people have applied |
JOB_CLOSED | 409 | This job is closed, so its applicants can't be contacted |
VACANCIES_FILLED | 409 | All the vacancies for this job have been filled |
CONVERSATION_CLOSED | 409 | This conversation is closed; you can read it but not send messages |
JOB_NOT_AVAILABLE | 409 | This job is no longer available |
ALREADY_APPLIED | 409 | You've already applied for this job |
ALREADY_REPORTED | 409 | You've already reported this job. Thank you, our team will review it |
ALREADY_RATED | 409 | You've already rated this employee for this job |
MOBILE_CHANGE_NOT_ALLOWED | 403 | Your mobile number can't be changed. Contact us if you need help |
CV_REQUIRED | 422 | Complete your CV to apply |
AI_LIMIT_REACHED | 429 | You have reached today’s assistant message limit. You can continue tomorrow |
AI_UNAVAILABLE | 503 | The assistant is unavailable right now. Please try again shortly |
MOBILE_NOT_REGISTERED | 404 | This mobile number isn't registered. Create an account |
MOBILE_ALREADY_REGISTERED | 409 | This mobile number is already registered. Sign in instead |
MOBILE_UNCHANGED | 400 | This is already your mobile number. Enter a new one |
OTP_INVALID | 400 | The verification code is incorrect. {remainingAttempts} attempts left |
OTP_EXPIRED | 400 | The verification code has expired. Request a new one |
OTP_TOO_MANY_ATTEMPTS | 429 | Too many incorrect attempts. Request a new code |
OTP_RESEND_TOO_SOON | 429 | You can request a new code in {seconds} seconds |
SMS_UNAVAILABLE | 503 | The message couldn't be sent. Please try again shortly |
MAIL_UNAVAILABLE | 503 | The email couldn't be sent, so the reply wasn't saved. Try again later |
REALTIME_UNAVAILABLE | 503 | Live updates are unavailable right now. Refresh to see changes |
FILE_REQUIRED | 400 | No file was attached |
FILE_TOO_LARGE | 413 | The file is larger than allowed ({maxMb} MB at most) |
FILE_TYPE_NOT_ALLOWED | 415 | This file type isn't supported. Allowed: {allowed} |
INTERNAL_ERROR | 500 | Something went wrong, please try again |