API — Watchlists
Gestionarea watchlist-urilor prin API — creare, editare, ștergere.
API — Watchlists
GET /watchlists
Returnează toate watchlist-urile active din contul tău.
Request:
GET /watchlists
Authorization: Bearer <access_token>
Răspuns de succes (200):
{
"data": [
{
"id": "uuid",
"name": "Client Constructii SRL",
"cpvCodes": ["45233120-6", "45000000-7"],
"keywords": ["reabilitare", "drum", "modernizare"],
"minValue": 500000,
"maxValue": null,
"authorityId": null,
"active": true,
"createdAt": "2026-04-01T12:00:00Z"
}
]
}
POST /watchlists
Creează un watchlist nou.
Request:
POST /watchlists
Authorization: Bearer <access_token>
Content-Type: application/json
{
"name": "Client IT SRL",
"cpvCodes": ["72000000-5", "72200000-7"],
"keywords": ["software", "licențe", "dezvoltare"],
"minValue": 100000,
"maxValue": 2000000
}
Câmpuri:
| Câmp | Tip | Obligatoriu | Descriere |
|---|---|---|---|
name | string | ✓ | Nume descriptiv pentru watchlist |
cpvCodes | string[] | — | Lista de coduri CPV (cel puțin unul recomandat) |
keywords | string[] | — | Termeni căutați în titlu și descriere |
minValue | number | — | Valoare minimă a contractului (RON) |
maxValue | number | — | Valoare maximă a contractului (RON) |
authorityId | string | — | UUID autoritate contractantă specifică |
Răspuns de succes (201): obiectul watchlist creat.
PATCH /watchlists/:id
Actualizează un watchlist existent.
Request:
PATCH /watchlists/uuid-watchlist
Authorization: Bearer <access_token>
Content-Type: application/json
{
"keywords": ["software", "licențe", "dezvoltare", "mentenanță"],
"maxValue": 5000000
}
Trimite doar câmpurile pe care vrei să le modifici. Câmpurile netrimise rămân neschimbate.
Răspuns de succes (200): obiectul watchlist actualizat.
DELETE /watchlists/:id
Șterge un watchlist. Alertele generate anterior de watchlist sunt păstrate.
Request:
DELETE /watchlists/uuid-watchlist
Authorization: Bearer <access_token>
Răspuns de succes (204): fără corp.
Erori frecvente
| Cod | Cauză |
|---|---|
| 400 | Câmpuri lipsă sau invalide (ex: cod CPV în format greșit) |
| 403 | Limita de watchlists a planului a fost atinsă |
| 404 | Watchlist-ul nu există sau nu îți aparține |