Markhub API
Post messages, notes and to-dos into a Markhub Hub from your own server with one HTTPS request, and send orders from your own ordering app into your sales. Use it for alerts, monitoring, nightly reports, table-order integrations, or anything a script should put in front of your team.
This page is available in English and Korean. Showing the English version.
On this page
Quick start
- In Markhub, open the workspace menu and go to Settings, then API.
- Click Issue key. Pick the Hub the key posts into and the scopes it needs.
- Copy the key. It starts with
mk_live_and is shown only once, so store it as a server secret right away. - Send your first message:
curl -X POST https://makigql.shop/api/public/v1/messages \
-H "Authorization: Bearer $MARKHUB_API_KEY" \
-H "Content-Type: application/json" \
-d '{"text":"**Deploy finished**: api v2.14.0 is live."}'The message shows up in the Hub right away, posted by your workspace's MAKi bot.
Authentication
Every endpoint lives under https://makigql.shop/api/public/v1. Send the key as a Bearer token on each request:
Authorization: Bearer mk_live_xxxxxxxxxxxxxxxx
Content-Type: application/json- Keep the key on your server, in an environment variable or secret manager. Never ship it to a browser or a mobile app.
- One key posts into one Hub. To post into several Hubs, issue one key per Hub.
- Scopes decide what a key can do: Create message, Create note, Create todo, Add orders and sales. Calling an endpoint outside the key's scopes returns
403. - Rotate issues a new key and keeps the old one working for 24 hours, so you can swap it without downtime. Revoke stops a key immediately.
Post a message
POST /api/public/v1/messages · scope Create message
| Field | Type | Description |
|---|---|---|
text | string | Markdown: bold, lists, links, code. Required unless you send blocks. |
blocks | array | Markhub editor blocks, for senders that already build them. If both are sent, blocks is used. |
{ "text": "**payment-worker** crashed on prod (exit 137). Restarting." }{
"success": true,
"data": {
"id": "5a85019d-…",
"conversationId": "2c0683cf-…",
"createdAt": "2026-09-11T12:24:05.092Z"
}
}Create a note
POST /api/public/v1/notes · scope Create note
| Field | Type | Description |
|---|---|---|
content | string | Required. Markdown body of the note. |
title | string | Optional. |
{
"title": "Nightly report 2026-09-11",
"content": "## Orders\n- 1,240 shipped\n- 17 late (1.4%)"
}{
"success": true,
"data": { "id": "…", "bucketId": "…", "createdAt": "…" }
}Create a to-do
POST /api/public/v1/todos · scope Create todo
| Field | Type | Description |
|---|---|---|
title | string | Required. |
content | string | Optional. Markdown details. |
dueDate | string | Optional. ISO 8601, for example 2026-09-12T09:00:00Z. |
priority | string | Optional. LOW, MEDIUM, HIGH or URGENT. |
{
"title": "Investigate 5xx spike on /checkout",
"content": "Started 02:14 UTC.",
"dueDate": "2026-09-12T09:00:00Z",
"priority": "HIGH"
}{
"success": true,
"data": { "id": "…", "bucketId": "…", "createdAt": "…" }
}Add an order
POST /api/public/v1/orders · scope Add orders and sales
Orders from your own ordering app, like a table-order page or an online store, are stored next to the orders your POS reports. That is why sales reports, store comparisons, the daily summary and MAKi answers about sales include them without extra setup.
curl -X POST https://makigql.shop/api/public/v1/orders \
-H "Authorization: Bearer $MARKHUB_API_KEY" \
-H "Content-Type: application/json" \
-d '{"id":"ord_8f31","total":2450,"payments":[{"method":"card","amount":2450}],"store":{"timezone":"America/Chicago","currency":"USD"}}'Only id and total are required.
| Field | Type | Description |
|---|---|---|
id | string | Required. Your order ID, up to 100 characters. Sending the same id to the same store again replaces that order. |
total | integer | Required. What the customer paid, after discounts, tax included. |
discount, tax | integer | Optional. Default 0. |
status | string | Optional. completed (default), cancelled or open. Only completed orders count as revenue. |
orderedAt | string | Optional. ISO 8601 with a UTC offset, for example 2026-11-16T18:02:11Z or 2026-11-16T12:02:11-06:00. A time without an offset returns 400. Defaults to now. Decides which business day the order belongs to. |
orderNumber | string | Optional. The number staff and customers see. |
source | string | Optional. Where the order came from, for example Table order. |
items | array | Optional, up to 200. Each has name, quantity (1 or more) and unitPrice; code and category are optional. Used for top-item rankings. |
payments | array | Optional, up to 20. Each has amount. method (card, cash, wallet, transfer, prepaid or other) is optional and defaults to other, or to wallet when wallet is set. wallet (for example Apple Pay) and id (unique within the store) are optional. Used for the split by payment method. |
store | object | Optional. id, name, timezone, currency, dailySummary. See Stores below. |
{
"id": "ord_8f31",
"total": 2450,
"tax": 200,
"orderedAt": "2026-11-16T18:02:11Z",
"items": [
{ "name": "Carnitas taco", "quantity": 3, "unitPrice": 550 },
{ "name": "Horchata", "quantity": 2, "unitPrice": 300 }
],
"payments": [{ "method": "card", "amount": 2450 }],
"store": { "name": "Table Order", "timezone": "America/Chicago", "currency": "USD" }
}{
"success": true,
"data": {
"id": "ord_8f31",
"storeId": "7d2c41aa-…",
"businessDay": "2026-11-16",
"created": true
}
}created is true for a new order and false when an existing order was replaced. Both return 201.
Amounts are integers in the smallest unit of the store currency: cents for USD (2450 is $24.50), won for KRW (12000 is ₩12,000). Decimals return 400, and each amount can be at most 100,000,000.
Stores
Orders are grouped into a store. Leave store.id out if you have one location. If you have several, send a stable store.id per location (letters, digits, _, ., -). A store is created the first time its store.id is seen.
- The first request for a store must include
store.timezone(IANA, for exampleAmerica/Chicago) andstore.currency(ISO 4217, for exampleUSD). If the workspace already has a store, a missing value is copied from its oldest store, so send both when your locations differ in currency or time zone. Later requests can leave them out. - If you use
store.id, send it on every request, retries included. An order without it goes to the default store. - Once a store has orders, its currency and time zone cannot change. Use a new
store.idinstead. - A business day runs from 5:00 AM to 5:00 AM in the store time zone.
- A workspace can have up to 50 API stores.
- Set
store.dailySummarytotrueto have MAKi post a sales summary around 11:30 PM store time, in the Hub of the key that first created the store. It stays off until you turn it on.
Retries, corrections and cancellations
An id is counted once per store. Sending an order again after a timeout does not count it twice, as long as it goes to the same store.
- To correct an order, send it again with the same
idand the new values. - To cancel, send it again with
"status": "cancelled". All of its payments are cancelled with it. - If you leave
orderedAtout when sending again, the order stays on the business day it was first recorded on. - If you leave
paymentsout when sending again, its payments stay as they are. If you sendpayments, that list replaces the earlier ones. - Every other field is replaced by what you send, so include
totalanditemseach time, cancellations included.
Do not send orders that a connected POS already reports. They would be counted twice.
Each order is one request, and the limit of 60 requests per minute per key applies here too.
Code examples
await fetch("https://makigql.shop/api/public/v1/messages", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.MARKHUB_API_KEY}`,
"Content-Type": "application/json",
},
body: JSON.stringify({ text: "Nightly sync done. 1,240 orders imported." }),
});import os, requests
requests.post(
"https://makigql.shop/api/public/v1/messages",
headers={"Authorization": f"Bearer {os.environ['MARKHUB_API_KEY']}"},
json={"text": "Nightly sync done. 1,240 orders imported."},
timeout=10,
)Errors and limits
| Status | Meaning |
|---|---|
201 | Created. The body has the new id. |
400 | The body is invalid, for example a message with neither text nor blocks, or a dueDate that isn't a date. |
401 | The key is missing, wrong, expired or revoked. |
403 | The key lacks the scope for this endpoint, or the rate limit was hit. |
404 | The Hub this key posts into was deleted. |
Each key can make 60 requests per minute. Past that, the key is blocked for 5 minutes and requests return 403 with a Retry-After header in seconds.
Errors come back as JSON. Branch on statusCode; message is a readable reason meant for logs.
{
"statusCode": 403,
"message": "…",
"timestamp": "2026-09-11T12:24:31.033Z",
"path": "/api/public/v1/messages"
}A retried message, note or to-do posts again. If your sender retries on timeouts, include a run ID or similar marker in the text so duplicates are easy to spot. Orders are matched by id within a store, so sending one again is safe.
What your team sees
- Posts come from your workspace's MAKi bot and appear in real time for everyone in the Hub, in the Hub and in the Stream.
- Teammates can reply, react, or turn a message into a to-do or note, like any other message.
- Each post records which key sent it, so you can tell integrations apart.
Questions or a use case this doesn't cover? Email admin@markhub.ink.