Skip to content
Engine API

Code Tables

Code Tables endpoints of the MedHook engine API: 14 operations with parameters, schemas and a curl example for each.

On this page

Lookup tables for field mappings. Workspace-scoped; names are unique across all workspaces.

List a code table's versions

get/api/code-tables/{id}/versions

Every save (create, edit, restore, import) writes a version with who saved it, its note and the full rows. Newest first, without the rows. The newest CODE_TABLE_HISTORY_MAX_VERSIONS (default 200) are kept per table.

Auth: Bearer token (how to get one) · Operation: listCodeTableVersions

Parameters

NameInTypeDescription
idrequiredpathstring

Code table id (must be in the caller's workspace).

Responses

  • 200The versions.
    Response fields

    application/json · object

    • codeTableIdstring
    • namestring
    • currentinteger | null
    • keptinteger
    • versionsarray of object
      9 fields
      • versioninteger
      • namestring

        The table's name at this save.

      • sourcestring

        One of: "create", "edit", "restore", "import", "backfill"

      • notestring | null
      • restoredFrominteger | null
      • createdBystring | null
      • createdAtstring (date-time)
      • rowCountinteger
      • summaryobject | null

        Counts of codes added, removed and changed against the version before, columnsChanged, and up to 50 of each kind's codes.

  • 404Code table or version not found in this workspace.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/code-tables/<id>/versions" \
  -H "Authorization: Bearer $TOKEN"

What a code table version changed

get/api/code-tables/{id}/versions/{version}

A row diff by code (first column). against=previous (default): against the version before; against=<n>: against another version; against=current: what restoring this version would change in the table now.

Auth: Bearer token (how to get one) · Operation: diffCodeTableVersion

Parameters

NameInTypeDescription
idrequiredpathstring

Code table id (must be in the caller's workspace).

versionrequiredpathinteger

Version number.

againstquerystring

"previous", "current" or a version number.

Responses

  • 200The diff.
    Response fields

    application/json · object

    • versioninteger
    • againstinteger | string | null
    • diffobject
      8 fields
      • columnsBeforearray of string
      • columnsAfterarray of string
      • columnsChangedboolean
      • addedarray of object
        2 fields
        • keystring

          The code (first column).

        • rowsarray of array of string
      • removedarray of object
        2 fields
        • keystring

          The code (first column).

        • rowsarray of array of string
      • changedarray of object
        3 fields
        • keystring
        • beforearray of array of string
        • afterarray of array of string
      • countsobject
        3 fields
        • addedinteger
        • removedinteger
        • changedinteger
      • truncatedboolean

        Detail is capped at 500 codes per kind; counts are exact.

  • 400A bad version or against value.

    application/json · ApiError

  • 404Code table or version not found in this workspace.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/code-tables/<id>/versions/1" \
  -H "Authorization: Bearer $TOKEN"

Restore a code table version

post/api/code-tables/{id}/versions/{version}/restore

Puts the version's columns and rows back, saved as a new version (the table keeps its current name). Running workflows see it on every replica within 1 s. Audited (code_table.restored). Operator. Rate limited: 20 req / 60 s.

Auth: Bearer token (how to get one) · Operation: restoreCodeTableVersion

Parameters

NameInTypeDescription
idrequiredpathstring

Code table id (must be in the caller's workspace).

versionrequiredpathinteger

Version number.

Request body

application/json · object

  • notestring

Responses

  • 200Restored.
    Response fields

    application/json · object

    • codeTableobject
    • versioninteger
    • restoredFrominteger
  • 404Code table or version not found in this workspace.

    application/json · ApiError

  • 409The table already matches this version.

    application/json · ApiError

Example request

curl
curl -X POST "$ENGINE_URL/api/code-tables/<id>/versions/1/restore" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "note": "string"
}'

List code tables

get/api/code-tables

Code tables in the caller's workspace. Rate limited: 30 req / 60 s (view=summary: 60 req / 60 s, a separate bucket). An unknown view or a malformed preview name is a 400.

Auth: Bearer token (how to get one) · Operation: listCodeTables

Parameters

NameInTypeDescription
namequerystring

Case-insensitive substring filter on the name (full view only).

viewquerystring

summary: each table's id, name, entryCount and columns, with entries {} and rows null except for the preview table (the step editor's light listing).

previewquerystring

With view=summary: the table whose first 5 entries are returned.

Responses

  • 200The workspace's code tables.
    Response fields

    application/json · object

  • 400Unknown view or malformed preview name.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/code-tables" \
  -H "Authorization: Bearer $TOKEN"

Create a code table

post/api/code-tables

Creates a table in the caller's workspace. Names are unique across all workspaces. Audited (code_table.created). Rate limited: 20 req / 60 s.

Auth: Bearer token (how to get one) · Operation: createCodeTable

Request body (required)

application/json · object

  • namestringrequired
  • entriesmap of string

    Source code → target value.

  • columnsarray of string

    Column names, in order (P091). A table made from entries has source and target.

  • rowsarray of array of string

    One array of cells per row, one cell per column; the first cell may not be empty. Send with columns instead of entries.

  • notestring

    Why it changed, kept on the version this save writes (GET /api/code-tables/{id}/versions).

Responses

  • 201Created.
    Response fields

    application/json · object

  • 400Invalid name, no entries, or columns and rows that break the rules (unique names, one cell per column).

    application/json · ApiError

  • 409The name is used by a code table in any workspace: "A code table with this name already exists (names are shared across workspaces because workflow lookups use the name)".

    application/json · ApiError

Example request

curl
curl -X POST "$ENGINE_URL/api/code-tables" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "string",
  "entries": {},
  "columns": [
    "string"
  ],
  "rows": [
    [
      "string"
    ]
  ],
  "note": "string"
}'

Get a code table

get/api/code-tables/{id}

Auth: Bearer token (how to get one) · Operation: getCodeTable

Parameters

NameInTypeDescription
idrequiredpathstring

Code table id (must be in the caller's workspace).

Responses

  • 200The table.
    Response fields

    application/json · object

  • 404Code table not found in this workspace.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/code-tables/<id>" \
  -H "Authorization: Bearer $TOKEN"

Update a code table

put/api/code-tables/{id}

Changes the name, the entries, or the columns and rows (at least one is required). Entries alone onto a table with more columns keep its other columns. A new name must be free in every workspace. Running workflows see the change on every replica within 1 s (lookups revalidate against updated_at). Audited (code_table.updated). Rate limited: 20 req / 60 s.

Auth: Bearer token (how to get one) · Operation: updateCodeTable

Parameters

NameInTypeDescription
idrequiredpathstring

Code table id (must be in the caller's workspace).

Request body (required)

application/json · object

  • namestring
  • entriesmap of string

    Source code → target value.

  • columnsarray of string

    Column names, in order (P091). A table made from entries has source and target.

  • rowsarray of array of string

    One array of cells per row, one cell per column; the first cell may not be empty. Send with columns instead of entries.

  • notestring

    Why it changed, kept on the version this save writes (GET /api/code-tables/{id}/versions).

Responses

  • 200Updated.
    Response fields

    application/json · object

  • 400Invalid name, or neither field given.

    application/json · ApiError

  • 404Code table not found in this workspace.

    application/json · ApiError

  • 409The name is used by a code table in any workspace: "A code table with this name already exists (names are shared across workspaces because workflow lookups use the name)".

    application/json · ApiError

Example request

curl
curl -X PUT "$ENGINE_URL/api/code-tables/<id>" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "string",
  "entries": {},
  "columns": [
    "string"
  ],
  "rows": [
    [
      "string"
    ]
  ],
  "note": "string"
}'

Delete a code table

delete/api/code-tables/{id}

Workflows that look the table up fail closed within 1 s on every replica (code table "x" does not exist): nothing passes through untranslated. Audited (code_table.deleted). Rate limited: 5 req / 60 s.

Auth: Bearer token (how to get one) · Operation: deleteCodeTable

Parameters

NameInTypeDescription
idrequiredpathstring

Code table id (must be in the caller's workspace).

Responses

  • 200Deleted.
    Response fields

    application/json · object

    • successboolean

      One of: true

    • deletedIdstring
    • deletedNamestring
    • deletedAtstring (date-time)
  • 404Code table not found in this workspace.

    application/json · ApiError

Example request

curl
curl -X DELETE "$ENGINE_URL/api/code-tables/<id>" \
  -H "Authorization: Bearer $TOKEN"

Message definitions

get/api/message-definitions

The workspace's HL7 v2 message definitions: Z-segment and renamed field names for the message inspector and the data map, segment structure, and allowed values from code tables for hl7-validate steps that use one as their profile.

Minimum role: viewer.

Auth: Bearer token (how to get one) · Operation: listMessageDefinitions

Responses

  • 200The definitions.
    Response fields

    application/json · object

    • definitionsarray of object
      13 fields
      • idstring

        Use it as an hl7-validate step's profile.

      • namestring

        Unique in the workspace.

      • descriptionstring | null
      • baseVersionstring

        2.3 to 2.8; default 2.5.1.

      • messageTypesarray of string

        MSH-9 types it applies to; empty: any message.

      • strictSegmentsboolean

        Segments it doesn't list are errors when validating (Z-segments never are).

      • segmentsarray of object

        In message order.

        5 fields
        • idstringrequired

          PID, ZPI…

        • descriptionstring

          Shown as the segment's name.

        • requiredboolean
        • maxinteger

          Most occurrences; 0 = any number. Default 1.

        • fieldsarray of object
          8 fields
          • positionintegerrequired

            The field number (PID-8 is 8).

          • namestring

            What people call it; shown in the inspector and data map.

          • datatypestring

            HL7 datatype (ST, CWE, XPN…). ST, ID, IS, NM, SI, TS, DTM, DT and TM are checked when validating.

          • requiredboolean
          • maxRepeatsinteger
          • maxLengthinteger

            Length of each repetition's first component.

          • codeTablestring

            A code table in the workspace whose first column lists the allowed values.

          • tableSeveritystring

            error | warning (default): a value outside the table.

            One of: "error", "warning"

      • segmentCountinteger
      • fieldCountinteger
      • createdBystring | null
      • updatedBystring | null
      • createdAtstring

        ISO 8601.

      • updatedAtstring

        ISO 8601.

    • totalinteger
  • 401No credential, or the token is invalid or expired.

    application/json · ApiError

  • 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/message-definitions" \
  -H "Authorization: Bearer $TOKEN"

Create a message definition

post/api/message-definitions

A code table it names that doesn't exist is a warning, not a refusal; a step validating with it fails until the table exists. Audited as message_definition.created.

Minimum role: operator.

Auth: Bearer token (how to get one) · Operation: createMessageDefinition

Request body (required)

application/json · object

  • namestringrequired

    Unique in the workspace.

  • descriptionstring | null
  • baseVersionstring

    2.3 to 2.8; default 2.5.1.

  • messageTypesarray of string

    MSH-9 types it applies to; empty: any message.

  • strictSegmentsboolean

    Segments it doesn't list are errors when validating (Z-segments never are).

  • segmentsarray of object

    In message order.

    5 fields
    • idstringrequired

      PID, ZPI…

    • descriptionstring

      Shown as the segment's name.

    • requiredboolean
    • maxinteger

      Most occurrences; 0 = any number. Default 1.

    • fieldsarray of object
      8 fields
      • positionintegerrequired

        The field number (PID-8 is 8).

      • namestring

        What people call it; shown in the inspector and data map.

      • datatypestring

        HL7 datatype (ST, CWE, XPN…). ST, ID, IS, NM, SI, TS, DTM, DT and TM are checked when validating.

      • requiredboolean
      • maxRepeatsinteger
      • maxLengthinteger

        Length of each repetition's first component.

      • codeTablestring

        A code table in the workspace whose first column lists the allowed values.

      • tableSeveritystring

        error | warning (default): a value outside the table.

        One of: "error", "warning"

Responses

  • 201The definition.
    Response fields

    application/json · object

    • definitionobject
      13 fields
      • idstring

        Use it as an hl7-validate step's profile.

      • namestring

        Unique in the workspace.

      • descriptionstring | null
      • baseVersionstring

        2.3 to 2.8; default 2.5.1.

      • messageTypesarray of string

        MSH-9 types it applies to; empty: any message.

      • strictSegmentsboolean

        Segments it doesn't list are errors when validating (Z-segments never are).

      • segmentsarray of object

        In message order.

        5 fields
        • idstringrequired

          PID, ZPI…

        • descriptionstring

          Shown as the segment's name.

        • requiredboolean
        • maxinteger

          Most occurrences; 0 = any number. Default 1.

        • fieldsarray of object
          8 fields
          • positionintegerrequired

            The field number (PID-8 is 8).

          • namestring

            What people call it; shown in the inspector and data map.

          • datatypestring

            HL7 datatype (ST, CWE, XPN…). ST, ID, IS, NM, SI, TS, DTM, DT and TM are checked when validating.

          • requiredboolean
          • maxRepeatsinteger
          • maxLengthinteger

            Length of each repetition's first component.

          • codeTablestring

            A code table in the workspace whose first column lists the allowed values.

          • tableSeveritystring

            error | warning (default): a value outside the table.

            One of: "error", "warning"

      • segmentCountinteger
      • fieldCountinteger
      • createdBystring | null
      • updatedBystring | null
      • createdAtstring

        ISO 8601.

      • updatedAtstring

        ISO 8601.

    • warningsarray of string

      Code tables it names that the workspace doesn't have yet.

  • 400The request is malformed or fails validation.

    application/json · ApiError

  • 401No credential, or the token is invalid or expired.

    application/json · ApiError

  • 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).

    application/json · ApiError

  • 409The request conflicts with the current state.

    application/json · ApiError

  • 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl -X POST "$ENGINE_URL/api/message-definitions" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "string",
  "description": "string",
  "baseVersion": "string",
  "messageTypes": [
    "string"
  ],
  "strictSegments": true,
  "segments": [
    {
      "id": "string",
      "description": "string",
      "required": true,
      "max": 0,
      "fields": [
        {
          "position": 0,
          "name": "string",
          "datatype": "string",
          "required": true,
          "maxRepeats": 0,
          "maxLength": 0,
          "codeTable": "string",
          "tableSeverity": "error"
        }
      ]
    }
  ]
}'

A message definition

get/api/message-definitions/{id}

The definition and the workflows whose Validate HL7 steps use it.

Minimum role: viewer.

Auth: Bearer token (how to get one) · Operation: getMessageDefinition

Parameters

NameInTypeDescription
idrequiredpathstring

Message definition id in the caller's workspace.

Responses

  • 200The definition.
    Response fields

    application/json · object

    • definitionobject
      13 fields
      • idstring

        Use it as an hl7-validate step's profile.

      • namestring

        Unique in the workspace.

      • descriptionstring | null
      • baseVersionstring

        2.3 to 2.8; default 2.5.1.

      • messageTypesarray of string

        MSH-9 types it applies to; empty: any message.

      • strictSegmentsboolean

        Segments it doesn't list are errors when validating (Z-segments never are).

      • segmentsarray of object

        In message order.

        5 fields
        • idstringrequired

          PID, ZPI…

        • descriptionstring

          Shown as the segment's name.

        • requiredboolean
        • maxinteger

          Most occurrences; 0 = any number. Default 1.

        • fieldsarray of object
          8 fields
          • positionintegerrequired

            The field number (PID-8 is 8).

          • namestring

            What people call it; shown in the inspector and data map.

          • datatypestring

            HL7 datatype (ST, CWE, XPN…). ST, ID, IS, NM, SI, TS, DTM, DT and TM are checked when validating.

          • requiredboolean
          • maxRepeatsinteger
          • maxLengthinteger

            Length of each repetition's first component.

          • codeTablestring

            A code table in the workspace whose first column lists the allowed values.

          • tableSeveritystring

            error | warning (default): a value outside the table.

            One of: "error", "warning"

      • segmentCountinteger
      • fieldCountinteger
      • createdBystring | null
      • updatedBystring | null
      • createdAtstring

        ISO 8601.

      • updatedAtstring

        ISO 8601.

    • usedByarray of string
  • 401No credential, or the token is invalid or expired.

    application/json · ApiError

  • 404Not found in the caller's workspace.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/message-definitions/<id>" \
  -H "Authorization: Bearer $TOKEN"

Replace a message definition

put/api/message-definitions/{id}

The whole definition, as POST. Steps that use it read the change within a second. Audited as message_definition.updated.

Minimum role: operator.

Auth: Bearer token (how to get one) · Operation: updateMessageDefinition

Parameters

NameInTypeDescription
idrequiredpathstring

Message definition id in the caller's workspace.

Request body (required)

application/json · object

  • namestringrequired

    Unique in the workspace.

  • descriptionstring | null
  • baseVersionstring

    2.3 to 2.8; default 2.5.1.

  • messageTypesarray of string

    MSH-9 types it applies to; empty: any message.

  • strictSegmentsboolean

    Segments it doesn't list are errors when validating (Z-segments never are).

  • segmentsarray of object

    In message order.

    5 fields
    • idstringrequired

      PID, ZPI…

    • descriptionstring

      Shown as the segment's name.

    • requiredboolean
    • maxinteger

      Most occurrences; 0 = any number. Default 1.

    • fieldsarray of object
      8 fields
      • positionintegerrequired

        The field number (PID-8 is 8).

      • namestring

        What people call it; shown in the inspector and data map.

      • datatypestring

        HL7 datatype (ST, CWE, XPN…). ST, ID, IS, NM, SI, TS, DTM, DT and TM are checked when validating.

      • requiredboolean
      • maxRepeatsinteger
      • maxLengthinteger

        Length of each repetition's first component.

      • codeTablestring

        A code table in the workspace whose first column lists the allowed values.

      • tableSeveritystring

        error | warning (default): a value outside the table.

        One of: "error", "warning"

Responses

  • 200The definition.
    Response fields

    application/json · object

    • definitionobject
      13 fields
      • idstring

        Use it as an hl7-validate step's profile.

      • namestring

        Unique in the workspace.

      • descriptionstring | null
      • baseVersionstring

        2.3 to 2.8; default 2.5.1.

      • messageTypesarray of string

        MSH-9 types it applies to; empty: any message.

      • strictSegmentsboolean

        Segments it doesn't list are errors when validating (Z-segments never are).

      • segmentsarray of object

        In message order.

        5 fields
        • idstringrequired

          PID, ZPI…

        • descriptionstring

          Shown as the segment's name.

        • requiredboolean
        • maxinteger

          Most occurrences; 0 = any number. Default 1.

        • fieldsarray of object
          8 fields
          • positionintegerrequired

            The field number (PID-8 is 8).

          • namestring

            What people call it; shown in the inspector and data map.

          • datatypestring

            HL7 datatype (ST, CWE, XPN…). ST, ID, IS, NM, SI, TS, DTM, DT and TM are checked when validating.

          • requiredboolean
          • maxRepeatsinteger
          • maxLengthinteger

            Length of each repetition's first component.

          • codeTablestring

            A code table in the workspace whose first column lists the allowed values.

          • tableSeveritystring

            error | warning (default): a value outside the table.

            One of: "error", "warning"

      • segmentCountinteger
      • fieldCountinteger
      • createdBystring | null
      • updatedBystring | null
      • createdAtstring

        ISO 8601.

      • updatedAtstring

        ISO 8601.

    • warningsarray of string

      Code tables it names that the workspace doesn't have yet.

  • 400The request is malformed or fails validation.

    application/json · ApiError

  • 401No credential, or the token is invalid or expired.

    application/json · ApiError

  • 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).

    application/json · ApiError

  • 404Not found in the caller's workspace.

    application/json · ApiError

  • 409The request conflicts with the current state.

    application/json · ApiError

  • 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl -X PUT "$ENGINE_URL/api/message-definitions/<id>" \
  -H "Authorization: Bearer $TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "string",
  "description": "string",
  "baseVersion": "string",
  "messageTypes": [
    "string"
  ],
  "strictSegments": true,
  "segments": [
    {
      "id": "string",
      "description": "string",
      "required": true,
      "max": 0,
      "fields": [
        {
          "position": 0,
          "name": "string",
          "datatype": "string",
          "required": true,
          "maxRepeats": 0,
          "maxLength": 0,
          "codeTable": "string",
          "tableSeverity": "error"
        }
      ]
    }
  ]
}'

Delete a message definition

delete/api/message-definitions/{id}

409 names the workflows whose Validate HL7 steps still use it. Audited as message_definition.deleted.

Minimum role: operator.

Auth: Bearer token (how to get one) · Operation: deleteMessageDefinition

Parameters

NameInTypeDescription
idrequiredpathstring

Message definition id in the caller's workspace.

Responses

  • 200Deleted.
    Response fields

    application/json · object

    • deletedboolean
  • 401No credential, or the token is invalid or expired.

    application/json · ApiError

  • 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).

    application/json · ApiError

  • 404Not found in the caller's workspace.

    application/json · ApiError

  • 409The request conflicts with the current state.

    application/json · ApiError

  • 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl -X DELETE "$ENGINE_URL/api/message-definitions/<id>" \
  -H "Authorization: Bearer $TOKEN"

How many other workflows use a code table

get/api/code-tables/usage

The step editor's Table section ("Shared with 3 other workflows."): how many workflows of the caller's workspace, other than workflowId, refer to the code table: a step's codeTableName, a data map's mapping[].lookup, or a script's declared config.codeTables. One query on workflow definitions, never on executions. Names and a count only, so the read is not audited and viewers get the same answer. Rate limited: 60 req / 60 s.

Minimum role: viewer.

Auth: Bearer token (how to get one) · Operation: getCodeTableUsage

Parameters

NameInTypeDescription
namerequiredquerystring

The code table name (letters, digits, _ and -; up to 100).

workflowIdquerystring

The workflow asking, left out of the count (up to 200). Absent: every workflow counts.

Responses

  • 200The count.
    Response fields

    application/json · object

    • namestring

      The code table name.

    • otherWorkflowsinteger

      Other workflows that refer to it.

  • 400The request is malformed or fails validation.

    application/json · ApiError

  • 401No credential, or the token is invalid or expired.

    application/json · ApiError

  • 403The caller's role, license or network address does not allow this. A signed-in person who is not a member of the requested workspace gets code `WORKSPACE_FORBIDDEN`; a viewer asking for message content gets `PHI_FORBIDDEN` (or `PHI_SEARCH_FORBIDDEN` for a search on message content).

    application/json · ApiError

  • 429Rate limit exceeded (see the `Retry-After` header), or on the AI routes the daily AI budget is used up.

    application/json · ApiError

  • 500Unexpected server error.

    application/json · ApiError

Example request

curl
curl "$ENGINE_URL/api/code-tables/usage?name=string" \
  -H "Authorization: Bearer $TOKEN"

Schemas

Named objects the operations above link to.

ApiError

The error body. error is always present. code is present on most errors and is the field to branch on; a few routes and the sign-in and role checks return only error (and sometimes detail).

  • errorstringrequired

    Human-readable error message.

  • codestring

    Machine-readable error code.

    One of: "BAD_REQUEST", "INVALID_REQUEST", "UNAUTHORIZED", "UNAUTHENTICATED", "FORBIDDEN", "NOT_FOUND", "CONFLICT", "UNPROCESSABLE_ENTITY", "RATE_LIMITED", "INTERNAL_ERROR", "SERVICE_UNAVAILABLE", "NOT_CONFIGURED", "SIGNATURE_REQUIRED", "INVALID_SIGNATURE", "TIMESTAMP_REQUIRED", "TIMESTAMP_INVALID", "TIMESTAMP_OUT_OF_TOLERANCE", "INVALID_CREDENTIALS", "INVALID_TOKEN", "PAYLOAD_TOO_LARGE", "INVALID_NDJSON", "PHI_NOT_AUTHORIZED", "PHI_IN_SANDBOX", "IN_PROGRESS", "RETRY_SCHEDULED", "WORKFLOW_DISABLED", "CONFLICTING_SCOPE", "ALREADY_DELIVERED", "CHAIN_TOO_DEEP", "NO_FAILED_DESTINATION", "STALE_SCOPE", "UNKNOWN_DESTINATION", "NO_DESTINATIONS", "NOT_A_MESSAGE", "AI_FEATURES_DISABLED"

  • detailsany

    Optional structured context about the error.

CodeTable

  • idstringrequired
  • namestringrequired
  • entriesmap of stringrequired

    First column → second column (the first row wins). What lookup() and per-field lookups read.

  • entryCountintegerrequired
  • columnsarray of string

    Column names, in order (P091). A table made from entries has source and target.

  • rowsarray of array of string | null

    Every row, or null when the rows are the entries (a plain two-column map).

  • rowCountinteger
  • createdAtstring (date-time)
  • updatedAtstring (date-time)