Skip to content

Codebook

A named catalogue of what the numbers a device reports mean: one entry per value, with a short name for lists and charts and an optional text wording the value as a sentence — both translatable. A schema property points here through its display spec (schema module), which may first cut the value into named fields; because an entry's text may name the other fields, each code words the rest of the value its own way — the catalogue is the case distinction.

The wording is composed at render time, in the reader's own locale. Changes are pushed as CODEBOOK_CREATE, CODEBOOK_UPDATE, CODEBOOK_ENTRIES_WRITE, CODEBOOK_ENTRY_DELETE and CODEBOOK_DELETE over the websocket.

POSTCreate a codebook/api/v1/codebook
GETList codebooks/api/v1/codebook
GETRead one codebook/api/v1/codebook/:codebookId
PATCHUpdate a codebook/api/v1/codebook/:codebookId
DELETEDelete a codebook/api/v1/codebook/:codebookId
GETList entries of a codebook/api/v1/codebook/:codebookId/entries
GETRead one entry/api/v1/codebook/:codebookId/entries/:key
PUTWrite entries/api/v1/codebook/:codebookId/entries
DELETEDelete one entry/api/v1/codebook/:codebookId/entries/:key

Create a codebook

Registers the catalogue itself — its meanings are written afterwards with PUT …/entries. codebookId is chosen by the caller and is the reference a schema holds; it cannot be changed later.

POST/api/v1/codebook

Body

NameDescription
codebookIdstringSlug naming the codebook, chosen by the caller rather than generated: a schema references a catalogue by it, so deleting and re-importing has to land on the same name. Lowercase letters, digits and -, 2 to 63 characters.
Pattern: ^[a-z0-9][a-z0-9-]{1,62}$
namestringHuman-readable name of the catalogue, at most 64 characters.
min length 1 · max length 64
descriptionstringoptionalWhat the catalogue is for; optional, at most 256 characters.
max length 256
tenantIdstringoptionalWhich tenant the codebook belongs to; only needed when the caller's access spans several tenants, otherwise it is inferred.
Pattern: ^[0-9A-HJ-NP-Za-km-z]{9,16}$

Response

NameDescription
resourceIdentifierstringUnique Coldwave resource name (CRN) that identifies a resource

Errors

StatusDescriptionBody
403You do not have permission to perform this action
409A tenant with the given name already existscode: IAM_TENANT_CONFLICT_ERROR
400A limit was reached — 64 codebooks per tenant, or 4096 entries in one codebook. message names the limit; delete what is no longer in use before writing more.message: string
409The tenant already has a codebook with this codebookId — write into that one with PUT …/entries, or choose another id.
401No valid access token was presented, or the DPoP proof accompanying it was missing, expired or bound to a different key.error: string
500The request failed for a reason that is not the caller's to fix. Safe to retry.error: string, message: string, statusCode: 50

List codebooks

Lists the tenant's codebooks with their metadata only. Entries never travel on a list — they are read per codebook with GET …/entries.

GET/api/v1/codebook

Response

NameDescription
codebookIdstringSlug naming the codebook, chosen by the caller rather than generated: a schema references a catalogue by it, so deleting and re-importing has to land on the same name. Lowercase letters, digits and -, 2 to 63 characters.
Pattern: ^[a-z0-9][a-z0-9-]{1,62}$
namestringHuman-readable name of the catalogue, at most 64 characters.
min length 1 · max length 64
descriptionstringoptionalWhat the catalogue is for; absent when none was written.
max length 256
resourceIdentifierstringUnique Coldwave resource name (CRN) that identifies a resource
createdBystringResource identifier of the entity that created this resource
createdAtintegerUnix timestamp in milliseconds when this resource was created.

Errors

StatusDescriptionBody
403You do not have permission to perform this action
409A tenant with the given name already existscode: IAM_TENANT_CONFLICT_ERROR
401No valid access token was presented, or the DPoP proof accompanying it was missing, expired or bound to a different key.error: string
500The request failed for a reason that is not the caller's to fix. Safe to retry.error: string, message: string, statusCode: 50

Read one codebook

Metadata of one codebook. The response does not grow with the catalogue — the meanings are a separate read.

GET/api/v1/codebook/fault-codes

Path Parameters

NameDescription
codebookIdstringSlug naming the codebook, chosen by the caller rather than generated: a schema references a catalogue by it, so deleting and re-importing has to land on the same name. Lowercase letters, digits and -, 2 to 63 characters.
Pattern: ^[a-z0-9][a-z0-9-]{1,62}$

Response

NameDescription
codebookIdstringSlug naming the codebook, chosen by the caller rather than generated: a schema references a catalogue by it, so deleting and re-importing has to land on the same name. Lowercase letters, digits and -, 2 to 63 characters.
Pattern: ^[a-z0-9][a-z0-9-]{1,62}$
namestringHuman-readable name of the catalogue, at most 64 characters.
min length 1 · max length 64
descriptionstringoptionalWhat the catalogue is for; absent when none was written.
max length 256
resourceIdentifierstringUnique Coldwave resource name (CRN) that identifies a resource
createdBystringResource identifier of the entity that created this resource
createdAtintegerUnix timestamp in milliseconds when this resource was created.

Errors

StatusDescriptionBody
403You do not have permission to perform this action
404No codebook with this codebookId in the tenant, or no entry under this key. GET /codebook lists what exists.
409A tenant with the given name already existscode: IAM_TENANT_CONFLICT_ERROR
400The request did not match the schema for this endpoint. The details field carries the specific failures.error: Validation Error
401No valid access token was presented, or the DPoP proof accompanying it was missing, expired or bound to a different key.error: string
500The request failed for a reason that is not the caller's to fix. Safe to retry.error: string, message: string, statusCode: 50

Update a codebook

Changes name or description; an omitted field is left alone, an explicit null clears the description. codebookId is not among them — it is the reference schemas hold.

PATCH/api/v1/codebook/fault-codes

Path Parameters

NameDescription
codebookIdstringSlug naming the codebook, chosen by the caller rather than generated: a schema references a catalogue by it, so deleting and re-importing has to land on the same name. Lowercase letters, digits and -, 2 to 63 characters.
Pattern: ^[a-z0-9][a-z0-9-]{1,62}$

Body

NameDescription
namestringoptionalNew name; omitting it leaves the stored one as it is.
min length 1 · max length 64
descriptionstringoptionalNew description; null clears it, omitting it leaves it as it is.
max length 256

Errors

StatusDescriptionBody
403You do not have permission to perform this action
404No codebook with this codebookId in the tenant, or no entry under this key. GET /codebook lists what exists.
409A tenant with the given name already existscode: IAM_TENANT_CONFLICT_ERROR
400The request did not match the schema for this endpoint. The details field carries the specific failures.error: Validation Error
401No valid access token was presented, or the DPoP proof accompanying it was missing, expired or bound to a different key.error: string
500The request failed for a reason that is not the caller's to fix. Safe to retry.error: string, message: string, statusCode: 50

Delete a codebook

Removes the codebook together with every entry in it. Refused while any schema of the tenant still renders a field through this codebookId — drop that reference first.

DELETE/api/v1/codebook/fault-codes

Path Parameters

NameDescription
codebookIdstringSlug naming the codebook, chosen by the caller rather than generated: a schema references a catalogue by it, so deleting and re-importing has to land on the same name. Lowercase letters, digits and -, 2 to 63 characters.
Pattern: ^[a-z0-9][a-z0-9-]{1,62}$

Errors

StatusDescriptionBody
403You do not have permission to perform this action
404No codebook with this codebookId in the tenant, or no entry under this key. GET /codebook lists what exists.
409The delete was refused because a schema of the tenant still renders a field through this codebook. Remove or retarget that field's codebook render, then repeat the delete.message: string
409A tenant with the given name already existscode: IAM_TENANT_CONFLICT_ERROR
400The request did not match the schema for this endpoint. The details field carries the specific failures.error: Validation Error
401No valid access token was presented, or the DPoP proof accompanying it was missing, expired or bound to a different key.error: string
500The request failed for a reason that is not the caller's to fix. Safe to retry.error: string, message: string, statusCode: 50

List entries of a codebook

Every meaning in the codebook, ordered numerically by key rather than as text. Unpaged — a codebook holds at most 4096 entries.

GET/api/v1/codebook/fault-codes/entries

Path Parameters

NameDescription
codebookIdstringSlug naming the codebook, chosen by the caller rather than generated: a schema references a catalogue by it, so deleting and re-importing has to land on the same name. Lowercase letters, digits and -, 2 to 63 characters.
Pattern: ^[a-z0-9][a-z0-9-]{1,62}$

Response

NameDescription
keystringThe value this entry describes, as a decimal string, canonical: the lookup compares it verbatim, so 0001 would store and serve cleanly and then never match. Up to 20 digits, the widest unsigned 64-bit value.
Pattern: ^(0|[1-9]\d{0,19})$
namestringThe label on its own — what a list, a filter or a chart shows.
min length 1 · max length 96
textstringoptionalThe label worded as a sentence, with {{slot}} references to the other fields of the property that selected this entry; absent means name is the whole answer.
min length 1 · max length 120
i18ndictionaryoptionalTranslations of name and text, keyed by locale. A reader gets the exact locale, then the bare language, then the untranslated value.
namestringoptionalTranslated label.
min length 1 · max length 96
textstringoptionalTranslated sentence; carries its own {{slot}} references.
min length 1 · max length 120
resourceIdentifierstringUnique Coldwave resource name (CRN) that identifies a resource
codebookstringUnique Coldwave resource name (CRN) that identifies a resource
codeintegeroptionalkey as a number, so a database can sort numerically — as text, 10 comes before 9. Omitted once the key grows past what a JavaScript number holds exactly.
min 0 · max 9007199254740991

Errors

StatusDescriptionBody
403You do not have permission to perform this action
404No codebook with this codebookId in the tenant, or no entry under this key. GET /codebook lists what exists.
409A tenant with the given name already existscode: IAM_TENANT_CONFLICT_ERROR
400The request did not match the schema for this endpoint. The details field carries the specific failures.error: Validation Error
401No valid access token was presented, or the DPoP proof accompanying it was missing, expired or bound to a different key.error: string
500The request failed for a reason that is not the caller's to fix. Safe to retry.error: string, message: string, statusCode: 50

Read one entry

One meaning, addressed by the decimal value it describes. {key} is canonical decimal — 0001 is rejected rather than read as 1.

GET/api/v1/codebook/fault-codes/entries/258

Path Parameters

NameDescription
codebookIdstringSlug naming the codebook, chosen by the caller rather than generated: a schema references a catalogue by it, so deleting and re-importing has to land on the same name. Lowercase letters, digits and -, 2 to 63 characters.
Pattern: ^[a-z0-9][a-z0-9-]{1,62}$
keystringThe value this entry describes, as a decimal string, canonical: the lookup compares it verbatim, so 0001 would store and serve cleanly and then never match. Up to 20 digits, the widest unsigned 64-bit value.
Pattern: ^(0|[1-9]\d{0,19})$

Response

NameDescription
keystringThe value this entry describes, as a decimal string, canonical: the lookup compares it verbatim, so 0001 would store and serve cleanly and then never match. Up to 20 digits, the widest unsigned 64-bit value.
Pattern: ^(0|[1-9]\d{0,19})$
namestringThe label on its own — what a list, a filter or a chart shows.
min length 1 · max length 96
textstringoptionalThe label worded as a sentence, with {{slot}} references to the other fields of the property that selected this entry; absent means name is the whole answer.
min length 1 · max length 120
i18ndictionaryoptionalTranslations of name and text, keyed by locale. A reader gets the exact locale, then the bare language, then the untranslated value.
namestringoptionalTranslated label.
min length 1 · max length 96
textstringoptionalTranslated sentence; carries its own {{slot}} references.
min length 1 · max length 120
resourceIdentifierstringUnique Coldwave resource name (CRN) that identifies a resource
codebookstringUnique Coldwave resource name (CRN) that identifies a resource
codeintegeroptionalkey as a number, so a database can sort numerically — as text, 10 comes before 9. Omitted once the key grows past what a JavaScript number holds exactly.
min 0 · max 9007199254740991

Errors

StatusDescriptionBody
403You do not have permission to perform this action
404No codebook with this codebookId in the tenant, or no entry under this key. GET /codebook lists what exists.
409A tenant with the given name already existscode: IAM_TENANT_CONFLICT_ERROR
400The request did not match the schema for this endpoint. The details field carries the specific failures.error: Validation Error
401No valid access token was presented, or the DPoP proof accompanying it was missing, expired or bound to a different key.error: string
500The request failed for a reason that is not the caller's to fix. Safe to retry.error: string, message: string, statusCode: 50

Write entries

Upserts by key — an entry named here replaces the stored one wholesale, one not named is left alone, so this PUT never empties a catalogue. At most 500 entries per call and 4096 per codebook; removing a meaning is an explicit DELETE.

PUT/api/v1/codebook/fault-codes/entries

Path Parameters

NameDescription
codebookIdstringSlug naming the codebook, chosen by the caller rather than generated: a schema references a catalogue by it, so deleting and re-importing has to land on the same name. Lowercase letters, digits and -, 2 to 63 characters.
Pattern: ^[a-z0-9][a-z0-9-]{1,62}$

Body

NameDescription
entriesarrayThe entries to write — 1 to 500 per call, and unique by key within one body.
keystringThe value this entry describes, as a decimal string, canonical: the lookup compares it verbatim, so 0001 would store and serve cleanly and then never match. Up to 20 digits, the widest unsigned 64-bit value.
Pattern: ^(0|[1-9]\d{0,19})$
namestringThe label on its own, 1 to 96 characters — what a list, a filter or a chart shows.
min length 1 · max length 96
textstringoptionalThe label worded as a sentence; every {{…}} must be a field slot, or the write is rejected. Absent means name is the whole answer.
min length 1 · max length 120
i18ndictionaryoptionalTranslations of name and text, keyed by locale such as de-DE; at most 16 locales.
namestringoptionalTranslated label.
min length 1 · max length 96
textstringoptionalTranslated sentence; carries its own {{slot}} references.
min length 1 · max length 120

Response

NameDescription
writtenintegerHow many entries the request carried — what was sent, not what actually changed.
min 0

Errors

StatusDescriptionBody
403You do not have permission to perform this action
404No codebook with this codebookId in the tenant, or no entry under this key. GET /codebook lists what exists.
400A limit was reached — 64 codebooks per tenant, or 4096 entries in one codebook. message names the limit; delete what is no longer in use before writing more.message: string
409A tenant with the given name already existscode: IAM_TENANT_CONFLICT_ERROR
401No valid access token was presented, or the DPoP proof accompanying it was missing, expired or bound to a different key.error: string
500The request failed for a reason that is not the caller's to fix. Safe to retry.error: string, message: string, statusCode: 50

Delete one entry

Removes one meaning from the codebook. A value that no longer has an entry still renders — as its bare number.

DELETE/api/v1/codebook/fault-codes/entries/258

Path Parameters

NameDescription
codebookIdstringSlug naming the codebook, chosen by the caller rather than generated: a schema references a catalogue by it, so deleting and re-importing has to land on the same name. Lowercase letters, digits and -, 2 to 63 characters.
Pattern: ^[a-z0-9][a-z0-9-]{1,62}$
keystringThe value this entry describes, as a decimal string, canonical: the lookup compares it verbatim, so 0001 would store and serve cleanly and then never match. Up to 20 digits, the widest unsigned 64-bit value.
Pattern: ^(0|[1-9]\d{0,19})$

Errors

StatusDescriptionBody
403You do not have permission to perform this action
404No codebook with this codebookId in the tenant, or no entry under this key. GET /codebook lists what exists.
409A tenant with the given name already existscode: IAM_TENANT_CONFLICT_ERROR
400The request did not match the schema for this endpoint. The details field carries the specific failures.error: Validation Error
401No valid access token was presented, or the DPoP proof accompanying it was missing, expired or bound to a different key.error: string
500The request failed for a reason that is not the caller's to fix. Safe to retry.error: string, message: string, statusCode: 50

Events

Published on the tenant's event stream and delivered over the websocket to every subscriber holding read on the resource the message names. resourceIdentifier is the resource the action changed; the payload is the shape below.

EventDescription
CODEBOOK_CREATEA codebook was registered — metadata only, still without any entries.
CODEBOOK_DELETEA codebook was removed together with all of its entries.
CODEBOOK_ENTRIES_WRITEMeanings were written as one batch — an import of several hundred is a single event, not several hundred.
CODEBOOK_ENTRY_DELETEA single meaning was removed from a codebook.
CODEBOOK_UPDATEThe name or description of a codebook was changed; carries the merged document.

Codebook created

A codebook was registered — metadata only, still without any entries.

EVENTCODEBOOK_CREATE

Payload

NameDescription
codebookIdstringSlug naming the codebook, chosen by the caller rather than generated: a schema references a catalogue by it, so deleting and re-importing has to land on the same name. Lowercase letters, digits and -, 2 to 63 characters.
Pattern: ^[a-z0-9][a-z0-9-]{1,62}$
namestringHuman-readable name of the catalogue, at most 64 characters.
min length 1 · max length 64
descriptionstringoptionalWhat the catalogue is for; absent when none was written.
max length 256
resourceIdentifierstringUnique Coldwave resource name (CRN) that identifies a resource
createdBystringResource identifier of the entity that created this resource
createdAtintegerUnix timestamp in milliseconds when this resource was created.

Codebook deleted

A codebook was removed together with all of its entries.

EVENTCODEBOOK_DELETE

Payload

NameDescription

Entries written

Meanings were written as one batch — an import of several hundred is a single event, not several hundred.

EVENTCODEBOOK_ENTRIES_WRITE

Payload

NameDescription
entriesarrayThe entries the write carries — a batch of codebook meanings, or a user's key/value map.
keystringThe value this entry describes, as a decimal string, canonical: the lookup compares it verbatim, so 0001 would store and serve cleanly and then never match. Up to 20 digits, the widest unsigned 64-bit value.
Pattern: ^(0|[1-9]\d{0,19})$
namestringThe label on its own — what a list, a filter or a chart shows. Up to 96 characters, because these are written alongside the firmware rather than filed by hand.
min length 1 · max length 96
textstringoptionalThe label worded as a sentence, with {{slot}} references to the other fields of the property that selected this entry. Absent means name is the whole answer.
min length 1 · max length 120
i18ndictionaryoptionalTranslations of this entry, keyed by locale, at most 16 of them. Rendering takes the exact locale, then the bare language, then the entry's own wording, so a partial translation is fine.
namestringoptionalTranslated name; falls back to the entry's own when this locale does not carry it.
min length 1 · max length 96
textstringoptionalTranslated text; falls back to the entry's own when this locale does not carry it.
min length 1 · max length 120
resourceIdentifierstringUnique Coldwave resource name (CRN) that identifies a resource
codebookstringUnique Coldwave resource name (CRN) that identifies a resource
codeintegeroptionalkey as a number, written only so an editor can sort in the database — sorted as text, 10 comes before 9. Omitted above 2^53, where a JavaScript number stops being exact.
min 0 · max 9007199254740991

Entry deleted

A single meaning was removed from a codebook.

EVENTCODEBOOK_ENTRY_DELETE

Payload

NameDescription

Codebook updated

The name or description of a codebook was changed; carries the merged document.

EVENTCODEBOOK_UPDATE

Payload

NameDescription
codebookIdstringSlug naming the codebook, chosen by the caller rather than generated: a schema references a catalogue by it, so deleting and re-importing has to land on the same name. Lowercase letters, digits and -, 2 to 63 characters.
Pattern: ^[a-z0-9][a-z0-9-]{1,62}$
namestringHuman-readable name of the catalogue, at most 64 characters.
min length 1 · max length 64
descriptionstringoptionalWhat the catalogue is for; absent when none was written.
max length 256
resourceIdentifierstringUnique Coldwave resource name (CRN) that identifies a resource
createdBystringResource identifier of the entity that created this resource
createdAtintegerUnix timestamp in milliseconds when this resource was created.