API Reference / Authentication
POST
/auth/registerRegister an organization
Create a new organization and its owner account. The account is created pending approval — you can log in once approved.
🌐 PublicTry in Console →
Purpose
Use this as the first step when a new travel company onboards to the platform. It provisions a tenant (organization) and an owner login. New accounts start in the "pending" state and must be approved by a marketplace admin before they can authenticate and call protected endpoints.
Authentication
This endpoint is public — no authentication required.
Parameters
| Name | In | Type | Description |
|---|---|---|---|
| email* | body | string | Owner login email |
| password* | body | string | Min 8 chars, upper + lower + number |
| orgName* | body | string | Organization display name |
| fullName* | body | string | Owner full name |
Request samples
bash
curl -X POST https://tourapi.nirajp.com.np/api/v1/auth/register \
-H "Content-Type: application/json" \
-d '{"email":"owner@org.com","password":"Secret123!","orgName":"My Travel Co","fullName":"Jane Doe"}'Success response
Returns 200 OK with the shape below.
| Field | Type | Description |
|---|---|---|
| id | number | User id of the created owner |
| string | Login email (echoed back) | |
| organizationId | number | Tenant id created for this org |
| role | string | Always "owner" for a new registration |
| status | string | "pending" until an admin approves the account |
json
{
"success": true,
"message": "Request successful.",
"data": {
"id": 12,
"email": "owner@org.com",
"organizationId": 9,
"role": "owner",
"status": "pending"
}
}Errors
All errors share the envelope { "success": false, "message": "..." }.
400A required field is missing or malformed (e.g. invalid email, short password).
json
{
"success": false,
"message": "Validation failed",
"errors": {
"email": "email must be a valid email"
}
}409The resource already exists (e.g. duplicate email on register).
json
{
"success": false,
"message": "Email already registered"
}500An unexpected error occurred on our side. Retry; if it persists, contact support.
json
{
"success": false,
"message": "Internal server error"
}