Skip to main content

Register

Register a new organization and create the first admin user account.

Request

POST /api/v1/auth/register

Authentication

Public - No authentication required.

Request Body

{
"organizationName": "Acme Corporation",
"email": "[email protected]",
"name": "John Doe",
"password": "SecurePass123!"
}
NameTypeRequiredDescription
organizationNamestringYesName of the organization to create
emailstringYesEmail address for the admin user (must be valid email format)
namestringNoFull name of the admin user
passwordstringYesPassword for the admin user (8-128 characters)

Response

Success Response (201 Created)

{
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refreshToken": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"expiresIn": 3600,
"tokenType": "Bearer",
"user": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"email": "[email protected]",
"name": "John Doe",
"isOrgAdmin": true,
"organizationId": "223e4567-e89b-12d3-a456-426614174001",
"organizationName": "Acme Corporation",
"organizationSlug": "acme-corporation",
"subscriptionTier": "FREE",
"mfaEnabled": false
}
}
FieldTypeDescription
accessTokenstringJWT access token for authenticated requests
refreshTokenstringRefresh token to obtain new access tokens
expiresInnumberAccess token expiration time in seconds
tokenTypestringToken type (always "Bearer")
userobjectUser information object
user.idstringUnique user ID (UUID)
user.emailstringUser's email address
user.namestringUser's full name
user.isOrgAdminbooleanWhether the user is an organization admin
user.organizationIdstringOrganization ID (UUID)
user.organizationNamestringOrganization name
user.organizationSlugstringURL-friendly organization identifier
user.subscriptionTierstringSubscription tier (FREE, BUSINESS, ENTERPRISE, PLATFORM)
user.mfaEnabledbooleanWhether MFA is enabled for this user

Error Responses

Status CodeDescription
400 Bad RequestInvalid request body (missing required fields, invalid email format, password too short/long)
409 ConflictEmail address already registered or organization name already taken
429 Too Many RequestsRate limit exceeded
500 Internal Server ErrorServer error occurred

Example

curl -X POST https://api.entryguard.io/api/v1/auth/register \
-H "Content-Type: application/json" \
-d '{
"organizationName": "Acme Corporation",
"email": "[email protected]",
"name": "John Doe",
"password": "SecurePass123!"
}'

Example Response

{
"accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjNlNDU2Ny1lODliLTEyZDMtYTQ1Ni00MjY2MTQxNzQwMDAiLCJvcmdJZCI6IjIyM2U0NTY3LWU4OWItMTJkMy1hNDU2LTQyNjYxNDE3NDAwMSIsInJvbGVzIjpbIk9SR19BRE1JTiJdLCJpYXQiOjE3MDkwNDk2MDAsImV4cCI6MTcwOTA1MzIwMH0.xyz123",
"refreshToken": "f47ac10b-58cc-4372-a567-0e02b2c3d479",
"expiresIn": 3600,
"tokenType": "Bearer",
"user": {
"id": "123e4567-e89b-12d3-a456-426614174000",
"email": "[email protected]",
"name": "John Doe",
"isOrgAdmin": true,
"organizationId": "223e4567-e89b-12d3-a456-426614174001",
"organizationName": "Acme Corporation",
"organizationSlug": "acme-corporation",
"subscriptionTier": "FREE",
"mfaEnabled": false
}
}