Texecom Event Schemas

JSON Schema Documentation

Audit Event Log Payload

Payload for all audit log events. Every audit entry — regardless of category or code — uses this schema. The specific action is identified via audit.reference; Lambda routing branches on that field without platform changes.

$idhttps://schemas.texecom-prod.com/v2/events/payload/service/audit/event/log/v1.0.0.json
$schemahttp://json-schema.org/draft-07/schema

Properties

NameType
actorObject
auditObject
attributesObject

actor

Description Who performed the action.
TypeObject
Required Yes

Properties

NameType
userIdInteger
userGroupIdInteger
username[string, null]
actorTypeString

actor.userId

Description Numeric user ID from the audit_log table. 0 for system-initiated events.
TypeInteger
Required Yes

actor.userGroupId

Description Numeric user group ID from the audit_log table. 0 for system-initiated events.
TypeInteger
Required Yes

actor.username

Description Human-readable username (str_user argument in fern.Audit.log()). Null for system-initiated events.
Type[string, null]
Required Yes

actor.actorType

Description system when userId is 0, user otherwise.
TypeString
Required Yes
Enum
  • user
  • system

audit

Description What happened — self-describing, no database or code lookups required to interpret.
TypeObject
Required Yes

Properties

NameType
referenceString
categoryIdInteger
categoryNameString
codeInteger
descriptionString

audit.reference

Description String key from fern.Audit.Codes, e.g. UserLoggedIn. Used for Lambda internal routing.
TypeString
Required Yes

audit.categoryId

Description Numeric audit_log_category, embedded at write time.
TypeInteger
Required Yes

audit.categoryName

Description Human-readable category name resolved from fern.Audit.Categories at write time.
TypeString
Required Yes

audit.code

Description Numeric audit_log_code.
TypeInteger
Required Yes

audit.description

Description Human-readable description resolved from fern.Audit.Codes at write time.
TypeString
Required Yes

attributes

Description Named contextual fields replacing the generic data1-4 and text columns. Keys are camelCase labels registered in fern.Audit.Codes. Fields with an empty label are omitted.
TypeObject
Required Yes

Schema

{
    "$id": "https://schemas.texecom-prod.com/v2/events/payload/service/audit/event/log/v1.0.0.json",
    "$schema": "http://json-schema.org/draft-07/schema",
    "title": "Audit Event Log Payload",
    "description": "Payload for all audit log events. Every audit entry — regardless of category or code — uses this schema. The specific action is identified via audit.reference; Lambda routing branches on that field without platform changes.",
    "type": "object",
    "properties": {
        "actor": {
            "description": "Who performed the action.",
            "type": "object",
            "properties": {
                "userId": {
                    "description": "Numeric user ID from the audit_log table. 0 for system-initiated events.",
                    "type": "integer"
                },
                "userGroupId": {
                    "description": "Numeric user group ID from the audit_log table. 0 for system-initiated events.",
                    "type": "integer"
                },
                "username": {
                    "description": "Human-readable username (str_user argument in fern.Audit.log()). Null for system-initiated events.",
                    "type": [
                        "string",
                        "null"
                    ]
                },
                "actorType": {
                    "description": "system when userId is 0, user otherwise.",
                    "type": "string",
                    "enum": [
                        "user",
                        "system"
                    ]
                }
            },
            "required": [
                "userId",
                "userGroupId",
                "username",
                "actorType"
            ],
            "additionalProperties": false
        },
        "audit": {
            "description": "What happened — self-describing, no database or code lookups required to interpret.",
            "type": "object",
            "properties": {
                "reference": {
                    "description": "String key from fern.Audit.Codes, e.g. UserLoggedIn. Used for Lambda internal routing.",
                    "type": "string"
                },
                "categoryId": {
                    "description": "Numeric audit_log_category, embedded at write time.",
                    "type": "integer"
                },
                "categoryName": {
                    "description": "Human-readable category name resolved from fern.Audit.Categories at write time.",
                    "type": "string"
                },
                "code": {
                    "description": "Numeric audit_log_code.",
                    "type": "integer"
                },
                "description": {
                    "description": "Human-readable description resolved from fern.Audit.Codes at write time.",
                    "type": "string"
                }
            },
            "required": [
                "reference",
                "categoryId",
                "categoryName",
                "code",
                "description"
            ],
            "additionalProperties": false
        },
        "attributes": {
            "description": "Named contextual fields replacing the generic data1-4 and text columns. Keys are camelCase labels registered in fern.Audit.Codes. Fields with an empty label are omitted.",
            "type": "object",
            "additionalProperties": {
                "type": [
                    "string",
                    "integer",
                    "null"
                ]
            }
        }
    },
    "required": [
        "actor",
        "audit",
        "attributes"
    ],
    "additionalProperties": false
}