WorkZone
API v1

WorkZone for developers

Read and add work in WorkZone from your own website, CRM, automation or AI assistant. A small JSON API over HTTPS, signed webhooks for the moment something happens, and an MCP server for AI tools.

Quick start

1. In WorkZone open System manager → API & webhooks → New key. Name it, choose Read only or Read and write, and copy the key - it is shown once.

2. Call the API with the key. The first call to try is /me: it shows the workspace, the key's scopes and who the key acts as.

curl https://mashhor-hub.com/api/agency/v1/me \
  -H "Authorization: Bearer wz_YOUR_KEY"

Authentication

Send the key as "Authorization: Bearer wz_..." or in an "X-WorkZone-Key" header. The key looks like wz_<16 hex>_<secret>. Only a hash of it is stored, so WorkZone cannot show it again - make a new key if it is lost.

A key acts as the person who made it, inside the workspace it was made in. Every call follows the same permission rules as the app, with that person's current level: a key can never do more than its maker can do today, and it stops working when they lose access or sign out everywhere. Scopes narrow it further: read (GET only) or write (also create and change tasks and receive work).

The API is part of the Professional and Enterprise plans. A paused workspace answers 403, and a workspace whose free trial has ended can read but not write (402).

Keep keys on your server, never in a web page or a mobile app.

Conventions

Base address: https://mashhor-hub.com/api/agency/v1. Answers are { "data": ..., "meta": ... } and errors are { "error": { "code", "message" } }. Dates are ISO 8601 (a due date is YYYY-MM-DD). Answers are never cached.

Rate limit: 120 calls a minute per key. Past it you get 429 and a Retry-After header (seconds).

Lists are paged: send limit (1-200, default 50) and page; the meta says total and pages.

Idempotency

Send an Idempotency-Key header (1-120 visible characters) with every POST and PATCH. If your call is retried with the same key within 24 hours, you get the first answer again (with "Idempotent-Replayed: true") and the work is created once. A call still being handled answers 409 in_progress.

Endpoints

Base address: https://mashhor-hub.com/api/agency/v1

GET /meread key

Who the key is. The workspace, the key's name and scopes, the person it acts as, and the webhook events that exist.

Example

curl https://mashhor-hub.com/api/agency/v1/me \
  -H "Authorization: Bearer wz_YOUR_KEY"

Answer

{
  "data": {
    "workspace": { "id": "acme", "name": "Acme" },
    "key": { "id": "3f9a0c1d2e4b5a67", "name": "Website", "scopes": ["read", "write"] },
    "actingAs": { "uid": "u_ali", "name": "Ali", "level": "admin" },
    "events": ["task.created", "task.updated", "..."]
  }
}

GET /projectsread key

List projects. The projects this key may see, by name. Archived ones only when you ask for them.

NameInTypeNeededDescription
statusquerystringOnly projects with this status (for example archived).

Example

curl https://mashhor-hub.com/api/agency/v1/projects \
  -H "Authorization: Bearer wz_YOUR_KEY"

Answer

{
  "data": [
    { "id": "p_4821", "name": "Oud Store", "client": "Oud Store", "type": null, "status": "active",
      "startDate": null, "endDate": null, "managerUid": "u_mona", "createdAt": "...", "updatedAt": "..." }
  ],
  "meta": { "count": 1 }
}

GET /peopleread key

List people. Everyone with access to the workspace. Use the uid to assign tasks.

Example

curl https://mashhor-hub.com/api/agency/v1/people \
  -H "Authorization: Bearer wz_YOUR_KEY"

Answer

{
  "data": [ { "uid": "u_mona", "name": "Mona", "title": "Account manager", "department": "Clients", "level": "manager" } ],
  "meta": { "count": 1 }
}

GET /tasksread key

List tasks. Tasks in the projects the key may see, the most recently changed first.

NameInTypeNeededDescription
projectIdquerystringOnly this project.
statusquerystringOne or more status keys, comma separated (todo,in_progress).
assigneequerystringOnly tasks assigned to this uid.
updatedSincequeryISO dateOnly tasks changed since then - the way to sync.
archivedquerytrueSend true to include archived tasks.
limitqueryinteger1-200, default 50.
pagequeryintegerPage number, from 1.

Example

curl https://mashhor-hub.com/api/agency/v1/tasks \
  -H "Authorization: Bearer wz_YOUR_KEY"

Answer

{
  "data": [ { "id": "8xKf2LmQ", "title": "Shoot the Eid story", "status": "todo", "...": "..." } ],
  "meta": { "total": 1, "page": 1, "limit": 50, "pages": 1 }
}

GET /tasks/:idread key

Get a task. One task with its description, estimate, checklist and requester. A task the key may not see answers 404.

NameInTypeNeededDescription
idpathstringyesThe task id.

Example

curl https://mashhor-hub.com/api/agency/v1/tasks/TASK_ID \
  -H "Authorization: Bearer wz_YOUR_KEY"

Answer

{
  "data": {
    "id": "8xKf2LmQ",
    "projectId": "p_4821",
    "title": "Shoot the Eid story",
    "status": "todo",
    "priority": "high",
    "dueDate": "2026-12-01",
    "startDate": null,
    "assignees": ["u_mona"],
    "labels": ["eid", "api"],
    "archived": false,
    "createdAt": "2026-11-07T09:12:44.000Z",
    "updatedAt": "2026-11-07T09:12:44.000Z",
    "completedAt": null,
    "source": "api",
    "url": "https://mashhor-hub.com/workzone/agency/projects/p_4821?task=8xKf2LmQ",
    "description": "",
    "estimateHours": 0,
    "checklist": [],
    "requester": null
  }
}

GET /eventsread key

Webhook events. The names of the events a webhook may listen to.

Example

curl https://mashhor-hub.com/api/agency/v1/events \
  -H "Authorization: Bearer wz_YOUR_KEY"

Answer

{ "data": ["task.created", "task.updated", "task.status_changed", "..."] }

POST /taskswrite key

Create a task. Creates a task in a project, as the key's person. The label "api" is added automatically. Answers 201 with the task.

NameInTypeNeededDescription
projectIdbodystringyesThe project id.
titlebodystringyesTask title, at least 2 characters.
descriptionbodystringLonger text.
statusbodystringA status key of the board.
prioritybodystringlow, normal, high or urgent.
dueDatebodyYYYY-MM-DDDue date.
startDatebodyYYYY-MM-DDStart date.
estimateHoursbodynumberEstimated hours.
labelsbodystring[]Labels.
assigneesbodystring[]People uids.
checklistbody{ text, done }[]Checklist items.

Example

curl -X POST https://mashhor-hub.com/api/agency/v1/tasks \
  -H "Authorization: Bearer wz_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{ "projectId": "p_4821", "title": "Shoot the Eid story", "priority": "high", "dueDate": "2026-12-01", "labels": ["eid"], "assignees": ["u_mona"] }'

Answer

{
  "data": {
    "id": "8xKf2LmQ",
    "projectId": "p_4821",
    "title": "Shoot the Eid story",
    "status": "todo",
    "priority": "high",
    "dueDate": "2026-12-01",
    "startDate": null,
    "assignees": ["u_mona"],
    "labels": ["eid", "api"],
    "archived": false,
    "createdAt": "2026-11-07T09:12:44.000Z",
    "updatedAt": "2026-11-07T09:12:44.000Z",
    "completedAt": null,
    "source": "api",
    "url": "https://mashhor-hub.com/workzone/agency/projects/p_4821?task=8xKf2LmQ",
    "description": "",
    "estimateHours": 0,
    "checklist": [],
    "requester": null
  }
}

PATCH /tasks/:idwrite key

Change a task. Changes only the fields you send (at least one). The same fields as when creating, without projectId.

NameInTypeNeededDescription
idpathstringyesThe task id.
title, description, status, priority, dueDate, startDate, estimateHours, labels, assignees, checklistbodyas aboveWhatever changes.

Example

curl -X PATCH https://mashhor-hub.com/api/agency/v1/tasks/TASK_ID \
  -H "Authorization: Bearer wz_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{ "status": "in_progress", "assignees": ["u_mona", "u_sara"] }'

Answer

{
  "data": {
    "id": "8xKf2LmQ",
    "projectId": "p_4821",
    "title": "Shoot the Eid story",
    "status": "todo",
    "priority": "high",
    "dueDate": "2026-12-01",
    "startDate": null,
    "assignees": ["u_mona"],
    "labels": ["eid", "api"],
    "archived": false,
    "createdAt": "2026-11-07T09:12:44.000Z",
    "updatedAt": "2026-11-07T09:12:44.000Z",
    "completedAt": null,
    "source": "api",
    "url": "https://mashhor-hub.com/workzone/agency/projects/p_4821?task=8xKf2LmQ",
    "description": "",
    "estimateHours": 0,
    "checklist": [],
    "requester": null
  }
}

POST /intakewrite key

Receive work (TRM). Logs work that arrived from outside - a form on your website, a message, a call - into TRM, where the workspace's automation gives it out by hours and skills. The same work sent twice within ten minutes becomes one task (200 with "duplicate": true); a new one answers 201.

NameInTypeNeededDescription
projectIdbodystringyesThe project the work belongs to.
titlebodystringyesWhat was asked.
detailsbodystringThe message or notes.
prioritybodystringlow, normal, high or urgent (default normal).
dueDatebodyYYYY-MM-DDDue date.
requesterbody{ name, email, phone, lang }Who asked (lang: ar or en).
assigneesbodystring[]Leave empty to let TRM give it out.

Example

curl -X POST https://mashhor-hub.com/api/agency/v1/intake \
  -H "Authorization: Bearer wz_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: $(uuidgen)" \
  -d '{ "projectId": "p_4821", "title": "Logo on the invoice", "details": "Sara asked on WhatsApp", "requester": { "name": "Sara", "phone": "+965 5000 0000", "lang": "ar" } }'

Answer

{ "data": { "duplicate": false, "id": "9aQ1xZ", "projectId": "p_4821", "assignedTo": "u_omar" } }

Errors

StatuscodeMeaning
400invalidA field is missing or wrong (the message says which).
401api_keyNo key, a malformed key, a wrong or revoked key, or its maker signed out everywhere.
402trial_endedThe free trial ended: reading still works, writing does not.
403scope / plan / switched_off / workspace_paused / maker_no_access / maker_view_onlyThe key may only read; or the API is not in the plan or is switched off; or the workspace is paused; or the key's maker lost access or is view-only.
404not_foundNo such task, or one this key may not see.
409in_progress / conflictA call with this Idempotency-Key is still being handled, or the work conflicts with one already received.
429rate_limitedMore than 120 calls in a minute. Wait for Retry-After seconds.
500errorSomething went wrong on our side. Retry with the same Idempotency-Key.
{ "error": { "code": "scope", "message": "This key may only read. Make a key with the write scope." } }

Webhooks

A webhook tells your system the moment something happens. In System manager → API & webhooks → New webhook, give an https address and choose the events. Copy the signing secret (whsec_...) - it is shown once; "Rotate" makes a new one.

The address must be https (port 443 or 8443), with no user name or password, and must not point at a private network. WorkZone checks it again on every delivery and never follows redirects. Your server must answer within 10 seconds with any 2xx status.

Every message is a POST with a JSON body { id, event, createdAt, workspace, data } and the headers X-WorkZone-Event, X-WorkZone-Delivery, X-WorkZone-Timestamp (unix seconds) and X-WorkZone-Signature: v1=<hex HMAC-SHA256 of timestamp + "." + body, with your secret>. Verify it on the RAW body before you trust the message.

A failed delivery is tried again after 1 minute, 5 minutes, 30 minutes, 2 hours and 6 hours (six tries in all). After 10 deliveries in a row fail for good, the webhook switches itself off and says why. The Log shows every message with its answer; "Test" sends a ping and "Send again" retries one. Use X-WorkZone-Delivery to ignore a message you already handled.

Events

task.createdtask.updatedtask.status_changedtask.completedtask.deletedtask.approvedtask.changes_requestedintake.receivedrequest.createdrequest.updatedcontent.client_answered

A message

{
  "id": "d_7Qm2",
  "event": "task.status_changed",
  "createdAt": "2026-11-07T09:30:00.000Z",
  "workspace": "acme",
  "data": {
    "id": "8xKf2LmQ", "projectId": "p_4821", "title": "Shoot the Eid story",
    "status": "done", "changed": ["status"], "by": { "uid": "u_mona", "name": "Mona" }
  }
}

Verify the signature - Node.js

const crypto = require('crypto');

// raw = the request body EXACTLY as received (do not parse and re-serialise it)
function verify(secret, headers, raw, toleranceSeconds = 300) {
  const ts = headers['x-workzone-timestamp'];
  const sig = headers['x-workzone-signature'];            // "v1=<hex>"
  if (!ts || !sig) return false;
  if (Math.abs(Date.now() / 1000 - Number(ts)) > toleranceSeconds) return false;   // too old: a replay
  const expected = 'v1=' + crypto.createHmac('sha256', secret).update(ts + '.' + raw).digest('hex');
  const a = Buffer.from(sig), b = Buffer.from(expected);
  return a.length === b.length && crypto.timingSafeEqual(a, b);
}

Verify the signature - Python

import hmac, hashlib, time

def verify(secret: str, headers: dict, raw: bytes, tolerance=300) -> bool:
    ts = headers.get("X-WorkZone-Timestamp")
    sig = headers.get("X-WorkZone-Signature", "")        # "v1=<hex>"
    if not ts or abs(time.time() - int(ts)) > tolerance:
        return False
    expected = "v1=" + hmac.new(secret.encode(), ts.encode() + b"." + raw, hashlib.sha256).hexdigest()
    return hmac.compare_digest(sig, expected)

MCP

WorkZone runs its own MCP server, so Claude, ChatGPT, Cursor and other AI apps can work with your projects and tasks. Connect once with your WorkZone account - no key to copy - and ask in plain words. The app sees only what YOU can see, it can only read until your company allows changes, and you can disconnect it any time.

Set up the WorkZone MCP server