Motaah

Motaah API

One REST API for the employee app, the establishment app and the admin dashboard.

All systems operational Version 0.0.1 · 84e181a Base URL https://motaah-api.dev-moltaqa.cloud Sandbox environment

API reference (Swagger)

Every endpoint with its request, responses and errors. Try requests right in the browser.

Open docs

Postman collection

Download and import. Sign-in requests save the token, so the rest are authenticated.

Download

OpenAPI 3 document

For code generators and API clients (Dart, TypeScript, …).

Get JSON

Health

Postgres up 1.8 ms·Redis up 1.8 ms

View JSON

Request logs

Every recent request with its body, response, errors and timing. Look up a failing call by its X-Request-Id.

Open logs
This is a test environment.
  • 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

PathUsed bySigns in withToken
/v1/employeeEmployee app (job seekers)Mobile number + SMS codemt_emp_…
/v1/establishmentEstablishment app (employers)Mobile number + SMS codemt_est_…
/v1/adminAdmin dashboardEmail + passwordmt_adm_…

Send the token as Authorization: Bearer <token>. A token only works in its own app's path.

Sign in to an app

  1. Request a code (use register/otp for 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"}'
  2. 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"}'
  3. 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
CodeStatusMessage
VALIDATION_FAILED400The request data is invalid
INVALID_JSON400The request body could not be read
UNAUTHORIZED401Please sign in to continue
FORBIDDEN403You don't have permission to do this
ACCOUNT_DISABLED403This account has been deactivated. Contact support for help
NOT_FOUND404The requested item was not found
CONFLICT409The request conflicts with existing data
PAYLOAD_TOO_LARGE413The request is larger than allowed
TOO_MANY_REQUESTS429Too many requests, please try again shortly
INVALID_CREDENTIALS401The email or password is incorrect
PASSWORD_INCORRECT400Your current password is incorrect
RESET_TOKEN_INVALID400This password reset has expired. Start again and request a new code
RESET_CODE_INVALID400The code is wrong or has expired. Request a new one if needed
EMAIL_TAKEN409This email is already used by another admin
MOBILE_TAKEN409This mobile number is already used by another admin
ACCOUNT_MOBILE_TAKEN409Another account already uses this mobile number
ACCOUNT_EMAIL_TAKEN409Another account already uses this email
CONTACT_MESSAGE_REPLIED409This message has already been replied to
ROLE_NAME_TAKEN409Another role already has this name
ROLE_IN_USE409This role can't be deleted: {count} admins use it. Move them to another role first
SYSTEM_ROLE_LOCKED409The Super Admin role can't be changed or deleted
SUPER_ADMIN_PROTECTED409The super admin's account can't be edited, deactivated or deleted
SUPER_ADMIN_ROLE_RESERVED409The Super Admin role belongs to one account. Choose another role; it can include every permission
SELF_CHANGE_NOT_ALLOWED409You can't do this to your own account or role
FAQ_ORDER_MISMATCH400The new order must list every FAQ exactly once. Refresh and try again
PACKAGE_NAME_TAKEN409Another package already has this name
PACKAGE_IN_USE409This package has subscriptions and can't be deleted. Deactivate it instead
REPORT_REASON_IN_USE409This reason is used by reports, so it can't be deleted. Deactivate it instead
REPORT_REASON_ORDER_MISMATCH400The order must list every report reason exactly once
PACKAGE_ORDER_MISMATCH400The new order must list every package exactly once. Refresh and try again
SUBSCRIPTION_QUEUE_FULL409You already have an upcoming subscription. You can subscribe again once it starts
STATISTICS_RANGE_INVALID400Invalid range: the start must not be after the end, and it can cover at most 366 days, 104 weeks or 36 months
CV_SECTION_FULL409This section is full (20 entries). Remove one to add another
CITY_NOT_FOUND400Choose a city from the list
SUBSCRIPTION_REQUIRED403Subscribe to a package to post jobs
JOB_POST_QUOTA_REACHED409You've used all the job posts in your package. It ends on {date}; subscribe to a new package to post more
JOB_ACTION_NOT_ALLOWED409This can't be done while the job is {status}
APPLICATION_ACTION_NOT_ALLOWED409This can't be done with the application in its current status
JOB_TERMS_LOCKED409The title and salary can't change once people have applied
JOB_CLOSED409This job is closed, so its applicants can't be contacted
VACANCIES_FILLED409All the vacancies for this job have been filled
CONVERSATION_CLOSED409This conversation is closed; you can read it but not send messages
JOB_NOT_AVAILABLE409This job is no longer available
ALREADY_APPLIED409You've already applied for this job
ALREADY_REPORTED409You've already reported this job. Thank you, our team will review it
ALREADY_RATED409You've already rated this employee for this job
MOBILE_CHANGE_NOT_ALLOWED403Your mobile number can't be changed. Contact us if you need help
CV_REQUIRED422Complete your CV to apply
AI_LIMIT_REACHED429You have reached today’s assistant message limit. You can continue tomorrow
AI_UNAVAILABLE503The assistant is unavailable right now. Please try again shortly
MOBILE_NOT_REGISTERED404This mobile number isn't registered. Create an account
MOBILE_ALREADY_REGISTERED409This mobile number is already registered. Sign in instead
MOBILE_UNCHANGED400This is already your mobile number. Enter a new one
OTP_INVALID400The verification code is incorrect. {remainingAttempts} attempts left
OTP_EXPIRED400The verification code has expired. Request a new one
OTP_TOO_MANY_ATTEMPTS429Too many incorrect attempts. Request a new code
OTP_RESEND_TOO_SOON429You can request a new code in {seconds} seconds
SMS_UNAVAILABLE503The message couldn't be sent. Please try again shortly
MAIL_UNAVAILABLE503The email couldn't be sent, so the reply wasn't saved. Try again later
REALTIME_UNAVAILABLE503Live updates are unavailable right now. Refresh to see changes
FILE_REQUIRED400No file was attached
FILE_TOO_LARGE413The file is larger than allowed ({maxMb} MB at most)
FILE_TYPE_NOT_ALLOWED415This file type isn't supported. Allowed: {allowed}
INTERNAL_ERROR500Something went wrong, please try again