Console API Documentation
The Solução42 Console API is a RESTful API that lets you integrate multi-tenant user management, authentication, and authorization into your applications.
What You Can Build
🔐 Authentication
Implement JWT-based auth with token refresh, SSO, and 2FA support.
👥 User Management
Programmatically create, invite, and manage users across your organization.
🔒 Authorization
Build role-based access control with groups and permissions.
🏢 Multi-Tenancy
Handle multiple customers with complete data isolation.
API Characteristics
| Feature | Details |
|---|---|
| Protocol | REST over HTTPS |
| Authentication | JWT (HS256) with refresh tokens |
| Response Format | JSON |
| Base URL | https://api.console.solucao42.com.br |
| API Version | v1 (prefix: /v1/) |
Quick Example
Here's how easy it is to authenticate and fetch users:
// 1. Login to get tokens
const response = await fetch('https://api.console.solucao42.com.br/v1/auth/login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
company_slug: 'acme-corp',
email: '[email protected]',
password: 'your-secure-password'
})
});
const { access_token } = await response.json();
// 2. Use the token to fetch users
const users = await fetch('https://api.console.solucao42.com.br/v1/users', {
headers: { 'Authorization': `Bearer ${access_token}` }
});
console.log(await users.json());
// { total: 25, quantity: 20, records: [...] }
Core Concepts
Before diving in, understand these key concepts:
| Concept | Description |
|---|---|
| Access Token | Short-lived JWT (10 min) for API requests |
| Refresh Token | Long-lived token (7 days) to renew access tokens |
| Company | Root tenant representing a customer organization |
| Group | Collection of users with specific permissions |
| Context | Current company scope in JWT |
API Conventions
REST Endpoints
| Method | Purpose | Example |
|---|---|---|
GET /resources | List all | GET /v1/users |
GET /resources/:id | Get one | GET /v1/users/123 |
POST /resources | Create | POST /v1/users/invite |
PATCH /resources/:id | Update | PATCH /v1/users/123 |
DELETE /resources/:id | Delete | DELETE /v1/users/123 |
Pagination
All list endpoints support pagination:
GET /v1/users?page=2&per_page=50&sort_by=-created_at
Response format:
{
"total": 150,
"quantity": 20,
"records": [...]
}
Error Handling
| Status | Meaning |
|---|---|
200 | Success |
201 | Created |
400 | Bad request |
401 | Not authenticated |
403 | Not authorized |
404 | Not found |
422 | Validation error |
429 | Rate limit exceeded |
Next Steps
- Quick Start - Make your first API request
- Authentication Flows - Understand JWT tokens
- API Reference - Explore all endpoints
- Integration Guides - Build auth into your app
For Product Users
Using the Console web interface? See the Product Documentation for UI guides and walkthroughs.
Need Help?
- 📧 Email: [email protected]
- 📚 GitHub: Example Projects
- 💬 Discord: Join our developer community