packerooDevelopers Deutsch

Concepts

How the packeroo API signs in, makes retries safe, reports errors and limits requests. Token prefixes, idempotency keys, problem answers after RFC 9457, rate limits, User-Agent, times and versions.

These rules hold for every public operation. What is described here is built; what is planned is marked as such.

Addresses

EnvironmentBase addressTokens
Livehttps://api.packeroo.com/api/v1pkd_live_…
Sandboxhttps://api.qm.packeroo.com/api/v1pkd_test_…

The sandbox is the demo environment of packeroo. It can be reset; keep nothing there you want to keep. In the sandbox a device pairs itself with POST /sandbox/device-pairings/confirm at a test table of its own, without anyone entering the code in the app; see the quickstart.

Authentication and token prefixes

A device signs in with its token in the header:

Authorization: Bearer pkd_live_7Hq2xV9pLm3RtY6wQz8NbC4kDf1Gs5Je0aB3cD

The token is a random string, not a JWT: it carries no data, and once the device is unpaired it stops working at once. packeroo stores only its SHA-256 hash and shows it exactly once, in the answer to POST /device-pairings.

A token is 47 characters long: a prefix, 32 random characters and a checksum of 6. The prefix tells kind and environment. The checksum lets secret scanners recognize a leaked token, and the API refuses a mistyped one without looking it up.

PrefixKindState
pkd_live_, pkd_test_device at a tableavailable
pko_live_, pko_test_organization key for intranets, dashboards, chat botsplanned
pkp_live_, pkp_test_personal tokenplanned

Tokens belong on devices and servers, never in a web page. The API accepts requests from a browser only from the packeroo app.

Scopes

GET /device names in scopes what the token may do. For a device token this is a fixed set: leagues:read, standings:read, matches:read, matches:write, matches:live. It includes scopes for operations that are planned; those take effect only once the operations exist. Today the token is good for GET /device. When an operation is added, a paired device does not need to be paired again: its token has the scopes already.

Idempotency key

Every write (POST, PUT, PATCH, DELETE) carries the header Idempotency-Key with a UUID or ULID. Make a new key for every new action, and send the same one when you repeat a request, for example after a network error.

Error answers

Every error comes as a problem after RFC 9457 with the content type application/problem+json:

{
  "type": "https://api.packeroo.com/problems/user-agent-required",
  "title": "User-Agent required",
  "status": 400,
  "detail": "The device does not name itself. Every request needs a User-Agent, such as Kickertisch/1.2.",
  "code": "user_agent_required",
  "correlation_id": "01JD7R4X2Y3Z4A5B6C7D8E9F0G"
}

Codes of the public operations

CodeStatusMeaning
user_agent_required400The request has no User-Agent.
idempotency_key_required400The write has no valid Idempotency-Key.
bad_request400The request cannot be read, for example no valid UTF-8.
unauthenticated401No valid token: not paired yet, unpaired, from the other environment, or table devices are switched off.
not_found404The operation does not exist here, such as POST /sandbox/device-pairings/confirm outside the sandbox.
device_already_paired409The device asking for a code is paired already. It keeps its token.
table_devices_off409Table devices are switched off; no device pairs.
request_in_progress409A request with the same idempotency key is still running.
idempotency_key_reused422The idempotency key belongs to another request already.
validation_failed422A field is invalid; errors names it.
rate_limited429Too many requests; Retry-After gives the wait in seconds.
server_error500An error at packeroo. The cause is in our log under the correlation_id.
unavailable503packeroo cannot be reached for a moment. Try again later.

Rate limits

WhatLimit
POST /device-pairings60 a minute per IP address
POST /sandbox/device-pairings/confirm10 an hour and 20 new test tables a day per IP address (IPv6 per /48)
GET /device120 a minute per device

The limit for codes counts per IP address, the one for GET /device per device. An example: in a hall, 40 tables sit behind one address. After a power cut all of them ask for a code at once, which is 40 of 60 POST a minute. Then every device asks GET /device every five seconds, 12 of 120 per device; the 40 devices do not add up there. With more than 60 tables behind one address, the rest get 429 with Retry-After and ask again after it; the examples of the guide do that by themselves. Whoever goes over a limit gets 429 with rate_limited and the header Retry-After in seconds. Wait that long before you try again.

Planned: the headers RateLimit and RateLimit-Policy after the IETF draft on every answer, and limits of their own for goals and organization keys once those operations exist.

User-Agent

Every request of a device names its product and firmware in the User-Agent, such as Kickertisch/1.2 or Kickertisch-ESP32/0.9.3. That tells a misbehaving device apart from the others in the logs without anyone looking at its token. Without a User-Agent the API answers 400 with user_agent_required.

Times

Times come in ISO 8601 and always in UTC, with a Z at the end: 2026-11-22T14:15:00Z. Show them in the time zone of the location; GET /device names it in location.time_zone, such as Europe/Berlin. IDs are ULIDs, 26 characters, sortable by time.

Versioning

The version is in the path: /api/v1. Within v1 only additions come: new operations, new fields, new error codes. Write your program so that unknown fields in an answer break nothing. What would break existing programs goes into a new version v2.

Planned: what goes away is announced with the headers Deprecation and Sunset (RFC 8594), at least six months ahead. For operations of devices, whose firmware stays in the field for years, twelve months ahead and not before 24 months after their release.

New operations and changes are in the changelog, also as an RSS feed.

This page as Markdown