Registration
Summary
Cheat sheet — pick a path, copy the curl, recognize the common errors.
Pick a path
| Need | Path | Credential |
|---|---|---|
| Create the first user right after the Eved Auth wizard | Admin via Eved dashboard | Your Eved session — open the Auth project, Users tab. |
| Let an admin in your product create other users | Admin via JWT (in-product) | Authorization: Bearer <admin-jwt> |
| Run a public signup page in your tenant's app | Server-side proxy | ck_* with users:create + X-Tenant-Code |
| One-off admin task without writing code | Admin via Eved dashboard | Your Eved session — Auth project, Users tab. |
Curl quick reference
In-product admin (JWT)
curl -X POST https://auth.febasi.com.br/api/v1/register \
-H "Authorization: Bearer $ADMIN_JWT" \
-H "Content-Type: application/json" \
-d '{
"email": "alice@acme.com",
"password": "Strong-Pass-12!"
}'Server-side proxy (Client Key)
curl -X POST https://auth.febasi.com.br/api/v1/register \
-H "X-API-Key: $CK_SECRET" \
-H "X-Tenant-Code: acme" \
-H "Content-Type: application/json" \
-d '{
"email": "alice@acme.com",
"password": "Strong-Pass-12!"
}'Both return 201 Created with the new user's id, email, username, cpfCnpj, tenantId, and createdAt.
Body in one glance
{
"email": "alice@acme.com", // one-of: email | username | cpfCnpj
"username": "alice", // 3–100 chars
"cpfCnpj": "12345678901", // exactly 11 (CPF) or 14 (CNPJ) digits
"password": "Strong-Pass-12!" // ≥ 8 chars + tenant's policy
}At least one of email, username, cpfCnpj is required. The endpoint does not assign roles — call POST /api/v1/roles/assign after.
Common errors
| Status | Code | Most likely cause |
|---|---|---|
| 400 | VALIDATION_ERROR | Missing every identifier, malformed field, or password under 8 chars. |
| 400 | PASSWORD_POLICY_VIOLATION | Password fails the tenant's passwordPolicy. Response includes violations[]. |
| 401 | MISSING_TENANT_CONTEXT | Client Key call without X-Tenant-Code, or X-Tenant-Code does not resolve. |
| 403 | INSUFFICIENT_SCOPE | Client Key lacks users:create. |
| 409 | CONFLICT | Email / username / CPF / CNPJ already taken inside that tenant. |
Next steps
- Authorization → RBAC and roles — assign roles to the newly-created user.
- Login and sessions → Login — what happens when that user authenticates.
- Reference → Errors — full error catalog.