« All modules

Sales Leads

Clienți potențiali (sales leads) — add leads, list and view them, change status, add notes.

Filters on list endpoints are URL path segments, not query strings — see Conventions. The Swagger tester works best for JSON body endpoints.
GET /leads/meta/ Valid ids for the lead fields

Call this first. Returns the values an integration needs before it creates or updates a lead: statuses[] (id, name, stage_id, is_initial, archives_lead), stages[], departments[], interests[], lists[], lost_reasons[] and users[] (each id, name).

Stages are fixed: 1 new lead, 2 in discussion, 3 won, 4 lost. Statuses are defined by each account and each one belongs to a stage.

Responses

StatusDescription
200 OK — response uses the shared envelope.
401 Missing or invalid Basic Auth credentials.
GET /leads/list/ List sales leads

Returns leads, newest first, 250 per page. Deleted leads are never returned. Each row has: bocp_id, created_at, contact (bocp_id, name, email, phone), status_id, status, stage_id, allocated_to_userid, allocated_to, workpoint_id, department_id, interest_id, list_id, source, mentions, potential_value, currency, follow_up_date, postponed_until, last_note, external_id.

Filters (URL path segments):
- status_id:{id} — leads in one status.
- stage_id:{id} — leads whose status belongs to a stage (1 new, 2 in discussion, 3 won, 4 lost).
- allocated_to_userid:{id} — leads allocated to one user.
- changed_since:{YYYY-MM-DD HH:MM:SS} — leads with a history entry (note or status change) after that moment. Use it to poll for changes.
- Standard: year, yearmonth, date, datefrom, datethrough (on the creation date), id, minid, page. There is no modifiedafter on this route; use changed_since.

Responses

StatusDescription
200 OK — response uses the shared envelope.
400 Request is malformed or a required field is missing / invalid.
401 Missing or invalid Basic Auth credentials.
404 The requested resource does not exist.
GET /leads/{lead_id}/ Get one lead with its history

Returns the same fields as the list, plus history[]: the last 20 entries, newest first, each with date, user, status_id, status, note, lost_reason_id.

Parameters

NameInTypeRequiredDescription
lead_id path integer yes

Responses

StatusDescription
200 OK — response uses the shared envelope.
404 The requested resource does not exist.
PATCH /leads/{lead_id}/ Update a lead: status, note, allocation and other fields

Send only the fields to change. Nothing is changed when any field is invalid: the response lists every error.

- status_id — move the lead to another status. Optional note and, for a status in the lost stage, lost_reason_id. The move is written to the lead history.
- note alone — adds a history entry without changing the status.
- allocated_to_userid — allocate to a user (-1 removes the allocation).
- potential_value — number, zero or above.
- follow_up_date — YYYY-MM-DD or YYYY-MM-DD HH:MM.
- department_id, interest_id, list_id — ids from GET /leads/meta/.
- postponed_until — a future date YYYY-MM-DD postpones the lead; an empty string resumes it.

Permission: the API key needs an explicit PATCH grant on the leads route. Keys without it receive 403.

The response is the updated lead (same shape as GET /leads/{lead_id}/).

Parameters

NameInTypeRequiredDescription
lead_id path integer yes

Request body (JSON)

{
    "status_id": 3,
    "note": "Offer sent by e-mail",
    "follow_up_date": "2026-12-02 10:00"
}

Responses

StatusDescription
200 OK — response uses the shared envelope.
400 Request is malformed or a required field is missing / invalid.
401 Missing or invalid Basic Auth credentials.
404 The requested resource does not exist.
POST /leads/ Add a sales lead

Creates a lead. The contact is either an existing one (contact_bocp_id) or a contact object: BOCP looks for an existing contact by vat_id, then by e-mail when the account identifies leads by e-mail, then by name with e-mail or phone, and creates one only when none is found. The contact is not marked as a client.

Optional fields: status_id (default: the account's initial status), allocated_to_userid (default: the user set for the contact's county, otherwise unallocated), workpoint_id, department_id, interest_id, source (free text, e.g. the campaign or site), mentions, potential_value, currency, follow_up_date.

external_id (max 32 characters) makes the call safe to repeat: a second POST with the same external_id returns the existing lead with created: 0 instead of adding a duplicate.

Nothing is created when any field is invalid: the response lists every error. Valid ids come from GET /leads/meta/.

Permission: the API key needs an explicit POST grant on the leads route. Keys without it receive 403.

The response is the lead (same shape as in the list) plus created (1 or 0).

Request body (JSON)

{
    "contact": {
        "name": "Popescu Ion",
        "email": "ion@example.com",
        "phone": "0722000000",
        "is_company": 0
    },
    "source": "Website contact form",
    "mentions": "Asked for an offer for 20 licences",
    "potential_value": 4500,
    "currency": "RON",
    "follow_up_date": "2026-11-25",
    "external_id": "web-2026-000123"
}

Responses

StatusDescription
200 OK — response uses the shared envelope.
400 Request is malformed or a required field is missing / invalid.
401 Missing or invalid Basic Auth credentials.

This page is generated from openapi.json.