Skip to main content
Retrieve a counter

Authorizations

token
string
query
required

Standard authorization for most API calls. This token identifies the logged-in user and their permissions. It is obtained either as a temporary token after a successful login or as a long-term API key.

Query Parameters

name
string
required

Name of the counter to retrieve, matched exactly.

Minimum string length: 1
Example:

"invoice_number"

Response

Returns the counter with its pattern, current position and reset period.

current
string
required

Position the sequence has reached, with the pattern's brackets kept around the generated segments so the following value can be derived from it. GET /counters/next always answers with the value one step past this one, never with this one.

Example:

"ID-{2025}-{ac}-{074}"

pattern
string
required

Template the generated values are built from. Alongside static text it takes time segments ({year}, {month}, {day}, {hour}, {minute}, {second}) and incrementing segments — digits as {#} padded with leading zeroes or {$} left unpadded, letters as {@} padded with leading as or {%} left unpadded. Repeating the character widens the segment, so {###} counts up to 999 and then carries over into the segment on its left; once the leftmost one overflows, the counter is exhausted and refuses to generate further values.

Example:

"ID-{year}-{@@}-{###}"

timeResetColumn
enum<string> | null

Time segment whose change restarts the incrementing segments from their initial value — year starts a fresh series every year. The segment has to appear in the pattern, and every coarser one should too, otherwise values from two periods collide. Left empty, the sequence keeps incrementing until it is exhausted.

Available options:
year,
month,
day,
hour,
minute,
second,
null
Example:

"year"