Developers

OneDesk API

Connect an e-shop, an ERP or your own code to your team’s conversations, tasks and email, or connect OneDesk to thousands of apps through Zapier, Make or n8n. Base address: https://app.onedesk.gr/api/v1 · OpenAPI description

Start in a minute

1. In OneDesk, an admin: Settings → API and webhooks → Organization keys → Create key. Name it after the system that will use it, give it only the rights and inboxes it needs.

2. Send it with every request:

curl -H "Authorization: Bearer ti_…" https://app.onedesk.gr/api/v1/conversations?view=unassigned

Errors come back as {"error": "…", "code": "…"} (code when there is one) with a 4xx status, or 5xx if something broke on our side. The API and webhooks are part of the Team and Business plans. /api/v1 only changes in ways that don’t break callers: new endpoints, new fields, new optional parameters.

Keys and scopes

Organization keys (made by an admin) are for systems — an e-shop, an ERP, a sync job. A key belongs to the organization, not to a person, so it keeps working when people leave; it isn’t a paid user; it sees the shared inboxes it was given (all unrestricted ones, or a list). What it writes shows the key’s name. Personal tokens act as the person who made them and see what they see — for your own scripts.

readLook only: every GET.
writeAlso work on conversations: notes, assign, labels, close and reopen, read state, tasks, REST hooks. Not sending.
fullEverything above, sending included. Never: managing people, keys, webhooks, integrations or settings.

Limits and safe retries

Rate limit. Each key has a bucket of 120 requests that refills at 2 a second (about 120 a minute); sending an email takes 10. Every answer says what’s left in X-RateLimit-Remaining. Over the limit you get 429 with Retry-After (seconds): wait that long and try again.

Idempotency. Network trouble can make you retry a request that actually went through. Add an Idempotency-Key header (any unique string, e.g. your invoice number) to POST, PUT, PATCH and DELETE requests: for 24 hours, the same key on the same endpoint gets the first answer again, marked Idempotent-Replayed: true, instead of doing it twice.

curl -X POST https://app.onedesk.gr/api/v1/send   -H "Authorization: Bearer ti_…" -H "Content-Type: application/json"   -H "Idempotency-Key: invoice-2026-001542"   -d '{"accountId": 5, "to": "customer@example.com", "subject": "Invoice 001542", "html": "<p>Attached…</p>"}'

Account

GET/meread

Who this token belongs to, and its organization.

Answer
{
  "id": 2,
  "name": "Maria",
  "email": "maria@example.com",
  "role": "admin",
  "org": {
    "id": 1,
    "name": "Example"
  },
  "tokenScope": "write"
}
GET/usersread

Teammates in the organization.

Answer
[
  {
    "id": 2,
    "name": "Maria",
    "email": "maria@example.com",
    "role": "admin"
  }
]
GET/inboxesread

Inboxes you can read and send from (team and your personal ones).

Answer
[
  {
    "id": 5,
    "email": "support@example.com",
    "name": "Support",
    "kind": "shared"
  }
]
GET/labelsread

Labels of the organization.

Answer
[
  {
    "id": 3,
    "name": "VIP",
    "color": "#E5484D"
  }
]

Conversations

GET/conversationsread

List conversations, newest first, 50 at a time. An email sent to several of your inboxes is one conversation, in each of them: accountId is its first inbox, accountIds all of them.

viewinbox, assigned_me, unassigned, assigned_others, snoozed, closed, sent, starred, mentions, label, search
accountOnly this inbox
labelWith view=label
qSearch words
beforeThe "cursor" of the previous page
Answer
{
  "items": [
    {
      "id": 123,
      "accountId": 5,
      "accountIds": [
        5,
        8
      ],
      "subject": "Order 1015",
      "snippet": "Hello, where is…",
      "status": "open",
      "assignees": [
        2
      ],
      "labels": [
        3
      ],
      "unread": true,
      "lastMessageAt": "2026-10-04T09:00:00.000Z",
      "tasks": {
        "open": 1,
        "total": 2,
        "due": "2026-10-09"
      }
    }
  ],
  "more": true,
  "cursor": "2026-10-04T08:00:00.000Z|120"
}
GET/conversations/{id}read

One conversation: its emails, team notes, history, tasks and drafts. In long threads the older emails come with a short text and "partial": true — ask with ?bodies=all for every email in full, or get one with GET /messages/{id}.

bodies"all": every email with its full text and HTML
Answer
{
  "id": 123,
  "subject": "Order 1015",
  "messages": [
    {
      "id": 456,
      "fromName": "Customer",
      "fromEmail": "customer@example.com",
      "date": "2026-10-04T09:00:00.000Z",
      "direction": "in",
      "text": "Hello…",
      "html": "<p>Hello…</p>",
      "attachments": [
        {
          "id": 9,
          "filename": "invoice.pdf",
          "contentType": "application/pdf",
          "size": 52000
        }
      ]
    }
  ],
  "comments": [],
  "events": [],
  "taskList": []
}
POST/conversations/{id}/statuswrite

Archive (closed), reopen (open), or close as its assignees do (done: stays in the Inbox, faded, until archived; archives when nobody is assigned). The answer says which it did.

Body
{
  "status": "closed"
}
Answer
{
  "ok": true,
  "status": "closed"
}
PUT/conversations/{id}/assigneeswrite

Set who it’s assigned to (an empty list unassigns).

Body
{
  "userIds": [
    2,
    4
  ]
}
Answer
{
  "ok": true
}
PUT/conversations/{id}/duewrite

Set its due date: a day and, optionally, a time (HH:MM) in the organization’s time zone; date null removes it. The assignees (else whoever set it) are reminded an hour before, or at 9:00 that day for a day alone. Archiving or closing clears it. Conversations carry dueDate, dueTime and dueAt.

Body
{
  "date": "2026-10-17",
  "time": "14:00"
}
Answer
{
  "ok": true,
  "dueDate": "2026-10-17",
  "dueTime": "14:00",
  "dueAt": "2026-10-17T11:00:00.000Z"
}
PUT/conversations/{id}/labelswrite

Set its labels.

Body
{
  "labelIds": [
    3
  ]
}
Answer
{
  "ok": true
}
POST/conversations/{id}/snoozewrite

Snooze until a time (or "until": null to end it).

Body
{
  "until": "2026-10-09T07:00:00Z"
}
Answer
{
  "ok": true
}
POST/conversations/{id}/readwrite

Mark as read or unread for the token’s owner.

Body
{
  "read": true
}
Answer
{
  "ok": true
}
POST/conversations/{id}/commentswrite

Write a team note (only the team sees it). Mentioned people are notified.

Body
{
  "body": "Called the customer, all good.",
  "mentions": [
    4
  ]
}
Answer
{
  "id": 77
}
GET/contacts/{email}read

A contact’s name and their conversations with you.

Answer
{
  "name": "Customer",
  "stats": {
    "messages": 4
  },
  "conversations": [
    {
      "id": 123,
      "subject": "Order 1015"
    }
  ]
}

Emails

GET/messagesread

Emails (and messages from other systems) in the inboxes you can see. Newest first, to look through or search them; or, with "after", every email stored after a known one, oldest first — to follow new email from an ERP or a sync job. Each comes with its files; with bodies=true also its text and HTML. "folder" is where the email is on the mail server: inbox, archive, sent, junk, trash (null for messages from other systems).

afterFollow mode: emails stored after this message id, oldest first. Start with 0 (everything) or the newest id you have; the answer’s "after" is the value for next time.
qWords to find (as in /search); each email found has an "excerpt"
inboxInbox ids
conversationIdOnly this conversation
directionin (received) or out (sent)
fromSenders: addresses or domains
toRecipients (To or Cc): addresses or domains
sinceSent on or after this day or time
untilUp to this day (inclusive) or before this time
bodiestrue: include "text" and "html" (25 a page at most)
limitHow many: 50 by default, 100 at most (25 with bodies)
cursorNewest-first mode: the "cursor" of the previous page
Answer
{
  "items": [
    {
      "id": 456,
      "conversationId": 123,
      "inboxId": 5,
      "direction": "in",
      "folder": "inbox",
      "fromName": "Customer",
      "fromEmail": "customer@example.com",
      "to": [
        {
          "name": "Support",
          "email": "support@example.com"
        }
      ],
      "cc": [],
      "replyTo": null,
      "subject": "Order 1015",
      "date": "2026-10-04T09:00:00.000Z",
      "internetMessageId": "<CA+abc@mail.example.com>",
      "inReplyTo": null,
      "snippet": "Hello, where is my order?",
      "attachments": [
        {
          "id": 9,
          "filename": "invoice.pdf",
          "contentType": "application/pdf",
          "size": 52000,
          "inline": false,
          "cid": null,
          "url": "https://app.onedesk.gr/api/v1/attachments/9"
        }
      ],
      "sentByUserId": null
    }
  ],
  "more": true,
  "after": 456
}
GET/messages/{id}read

One email in full: addresses, its text and HTML, and every file — pictures inside the HTML too ("inline": true; the HTML already points at their "url", which needs your token like any request).

Answer
{
  "id": 456,
  "conversationId": 123,
  "inboxId": 5,
  "direction": "in",
  "folder": "inbox",
  "fromName": "Customer",
  "fromEmail": "customer@example.com",
  "to": [
    {
      "name": "Support",
      "email": "support@example.com"
    }
  ],
  "cc": [],
  "replyTo": null,
  "subject": "Order 1015",
  "date": "2026-10-04T09:00:00.000Z",
  "internetMessageId": "<CA+abc@mail.example.com>",
  "inReplyTo": null,
  "snippet": "Hello, where is my order?",
  "text": "Hello, where is my order?\n\nMaria",
  "html": "<p>Hello, where is my order?</p><p>Maria</p>",
  "attachments": [
    {
      "id": 9,
      "filename": "invoice.pdf",
      "contentType": "application/pdf",
      "size": 52000,
      "inline": false,
      "cid": null,
      "url": "https://app.onedesk.gr/api/v1/attachments/9"
    }
  ],
  "sentByUserId": null
}
GET/attachments/{id}read

Download a file, as it came. If the conversation was closed long ago, OneDesk may first fetch it from the mail server again.

Answer

The file itself (application/octet-stream), with its name in Content-Disposition.

GET/messages/{id}/emlread

The original email (.eml, RFC 822) as the mail server keeps it, headers and all — to archive it in your ERP or document system. It’s fetched from the mail server, so it counts as 5 requests. Not for messages from other systems (404).

Answer

The file itself (message/rfc822), with its name in Content-Disposition.

Tasks

GET/tasksread

Your open tasks (and those done in the last day). Admins: ?scope=everyone.

scopemine (default) or everyone
Answer
{
  "today": "2026-10-04",
  "tasks": [
    {
      "id": 9,
      "conversationId": 123,
      "text": "Send the invoice",
      "assigneeId": 2,
      "due": "2026-10-09",
      "doneAt": null,
      "subject": "Order 1015"
    }
  ]
}
GET/conversations/{id}/tasksread

A conversation’s tasks.

Answer
[
  {
    "id": 9,
    "text": "Send the invoice",
    "assigneeId": 2,
    "due": "2026-10-09",
    "doneAt": null
  }
]
POST/conversations/{id}/taskswrite

Add a task. Without assigneeId it goes to whoever the conversation is assigned to.

Body
{
  "text": "Send the invoice",
  "assigneeId": 2,
  "due": "2026-10-09"
}
Answer
{
  "id": 9,
  "conversationId": 123,
  "text": "Send the invoice",
  "assigneeId": 2,
  "due": "2026-10-09",
  "doneAt": null
}
PATCH/tasks/{id}write

Tick, untick or change a task.

Body
{
  "done": true
}
Answer
{
  "id": 9,
  "doneAt": "2026-10-05T10:00:00.000Z"
}
DELETE/tasks/{id}write

Remove a task.

Answer
{
  "ok": true
}

Messages from other systems

POST/messageswrite

Put a message from another system — a contact form, an ERP alert, a shop event — into a shared inbox, as a conversation the team handles like an email. With "from", replies go by email to that address. Messages with the same "thread" in the same inbox join one conversation (reopening it if closed). Attachments as base64: up to 10 files, 15 MB in all.

Body
{
  "inboxId": 5,
  "from": {
    "name": "Γιώργος Παπαδάκης",
    "email": "george@example.com"
  },
  "subject": "Φόρμα επικοινωνίας: ερώτηση για παραγγελία",
  "text": "Καλησπέρα, θα ήθελα να μάθω…",
  "fields": [
    {
      "label": "Τηλέφωνο",
      "value": "6912345678"
    },
    {
      "label": "Αρ. παραγγελίας",
      "value": "4821"
    }
  ],
  "source": "Φόρμα · example.gr",
  "thread": "order-4821",
  "attachments": [
    {
      "filename": "photo.jpg",
      "contentType": "image/jpeg",
      "content": "/9j/4AAQ…"
    }
  ]
}
Answer
{
  "conversationId": 123,
  "messageId": 456,
  "created": true
}

Sending

POST/sendfull

Send an email from one of your inboxes: a new one, or a reply (conversationId + replyToId). JSON, or multipart with a "data" field and "files" to attach.

Body
{
  "accountId": 5,
  "to": "customer@example.com",
  "cc": "",
  "subject": "Your order",
  "html": "<p>Hello!</p>",
  "conversationId": 123,
  "replyToId": 456
}
Answer
{
  "conversationId": 123
}

Automation (REST hooks)

POST/hookswrite

Subscribe a URL to one event (admins’ tokens). Zapier, Make and n8n do this when a workflow is switched on.

Body
{
  "url": "https://hooks.zapier.com/hooks/standard/123/abc",
  "event": "message.received"
}
Answer
{
  "id": 31,
  "url": "https://hooks.zapier.com/…",
  "event": "message.received",
  "secret": "…"
}
DELETE/hooks/{id}write

Unsubscribe.

Answer
{
  "ok": true
}
GET/hooks/samples/{event}read

Recent examples of an event, shaped like deliveries (to map fields while building a workflow).

Answer
[
  {
    "id": "message.received:456",
    "event": "message.received",
    "data": {
      "conversationId": 123,
      "subject": "Order 1015"
    },
    "sentAt": "2026-10-04T09:00:01.000Z"
  }
]

Reading and following email

Follow new email from your ERP. To copy email into another system — a customer’s messages into their ERP record, a supplier’s confirmations into the order — ask for GET /messages?after=<id> every few minutes. You get every email OneDesk stored after that id, oldest first, and an after to send next time. Nothing is missed while your system is off and nothing comes twice, with no public address needed. Webhooks are faster; use both if you like — message.received to act at once, follow mode to catch up on anything missed.

<?php // every few minutes (cron)
function onedesk($path) {
  $ch = curl_init('https://app.onedesk.gr/api/v1' . $path);
  curl_setopt_array($ch, [CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30,
    CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . ONEDESK_KEY]]);
  $body = curl_exec($ch);
  if (curl_getinfo($ch, CURLINFO_HTTP_CODE) == 429) { sleep(30); return onedesk($path); } // over the limit: wait
  return json_decode($body, true);
}
$after = (int) @file_get_contents(__DIR__ . '/onedesk-after.txt');   // 0 the first time: everything
do {
  $page = onedesk("/messages?after=$after&bodies=true");
  foreach ($page['items'] as $m) {
    if (in_array($m['folder'], ['junk', 'trash'])) continue;            // skip spam and deleted mail
    $email = $m['direction'] === 'in' ? $m['fromEmail'] : ($m['to'][0]['email'] ?? '');
    // find the customer by $email; keep $m['subject'], $m['date'], $m['text'];
    // files: $m['attachments'][…]['url'], downloaded with the same Authorization header
  }
  $after = $page['after'];
  file_put_contents(__DIR__ . '/onedesk-after.txt', $after);            // only after you've saved them
} while ($page['more']);

What an email carries. text is plain text; html is the email as it was written — clean it (e.g. HTML Purifier) before showing it in a web page of yours. Pictures inside the HTML point at their url on OneDesk, which needs your token: to show them elsewhere, download them. Messages from other systems (POST /messages) also have source and fields. internetMessageId is the email’s own Message-ID, the same in every mailbox it reached.

Searching. GET /search finds conversations, like the search bar in OneDesk; GET /messages?q= finds single emails. Both match the start of words (“τιμολ” finds “τιμολόγιο”) with or without Greek accents and capitals, in the subject, text, sender and form fields. Plain days (since=2026-09-01) are in your organization’s time zone, the one of its business hours (Settings → Organization).

Webhooks

OneDesk POSTs JSON to your URL when something happens. Add them in Settings → API and webhooks, or subscribe from code with POST /hooks.

{
  "id": "evt_3kq9ZlV0uB1x2YtR",
  "event": "message.received",
  "data": {
    "account": "support@example.com",
    "conversationId": 123,
    "messageId": 456,
    "from": {
      "name": "Customer",
      "email": "customer@example.com"
    },
    "subject": "Order 1015",
    "snippet": "Hello, where is my order?",
    "date": "2026-10-04T09:00:00.000Z"
  },
  "sentAt": "2026-10-04T09:00:01.000Z"
}

Delivery and retries

Answer with any 2xx within 10 seconds. Anything else — an error, a timeout, your server being down — and OneDesk tries again after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 12 hours (7 tries, about 21 hours), always with the same body. After that the delivery is marked failed and the organization’s admins are told; they can resend it from Settings, where every delivery of the last 30 days is listed. A webhook that has only failed for 3 days is switched off. Automation tools that answer 410 Gone are unsubscribed.

Duplicates and order. A retry can arrive after newer events, and rarely the same event twice. Every event has an id (also in X-OneDesk-Event-Id): store the ids you’ve handled and skip repeats. Use sentAt or fetch the conversation for the current state. Events carry a short version; the whole email is GET /messages/{messageId}.

Events

message.receivedAn email arrived in an inbox
message.sentAn email was sent from OneDesk
comment.createdA team note was written
conversation.assignedAssignees changed
conversation.closedA conversation was closed
conversation.reopenedA conversation was reopened
conversation.snoozedA conversation was snoozed
conversation.labeledLabels changed
task.createdA task was added
task.completedA task was ticked off
task.dueA task’s day came (8:00 local time)

Check that it’s from OneDesk

Each delivery has X-OneDesk-Signature-256: t=<timestamp>,v1=<signature>: an HMAC-SHA256, keyed with the webhook’s secret, of the timestamp, a dot and the raw body. Check it in constant time, and reject timestamps more than 5 minutes old, so a recorded delivery can’t be replayed later:

<?php // PHP
$raw = file_get_contents('php://input');
preg_match('/t=(d+),v1=([a-f0-9]+)/', $_SERVER['HTTP_X_ONEDESK_SIGNATURE_256'] ?? '', $m);
$ok = $m && abs(time() - (int)$m[1]) < 300
  && hash_equals(hash_hmac('sha256', $m[1] . '.' . $raw, $secret), $m[2]);
if (!$ok) { http_response_code(401); exit; }
$event = json_decode($raw, true);   // skip it if you've seen $event['id'] before
http_response_code(200);

// Node.js (Express: use express.raw() so you get the exact body)
const [, t, v1] = req.get('x-onedesk-signature-256').match(/t=(d+),v1=([a-f0-9]+)/) || [];
const mac = crypto.createHmac('sha256', SECRET).update(t + '.' + req.body).digest('hex');
const ok = v1 && Math.abs(Date.now() / 1000 - t) < 300 && crypto.timingSafeEqual(Buffer.from(mac), Buffer.from(v1));

Older receivers can keep checking X-OneDesk-Signature: sha256=… (the HMAC of the body alone); it’s still sent. Other headers: X-OneDesk-Event, X-OneDesk-Event-Id, X-OneDesk-Delivery, X-OneDesk-Timestamp.

Messages from your website or ERP

A contact form, an ERP’s alert (“customer over their credit limit”), a shop’s return request: send it with POST /messages and it becomes a conversation in a shared inbox, exactly like an email. Rules run on it, the team is told, webhooks fire; the team assigns it, writes notes and replies. With from.email, a reply goes by email from that inbox, and the customer’s answer comes back into the same conversation. Fields show as a small table above the message, and source as a badge (“via Φόρμα · example.gr”).

One conversation per thing. Send the same thread (an order number, a ticket id) and later messages join the same conversation, reopening it if it was closed. Add an Idempotency-Key so a retried request doesn’t create it twice. These messages live only in OneDesk: no copy is put in the mailbox.

<?php // contact.php — your website's form handler
$payload = [
  'inboxId' => 5,                                   // GET /api/v1/inboxes
  'from'    => ['name' => $_POST['name'], 'email' => $_POST['email']],
  'subject' => 'Φόρμα επικοινωνίας: ' . $_POST['topic'],
  'text'    => $_POST['message'],
  'fields'  => [['label' => 'Τηλέφωνο', 'value' => $_POST['phone']], ['label' => 'Σελίδα', 'value' => $_SERVER['HTTP_REFERER'] ?? '']],
  'source'  => 'Φόρμα · example.gr',
];
$ch = curl_init('https://app.onedesk.gr/api/v1/messages');
curl_setopt_array($ch, [CURLOPT_POST => true, CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 15,
  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . ONEDESK_KEY, 'Content-Type: application/json', 'Idempotency-Key: form-' . bin2hex(random_bytes(8))],
  CURLOPT_POSTFIELDS => json_encode($payload, JSON_UNESCAPED_UNICODE)]);
$answer = json_decode(curl_exec($ch), true);   // {"conversationId": 123, "messageId": 456, "created": true}

Use an organization key with “Read and work on conversations” and only the inbox it needs. Up to 10 attachments, 15 MB in all, as base64.

Cards from your ERP (or any system)

Show what your own system knows about a customer — balance, unpaid invoices, orders, a link to their record — in the Details panel next to their email. You write a small bridge: one address that OneDesk asks, and that answers JSON. Add it in Settings → Integrations → Your own systems, put the secret it gives you in the bridge, and use Test to see the card exactly as your team will.

What OneDesk sends

A POST when someone opens a conversation (answers are kept for a minute per person), with X-OneDesk-Timestamp and X-OneDesk-Signature-256 signed exactly like webhooks, using the card’s secret:

{
  "event": "card",
  "contact": {
    "email": "customer@example.com",
    "name": "Γιώργος Παπαδάκης"
  },
  "conversation": {
    "id": 123,
    "subject": "Παραγγελία 4821",
    "inbox": "sales@example.gr"
  },
  "user": {
    "id": 2,
    "name": "Maria",
    "email": "maria@example.gr"
  },
  "org": {
    "id": 1,
    "name": "Example"
  }
}

What to answer

Within 6 seconds, HTTP 200 with JSON. Every field is optional; text is shown as plain text, links must be http(s)://, colours are gray, blue, green, yellow, red, purple. Not a customer? Answer {"found": false, "message": "…"}.

{
  "title": "Παπαδάκης Γεώργιος",
  "subtitle": "Πελάτης · ΑΦΜ 123456789",
  "url": "https://erp.example.gr/customers/1042",
  "badges": [
    {
      "text": "Ανεξόφλητα",
      "color": "red"
    }
  ],
  "fields": [
    {
      "label": "Υπόλοιπο",
      "value": "€1.240,00"
    },
    {
      "label": "Πιστωτικό όριο",
      "value": "€5.000,00"
    },
    {
      "label": "Πωλητής",
      "value": "Ελένη"
    }
  ],
  "sections": [
    {
      "title": "Τελευταία παραστατικά",
      "items": [
        {
          "title": "ΤΔΑ 1542",
          "subtitle": "12/09/2026",
          "value": "€320,00",
          "badge": {
            "text": "Ανεξόφλητο",
            "color": "red"
          },
          "url": "https://erp.example.gr/docs/1542"
        },
        {
          "title": "ΤΔΑ 1498",
          "subtitle": "28/08/2026",
          "value": "€920,00",
          "badge": {
            "text": "Εξοφλήθηκε",
            "color": "green"
          }
        }
      ],
      "more": {
        "text": "Όλα τα παραστατικά",
        "url": "https://erp.example.gr/customers/1042/docs"
      }
    }
  ],
  "links": [
    {
      "label": "Καρτέλα πελάτη",
      "url": "https://erp.example.gr/customers/1042"
    }
  ]
}

Limits: 5 badges, 20 fields, 6 sections of 20 items, 6 links; longer lists are cut. The Test button lists anything OneDesk had to leave out, and why.

A bridge in PHP

<?php // onedesk-card.php — next to your ERP
$secret = 'the secret from OneDesk';
$raw = file_get_contents('php://input');
preg_match('/t=(d+),v1=([a-f0-9]+)/', $_SERVER['HTTP_X_ONEDESK_SIGNATURE_256'] ?? '', $m);
if (!$m || abs(time() - (int)$m[1]) > 300 || !hash_equals(hash_hmac('sha256', $m[1] . '.' . $raw, $secret), $m[2])) {
  http_response_code(401); exit;
}
$req = json_decode($raw, true);
$email = $req['contact']['email'];

$customer = find_customer_by_email($email);   // your ERP: a query, or its web services (e.g. SoftOne)
header('Content-Type: application/json; charset=utf-8');
if (!$customer) { echo json_encode(['found' => false, 'message' => 'Δεν είναι πελάτης στο ERP']); exit; }

$docs = latest_documents($customer['id'], 5);
echo json_encode([
  'title'    => $customer['name'],
  'subtitle' => 'ΑΦΜ ' . $customer['vat'],
  'url'      => 'https://erp.example.gr/customers/' . $customer['id'],
  'badges'   => $customer['balance'] > 0 ? [['text' => 'Ανεξόφλητα', 'color' => 'red']] : [],
  'fields'   => [['label' => 'Υπόλοιπο', 'value' => number_format($customer['balance'], 2, ',', '.') . ' €']],
  'sections' => [['title' => 'Τελευταία παραστατικά', 'items' => array_map(fn($d) => [
    'title' => $d['code'], 'subtitle' => $d['date'], 'value' => number_format($d['total'], 2, ',', '.') . ' €',
    'badge' => $d['paid'] ? ['text' => 'Εξοφλήθηκε', 'color' => 'green'] : ['text' => 'Ανεξόφλητο', 'color' => 'red'],
  ], $docs)]],
], JSON_UNESCAPED_UNICODE);

The bridge must be reachable from the internet over https (it can sit behind your firewall’s https port). Cards are part of the Team and Business plans.

Zapier, Make and n8n

Zapier

Trigger: Webhooks by Zapier → Catch Hook, then add that URL as a webhook in OneDesk (or subscribe it with POST /hooks). Actions: Webhooks by Zapier → Custom Request with your token, e.g. POST /conversations/{id}/tasks.

Make

Trigger: Webhooks → Custom webhook, copy its address into a OneDesk webhook. Actions: HTTP → Make a request to https://app.onedesk.gr/api/v1/… with the header Authorization: Bearer ti_….

n8n

Trigger: the Webhook node (POST); add its production URL as a OneDesk webhook. Actions: HTTP Request node, authentication “Header Auth” with Authorization = Bearer ti_….

Example: every VIP email becomes a task

Trigger on message.received, filter on the sender, then:

POST https://app.onedesk.gr/api/v1/conversations/{{data.conversationId}}/tasks
Authorization: Bearer ti_…
Content-Type: application/json

{"text": "Answer the VIP within the hour", "due": "{{today}}"}

Questions or something missing? Write to hello@onedesk.gr.