For Developers

Audit Log Schemas Overview

Create and manage Schemas in the Edlink Dashboard. That is the supported way to add, update, and opt into starter Schemas.

Schema

A Schema describes what inputs are acceptable for a given action. action identifiers are always lowercased (e.g. Assignment.Submit is stored as assignment.submit), matching how Events normalize action on ingest. Defining a Schema is recommended: it lets Edlink validate incoming Events and reject or flag data that does not conform.

Each Schema has a validation_level, which dictates what Edlink should do with non-conforming Events it receives:

  • strict: non-conforming Events are rejected.
  • lax: the default if unspecified. Non-conforming Events are accepted but flagged with a warning in the response to the Create Event call.

If no Schema exists for an Event's action, the Event is still accepted. Create Event returns a warning that the action has no Schema.

Schemas are versioned. Each change in the dashboard closes the current version and opens a new one. Events are validated against the current Schema for that action at ingest time. When you read an Event back, schema is that version's UUID (omitted if none), and action_type comes from the Schema (other if none exists).

Properties

PropertyTypeRequiredDescription
actionobjectRequiredAn object with id (the action string identifier, e.g. assignment.submit; always stored lowercase) and type (see action).
validation_levelstringOptionalOne of strict or lax. Defaults to lax.
dataobjectOptionalAny valid JSON Schema object describing the shape of your custom data payload. data is stored as after on the Event.
beforeobjectOptionalAny valid JSON Schema object describing the shape of before (pre-update snapshot).
afterobjectOptionalAny valid JSON Schema object describing the shape of after (post-update snapshot, or the stored form of data).

The dashboard also shows:

PropertyTypeDescription
idstringUUID for this Schema.
versionstringUUID identifying this specific version of the Schema for this action.
created_datedateWhen this Schema version was defined.

action

Identifies which Events this Schema governs.

{
    "action": {
        "id": "assignment.submit",
        "type": "create"
    }
}
  • id: your action string identifier, such as assignment.submit. Always stored lowercase — mixed-case values are accepted and normalized.
  • type: one of create, read, update, delete, or other. This is copied onto matching Events as action_type. Until a Schema exists, Events for that action use action_type other.

validation_level

Dictates what Edlink does with non-conforming Events. One of strict or lax. Defaults to lax if unspecified.

data

Any valid JSON Schema object describing the shape of your custom data object. data on an Event is stored as after.

before

Any valid JSON Schema object describing the pre-update snapshot on update-tracking Events.

after

Any valid JSON Schema object describing the post-update snapshot. Events that send data are validated against this schema when data is not itself defined on the Schema.

A Schema may specify any subset of data, before, and after.

Other Event properties

No other Event properties (actor, targets, scope, context, severity) are controllable by a Schema. Edlink validates those fields against its own built-in expectations — see the Event documentation.

Starter actions and Schemas

It can be difficult to know what to track. Edlink provides starter Schemas for common actions that you can opt into for any application. All starters use validation_level: lax. User identity belongs on the Event actor — starter data / before / after schemas only describe optional contextual fields.

Add any missing starters from the dashboard (Add Starter Schemas). After that, the Schemas belong to your application and can be edited in the dashboard.

The starter definitions are:

  • user.login.success
    • Schema:
    {
        "validation_level": "lax",
        "action": {
            "id": "user.login.success",
            "type": "create"
        },
        "data": {
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "title": "user.login.success",
            "description": "An event describing a successful user login. Identify the user via the event actor.",
            "type": "object",
            "properties": {
              "application_name": {
                "description": "Name of the application the user is accessing",
                "type": "string"
              },
              "login_method": {
                "description": "How the user authenticated (e.g. password, sso, magic_link)",
                "type": "string"
              },
              "previous_login_date": {
                "description": "The timestamp of the user's last successful login",
                "type": "string"
              }
            }
        }
    }
    
  • user.login.error
    • Schema:
    {
        "validation_level": "lax",
        "action": {
            "id": "user.login.error",
            "type": "other"
        },
        "data": {
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "title": "user.login.error",
            "description": "An event describing a failed user login attempt. Identify the user via the event actor when known.",
            "type": "object",
            "properties": {
              "application_name": {
                "description": "Name of the application the user is accessing",
                "type": "string"
              },
              "login_method": {
                "description": "How the user attempted to authenticate (e.g. password, sso, magic_link)",
                "type": "string"
              },
              "error_code": {
                "description": "Application-specific code for the login failure",
                "type": "string"
              },
              "error_message": {
                "description": "Human-readable description of the login failure",
                "type": "string"
              }
            }
        }
    }
    
  • user.logout
    • Schema:
    {
        "validation_level": "lax",
        "action": {
            "id": "user.logout",
            "type": "delete"
        },
        "data": {
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "title": "user.logout",
            "description": "An event describing a user logging out of a client application. Identify the user via the event actor.",
            "type": "object",
            "properties": {
              "application_name": {
                "description": "Name of the application the user is accessing",
                "type": "string"
              },
              "session_duration_ms": {
                "description": "The duration of the user's session in milliseconds",
                "type": "integer"
              }
            }
        }
    }
    
  • resource.access
    • Schema:
    {
        "validation_level": "lax",
        "action": {
            "id": "resource.access",
            "type": "read"
        },
        "data": {
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "title": "resource.access",
            "description": "An event describing a user accessing a resource within a client application. Identify the user via the event actor.",
            "type": "object",
            "properties": {
              "application_name": {
                "description": "Name of the application the user is accessing",
                "type": "string"
              },
              "resource_id": {
                "description": "The unique identifier for the resource",
                "type": "string"
              },
              "resource_name": {
                "description": "The human-readable name of the resource",
                "type": "string"
              },
              "resource_type": {
                "description": "The internal type of the resource (text, video, etc)",
                "type": "string"
              }
            }
        }
    }
    
  • resource.create
    • Schema:
    {
        "validation_level": "lax",
        "action": {
            "id": "resource.create",
            "type": "create"
        },
        "data": {
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "title": "resource.create",
            "description": "An event describing a user creating a resource within a client application. Identify the user via the event actor.",
            "type": "object",
            "properties": {
              "application_name": {
                "description": "Name of the application the user is accessing",
                "type": "string"
              },
              "resource_id": {
                "description": "The unique identifier for the resource",
                "type": "string"
              },
              "resource_name": {
                "description": "The human-readable name of the resource",
                "type": "string"
              },
              "resource_type": {
                "description": "The internal type of the resource (text, video, etc)",
                "type": "string"
              }
            }
        }
    }
    
  • resource.update
    • Schema:
    {
        "validation_level": "lax",
        "action": {
            "id": "resource.update",
            "type": "update"
        },
        "before": {
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "title": "resource.update before",
            "description": "The resource as it existed before the update. Identify the user via the event actor.",
            "type": "object",
            "properties": {
              "application_name": {
                "description": "Name of the application the user is accessing",
                "type": "string"
              },
              "resource_id": {
                "description": "The unique identifier for the resource",
                "type": "string"
              },
              "resource_name": {
                "description": "The human-readable name of the resource",
                "type": "string"
              },
              "resource_type": {
                "description": "The internal type of the resource (text, video, etc)",
                "type": "string"
              }
            }
        },
        "after": {
            "$schema": "https://json-schema.org/draft/2020-12/schema",
            "title": "resource.update after",
            "description": "The resource as it exists after the update. Identify the user via the event actor.",
            "type": "object",
            "properties": {
              "application_name": {
                "description": "Name of the application the user is accessing",
                "type": "string"
              },
              "resource_id": {
                "description": "The unique identifier for the resource",
                "type": "string"
              },
              "resource_name": {
                "description": "The human-readable name of the resource",
                "type": "string"
              },
              "resource_type": {
                "description": "The internal type of the resource (text, video, etc)",
                "type": "string"
              }
            }
        }
    }