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

  1. In Markhub, open the workspace menu and go to Settings, then API.
  2. Click Issue key. Pick the Hub the key posts into and the scopes it needs.
  3. Copy the key. It starts with mk_live_ and is shown only once, so store it as a server secret right away.
  4. Send your first message:
curl
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:

Headers
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

FieldTypeDescription
textstringMarkdown: bold, lists, links, code. Required unless you send blocks.
blocksarrayMarkhub editor blocks, for senders that already build them. If both are sent, blocks is used.
Request body
{ "text": "**payment-worker** crashed on prod (exit 137). Restarting." }
Response · 201 Created
{
  "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

FieldTypeDescription
contentstringRequired. Markdown body of the note.
titlestringOptional.
Request body
{
  "title": "Nightly report 2026-09-11",
  "content": "## Orders\n- 1,240 shipped\n- 17 late (1.4%)"
}
Response · 201 Created
{
  "success": true,
  "data": { "id": "…", "bucketId": "…", "createdAt": "…" }
}

Create a to-do

POST /api/public/v1/todos · scope Create todo

FieldTypeDescription
titlestringRequired.
contentstringOptional. Markdown details.
dueDatestringOptional. ISO 8601, for example 2026-09-12T09:00:00Z.
prioritystringOptional. LOW, MEDIUM, HIGH or URGENT.
Request body
{
  "title": "Investigate 5xx spike on /checkout",
  "content": "Started 02:14 UTC.",
  "dueDate": "2026-09-12T09:00:00Z",
  "priority": "HIGH"
}
Response · 201 Created
{
  "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
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.

FieldTypeDescription
idstringRequired. Your order ID, up to 100 characters. Sending the same id to the same store again replaces that order.
totalintegerRequired. What the customer paid, after discounts, tax included.
discount, taxintegerOptional. Default 0.
statusstringOptional. completed (default), cancelled or open. Only completed orders count as revenue.
orderedAtstringOptional. 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.
orderNumberstringOptional. The number staff and customers see.
sourcestringOptional. Where the order came from, for example Table order.
itemsarrayOptional, up to 200. Each has name, quantity (1 or more) and unitPrice; code and category are optional. Used for top-item rankings.
paymentsarrayOptional, 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.
storeobjectOptional. id, name, timezone, currency, dailySummary. See Stores below.
Request body
{
  "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" }
}
Response · 201 Created
{
  "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 example America/Chicago) and store.currency (ISO 4217, for example USD). 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.id instead.
  • 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.dailySummary to true to 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 id and the new values.
  • To cancel, send it again with "status": "cancelled". All of its payments are cancelled with it.
  • If you leave orderedAt out when sending again, the order stays on the business day it was first recorded on.
  • If you leave payments out when sending again, its payments stay as they are. If you send payments, that list replaces the earlier ones.
  • Every other field is replaced by what you send, so include total and items each 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

Node.js 18+
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." }),
});
Python
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

StatusMeaning
201Created. The body has the new id.
400The body is invalid, for example a message with neither text nor blocks, or a dueDate that isn't a date.
401The key is missing, wrong, expired or revoked.
403The key lacks the scope for this endpoint, or the rate limit was hit.
404The 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.

Error body
{
  "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.