TrackMe API Docs
Flow guides

Jobs — Post, Publish, Hire

How truck owners post staffing listings that go live instantly, optionally promote them with a paid term, and hire — and how job-seekers discover, apply to, and track jobs.

The Jobs domain is the food-truck staffing feature. Truck owners post listings and hire; customers / job-seekers discover listings, apply, and chat. Everything lives under /api/v1 with the standard { data, meta } / { error, meta } envelope.

There are three surfaces:

  1. Public discovery — GET /api/v1/jobs and GET /api/v1/jobs/:id. Anonymous-allowed. These only ever return live listings (active, not soft-deleted, not expired).
  2. Applicant surface — POST /api/v1/jobs/:id/apply, POST /api/v1/jobs/:id/contact, GET /api/v1/jobs/applications, POST /api/v1/jobs/applications/:id/withdraw. Bearer token required.
  3. Owner CRUD + hiring — /api/v1/owner/*. Bearer token + active owner membership: create, edit, soft-delete, list applicants, accept / reject / message / annotate, and the optional paid publish/renew. A parallel customer-facing paid surface lives under /api/v1/job-advertising/*.

Admin moderation endpoints are covered in the Admin guide and the generated API reference; this flow focuses on the applicant and owner sequence.

Auth & headers on every call: non-public calls send Authorization: Bearer <oat_...>. Owner endpoints additionally require an active owner membership (else 403 FORBIDDEN). Send Accept-Language: ar for Arabic title/description/error/notification copy; add ?include=translations to discovery reads for the { en, ar } per-field map. All wire timestamps are UTC ISO-8601 with a trailing Z. Money fields (hourlyRateMinMinor, hourlyRateMaxMinor, totalAmountMinor) are integers in the currency's minor unit (e.g. halalas), never major-unit decimals.

Response envelope is always one of:

{ "data": { /* payload */ }, "meta": { "requestId": "req_01..." } }
{ "error": { "code": "CONFLICT", "message": "..." }, "meta": { "requestId": "req_01..." } }

Creating a job AUTO-PUBLISHES it. There is no draft gate.

POST /api/v1/owner/jobs sets status: "active", publishedAt: now, no expiresAt, and indexes the post for search — the listing is live and accepting applications the moment it is created. No payment is required for visibility.

Two integration rules follow from that behavior:

  • Do not build a "pay to go live" step into the create flow. There is no draft in the current owner-create path.
  • The paid POST /api/v1/owner/jobs/:id/publish and /renew flows are now optional promotion/featuring steps that attach a paid activation (and a real expiresAt window). Calling publish on a freshly-created job returns 409 "Job is already published." — see Implementation notes.

The flow at a glance

Owner: post → (optional) promote → hire

Step 1 — Create the job (goes live immediately)

POST /api/v1/owner/jobs with the listing fields. Response is the full job with status: "active" and a non-null publishedAt. It is already discoverable. End the flow here if no paid promotion is required.

Step 2 — (Optional) Edit

PATCH /api/v1/owner/jobs/:id. Same fields as create, all partial. You cannot change truckId once the job is active or has ever been published (409, field truckId).

Step 3 — (Optional) Start the paid promotion

POST /api/v1/owner/jobs/:id/publish with { "durationDays": 30 }. Returns { paymentOrder, clientSecret, immediatelyActivated }. Feed clientSecret to the native Paymob SDK. The response is pending; settlement is not confirmed yet. (Equivalent entry point: POST /api/v1/job-advertising/payment-orders.)

Step 4 — Wait for the webhook, then poll

After the Paymob sheet closes, re-poll GET /api/v1/job-advertising/payment-orders/:id (or re-read GET /api/v1/owner/jobs/:id). The payment webhook — not the sheet, not the create response — is the source of truth; only on confirmation does the activation handler set publishedAt / expiresAt / paidActivationId.

Step 5 — Review applicants and hire

GET /api/v1/owner/jobs/:id/applicants lists candidates. Per applicant: POST /api/v1/owner/applications/:applicationId/accept, .../reject, or .../message (opens a hiring chat). Optionally attach a private note + 1–5 score with POST /api/v1/owner/jobs/:jobId/applications/:appId/note.

Applicant: discover → apply / contact → track

Step 1 — Discover

GET /api/v1/jobs (filter by ?city=, ?type=, free-text ?search= / ?q=, ?limit=). Read detail with GET /api/v1/jobs/:id. Both only ever return live jobs.

Step 2 — Apply and/or contact

POST /api/v1/jobs/:id/apply creates a pending application (one per applicant per job). POST /api/v1/jobs/:id/contact reveals the owner's WhatsApp/phone/email and opens a hiring chat.

Step 3 — Track and withdraw

GET /api/v1/jobs/applications is your inbox. While still pending, you can POST /api/v1/jobs/applications/:id/withdraw. When the owner accepts or rejects, you get a localized push/inbox notification.

Endpoint detail

Discover live jobs — GET /api/v1/jobs

Anonymous-allowed. Returns only status: "active" jobs that are not soft-deleted and whose expiresAt is null or in the future, ordered by publishedAt desc.

Query params: ?city=, ?type= (full_time | part_time | contract | seasonal), ?search= (alias ?q=, 1–100 chars, case-insensitive partial across title + description incl. Arabic translations), ?limit= (default 20, max 50). Bad query → 422 VALIDATION_ERROR.

GET /api/v1/jobs?city=Riyadh&type=part_time&q=cook&limit=20 HTTP/1.1
Accept-Language: en
{
  "data": {
    "items": [
      {
        "id": "job_01jq8zk1a3c5e7g9j1l3n5p7q9",
        "ownerId": "usr_01...",
        "truckId": "trk_01...",
        "title": "Line Cook — Smash Burger Specialist",
        "type": "part_time",
        "hourlyRateMinMinor": 4500,
        "hourlyRateMaxMinor": 6500,
        "currencyCode": "SAR",
        "city": "Riyadh",
        "schedule": "Thu–Sun evenings, 5pm–1am.",
        "description": "Join our peak-night brigade.",
        "requirements": ["1+ year line experience"],
        "status": "active",
        "langActual": "en",
        "publishedAt": "2026-06-21T09:00:00.000Z",
        "expiresAt": null,
        "createdAt": "2026-06-21T09:00:00.000Z"
      }
    ]
  },
  "meta": { "requestId": "req_01..." }
}

Public job detail — GET /api/v1/jobs/:id

Anonymous-allowed. Returns the job only if it is active + not deleted + not expired; otherwise 404 NOT_FOUND. Draft/suspended/expired/archived/soft-deleted jobs are invisible here even to someone holding a valid id — do not deep-link from a stale cache and assume it resolves.

List my applications — GET /api/v1/jobs/applications

Bearer. The applicant's own inbox. Registered before /jobs/:id server-side so the literal applications segment is never read as a job id (if you build URLs by hand, never send applications as a job id). 401 if unauthenticated.

{
  "data": {
    "items": [
      {
        "id": "japp_01...",
        "jobId": "job_01...",
        "status": "pending",
        "experienceYears": 3,
        "coverMessage": "Two years at Section-B.",
        "appliedAt": "2026-06-21T10:00:00.000Z",
        "acceptedAt": null,
        "rejectedAt": null,
        "withdrawnAt": null
      }
    ]
  },
  "meta": { "requestId": "req_01..." }
}

Apply to a job — POST /api/v1/jobs/:id/apply

Bearer. Body is all-optional: experienceYears (0–70), coverMessage (≤2000), preferredContactMethod (whatsapp | email | phone | message). Success returns 201 (not 200) with the created application.

POST /api/v1/jobs/job_01.../apply HTTP/1.1
Authorization: Bearer oat_...
Content-Type: application/json

{ "experienceYears": 3, "coverMessage": "References on request.", "preferredContactMethod": "whatsapp" }
{
  "data": {
    "application": {
      "id": "japp_01...",
      "jobId": "job_01...",
      "status": "pending",
      "appliedAt": "2026-06-21T10:00:00.000Z",
      "preferredContactMethod": "whatsapp"
    }
  },
  "meta": { "requestId": "req_01..." }
}

Errors: 401 if unauthenticated; 404 if the job is missing or soft-deleted; 409 CONFLICT if the job is not active (not accepting); 403 FORBIDDEN (code JOB_OWN_APPLICATION_FORBIDDEN) if you own the job; 409 CONFLICT if you already applied (one application per applicant per job); 422 on body validation.

Created status is pending — the model enum is pending | accepted | rejected | withdrawn.

Reveal owner contact + open chat — POST /api/v1/jobs/:id/contact

Bearer. Find-or-creates a type: "hiring" conversation contextualised on the job and returns the owner's contact channels so the app can render the WhatsApp/phone/email/message sheet. Business-profile values are preferred, falling back to the owner user's phone/email. 404 if the job is not live; 409 if you try to contact your own job.

{
  "data": {
    "conversationId": "conv_01...",
    "owner": {
      "id": "usr_01...",
      "businessName": "Salt & Smoke",
      "phone": "+9665...",
      "email": "[email protected]"
    }
  },
  "meta": { "requestId": "req_01..." }
}

Withdraw my application — POST /api/v1/jobs/applications/:id/withdraw

Bearer (must be the applicant). :id is the application id. Sets status: "withdrawn" + withdrawnAt. 404 if it does not exist or belongs to another user (ownership leak masked as 404 — do not treat 404 as "definitely deleted"). 409 if the application is no longer pending (owner already decided).

List my jobs (owner) — GET /api/v1/owner/jobs

Bearer + active owner. Lists every non-deleted job the owner posted — any status except soft_deleted (so active, expired, archived, suspended), ordered createdAt desc. 403 if the caller is not an active owner.

Create a job — POST /api/v1/owner/jobs

Bearer + active owner. Auto-publishes (see the warning at the top). Body:

FieldRequiredNotes
titleyes2–200 chars
typeyesfull_time | part_time | contract | seasonal
hourlyRateMinMinor / hourlyRateMaxMinornointeger minor units, ≥ 0
currencyCodeno3-letter, default SAR
cityno≤ 80 chars
scheduleno≤ 200 chars
descriptionno≤ 5000 chars
requirements[]no≤ 50 items, each ≤ 200 chars
experienceLevelno≤ 24 chars
truckIdnothe truck this job belongs to
translations.ar.{title,description}noArabic copy
POST /api/v1/owner/jobs HTTP/1.1
Authorization: Bearer oat_...
Content-Type: application/json

{
  "title": "Line Cook — Smash Burger Specialist",
  "type": "part_time",
  "hourlyRateMinMinor": 4500,
  "hourlyRateMaxMinor": 6500,
  "currencyCode": "SAR",
  "city": "Riyadh",
  "requirements": ["1+ year line experience"],
  "truckId": "trk_01..."
}

201 returns the full job with status: "active", a non-null publishedAt, and expiresAt: null. Errors: 401, 403 (not an active owner), 422 (validation).

Update a job — PATCH /api/v1/owner/jobs/:id

Bearer + active owner + ownership. Partial body, same fields as create. 409 CONFLICT (field truckId) if you try to change truckId once the job is active or has ever been published — paid placement is bound to its truck; create a fresh post instead. 404 if not found/not owned, 403 if not the owner, 422 on validation.

Soft-delete a job — DELETE /api/v1/owner/jobs/:id

Bearer + active owner + ownership. Sets status: "soft_deleted" + deletedAt and removes it from search. Returns { "success": true }. Reversible only by admin restore — not by the owner.

Start the paid promotion — POST /api/v1/owner/jobs/:id/publish

Bearer + active owner + publish policy. Body: durationDays (1–365, required), currencyCode (optional). Delegates to job-advertising → creates a Paymob payment order.

POST /api/v1/owner/jobs/job_01.../publish HTTP/1.1
Authorization: Bearer oat_...
Content-Type: application/json

{ "durationDays": 30, "currencyCode": "SAR" }
{
  "data": {
    "paymentOrder": {
      "id": "pord_01...",
      "orderNumber": "JA-2026-000123",
      "status": "pending",
      "totalAmountMinor": 9000,
      "currencyCode": "SAR",
      "gateway": "paymob",
      "gatewayReference": "..."
    },
    "clientSecret": "csk_...",
    "immediatelyActivated": false
  },
  "meta": { "requestId": "req_01..." }
}

clientSecret feeds the native Paymob SDK. It is null on the zero-price path, where immediatelyActivated is true — skip the payment sheet entirely.

409 on an already-active job is expected. Because create auto-publishes to active, calling publish on a freshly-created job returns 409 "Job is already published." publish/renew are for promotion/featuring + a real expiry window, never first-time visibility. Also 409 if the job is suspended or soft_deleted.

Paid placement is not confirmed by this response. The order comes back pending with immediatelyActivated: false. publishedAt / expiresAt / paidActivationId are set only after the gateway webhook confirms — see Payments. Do not assume settlement from the create response.

Renew the paid term — POST /api/v1/owner/jobs/:id/renew

Bearer + active owner + renew policy. Body: durationDays (1–365), currencyCode optional. 409 if the job was never published (publishedAt is null) or is suspended/soft_deleted. Unused days from the current paid term carry over. Same payment-order envelope + webhook-confirmation model as publish.

List applicants (owner) — GET /api/v1/owner/jobs/:id/applicants

Bearer + active owner + applicants policy. Ordered appliedAt desc.

{
  "data": {
    "items": [
      {
        "id": "japp_01...",
        "applicantId": "usr_01...",
        "applicant": {
          "id": "usr_01...",
          "fullName": "Mona K.",
          "avatar": { "original": "...", "thumb": "...", "medium": "...", "large": "..." },
          "phone": "+9665..."
        },
        "status": "pending",
        "experienceYears": 3,
        "coverMessage": "References on request.",
        "preferredContactMethod": "whatsapp",
        "appliedAt": "2026-06-21T10:00:00.000Z"
      }
    ]
  },
  "meta": { "requestId": "req_01..." }
}

applicant is null if the account was deleted.

Accept / reject an applicant

POST /api/v1/owner/applications/:applicationId/accept and .../reject. Bearer + active owner + application policy. Pending-only — 409 otherwise (guards double-transition and the race against a withdraw). Accept sets status: "accepted" + acceptedAt; reject sets status: "rejected" + rejectedAt. Both notify the applicant. 404 if the application is missing, 403 if not the job owner.

Message an applicant — POST /api/v1/owner/applications/:applicationId/message

Bearer + active owner + application policy. Find-or-creates a type: "hiring" conversation contextualised on the job (contextType: "job_post"). Returns { conversationId, applicantId }. Independent of accept/reject — you can message a still-pending applicant. 404 if the application is missing; 409 if the underlying job no longer exists.

Annotate an applicant — POST /api/v1/owner/jobs/:jobId/applications/:appId/note

Bearer + active owner + application policy. Body: note (1–2000 chars) and/or score (1–5) — at least one is required, else 409 CONFLICT (code EMPTY_PATCH). Private owner triage; never surfaced to the applicant. Audit-logged. 404 if the application is missing, 422 on validation.

Job-advertising paid surface — /api/v1/job-advertising/*

The customer-facing side of the same paid activation. Use these or the owner publish/renew shortcuts — they create the same kind of order, settled by the same webhook.

Method & pathAuthPurpose
GET /api/v1/job-advertising/pricingpublicActive pricing rows used to compute publish/renew cost.
POST /api/v1/job-advertising/quoteBearerQuote the cost for { targetId, durationDays, currencyCode } before ordering. 409/422 on invalid target/duration.
POST /api/v1/job-advertising/payment-ordersBearerCreate an order. 201 returns { paymentOrder, clientSecret, immediatelyActivated } — same shape + webhook semantics as owner publish.
GET /api/v1/job-advertising/payment-orders/:idBearer (owner)Poll order status after the sheet closes. The webhook, not the sheet, flips the order. 403 if not yours, 404 if missing.
POST /api/v1/job-advertising/payment-orders/:id/cancelBearer (owner)Cancel a pending order. 409 otherwise.
GET /api/v1/job-advertising/activationsBearerThe caller's confirmed paid placements with start/expiry windows.

targetId is the job id. See Payments for the full Paymob + webhook lifecycle.

Lifecycle

Job post states

StateMeaningHow you got hereWhat's allowed next
activeLive + discoverable; accepting applicationsCreate (auto-publish), or admin restore, or paid activation confirmededit, soft-delete, paid promote (renew; publish 409s while active), apply/contact (applicants), natural expiry/refund, admin suspend
expiredPaid term ended — dropped from searchNatural expiry of a paid activationrenew (re-promote), edit, soft-delete
archivedPaid activation refunded — dropped from searchRefund of the paid activationsoft-delete
suspendedHidden from discovery by a moderator (owner still sees it)Admin suspendadmin restore
soft_deletedHidden everywhere; removed from searchDELETE /api/v1/owner/jobs/:id (or admin)admin restore only
draft / pending_paymentLegacy states; not produced by the current create flow——

draft and pending_payment exist in the model enum but the current create path never lands there — every owner-created job is born active.

Application states

StateMeaningHow you got hereWhat's allowed next
pendingAwaiting owner decisionPOST /api/v1/jobs/:id/applyowner accept/reject, applicant withdraw, owner message/note
acceptedOwner hired this applicantPOST .../acceptterminal (owner may still message)
rejectedOwner declinedPOST .../rejectterminal (owner may still message)
withdrawnApplicant pulled outPOST /api/v1/jobs/applications/:id/withdrawterminal

Transitions

Job post

  • (none) → active — POST /api/v1/owner/jobs (create auto-publishes: status=active, publishedAt=now, no expiry). Actor: owner.
  • active / expired / never-active → active (paid term) — POST .../publish or POST /api/v1/job-advertising/payment-orders → webhook confirm → activation handler sets publishedAt/expiresAt/paidActivationId. Actor: owner + gateway webhook.
  • active → active (extended expiresAt) — POST .../renew → webhook confirm. Actor: owner + gateway webhook.
  • active (paid term) → expired — natural expiry; drops from search. Actor: system.
  • active (paid term) → archived — refund of the paid activation; drops from search. Actor: system.
  • any owned → soft_deleted — DELETE /api/v1/owner/jobs/:id. Actor: owner.
  • active → suspended → active|expired — admin suspend/restore. Actor: admin.

Application

  • (none) → pending — POST /api/v1/jobs/:id/apply.
  • pending → accepted — POST .../accept (applicant notified).
  • pending → rejected — POST .../reject (applicant notified).
  • pending → withdrawn — POST /api/v1/jobs/applications/:id/withdraw.

Implementation Notes

Integration issueCorrect handling
Building a "create draft → pay to go live" flowCreate auto-publishes. The job is live on 201. Drop the draft step entirely.
Calling publish right after create and treating the 409 as an error conditionThe job is already active. Treat publish/renew as optional promotion; expect 409 on already-active jobs.
Treating the publish/order response as "paid + live"The order is pending, immediatelyActivated: false. Re-poll GET /api/v1/job-advertising/payment-orders/:id (or the job) after the sheet closes — the webhook confirms, not the response.
Always opening the Paymob sheetWhen immediatelyActivated: true, clientSecret is null (zero-price path) — skip the sheet, treat it as applied.
Expecting application status "submitted"The wire value on apply is "pending".
Deep-linking a cached job id to GET /jobs/:idPublic reads return only live jobs; a draft/suspended/expired/archived/soft-deleted job 404s even with a valid id.
Treating apply 404 and 409 the same404 = job missing/soft-deleted; 409 = exists but not active. Message accordingly.
Reassigning truckId on PATCH after publish409 (field truckId) once active or ever published — force a new post.
Retrying a 409 on accept/reject/withdrawTransitions are pending-only and racy. A withdraw racing an owner accept means one side gets 409 — handle as "already decided" and refresh, do not retry.
Reading a withdraw 404 as "deleted"404 also means the application belongs to someone else (ownership masked as 404).
Sending applications as a job id when building URLs/jobs/applications is matched before /jobs/:id server-side — never put the literal applications in the :id slot.
Showing apply/contact on the owner's own jobSelf-apply → 403 JOB_OWN_APPLICATION_FORBIDDEN; self-contact → 409. Hide those affordances when the viewer is the owner.
Calling note with neither note nor score409 EMPTY_PATCH — send at least one. Note/score are private and never returned to the applicant.
Treating money fields as decimalshourlyRate*Minor / totalAmountMinor are integer minor units (e.g. halalas).
Computing local times from the wireWire timestamps are always UTC with Z. Use Accept-Language: ar for Arabic copy and ?include=translations for the { en, ar } map; X-Timezone only affects any server-rendered display strings.
  • Payments — the Paymob payment-order + webhook lifecycle that confirms paid promotions.
  • Profile & Preferences — how a user becomes an active owner before they can post jobs.
  • API reference — full request/response schemas for every endpoint above.

On this page