Authentication
POST /api/v1/auth/signup
Create a new organization and user account.
Authentication: None required
curl -X POST https://api.attributehq.com/v1/auth/signup \
-H "Content-Type: application/json" \
-d '{
"email": "dev@opay.com",
"password": "securepass123",
"name": "Adewale Ogundimu",
"company_name": "OPay"
}'Request Body:
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Email address (must be unique) |
password | string | Yes | Minimum 8 characters |
name | string | Yes | User’s full name |
company_name | string | Yes | Organization name |
Response (201 Created):
{
"success": true,
"data": {
"token": "eyJhbGciOiJIUzI1NiIs...",
"user": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"email": "dev@opay.com",
"name": "Adewale Ogundimu",
"role": "admin",
"org_id": "660e8400-e29b-41d4-a716-446655440000"
}
}
}Errors: 400 validation error, 409 email already exists
POST /api/v1/auth/login
Authenticate and receive a JWT token.
Authentication: None required
curl -X POST https://api.attributehq.com/v1/auth/login \
-H "Content-Type: application/json" \
-d '{
"email": "dev@opay.com",
"password": "securepass123"
}'Request Body:
| Field | Type | Required | Description |
|---|---|---|---|
email | string | Yes | Registered email |
password | string | Yes | Password |
Response (200 OK):
{
"success": true,
"data": {
"token": "eyJhbGciOiJIUzI1NiIs...",
"user": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"email": "dev@opay.com",
"name": "Adewale Ogundimu",
"role": "admin",
"org_id": "660e8400-e29b-41d4-a716-446655440000"
}
}
}Errors: 400 validation error, 401 invalid credentials
GET /api/v1/auth/me
Get the currently authenticated user.
Authentication: JWT required
curl https://api.attributehq.com/v1/auth/me \
-H "Authorization: Bearer YOUR_JWT_TOKEN"Response (200 OK):
{
"success": true,
"data": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"email": "dev@opay.com",
"name": "Adewale Ogundimu",
"role": "admin",
"org_id": "660e8400-e29b-41d4-a716-446655440000"
}
}Errors: 401 invalid or missing token