Skip to main content

POST /api/auth/register

Create a new user account in the FairMatch AI system. This endpoint registers either a company or candidate user.

Authentication

No authentication required.

Request body

name
string
required
Full name of the user
email
string
required
Email address for the user account. Must be unique.
password
string
required
User password. Will be hashed using bcrypt before storage. Maximum 72 bytes.
role
enum
required
User role type. Available values:
  • company - For hiring companies
  • candidate - For job seekers

Response

id
string
Unique 8-character user identifier generated on registration
name
string
Full name of the registered user
email
string
Email address of the registered user
role
string
Role assigned to the user (company or candidate)

Example request

curl -X POST https://api.fairmatch.ai/api/auth/register \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Jane Smith",
    "email": "[email protected]",
    "password": "securePassword123",
    "role": "candidate"
  }'
{
  "name": "Jane Smith",
  "email": "[email protected]",
  "password": "securePassword123",
  "role": "candidate"
}

Example response

{
  "id": "a3f8c2d1",
  "name": "Jane Smith",
  "email": "[email protected]",
  "role": "candidate"
}

Status codes

200
Success
User successfully registered
400
Error
Email already registered
{
  "detail": "Email already registered"
}

Implementation details

  • User IDs are generated as 8-character UUID prefixes
  • Passwords are truncated to 72 bytes before bcrypt hashing
  • Password hashes are stored in the database, not plaintext passwords
  • Email uniqueness is validated before account creation

Build docs developers (and LLMs) love