Skip to main content

Location

All JSON schemas are stored under resources/schemas/ in the project repository.
resources/schemas
user_profile.json
user_profile.schema.json
auth
user_profile_updated.v1.json
user_password_changed.v1.json
events
user.registered.v1.json

Available schemas

Schema fileTypeDescription
user_profile.jsonResponse shapeUser profile API response, scoped to /api/v1/users/{id}
user_profile.schema.jsonResponse shapeStrict JSON Schema draft-07 version of the user profile
auth/user_profile_updated.v1.jsonDomain eventEvent emitted when a user updates their profile
auth/user_password_changed.v1.jsonDomain eventEvent emitted when a user changes their password
events/user.registered.v1.jsonDomain eventEvent emitted when a new user completes registration

Schema details

user_profile

Defines the shape returned by user profile API endpoints. Fields:
FieldTypeRequired
idstringYes
tenantIdstringYes
namestringYes
emailstringYes
tenantNamestring | nullNo
tenantSlugstring | nullNo
createdAtstring (ISO 8601)Yes

user_profile_updated.v1

Domain event schema. Version: 1. Fields:
FieldTypeDescription
event_iduuidUnique instance identifier
typeconst: auth.user_profile_updatedEvent type
schema_versionconst: 1Schema version
payload.user_iduuidAffected user
payload.tenant_iduuidTenant context
payload.occurred_atdate-timeISO 8601 timestamp
payload.email_changedbooleanWhether email was changed

user_password_changed.v1

Domain event schema. Version: 1. Fields:
FieldTypeDescription
event_iduuidUnique instance identifier
typeconst: auth.user_password_changedEvent type
schema_versionconst: 1Schema version
payload.user_iduuidAffected user
payload.tenant_iduuidTenant context
payload.occurred_atdate-timeISO 8601 timestamp
payload.session_invalidatedbooleanWhether all sessions were revoked

user.registered.v1

Domain event emitted when registration completes. Fields:
FieldTypeDescription
userIdstring (UUID v7)New user ID
tenantIdstringTenant the user belongs to
emailemailRegistered email address
providerstringAuth provider (email, google, etc.)

Artisan commands

Publish schemas

Publish the bundled schemas to the application’s schema directory:
php artisan schema:publish

Check compatibility

Validate that the current schemas are backward-compatible with the previous version:
php artisan schema:check-compatibility

Generate TypeScript types from schemas

php artisan schema:generate-types

Swagger / OpenAPI endpoints

RouteDescription
GET /api/documentationSwagger UI — interactive API explorer
GET /docsOpenAPI JSON specification
GET /mock/{schema}Mock API server (available in local environment only)
The /mock/{schema} endpoint is only available when APP_ENV=local. It is not exposed in production environments.

Build docs developers (and LLMs) love