Skip to main content

API Quick Start

Get up and running with the Console API in under 5 minutes.

Prerequisites

  • Company slug and admin credentials
  • Tool to make HTTP requests (curl, Postman, or code)
  • (Optional) jq for formatting JSON responses

Step 1: Authenticate

Get an access token by logging in:

curl -X POST https://api.console.solucao42.com.br/v1/auth/login \
-H "Content-Type: application/json" \
-d '{
"company_slug": "your-company",
"email": "[email protected]",
"password": "your-password"
}'

Response:

{
"access_token": "eyJhbGciOiJIUzI1NiIs...",
"refresh_token": "eyJhbGciOiJIUzI1NiIs...",
"access_token_expires_in": 600,
"refresh_token_expires_in": 604800,
"user": {
"_id": "507f1f77bcf86cd799439011",
"email": "[email protected]",
"name": "Admin User"
}
}
Save the Token

Store the access_token for subsequent requests. It expires in 10 minutes.

Step 2: Make Your First API Call

Fetch the list of users:

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

Response:

{
"total": 3,
"quantity": 3,
"records": [
{
"_id": "507f1f77bcf86cd799439011",
"email": "[email protected]",
"name": "Admin User",
"status": "active"
}
]
}

Step 3: Invite a New User

curl -X POST https://api.console.solucao42.com.br/v1/users/invite \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"email": "[email protected]",
"group_ids": ["users-group"]
}'

Token Refresh

When your access token expires (10 min), refresh it:

curl -X POST https://api.console.solucao42.com.br/v1/auth/refresh \
-H "Content-Type: application/json" \
-d '{
"refresh_token": "YOUR_REFRESH_TOKEN"
}'

Returns new access and refresh tokens.

Next Steps

For Product Users

Managing users through the web interface? See the Product Documentation.