Skip to main content

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

FeatureDetails
ProtocolREST over HTTPS
AuthenticationJWT (HS256) with refresh tokens
Response FormatJSON
Base URLhttps://api.console.solucao42.com.br
API Versionv1 (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:

ConceptDescription
Access TokenShort-lived JWT (10 min) for API requests
Refresh TokenLong-lived token (7 days) to renew access tokens
CompanyRoot tenant representing a customer organization
GroupCollection of users with specific permissions
ContextCurrent company scope in JWT

API Conventions

REST Endpoints

MethodPurposeExample
GET /resourcesList allGET /v1/users
GET /resources/:idGet oneGET /v1/users/123
POST /resourcesCreatePOST /v1/users/invite
PATCH /resources/:idUpdatePATCH /v1/users/123
DELETE /resources/:idDeleteDELETE /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

StatusMeaning
200Success
201Created
400Bad request
401Not authenticated
403Not authorized
404Not found
422Validation error
429Rate limit exceeded

Next Steps

  1. Quick Start - Make your first API request
  2. Authentication Flows - Understand JWT tokens
  3. API Reference - Explore all endpoints
  4. 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?