For Developers

Audit Log Schemas Overview

This model is part of an upcoming API update which is currently not available. Instead you can create schemas directly in the dashboard.

Schema

A Schema describes what kinds of 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.

A Schema is created through the Create Schema endpoint, updated through the Update Schema endpoint, and retrieved through the Get Schema endpoint. Each Schema is versioned; every successful update closes the current version and returns a new UUID version.

Details about the properties available on a Schema available here.

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.

You can add any missing starters from the dashboard (Add Starter Schemas), which creates each one via the normal Create Schema endpoint. After creation, the Schemas belong to your application — update them with PATCH as needed.

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"
              }
            }
        }
    }