Skip to Content

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:

FieldTypeRequiredDescription
emailstringYesEmail address (must be unique)
passwordstringYesMinimum 8 characters
namestringYesUser’s full name
company_namestringYesOrganization 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:

FieldTypeRequiredDescription
emailstringYesRegistered email
passwordstringYesPassword

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