Pełna dokumentacja REST API dla integracji z MideroERP. Wszystkie endpointy zwracają JSON.
Użyj Bearer token w nagłówku Authorization lub parametru ?token=YOUR_TOKEN
# Bearer Token
curl -H "Authorization: Bearer YOUR_API_TOKEN" \
https://erp.example.com/api/ai/overview
# Query parameter
curl https://erp.example.com/api/ai/overview?token=YOUR_API_TOKEN
https://your-domain.com/api/ai
Przegląd systemu — KPI firmy, statystyki modułów, ostatnia aktywność.
curl "https://erp.example.com/api/ai/overview?token=YOUR_TOKEN"
{
"company": { "name": "MIDERO S.A.", "employees": 38 },
"kpi": {
"revenue_ytd": 2450000,
"costs_ytd": 1230000,
"invoices_unpaid": 12,
"projects_active": 8,
"tasks_open": 45
},
"modules": ["crm", "hrm", "finance", "iso"]
}
Dane dashboardu — wykresy, alerty, zadania na dziś.
curl "https://erp.example.com/api/ai/dashboard?token=YOUR_TOKEN"
Podsumowanie finansowe — przychody, koszty, zaległe faktury, cashflow.
curl "https://erp.example.com/api/ai/finance?token=YOUR_TOKEN&year=2026"
Parametry: year (opcjonalny, default: bieżący rok)
Podsumowanie HR — pracownicy, urlopy, rekrutacja, szkolenia.
curl "https://erp.example.com/api/ai/hr?token=YOUR_TOKEN"
Status ISO compliance — audyty, ryzyka, dokumenty, CAPA, incydenty.
curl "https://erp.example.com/api/ai/iso?token=YOUR_TOKEN"
Podsumowanie CRM — pipeline, leady, firmy, kontakty.
curl "https://erp.example.com/api/ai/crm?token=YOUR_TOKEN"
Wyszukiwanie globalne — szukaj po wszystkich modułach.
curl "https://erp.example.com/api/ai/search?q=midero&token=YOUR_TOKEN"
Parametry: q (wymagany — fraza do wyszukania)
{
"results": [
{ "module": "companies", "id": "uuid...", "title": "MIDERO S.A.", "match": "name" },
{ "module": "contacts", "id": "uuid...", "title": "Grzegorz Świerk", "match": "company" }
],
"total": 2
}
Zapytanie o konkretny moduł — lista rekordów z paginacją.
curl "https://erp.example.com/api/ai/query?module=leads&status=WON&token=YOUR_TOKEN"
Parametry: module (wymagany), status, limit, offset
Szczegóły jednego rekordu z relacjami.
curl "https://erp.example.com/api/ai/record/leads/UUID?token=YOUR_TOKEN"
Schema bazy danych — tabele, kolumny, typy. Przydatne dla AI do generowania zapytań.
curl "https://erp.example.com/api/ai/schema?token=YOUR_TOKEN"
Auto-generowana dokumentacja endpointów (ta strona w JSON).
curl "https://erp.example.com/api/ai/docs?token=YOUR_TOKEN"
Utwórz nowy rekord w module. Pola zależą od modułu (użyj /schema aby poznać).
curl -X POST "https://erp.example.com/api/ai/create/leads?token=YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"title": "Nowy lead z API",
"company_name": "Firma ABC",
"contact_name": "Jan Kowalski",
"value": 50000,
"stage": "NEW"
}'
// Response 201
{
"success": true,
"id": "550e8400-e29b-41d4-a716-446655440000",
"message": "Record created"
}
Zaktualizuj istniejący rekord. Wysyłaj tylko pola do zmiany.
curl -X PUT "https://erp.example.com/api/ai/update/leads/UUID?token=YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "stage": "NEGOTIATION", "value": 75000 }'
Szybka zmiana statusu rekordu (shortcut dla update).
curl -X POST "https://erp.example.com/api/ai/status?token=YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "module": "tasks", "id": "UUID", "status": "DONE" }'
Dodaj notatkę/komentarz do rekordu.
curl -X POST "https://erp.example.com/api/ai/note?token=YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"module": "leads",
"record_id": "UUID",
"content": "Klient zainteresowany ofertą enterprise"
}'
X-RateLimit-Remaining w odpowiedzi