SociaLock

Venue API

For cafés, restaurants, libraries and anyone running SociaLock tables. Version 1.

How tables work

Each table has a QR code. A guest scans it, and their phone joins that table's phone-free session. Anyone else who scans the same code while the table is running joins the same session. When the table's time is up, its session finishes and you get the totals.

What you are told

What you are never told. Who anybody is: no names, usernames, photos or account IDs. Which apps anyone blocked (iOS doesn't tell us either). Who reached for their phone or left early. It's counts and times only, nothing more than you could see by looking at the table.

Authentication

We give you an API key starting slv_. Send it as a Bearer token. Keep it on your server; anyone with it can read your venue's numbers. Lost it? Ask us for a new one, and the old one stops working.

Authorization: Bearer slv_…

Events

New events, oldest first. Store next_since and pass it back next time to get only what's new.

GET https://socialock.app/api/v1/events?since=0&limit=100
{
  "venue": "blue-door-cafe",
  "events": [
    {
      "id": 41,
      "type": "table.finished",
      "created_at": "2026-11-17T21:10:02Z",
      "data": {
        "table": "4",
        "table_ref": "tbl_480ec770d8db9e47",
        "people": 3,
        "phone_free_minutes": 164,
        "started_at": "2026-11-17T19:58:00Z",
        "ended_at": "2026-11-17T20:58:00Z"
      }
    }
  ],
  "next_since": 41
}

table_ref is the same for every event from one sitting at a table, so you can group them. table.locked events carry table, table_ref, locked_now and ends_at.

Daily totals

GET https://socialock.app/api/v1/summary?from=2026-11-01&to=2026-11-30
{
  "venue": "blue-door-cafe",
  "from": "2026-11-01",
  "to": "2026-11-30",
  "days": [
    { "day": "2026-11-17", "tables": 12, "people": 31, "phone_free_minutes": 1840 }
  ]
}

Days are in UTC. Leave out from and to for the last 30 days.

Webhooks

Give us an https:// URL and every event is also POSTed to it the moment it happens, with the same JSON as one item in events. Webhooks are a nudge, not the record: if your server was down, read the events list to catch up.

Each request carries SociaLock-Event-Id and SociaLock-Signature: t=<unix time>,v1=<hex>. To check it really came from us, compute HMAC-SHA256 of "<t>.<raw body>" with your webhook secret (starts whsec_) and compare it with v1. Reject anything more than five minutes old.

// Node.js
const crypto = require("crypto");
function verify(rawBody, header, secret) {
  const parts = Object.fromEntries(header.split(",").map(p => p.split("=")));
  const expected = crypto.createHmac("sha256", secret)
    .update(parts.t + "." + rawBody).digest("hex");
  const fresh = Math.abs(Date.now() / 1000 - Number(parts.t)) < 300;
  return fresh && crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(parts.v1));
}

Redeeming a reward

When a guest shows you their code, mark it used. A code works once, only at your venue.

POST https://socialock.app/api/v1/rewards/redeem
Authorization: Bearer slv_…
Content-Type: application/json

{ "code": "UPX-JZV" }
{ "status": "redeemed", "code": "UPX-JZV", "reward": "Free dessert", "minutes": 60 }

status is redeemed, already_redeemed, expired or not_found. No code of your own to write? Staff can use socialock.app/venues/redeem on any device at the counter.

Errors

Get access

SociaLock for venues is opening to a first group of places. Join the waitlist, or write to [email protected].