Docs

Core Concepts

The building blocks of LogStitch. Understanding these concepts will help you design your audit log integration.

Organizations#

An organization is your company's LogStitch account. It is the top-level container for everything you create — projects, API keys, team members, and billing. When you sign up for LogStitch, an organization is created for you automatically.

Projects#

A project represents a product or application within your organization. Events, API keys, and redaction rules are all scoped to a single project. If your company ships multiple products, create a project for each one to keep their audit logs separate.

Tenants#

Tenants are your customers. Every event you send to LogStitch includes a tenant_id that identifies which of your customers the event belongs to. The embeddable log viewer uses this field to show each customer only their own activity.

Events#

Events are immutable, structured records of something that happened in your application. Once ingested, events cannot be modified or deleted.

Key event fields

NameTypeRequiredDescription
actionstringRequiredDot-namespaced, past tense identifier (e.g. user.created, document.shared).
categorystringRequiredOne of: auth, access, mutation, admin, security, system.
actorobjectRequiredThe user or service that performed the action. Includes id, type, and optional name/email.
tenant_idstringRequiredIdentifies which of your customers this event belongs to.
targetobjectOptionalThe resource being acted upon. Includes id, type, and optional name.
metadataobjectOptionalArbitrary key-value pairs for additional context. Subject to PII redaction rules.

API Keys#

LogStitch uses two types of API keys. Master keys (prefixed mk_) have full administrative access to your organization. Project keys (prefixed pk_) are scoped to a single project and used for event ingestion, querying, and creating viewer tokens.

Key security

Never expose master keys or project keys in client-side code. Use them server-side only. Viewer tokens are the only credential safe for the browser.

ID Formats#

LogStitch IDs use type prefixes for easy identification. Most use ULID format, while viewer tokens use JWTs.

ID prefixes

NameTypeRequiredDescription
evt_ULIDRequiredEvent IDs.
mk_ULIDRequiredMaster key IDs.
pk_ULIDRequiredProject key IDs.
vt_JWTRequiredViewer token IDs.

Action Naming#

Actions are dot-namespaced, lowercase, and use past tense. The format describes what resource was affected and what happened to it.

Valid action names
// resource.action_performed
'user.created'
'document.shared'
'member.invited'
'api_key.rotated'
'permission.revoked'

Actions must match the pattern: ^[a-z][a-z0-9_]*(\.[a-z][a-z0-9_]*)+$

Categories#

Every event must have one of six categories. Categories help organize and filter events in the log viewer and API queries.

Event categories

NameTypeRequiredDescription
authcategoryOptionalAuthentication events — sign in, sign out, password changes, MFA.
accesscategoryOptionalResource access events — viewing, downloading, or reading data.
mutationcategoryOptionalData changes — creating, updating, or deleting resources.
admincategoryOptionalAdministrative actions — managing users, roles, settings, billing.
securitycategoryOptionalSecurity-related events — permission changes, key rotations, suspicious activity.
systemcategoryOptionalSystem events — automated actions, cron jobs, integrations, webhooks.