Developers
Contents
On this page

Resources

Desks

The places where people are served.

A desk is a place somebody is called to: a doctor's room, a counter, a bay. It calls from one or more lines. A key has no desk of its own, so everything a key does at a desk names the desk — the way a front-desk tablet runs several desks from one screen.

Fields#

A desk
FieldTypeNotes
idrequiredstring
namerequiredstring
typerequiredenumOne of "person", "counter"
publicLabelrequiredstring | null
activerequiredboolean
staterequiredenumOne of "offline", "available", "called", "busy", "break"
lineIdsrequiredarray of string
  • type is person for one person's desk — a doctor, a stylist — and counter for a place anyone on shift can work.
  • publicLabel is what customers see and hear: "Room 1", "Counter 2". Show it on a screen, not name, which is for staff. It may be null; fall back to name.
  • lineIds are the lines it calls from, of those the key may see.
A desk's state
stateMeans
offline Not on shift. Nobody is called to it.
available On shift and free — Call next will call somebody here.
called Has called somebody who has not arrived yet.
busy Serving somebody.
break On shift, stepped away for a while, with a reason and a time back.

Endpoints#

Desk endpoints
EndpointScopeDoes
GET /desks read Every desk this key may see, and what state each is in.
POST /desks/{deskId}/call-next desks:operate Call the next visit to a desk, as its own Call next would.
PUT /desks/{deskId}/status desks:operate Start a desk's shift, put it on a break, or end it.

Call next#

POST /v1/desks/{deskId}/call-next does what the desk's own Call next button does: it calls whoever is next on the desk's lines — urgent visits first, then in line order — and answers that visit, now called. With nobody waiting it answers visit: null and changes nothing.

  • waiting is how many are still waiting on the desk's lines after this call.
  • held counts those of them who are with another desk at this moment — part-way through another step of their visit — and so were passed over, keeping their place.
  • The desk must be on shift and not already holding somebody; otherwise the answer is a 409 saying why.
  • Call next is not safe to retry blindly: if a request times out, the call may have happened. Look at GET /v1/visits?status=called before pressing again.

A desk's status#

PUT /v1/desks/{deskId}/status takes available to start a shift (or come back from a break), break to step away, and offline to end the shift. called and busy are not set directly: they follow from calling and serving.

  • A break may say why — reason — and when the desk will be back — backAt, up to eight hours ahead. A clinic's reasons are theatre, rounds, emergency_call, meal and other; every other business's are break, meal, away and other. A reason from the other list is refused.
  • A desk serving somebody cannot end its shift: finish or put back that visit first, or the answer is a 409.
  • A person's desk cannot start a shift on a day that person is on leave.
  • Setting a desk to the state it is already in changes nothing.

Examples#

List your desks#

Request

curl

curl "https://business.linemeup.in/api/v1/desks" \
  -H "Authorization: Bearer $LINEMEUP_API_KEY"

Node

const res = await fetch("https://business.linemeup.in/api/v1/desks", {
  headers: {
    Authorization: `Bearer ${process.env.LINEMEUP_API_KEY}`,
  },
});
if (!res.ok) throw new Error(`Line Me Up answered ${res.status}`);
const answer = await res.json();

Python

import os
import requests

res = requests.get(
    "https://business.linemeup.in/api/v1/desks",
    headers={
        "Authorization": f"Bearer {os.environ['LINEMEUP_API_KEY']}",
    },
    timeout=10,
)
res.raise_for_status()
answer = res.json()

PHP

<?php
$ch = curl_init("https://business.linemeup.in/api/v1/desks");
curl_setopt_array($ch, [
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("LINEMEUP_API_KEY"),
    ],
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT => 10,
]);
$answer = json_decode(curl_exec($ch), true);
Response (200)
{
  "data": [
    {
      "id": "sta-0193f2a1-7c4e-7a10-9b2e-000000000001",
      "name": "Dr Mehta",
      "type": "person",
      "publicLabel": "Room 1",
      "active": true,
      "state": "available",
      "lineIds": [
        "line-0193f2a1-7c4e-7a10-9b2e-000000000001"
      ]
    },
    {
      "id": "sta-0193f2a1-7c4e-7a10-9b2e-000000000002",
      "name": "X-ray counter",
      "type": "counter",
      "publicLabel": "Counter 2",
      "active": true,
      "state": "busy",
      "lineIds": [
        "line-0193f2a1-7c4e-7a10-9b2e-000000000002"
      ]
    }
  ]
}

Call the next person to a desk#

Request

curl

curl -X POST "https://business.linemeup.in/api/v1/desks/sta-0193f2a1-7c4e-7a10-9b2e-000000000001/call-next" \
  -H "Authorization: Bearer $LINEMEUP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Node

const res = await fetch("https://business.linemeup.in/api/v1/desks/sta-0193f2a1-7c4e-7a10-9b2e-000000000001/call-next", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.LINEMEUP_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({}),
});
if (!res.ok) throw new Error(`Line Me Up answered ${res.status}`);
const answer = await res.json();

Python

import os
import requests

res = requests.post(
    "https://business.linemeup.in/api/v1/desks/sta-0193f2a1-7c4e-7a10-9b2e-000000000001/call-next",
    headers={
        "Authorization": f"Bearer {os.environ['LINEMEUP_API_KEY']}",
    },
    json={},
    timeout=10,
)
res.raise_for_status()
answer = res.json()

PHP

<?php
$ch = curl_init("https://business.linemeup.in/api/v1/desks/sta-0193f2a1-7c4e-7a10-9b2e-000000000001/call-next");
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("LINEMEUP_API_KEY"),
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS => json_encode(new stdClass()),
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT => 10,
]);
$answer = json_decode(curl_exec($ch), true);
Response (200)
{
  "visit": {
    "id": "job-0193f2a1-7c4e-7a10-9b2e-000000000001",
    "journeyId": "jny-0193f2a1-7c4e-7a10-9b2e-000000000001",
    "token": "GEN-20261030-014",
    "lineId": "line-0193f2a1-7c4e-7a10-9b2e-000000000001",
    "status": "called",
    "bookingType": "walk_in",
    "priority": false,
    "note": "First visit",
    "customer": {
      "name": "Asha Rao",
      "phone": "+919000000001"
    },
    "services": [
      {
        "id": "svc-0193f2a1-7c4e-7a10-9b2e-000000000002",
        "name": "General consultation"
      }
    ],
    "deskId": "sta-0193f2a1-7c4e-7a10-9b2e-000000000001",
    "position": null,
    "slotAt": null,
    "createdAt": "2026-10-30T04:12:00.000Z",
    "calledAt": "2026-10-30T04:31:00.000Z",
    "startedAt": null,
    "endedAt": null,
    "updatedAt": "2026-10-30T04:31:00.000Z"
  },
  "waiting": 3,
  "held": 0
}

Call next when nobody is waiting#

Request

curl

curl -X POST "https://business.linemeup.in/api/v1/desks/sta-0193f2a1-7c4e-7a10-9b2e-000000000001/call-next" \
  -H "Authorization: Bearer $LINEMEUP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Node

const res = await fetch("https://business.linemeup.in/api/v1/desks/sta-0193f2a1-7c4e-7a10-9b2e-000000000001/call-next", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.LINEMEUP_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({}),
});
if (!res.ok) throw new Error(`Line Me Up answered ${res.status}`);
const answer = await res.json();

Python

import os
import requests

res = requests.post(
    "https://business.linemeup.in/api/v1/desks/sta-0193f2a1-7c4e-7a10-9b2e-000000000001/call-next",
    headers={
        "Authorization": f"Bearer {os.environ['LINEMEUP_API_KEY']}",
    },
    json={},
    timeout=10,
)
res.raise_for_status()
answer = res.json()

PHP

<?php
$ch = curl_init("https://business.linemeup.in/api/v1/desks/sta-0193f2a1-7c4e-7a10-9b2e-000000000001/call-next");
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("LINEMEUP_API_KEY"),
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS => json_encode(new stdClass()),
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT => 10,
]);
$answer = json_decode(curl_exec($ch), true);
Response (200)
{
  "visit": null,
  "waiting": 0,
  "held": 0
}

Start a desk's shift#

Request

curl

curl -X PUT "https://business.linemeup.in/api/v1/desks/sta-0193f2a1-7c4e-7a10-9b2e-000000000001/status" \
  -H "Authorization: Bearer $LINEMEUP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"state":"available"}'

Node

const res = await fetch("https://business.linemeup.in/api/v1/desks/sta-0193f2a1-7c4e-7a10-9b2e-000000000001/status", {
  method: "PUT",
  headers: {
    Authorization: `Bearer ${process.env.LINEMEUP_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "state": "available"
  }),
});
if (!res.ok) throw new Error(`Line Me Up answered ${res.status}`);
const answer = await res.json();

Python

import os
import requests

res = requests.put(
    "https://business.linemeup.in/api/v1/desks/sta-0193f2a1-7c4e-7a10-9b2e-000000000001/status",
    headers={
        "Authorization": f"Bearer {os.environ['LINEMEUP_API_KEY']}",
    },
    json={
        "state": "available",
    },
    timeout=10,
)
res.raise_for_status()
answer = res.json()

PHP

<?php
$ch = curl_init("https://business.linemeup.in/api/v1/desks/sta-0193f2a1-7c4e-7a10-9b2e-000000000001/status");
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => "PUT",
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("LINEMEUP_API_KEY"),
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS => json_encode([
        "state" => 'available',
    ]),
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT => 10,
]);
$answer = json_decode(curl_exec($ch), true);
Response (200)
{
  "id": "sta-0193f2a1-7c4e-7a10-9b2e-000000000001",
  "name": "Dr Mehta",
  "type": "person",
  "publicLabel": "Room 1",
  "active": true,
  "state": "available",
  "lineIds": [
    "line-0193f2a1-7c4e-7a10-9b2e-000000000001"
  ]
}

Put a desk on a break#

Request

curl

curl -X PUT "https://business.linemeup.in/api/v1/desks/sta-0193f2a1-7c4e-7a10-9b2e-000000000001/status" \
  -H "Authorization: Bearer $LINEMEUP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"state":"break","reason":"meal","backAt":"2026-10-30T08:00:00.000Z"}'

Node

const res = await fetch("https://business.linemeup.in/api/v1/desks/sta-0193f2a1-7c4e-7a10-9b2e-000000000001/status", {
  method: "PUT",
  headers: {
    Authorization: `Bearer ${process.env.LINEMEUP_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "state": "break",
    "reason": "meal",
    "backAt": "2026-10-30T08:00:00.000Z"
  }),
});
if (!res.ok) throw new Error(`Line Me Up answered ${res.status}`);
const answer = await res.json();

Python

import os
import requests

res = requests.put(
    "https://business.linemeup.in/api/v1/desks/sta-0193f2a1-7c4e-7a10-9b2e-000000000001/status",
    headers={
        "Authorization": f"Bearer {os.environ['LINEMEUP_API_KEY']}",
    },
    json={
        "state": "break",
        "reason": "meal",
        "backAt": "2026-10-30T08:00:00.000Z",
    },
    timeout=10,
)
res.raise_for_status()
answer = res.json()

PHP

<?php
$ch = curl_init("https://business.linemeup.in/api/v1/desks/sta-0193f2a1-7c4e-7a10-9b2e-000000000001/status");
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => "PUT",
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("LINEMEUP_API_KEY"),
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS => json_encode([
        "state" => 'break',
        "reason" => 'meal',
        "backAt" => '2026-10-30T08:00:00.000Z',
    ]),
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT => 10,
]);
$answer = json_decode(curl_exec($ch), true);
Response (200)
{
  "id": "sta-0193f2a1-7c4e-7a10-9b2e-000000000001",
  "name": "Dr Mehta",
  "type": "person",
  "publicLabel": "Room 1",
  "active": true,
  "state": "break",
  "lineIds": [
    "line-0193f2a1-7c4e-7a10-9b2e-000000000001"
  ]
}

End a desk's shift#

Request

curl

curl -X PUT "https://business.linemeup.in/api/v1/desks/sta-0193f2a1-7c4e-7a10-9b2e-000000000001/status" \
  -H "Authorization: Bearer $LINEMEUP_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"state":"offline"}'

Node

const res = await fetch("https://business.linemeup.in/api/v1/desks/sta-0193f2a1-7c4e-7a10-9b2e-000000000001/status", {
  method: "PUT",
  headers: {
    Authorization: `Bearer ${process.env.LINEMEUP_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "state": "offline"
  }),
});
if (!res.ok) throw new Error(`Line Me Up answered ${res.status}`);
const answer = await res.json();

Python

import os
import requests

res = requests.put(
    "https://business.linemeup.in/api/v1/desks/sta-0193f2a1-7c4e-7a10-9b2e-000000000001/status",
    headers={
        "Authorization": f"Bearer {os.environ['LINEMEUP_API_KEY']}",
    },
    json={
        "state": "offline",
    },
    timeout=10,
)
res.raise_for_status()
answer = res.json()

PHP

<?php
$ch = curl_init("https://business.linemeup.in/api/v1/desks/sta-0193f2a1-7c4e-7a10-9b2e-000000000001/status");
curl_setopt_array($ch, [
    CURLOPT_CUSTOMREQUEST => "PUT",
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer " . getenv("LINEMEUP_API_KEY"),
        "Content-Type: application/json",
    ],
    CURLOPT_POSTFIELDS => json_encode([
        "state" => 'offline',
    ]),
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_TIMEOUT => 10,
]);
$answer = json_decode(curl_exec($ch), true);
Response (200)
{
  "id": "sta-0193f2a1-7c4e-7a10-9b2e-000000000001",
  "name": "Dr Mehta",
  "type": "person",
  "publicLabel": "Room 1",
  "active": true,
  "state": "offline",
  "lineIds": [
    "line-0193f2a1-7c4e-7a10-9b2e-000000000001"
  ]
}

Recipes#

Open every desk at opening time#

Start every shift

Node

// At opening: start the shift of every desk this key may run.
const { data: desks } = await get("/desks");
for (const desk of desks.filter((d) => d.active && d.state === "offline")) {
  await put(`/desks/${desk.id}/status`, { state: "available" });
}

Python

# At opening: start the shift of every desk this key may run.
for desk in get("/desks")["data"]:
    if desk["active"] and desk["state"] == "offline":
        put(f"/desks/{desk['id']}/status", {"state": "available"})

PHP

<?php
// At opening: start the shift of every desk this key may run.
foreach (get('/desks')['data'] as $desk) {
    if ($desk['active'] && $desk['state'] === 'offline') {
        put("/desks/{$desk['id']}/status", ['state' => 'available']);
    }
}

A button that calls the next person#

A key with only desks:operate, limited to one desk, is all a physical button needs. The guide has a whole one, for a Raspberry Pi.

Know when a desk goes on a break#

Subscribe to desk.status_changed. It is sent when a shift starts, a break begins or ends, and a shift ends — not when a desk calls or serves, which arrive as visit.status_changed.