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!"
}
| Name | Type | Required | Description |
|---|---|---|---|
| organizationName | string | Yes | Name of the organization to create |
| string | Yes | Email address for the admin user (must be valid email format) | |
| name | string | No | Full name of the admin user |
| password | string | Yes | Password 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
}
}
| Field | Type | Description |
|---|---|---|
| accessToken | string | JWT access token for authenticated requests |
| refreshToken | string | Refresh token to obtain new access tokens |
| expiresIn | number | Access token expiration time in seconds |
| tokenType | string | Token type (always "Bearer") |
| user | object | User information object |
| user.id | string | Unique user ID (UUID) |
| user.email | string | User's email address |
| user.name | string | User's full name |
| user.isOrgAdmin | boolean | Whether the user is an organization admin |
| user.organizationId | string | Organization ID (UUID) |
| user.organizationName | string | Organization name |
| user.organizationSlug | string | URL-friendly organization identifier |
| user.subscriptionTier | string | Subscription tier (FREE, BUSINESS, ENTERPRISE, PLATFORM) |
| user.mfaEnabled | boolean | Whether MFA is enabled for this user |
Error Responses
| Status Code | Description |
|---|---|
| 400 Bad Request | Invalid request body (missing required fields, invalid email format, password too short/long) |
| 409 Conflict | Email address already registered or organization name already taken |
| 429 Too Many Requests | Rate limit exceeded |
| 500 Internal Server Error | Server 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
}
}