Skip to main content

API Overview

The Solução42 Console API is a RESTful API that allows you to manage companies, users, groups, and permissions programmatically.

Base URL

EnvironmentURL
Productionhttps://api.console.solucao42.com.br

All endpoints are prefixed with /v1/ for versioning.

Authentication

All API requests (except login and public endpoints) require authentication using a JWT token:

curl https://api.console.solucao42.com.br/v1/users \
-H "Authorization: Bearer YOUR_JWT_TOKEN"

See Authentication for details on obtaining tokens.

Request Format

Headers

HeaderRequiredDescription
AuthorizationYes*Bearer token for authentication
Content-TypeFor POST/PUTAlways application/json

*Not required for login and public endpoints.

Request Body

All request bodies must be valid JSON:

{
"name": "Example",
"email": "[email protected]"
}

Response Format

Successful Responses

Single resource:

{
"_id": "507f1f77bcf86cd799439011",
"name": "Example Resource",
"created_at": "2024-03-01T10:30:00.000Z"
}

List of resources:

{
"total": 100,
"quantity": 20,
"records": [
{ "_id": "...", "name": "Resource 1" },
{ "_id": "...", "name": "Resource 2" }
]
}
FieldDescription
totalTotal number of records matching your query
quantityNumber of records in this response
recordsArray of resource objects

Error Responses

Validation error (422):

{
"errors": [
{
"instancePath": "/email",
"message": "must be a valid email"
}
]
}

Business logic error (400):

{
"error": "User with this email already exists",
"error_code": "USER_EMAIL_DUPLICATE"
}

HTTP Status Codes

CodeDescription
200Success
201Created successfully
204Success with no content (e.g., delete)
400Bad request - check error message
401Unauthorized - invalid or missing token
403Forbidden - insufficient permissions
404Resource not found
422Validation error - check errors array
429Rate limit exceeded
500Internal server error

Pagination

List endpoints support pagination:

GET /v1/users?page=2&per_page=50
ParameterDefaultMaxDescription
page1-Page number (starts at 1)
per_page20100Items per page

Rate Limiting

To protect the API, rate limits are enforced:

Available Endpoints

Authentication

MethodEndpointDescription
GET/v1/auth/validate-companyCheck if company exists
POST/v1/auth/loginLogin with email/password
POST/v1/auth/googleLogin with Google OAuth
POST/v1/auth/passwordless/requestRequest login code
POST/v1/auth/passwordless/verifyVerify login code
POST/v1/auth/2fa/loginVerify 2FA token
GET/v1/auth/sso/:slug/startStart SSO flow
GET/v1/auth/meGet current user
POST/v1/auth/logoutLogout

View Authentication API →

Users

MethodEndpointDescription
GET/v1/usersList all users
GET/v1/users/:idGet user by ID
POST/v1/users/inviteInvite new user
POST/v1/users/accept-invitationAccept invitation
POST/v1/users/reset-password/requestRequest password reset
POST/v1/users/:id/activateActivate user
POST/v1/users/:id/deactivateDeactivate user
POST/v1/users/:id/groupsAdd groups to user
PUT/v1/users/:id/groupsReplace user groups
DELETE/v1/users/:id/groupsRemove groups from user

View Users API →

Groups

MethodEndpointDescription
GET/v1/groupsList all groups
GET/v1/groups/:idGet group by ID
POST/v1/groupsCreate group
PUT/v1/groups/:idUpdate group
DELETE/v1/groups/:idDelete group
POST/v1/groups/:id/permissionsAdd permissions
PUT/v1/groups/:id/permissionsReplace permissions
DELETE/v1/groups/:id/permissionsRemove permissions

View Groups API →

Permissions

MethodEndpointDescription
GET/v1/permissionsList all permissions
GET/v1/permissions/:idGet permission by ID
POST/v1/permissionsCreate permission
PUT/v1/permissions/:idUpdate permission
DELETE/v1/permissions/:idDelete permission

View Permissions API →

Error Codes

Common error codes you may encounter:

Error CodeDescription
INVALID_CREDENTIALSWrong email, password, or company
UNAUTHORIZEDToken missing or expired
FORBIDDENInsufficient permissions
VALIDATION_ERRORRequest validation failed
NOT_FOUNDResource doesn't exist
USER_EMAIL_DUPLICATEEmail already in use
COMPANY_NOT_FOUNDCompany slug not found
CANNOT_DEACTIVATE_SELFCannot deactivate your own user account

SDKs and Libraries

While we don't have official SDKs yet, here are community resources:

  • Example JavaScript client in our Getting Started guide
  • OpenAPI specification available upon request

Need Help?