DICTRA Auth Service API
API Endpoint
https://api.dictra.com.brVersion: 1.0.0 Base URL: https://api.dictra.com.br
The DICTRA Auth Service provides authentication, authorization, and user management capabilities for the DICTRA PIX payment platform. This service implements LSO/RSO (First and Second Signature) dual approval workflow for sensitive operations.
Features
-
JWT-based authentication with access and refresh tokens
-
User and entity management with encrypted PII
-
Permission-based authorization with bitmap storage
-
LSO/RSO dual approval workflow for critical operations
-
Comprehensive audit logging
-
Active Directory integration support
Authentication
Most endpoints require a valid JWT token in the Authorization header:
Authorization: Bearer <access_token>
Public endpoints (login, refresh) do not require authentication.
Error Codes
| Code | HTTP Status | Description |
|---|---|---|
| AUTH001 | 401 | Invalid credentials |
| AUTH002 | 403 | Account is locked |
| AUTH003 | 403 | Account is inactive |
| AUTH004 | 403 | Account pending approval |
| AUTH005 | 403 | Entity is inactive |
| AUTH010 | 401 | Session expired or revoked |
| AUTH011 | 401 | Session inactive due to timeout |
| AUTH020 | 400 | Current password is incorrect |
| AUTH021 | 400 | New password does not meet requirements |
| AUTH022 | 400 | Password was recently used |
| USER001 | 409 | Login already exists |
| USER002 | 409 | Email already exists |
| USER003 | 400 | Password does not meet requirements |
| USER004 | 400 | Entity is inactive |
| ENTITY001 | 409 | Entity code already exists |
| ENTITY002 | 400 | Consolidation entity is inactive |
| GROUP001 | 409 | Group code already exists in entity |
| GROUP002 | 400 | Entity is inactive |
| GROUP003 | 409 | Group has active users |
| APPROVAL001 | 409 | Operation has expired |
| APPROVAL002 | 409 | Operation is not in a valid state for LSO approval |
| APPROVAL003 | 409 | Cannot approve your own request |
| APPROVAL004 | 409 | RSO must be different from LSO approver |
| APPROVAL005 | 409 | Operation is not in a valid state for rejection |
Health & Status ¶
Health Check ¶
Headers
Content-Type: application/jsonBody
{
"status": "ok"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status": {
"type": "string"
}
},
"required": [
"status"
]
}Health CheckGET/health
Liveness probe endpoint. Returns 200 if service is running.
Readiness Check ¶
Headers
Content-Type: application/jsonBody
{
"status": "ready",
"database": "connected"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status": {
"type": "string"
},
"database": {
"type": "string"
}
},
"required": [
"status",
"database"
]
}Headers
Content-Type: application/jsonBody
{
"status": "not ready",
"database": "disconnected"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"status": {
"type": "string"
},
"database": {
"type": "string"
}
},
"required": [
"status",
"database"
]
}Readiness CheckGET/ready
Readiness probe endpoint. Returns 200 if service is ready (database connected).
Authentication ¶
Login ¶
Headers
Content-Type: application/jsonBody
{
"login": "admin",
"password": "Admin@2026!"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"login": {
"type": "string",
"description": "User login"
},
"password": {
"type": "string",
"description": "User password"
}
},
"required": [
"login",
"password"
]
}Headers
Content-Type: application/jsonBody
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expires_in": 3600,
"user": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"entity_id": "550e8400-e29b-41d4-a716-446655440001",
"group_id": "550e8400-e29b-41d4-a716-446655440002",
"login": "admin",
"name": "System Administrator",
"email": "admin@dictra.com.br",
"status": "ACTIVE",
"is_admin": true,
"last_login_at": "2026-01-24T10:30:00Z"
},
"must_change_password": false
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"token": {
"type": "string",
"description": "JWT access token"
},
"refresh_token": {
"type": "string",
"description": "JWT refresh token"
},
"expires_in": {
"type": "number",
"description": "Token expiration in seconds"
},
"user": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "User UUID"
},
"entity_id": {
"type": "string",
"description": "Entity UUID"
},
"group_id": {
"type": "string",
"description": "Group UUID"
},
"login": {
"type": "string",
"description": "User login"
},
"name": {
"type": "string",
"description": "User full name"
},
"email": {
"type": "string",
"description": "User email"
},
"status": {
"type": "string",
"enum": [
"ACTIVE",
"INACTIVE",
"PENDING_APPROVAL",
"LOCKED",
"SUSPENDED"
],
"description": "User status"
},
"is_admin": {
"type": "boolean",
"description": "Whether user is admin"
},
"last_login_at": {
"type": "string",
"description": "Last login timestamp"
}
},
"required": [
"id",
"entity_id",
"group_id",
"login",
"name",
"email",
"status",
"is_admin"
],
"description": "User information"
},
"must_change_password": {
"type": "boolean",
"description": "Password change required"
}
},
"required": [
"token",
"refresh_token",
"expires_in",
"user"
]
}Headers
Content-Type: application/jsonBody
{
"error": "Invalid credentials",
"code": "AUTH001"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Error message"
},
"code": {
"type": "string",
"description": "Error code"
},
"details": {
"type": "object",
"properties": {},
"description": "Additional error details"
}
},
"required": [
"error",
"code"
]
}Headers
Content-Type: application/jsonBody
{
"error": "Account is locked",
"code": "AUTH002"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Error message"
},
"code": {
"type": "string",
"description": "Error code"
},
"details": {
"type": "object",
"properties": {},
"description": "Additional error details"
}
},
"required": [
"error",
"code"
]
}LoginPOST/api/v1/auth/login
Authenticate a user and obtain access and refresh tokens.
Refresh Token ¶
Headers
Content-Type: application/jsonBody
{
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"refresh_token": {
"type": "string",
"description": "Refresh token"
}
},
"required": [
"refresh_token"
]
}Headers
Content-Type: application/jsonBody
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"expires_in": 3600
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"token": {
"type": "string",
"description": "New JWT access token"
},
"refresh_token": {
"type": "string",
"description": "New JWT refresh token"
},
"expires_in": {
"type": "number",
"description": "Token expiration in seconds"
}
},
"required": [
"token",
"refresh_token",
"expires_in"
]
}Headers
Content-Type: application/jsonBody
{
"error": "Session expired or revoked",
"code": "AUTH010"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Error message"
},
"code": {
"type": "string",
"description": "Error code"
},
"details": {
"type": "object",
"properties": {},
"description": "Additional error details"
}
},
"required": [
"error",
"code"
]
}Refresh TokenPOST/api/v1/auth/refresh
Refresh an access token using a refresh token.
Logout ¶
Headers
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...Headers
Content-Type: application/jsonBody
{
"error": "Invalid credentials",
"code": "AUTH001"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Error message"
},
"code": {
"type": "string",
"description": "Error code"
},
"details": {
"type": "object",
"properties": {},
"description": "Additional error details"
}
},
"required": [
"error"
]
}LogoutPOST/api/v1/auth/logout
Revoke the current session.
Get Current User ¶
Headers
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...Headers
Content-Type: application/jsonBody
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"entity_id": "550e8400-e29b-41d4-a716-446655440001",
"group_id": "550e8400-e29b-41d4-a716-446655440002",
"login": "admin",
"name": "System Administrator",
"email": "admin@dictra.com.br",
"status": "ACTIVE",
"is_admin": true,
"permissions": [
1
]
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"entity_id": {
"type": "string"
},
"group_id": {
"type": "string"
},
"login": {
"type": "string"
},
"name": {
"type": "string"
},
"email": {
"type": "string"
},
"status": {
"type": "string"
},
"is_admin": {
"type": "boolean"
},
"permissions": {
"type": "array"
}
},
"required": [
"id",
"entity_id",
"group_id",
"login",
"name",
"email",
"status",
"is_admin",
"permissions"
]
}Get Current UserGET/api/v1/auth/me
Get information about the currently authenticated user.
Change Password ¶
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...Body
{
"current_password": "OldPassword@2026!",
"new_password": "NewPassword@2026!"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"current_password": {
"type": "string",
"description": "Current password"
},
"new_password": {
"type": "string",
"description": "New password (min 12 chars)"
}
},
"required": [
"current_password",
"new_password"
]
}Headers
Content-Type: application/jsonBody
{
"message": "password changed successfully"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string"
}
},
"required": [
"message"
]
}Headers
Content-Type: application/jsonBody
{
"error": "Current password is incorrect",
"code": "AUTH020"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Error message"
},
"code": {
"type": "string",
"description": "Error code"
},
"details": {
"type": "object",
"properties": {},
"description": "Additional error details"
}
},
"required": [
"error",
"code"
]
}Change PasswordPOST/api/v1/auth/change-password
Change the current user’s password.
Users ¶
List Users ¶
Headers
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...Headers
Content-Type: application/jsonBody
{
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"entity_id": "550e8400-e29b-41d4-a716-446655440001",
"group_id": "550e8400-e29b-41d4-a716-446655440002",
"login": "admin",
"name": "System Administrator",
"email": "admin@dictra.com.br",
"status": "ACTIVE",
"is_admin": true,
"last_login_at": "2026-01-24T10:30:00Z"
}
],
"pagination": {
"page": 1,
"page_size": 20,
"total_count": 100,
"total_pages": 5
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"data": {
"type": "array",
"description": "User list"
},
"pagination": {
"type": "object",
"properties": {
"page": {
"type": "number"
},
"page_size": {
"type": "number"
},
"total_count": {
"type": "number"
},
"total_pages": {
"type": "number"
}
},
"required": [
"page",
"page_size",
"total_count",
"total_pages"
]
}
},
"required": [
"data",
"pagination"
]
}List UsersGET/api/v1/users{?page,page_size,search,status,group_id,entity_id}
List users with pagination and filters. Non-admin users can only see users in their entity.
- page
number(optional) Example: 1Page number (default: 1)
- page_size
number(optional) Example: 20Items per page (max: 100, default: 20)
- search
string(optional) Example: johnSearch in login, name, email
- status
string(optional) Example: ACTIVEFilter by status
Choices:
ACTIVEINACTIVEPENDING_APPROVALLOCKEDSUSPENDED- group_id
string(optional) Example: 550e8400-e29b-41d4-a716-446655440000Filter by group
- entity_id
string(optional) Example: 550e8400-e29b-41d4-a716-446655440001Filter by entity (admin only)
Get User ¶
Headers
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...Headers
Content-Type: application/jsonBody
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"entity_id": "550e8400-e29b-41d4-a716-446655440001",
"entity_name": "DICTRA",
"group_id": "550e8400-e29b-41d4-a716-446655440002",
"group_name": "System Administrator",
"login": "admin",
"name": "System Administrator",
"email": "admin@dictra.com.br",
"status": "ACTIVE",
"is_admin": true,
"can_approve": true,
"permissions": [
1
],
"last_login_at": "2026-01-24T10:30:00Z",
"created_at": "2026-01-01T00:00:00Z"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "string"
},
"entity_id": {
"type": "string"
},
"entity_name": {
"type": "string"
},
"group_id": {
"type": "string"
},
"group_name": {
"type": "string"
},
"login": {
"type": "string"
},
"name": {
"type": "string"
},
"email": {
"type": "string"
},
"status": {
"type": "string"
},
"is_admin": {
"type": "boolean"
},
"can_approve": {
"type": "boolean"
},
"permissions": {
"type": "array"
},
"last_login_at": {
"type": "string"
},
"created_at": {
"type": "string"
}
},
"required": [
"id",
"entity_id",
"entity_name",
"group_id",
"group_name",
"login",
"name",
"email",
"status",
"is_admin",
"can_approve",
"permissions",
"created_at"
]
}Headers
Content-Type: application/jsonBody
{
"error": "Invalid credentials",
"code": "AUTH001"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Error message"
},
"code": {
"type": "string",
"description": "Error code"
},
"details": {
"type": "object",
"properties": {},
"description": "Additional error details"
}
},
"required": [
"error"
]
}Get UserGET/api/v1/users/{id}
Get user details by ID.
- id
string(required) Example: 550e8400-e29b-41d4-a716-446655440000User UUID
Create User ¶
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...Body
{
"entity_id": "550e8400-e29b-41d4-a716-446655440001",
"group_id": "550e8400-e29b-41d4-a716-446655440002",
"login": "johndoe",
"name": "John Doe",
"email": "john.doe@example.com",
"password": "SecurePass@2026!",
"must_change_password": true
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"entity_id": {
"type": "string",
"description": "Entity UUID"
},
"group_id": {
"type": "string",
"description": "Group UUID"
},
"login": {
"type": "string",
"description": "User login (3-50 chars)"
},
"name": {
"type": "string",
"description": "Full name (2-200 chars)"
},
"email": {
"type": "string",
"description": "Email address"
},
"password": {
"type": "string",
"description": "Password (min 12 chars)"
},
"must_change_password": {
"type": "boolean",
"description": "Force password change on first login"
}
},
"required": [
"entity_id",
"group_id",
"login",
"name",
"email",
"password"
]
}Headers
Content-Type: application/jsonBody
{
"message": "User creation pending approval",
"pending_operation_id": "550e8400-e29b-41d4-a716-446655440099",
"status": "PENDING_LSO",
"user_id": "550e8400-e29b-41d4-a716-446655440000"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string"
},
"pending_operation_id": {
"type": "string"
},
"status": {
"type": "string"
},
"user_id": {
"type": "string"
}
},
"required": [
"message",
"pending_operation_id",
"status",
"user_id"
]
}Headers
Content-Type: application/jsonBody
{
"error": "Login already exists",
"code": "USER001"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Error message"
},
"code": {
"type": "string",
"description": "Error code"
},
"details": {
"type": "object",
"properties": {},
"description": "Additional error details"
}
},
"required": [
"error",
"code"
]
}Create UserPOST/api/v1/users
Create a new user. This operation requires LSO/RSO approval.
Update User ¶
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...Body
{
"name": "John Doe Updated",
"email": "john.updated@example.com",
"group_id": "550e8400-e29b-41d4-a716-446655440003"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"name": {
"type": "string",
"description": "Full name"
},
"email": {
"type": "string",
"description": "Email address"
},
"group_id": {
"type": "string",
"description": "New group UUID"
}
}
}Headers
Content-Type: application/jsonBody
{
"message": "User update pending approval",
"pending_operation_id": "550e8400-e29b-41d4-a716-446655440099",
"status": "PENDING_LSO"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string"
},
"pending_operation_id": {
"type": "string"
},
"status": {
"type": "string"
}
},
"required": [
"message",
"pending_operation_id",
"status"
]
}Headers
Content-Type: application/jsonBody
{
"error": "Invalid credentials",
"code": "AUTH001"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"error": {
"type": "string",
"description": "Error message"
},
"code": {
"type": "string",
"description": "Error code"
},
"details": {
"type": "object",
"properties": {},
"description": "Additional error details"
}
},
"required": [
"error"
]
}Update UserPUT/api/v1/users/{id}
Update user information. This operation requires LSO/RSO approval.
- id
string(required) Example: 550e8400-e29b-41d4-a716-446655440000User UUID
Deactivate User ¶
Headers
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...Headers
Content-Type: application/jsonBody
{
"message": "User deactivation pending approval",
"pending_operation_id": "550e8400-e29b-41d4-a716-446655440099",
"status": "PENDING_LSO"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string"
},
"pending_operation_id": {
"type": "string"
},
"status": {
"type": "string"
}
},
"required": [
"message",
"pending_operation_id",
"status"
]
}Deactivate UserDELETE/api/v1/users/{id}
Deactivate a user account. This operation requires LSO/RSO approval.
- id
string(required) Example: 550e8400-e29b-41d4-a716-446655440000User UUID
Entities ¶
List Entities ¶
Headers
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...Headers
Content-Type: application/jsonBody
{
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"code": "DICTRA",
"name": "DICTRA",
"legal_name": "DICTRA Tecnologia LTDA",
"cnpj": "12.345.***/**67-89",
"ispb": "12345678",
"type": "BANK",
"status": "ACTIVE",
"created_at": "2026-01-24T10:30:00Z"
}
],
"pagination": {
"page": 1,
"page_size": 20,
"total_count": 50,
"total_pages": 3
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"data": {
"type": "array"
},
"pagination": {
"type": "object",
"properties": {
"page": {
"type": "number"
},
"page_size": {
"type": "number"
},
"total_count": {
"type": "number"
},
"total_pages": {
"type": "number"
}
},
"required": [
"page",
"page_size",
"total_count",
"total_pages"
]
}
},
"required": [
"data",
"pagination"
]
}List EntitiesGET/api/v1/entities{?page,page_size,search,status,type,consolidation_id}
List entities with pagination and filters.
- page
number(optional) Example: 1Page number
- page_size
number(optional) Example: 20Items per page (max: 100)
- search
string(optional) Example: bankSearch in code, name
- status
string(optional) Example: ACTIVEFilter by status
- type
string(optional) Example: BANKFilter by type
- consolidation_id
string(optional) Example: 550e8400-e29b-41d4-a716-446655440000Filter by consolidation
Get Entity ¶
Headers
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...Headers
Content-Type: application/jsonBody
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"code": "DICTRA",
"name": "DICTRA",
"legal_name": "DICTRA Tecnologia LTDA",
"cnpj": "12.345.***/**67-89",
"ispb": "12345678",
"type": "BANK",
"status": "ACTIVE",
"created_at": "2026-01-24T10:30:00Z"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Entity UUID"
},
"code": {
"type": "string",
"description": "Entity code"
},
"name": {
"type": "string",
"description": "Entity name"
},
"legal_name": {
"type": "string",
"description": "Legal name"
},
"cnpj": {
"type": "string",
"description": "Masked CNPJ"
},
"ispb": {
"type": "string",
"description": "ISPB code"
},
"type": {
"type": "string",
"enum": [
"BANK",
"FINTECH",
"PSP",
"BACEN",
"OTHER"
],
"description": "Entity type"
},
"status": {
"type": "string",
"enum": [
"ACTIVE",
"INACTIVE",
"PENDING_APPROVAL",
"SUSPENDED"
],
"description": "Entity status"
},
"created_at": {
"type": "string",
"description": "Creation timestamp"
}
},
"required": [
"id",
"code",
"name",
"legal_name",
"cnpj",
"type",
"status",
"created_at"
]
}Get EntityGET/api/v1/entities/{id}
Get entity details by ID.
- id
string(required) Example: 550e8400-e29b-41d4-a716-446655440000Entity UUID
Create Entity ¶
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...Body
{
"code": "BANK01",
"name": "Example Bank",
"legal_name": "Example Bank S.A.",
"cnpj": "12345678000190",
"ispb": "12345678",
"type": "BANK",
"consolidation_id": "550e8400-e29b-41d4-a716-446655440000"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"code": {
"type": "string",
"description": "Entity code (2-20 chars)"
},
"name": {
"type": "string",
"description": "Entity name (2-200 chars)"
},
"legal_name": {
"type": "string",
"description": "Legal name (2-300 chars)"
},
"cnpj": {
"type": "string",
"description": "CNPJ (14 digits)"
},
"ispb": {
"type": "string",
"description": "ISPB code (8 digits)"
},
"type": {
"type": "string",
"enum": [
"BANK"
],
"description": "Entity type"
},
"consolidation_id": {
"type": "string",
"description": "Parent entity UUID"
}
},
"required": [
"code",
"name",
"legal_name",
"cnpj",
"type"
]
}Headers
Content-Type: application/jsonBody
{
"message": "Entity creation pending approval",
"pending_operation_id": "550e8400-e29b-41d4-a716-446655440099",
"status": "PENDING_LSO",
"entity_id": "550e8400-e29b-41d4-a716-446655440000"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string"
},
"pending_operation_id": {
"type": "string"
},
"status": {
"type": "string"
},
"entity_id": {
"type": "string"
}
},
"required": [
"message",
"pending_operation_id",
"status",
"entity_id"
]
}Create EntityPOST/api/v1/entities
Create a new entity. This operation requires LSO/RSO approval. Admin only.
Approvals ¶
List Pending Operations ¶
Headers
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...Headers
Content-Type: application/jsonBody
{
"data": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"entity_id": "550e8400-e29b-41d4-a716-446655440001",
"operation_type": 1,
"operation_type_name": "USER_REGISTRATION",
"target_table: `dictra_auth.users`": "",
"target_id": "550e8400-e29b-41d4-a716-446655440002",
"status": "PENDING_LSO",
"requested_by": "550e8400-e29b-41d4-a716-446655440003",
"requested_at": "2026-01-24T10:30:00Z",
"expires_at": "2026-01-31T10:30:00Z",
"is_expired": false
}
],
"pagination": {}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"data": {
"type": "array"
},
"pagination": {
"type": "object",
"properties": {}
}
},
"required": [
"data",
"pagination"
]
}List Pending OperationsGET/api/v1/approvals{?page,page_size,status,operation_type,requested_by,target_id,include_expired}
List pending operations requiring approval.
- page
number(optional) Example: 1- page_size
number(optional) Example: 20- status
string(optional) Example: PENDING_LSO- operation_type
number(optional) Example: 1Operation type code
- requested_by
string(optional) Example: 550e8400-e29b-41d4-a716-446655440000- target_id
string(optional) Example: 550e8400-e29b-41d4-a716-446655440001- include_expired
boolean(optional) Example: false
Get Pending Operation ¶
Headers
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...Headers
Content-Type: application/jsonBody
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"entity_id": "550e8400-e29b-41d4-a716-446655440001",
"operation_type": 1,
"operation_type_name": "USER_REGISTRATION",
"target_table: `dictra_auth.users`": "Hello, world!",
"target_id": "550e8400-e29b-41d4-a716-446655440002",
"status": "PENDING_LSO",
"requested_by": "550e8400-e29b-41d4-a716-446655440003",
"requested_at": "2026-01-24T10:30:00Z",
"expires_at": "2026-01-31T10:30:00Z",
"is_expired": false
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Operation UUID"
},
"entity_id": {
"type": "string",
"description": "Entity UUID"
},
"operation_type": {
"type": "number",
"description": "Operation type code"
},
"operation_type_name": {
"type": "string",
"description": "Operation type name"
},
"target_table: `dictra_auth.users`": {
"type": "string",
"description": "Target table"
},
"target_id": {
"type": "string",
"description": "Target record UUID"
},
"status": {
"type": "string",
"enum": [
"PENDING_LSO",
"PENDING_RSO",
"APPROVED",
"REJECTED",
"EXPIRED"
],
"description": "Operation status"
},
"requested_by": {
"type": "string",
"description": "Requestor UUID"
},
"requested_at": {
"type": "string",
"description": "Request timestamp"
},
"expires_at": {
"type": "string",
"description": "Expiration timestamp"
},
"is_expired": {
"type": "boolean",
"description": "Whether operation has expired"
}
},
"required": [
"id",
"entity_id",
"operation_type",
"operation_type_name",
"target_table: `dictra_auth.users`",
"status",
"requested_by",
"requested_at",
"expires_at",
"is_expired"
]
}Get Pending OperationGET/api/v1/approvals/{id}
Get pending operation details.
- id
string(required) Example: 550e8400-e29b-41d4-a716-446655440000
Approve LSO ¶
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...Body
{
"comment": "Approved after review"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"comment": {
"type": "string"
}
}
}Headers
Content-Type: application/jsonBody
{
"message": "LSO approval successful",
"status": "PENDING_RSO",
"operation": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"entity_id": "550e8400-e29b-41d4-a716-446655440001",
"operation_type": 1,
"operation_type_name": "USER_REGISTRATION",
"target_table: `dictra_auth.users`": "Hello, world!",
"target_id": "550e8400-e29b-41d4-a716-446655440002",
"status": "PENDING_LSO",
"requested_by": "550e8400-e29b-41d4-a716-446655440003",
"requested_at": "2026-01-24T10:30:00Z",
"expires_at": "2026-01-31T10:30:00Z",
"is_expired": false
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string"
},
"status": {
"type": "string"
},
"operation": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Operation UUID"
},
"entity_id": {
"type": "string",
"description": "Entity UUID"
},
"operation_type": {
"type": "number",
"description": "Operation type code"
},
"operation_type_name": {
"type": "string",
"description": "Operation type name"
},
"target_table: `dictra_auth.users`": {
"type": "string",
"description": "Target table"
},
"target_id": {
"type": "string",
"description": "Target record UUID"
},
"status": {
"type": "string",
"enum": [
"PENDING_LSO",
"PENDING_RSO",
"APPROVED",
"REJECTED",
"EXPIRED"
],
"description": "Operation status"
},
"requested_by": {
"type": "string",
"description": "Requestor UUID"
},
"requested_at": {
"type": "string",
"description": "Request timestamp"
},
"expires_at": {
"type": "string",
"description": "Expiration timestamp"
},
"is_expired": {
"type": "boolean",
"description": "Whether operation has expired"
}
},
"required": [
"id",
"entity_id",
"operation_type",
"operation_type_name",
"target_table: `dictra_auth.users`",
"status",
"requested_by",
"requested_at",
"expires_at",
"is_expired"
]
}
},
"required": [
"message",
"status",
"operation"
]
}Approve LSOPOST/api/v1/approvals/{id}/lso
Perform first signature (LSO) approval.
- id
string(required) Example: 550e8400-e29b-41d4-a716-446655440000
Approve RSO ¶
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...Body
{
"comment": "Final approval granted"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"comment": {
"type": "string"
}
}
}Headers
Content-Type: application/jsonBody
{
"message": "RSO approval successful - operation executed",
"status": "APPROVED",
"operation": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"entity_id": "550e8400-e29b-41d4-a716-446655440001",
"operation_type": 1,
"operation_type_name": "USER_REGISTRATION",
"target_table: `dictra_auth.users`": "Hello, world!",
"target_id": "550e8400-e29b-41d4-a716-446655440002",
"status": "PENDING_LSO",
"requested_by": "550e8400-e29b-41d4-a716-446655440003",
"requested_at": "2026-01-24T10:30:00Z",
"expires_at": "2026-01-31T10:30:00Z",
"is_expired": false
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string"
},
"status": {
"type": "string"
},
"operation": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Operation UUID"
},
"entity_id": {
"type": "string",
"description": "Entity UUID"
},
"operation_type": {
"type": "number",
"description": "Operation type code"
},
"operation_type_name": {
"type": "string",
"description": "Operation type name"
},
"target_table: `dictra_auth.users`": {
"type": "string",
"description": "Target table"
},
"target_id": {
"type": "string",
"description": "Target record UUID"
},
"status": {
"type": "string",
"enum": [
"PENDING_LSO",
"PENDING_RSO",
"APPROVED",
"REJECTED",
"EXPIRED"
],
"description": "Operation status"
},
"requested_by": {
"type": "string",
"description": "Requestor UUID"
},
"requested_at": {
"type": "string",
"description": "Request timestamp"
},
"expires_at": {
"type": "string",
"description": "Expiration timestamp"
},
"is_expired": {
"type": "boolean",
"description": "Whether operation has expired"
}
},
"required": [
"id",
"entity_id",
"operation_type",
"operation_type_name",
"target_table: `dictra_auth.users`",
"status",
"requested_by",
"requested_at",
"expires_at",
"is_expired"
]
}
},
"required": [
"message",
"status",
"operation"
]
}Approve RSOPOST/api/v1/approvals/{id}/rso
Perform second signature (RSO) approval. This executes the operation.
- id
string(required) Example: 550e8400-e29b-41d4-a716-446655440000
Reject Operation ¶
Headers
Content-Type: application/json
Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...Body
{
"reason": "Does not comply with security policy"
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"reason": {
"type": "string",
"description": "Rejection reason (min 10 chars)"
}
},
"required": [
"reason"
]
}Headers
Content-Type: application/jsonBody
{
"message": "Operation rejected",
"status": "REJECTED",
"operation": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"entity_id": "550e8400-e29b-41d4-a716-446655440001",
"operation_type": 1,
"operation_type_name": "USER_REGISTRATION",
"target_table: `dictra_auth.users`": "Hello, world!",
"target_id": "550e8400-e29b-41d4-a716-446655440002",
"status": "PENDING_LSO",
"requested_by": "550e8400-e29b-41d4-a716-446655440003",
"requested_at": "2026-01-24T10:30:00Z",
"expires_at": "2026-01-31T10:30:00Z",
"is_expired": false
}
}Schema
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"message": {
"type": "string"
},
"status": {
"type": "string"
},
"operation": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Operation UUID"
},
"entity_id": {
"type": "string",
"description": "Entity UUID"
},
"operation_type": {
"type": "number",
"description": "Operation type code"
},
"operation_type_name": {
"type": "string",
"description": "Operation type name"
},
"target_table: `dictra_auth.users`": {
"type": "string",
"description": "Target table"
},
"target_id": {
"type": "string",
"description": "Target record UUID"
},
"status": {
"type": "string",
"enum": [
"PENDING_LSO",
"PENDING_RSO",
"APPROVED",
"REJECTED",
"EXPIRED"
],
"description": "Operation status"
},
"requested_by": {
"type": "string",
"description": "Requestor UUID"
},
"requested_at": {
"type": "string",
"description": "Request timestamp"
},
"expires_at": {
"type": "string",
"description": "Expiration timestamp"
},
"is_expired": {
"type": "boolean",
"description": "Whether operation has expired"
}
},
"required": [
"id",
"entity_id",
"operation_type",
"operation_type_name",
"target_table: `dictra_auth.users`",
"status",
"requested_by",
"requested_at",
"expires_at",
"is_expired"
]
}
},
"required": [
"message",
"status",
"operation"
]
}Reject OperationPOST/api/v1/approvals/{id}/reject
Reject a pending operation.
- id
string(required) Example: 550e8400-e29b-41d4-a716-446655440000
Generated by aglio on 24 Jan 2026