Base URL: http://localhost:3000/api/v1
All endpoints require authentication via session cookie unless marked [public].
Login with email and password.
// Request
{ "email": "user@example.com", "password": "secret" }
// Response 200
{ "user": { "_id", "email", "role", "isActive", "firstName", "lastName" } }
// Response 401
{ "message": "Invalid credentials" }Create a new account. Sends verification email.
// Request
{ "email": "user@example.com", "password": "secret", "firstName": "John", "lastName": "Doe" }
// Response 201
{ "message": "Registration successful. Please check your email." }Verify email address. Auto-logs in on success.
{ "email": "user@example.com" }
// Always returns 200 (prevents email enumeration){ "token": "abc123", "password": "newpassword" }{ "currentPassword": "old", "newPassword": "new" }Destroys session.
Returns current auth state.
{ "isAuthenticated": true, "user": { "_id", "email", "role", "isActive" } }Search Italian companies. Permission: search_companies.
Query params:
| Param | Type | Description |
|---|---|---|
dataEnrichment |
string | start, advanced, pec, address, shareholders, name (default: name) |
companyName |
string | Filter by company name (full words) |
autocomplete |
string | Search strings beginning with query |
province |
string | Province code (e.g., MI, RM) |
townCode |
string | Town/municipality code |
atecoCode |
string | ATECO classification code |
minTurnover |
number | Minimum revenue |
maxTurnover |
number | Maximum revenue |
minEmployees |
number | Minimum employees |
maxEmployees |
number | Maximum employees |
activityStatus |
string | ATTIVA, CESSATA, etc. |
legalFormCode |
string | Legal form code |
pec |
string | PEC email address |
sdiCode |
string | SDI code |
dryRun |
boolean | Returns count + cost only, no data |
skip |
number | Pagination offset |
limit |
number | Max results |
Response:
{
"source": "api",
"timestamp": "2024-...",
"data": [
{
"companyName": "ACME SRL",
"vatCode": "12345678901",
"address": {
"registeredOffice": { "town": "Milano", "province": "MI" },
"streetName": "Via Roma 1",
"zipCode": "20100"
},
"atecoClassification": { "ateco": "62.01" },
"ecofin": { "turnover": 1500000, "enterpriseSize": "PMI" },
"employees": { "employee": 25 },
"companyStatus": { "activityStatus": { "code": "A", "description": "ATTIVA" } }
}
]
}Credit cost: 0.344 base + 0.008 per result
Get advanced company data. Permission: advanced_search. Cost: 0.389 credits.
Get full company data with financials. Permission: full_search. Cost: 0.800 credits.
Note: May return 302 with a polling ID. Backend handles polling automatically.
Check if company is closed. Permission: admin only. Cost: 0.085 credits.
Get remaining OpenAPI credit balance.
Get cached company data. Permission: company_details.
Returns most recent cached record (advanced, full, or closed).
{
"source": "database",
"timestamp": "2024-...",
"data": { /* full company object */ },
"piva": "12345678901",
"searchType": "advanced"
}Get all cached companies. Use ?format=slim for lightweight list.
Get or generate AI financial overview. Permission: company_llm_overview. Cost: 0.05 + OpenAI tokens.
{
"overview": "## Panoramica Finanziaria\n\n**ACME SRL** è un'azienda..."
}Full-text search via Meilisearch. Permission: search.
Parse natural language query into structured search params. Permission: search_companies.
// Request
{ "query": "aziende software a Milano con più di 50 dipendenti" }
// Response
{
"params": {
"province": "MI",
"atecoCode": "62",
"minEmployees": 50
},
"interpretation": "Software companies in Milan province with more than 50 employees",
"cached": false
}Constraints: Max 500 characters. Cached by query hash.
Allowed output params: province, atecoCode, companyName, minTurnover, maxTurnover, minEmployees, maxEmployees, activityStatus, townCode
{
"creditBalance": 85.5,
"creditLimit": 1000,
"creditSettings": {
"dailyLimit": 50,
"monthlyLimit": 500,
"autoRecharge": { "enabled": false, "threshold": 10, "amount": 100 }
}
}Paginated transaction history.
Aggregated spending by service type.
Update daily/monthly limits and auto-recharge.
Get current user profile.
Update profile fields: firstName, lastName, company, phone.
Delete user account.
Recent user activity entries.
Activity statistics for last 30 days.
These are Nuxt 4 server routes that proxy to Express. They handle SSR cookie forwarding.
| Route | Proxies To |
|---|---|
GET /auth/check |
GET /api/v1/auth/check |
GET /company/:piva |
GET /api/v1/company/:piva → fallback GET /api/v1/openapi/IT-advanced/:piva |
GET /company/:piva/overview |
GET /api/v1/company/llm-overview/:piva |
These routes are NOT under
/api/because Nitro devProxy intercepts/api/**.