Developer API

API Reference

Everything you need to build queue infrastructure in an afternoon. Base URL: https://api.linie.io/v1

Quick start

From zero to a live queue in four steps.

1

Get an API key

Sign up for a free hobby tier — no credit card needed. Your key appears in the dashboard under Account → API Keys.

2

Create a queue

POST to /queues with your TTL, heartbeat interval, and reminder thresholds.

const queue = await linie.queues.create({
  ttl: 600,
  heartbeat_interval: 60,
  reminder_at: [0.5, 0.8, 1.0],
});
queue = client.queues.create(
    ttl=600,
    heartbeat_interval=60,
    reminder_at=[0.5, 0.8, 1.0],
)
curl -X POST https://api.linie.io/v1/queues \
  -H "Authorization: Bearer $LINIE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"ttl":600,"heartbeat_interval":60,"reminder_at":[0.5,0.8,1.0]}'
3

Enqueue a customer

Call POST /queues/{id}/enqueue with optional priority and metadata.

const entry = await linie.queues.enqueue(queue.id, {
  priority: 0,
  metadata: { phone: "+6591234567", name: "Ahmad R." },
});
entry = client.queues.enqueue(queue.id,
    priority=0,
    metadata={"phone": "+6591234567", "name": "Ahmad R."},
)
curl -X POST https://api.linie.io/v1/queues/$QUEUE_ID/enqueue \
  -H "Authorization: Bearer $LINIE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"priority":0,"metadata":{"phone":"+6591234567"}}'
4

Receive webhooks

Configure a webhook URL on your queue. Linie fires position_changed, your_turn, and expired events to your endpoint.

Authentication

All API requests require a Bearer token in the Authorization header.

Authorization: Bearer linie_live_<your-key>

Manage keys at Account → API Keys. Only the SHA-256 hash of your key is stored — if you lose it, rotate it.

Endpoints

Queues

MethodPathDescription
POST/queuesCreate a queue
GET/queues/{id}Get a queue
DELETE/queues/{id}Delete (async drain, returns 202)
GET/queuesList queues (paginated)
PATCH/queues/{id}Configure WhatsApp notifications

Entries

MethodPathDescription
POST/queues/{id}/enqueueAdd an entry
GET/queues/{id}/nextPeek at head (204 if empty)
POST/queues/{id}/dequeueRemove and return head
GET/queues/{id}/entries/{entry_id}Get an entry
POST/queues/{id}/entries/{entry_id}/heartbeatReset TTL countdown
POST/queues/{id}/entries/{entry_id}/set_priorityUpdate priority
DELETE/queues/{id}/entries/{entry_id}Remove explicitly

Analytics Growth+

MethodPathDescription
GET/queues/{id}/analyticsWait time, abandonment rate, throughput

Error codes

HTTPCodeMeaning
400invalid_configQueue config validation failed
400invalid_priorityPriority out of range
400missing_webhook_urlon_events set but no URL
401unauthorizedMissing or invalid API key
402tier_limit_reachedQueue or operation limit for your tier
404queue_not_foundNo queue with that ID
404entry_not_foundNo entry with that ID
409duplicate_entryIdempotency key already used — re-fetch the existing entry with GET /entries/{entry_id}
409queue_emptyDequeue on an empty queue
429rate_limitedRequest rate exceeded for your tier
500internal_errorServer error — retry with backoff

Rate limits

TierOperations includedMax req/s
Hobby1,000 / day10
Starter500,000 / month50
Growth5,000,000 / month200
Scale20,000,000 / month1,000
EnterpriseCustomCustom

Operations: enqueue, dequeue, peek, heartbeat, set_priority. Exceeding the daily/monthly window returns 402 tier_limit_reached; exceeding req/s returns 429 rate_limited with a Retry-After: 1 header.