Create Provider
/api/v1/lead_providers/create/Add a new Lead Provider (partner) to the system. You then use the returned id
to generate an API key.
Auth: Admin JWT + IsAdminOnlyPosition.
Body fields
| Field | Type | Required | Description |
|---|---|---|---|
name | String | Required | Provider name |
email | String (email) | Required | Contact email |
status | String enum | Optional | active (default) / inactive |
is_exclusive | Boolean | Optional | Exclusive provider (default false) |
assigned_user | Integer (ID) | Optional | Responsible staff ID (an integer on write) |
price_per_lead | String (decimal) | Optional | Price per lead, ">= 0"; omitted if left empty |
:::info assigned_user — an integer on write
On read (List/Get) assigned_user is returned as an object, but on write send only
the user's integer id.
:::
:::note price_per_lead
price_per_lead is a decimal value sent as a string (e.g. "12.50").
If the value is empty, the field is not sent at all (this is how the frontend behaves).
:::
Request sample
{
"name": "Super Leads LLC",
"email": "contact@superleads.com",
"status": "active",
"is_exclusive": false,
"assigned_user": 7,
"price_per_lead": "12.50"
}
Response
The created provider object is returned (with id). Use the id in the next step
to generate an API key.
{
"id": 43,
"name": "Super Leads LLC",
"email": "contact@superleads.com",
"status": "active",
"is_exclusive": false,
"assigned_user": { "id": 7, "username": "jdoe", "full_name": "John Doe" },
"price_per_lead": "12.50",
"created_at": "2026-07-15T09:00:00Z",
"updated_at": "2026-07-15T09:00:00Z"
}
:::note TODO: verify — create response body
The exact response body depends on the backend serializer. At minimum id is expected;
confirm the full shape with the backend team.
:::
Code samples
- curl
- JavaScript
- Python
curl -X POST https://api.navigo.example/api/v1/lead_providers/create/ \
-H "Authorization: Bearer $NAVIGO_ADMIN_JWT" \
-H "Content-Type: application/json" \
-d '{
"name": "Super Leads LLC",
"email": "contact@superleads.com",
"status": "active",
"is_exclusive": false,
"assigned_user": 7,
"price_per_lead": "12.50"
}'
const res = await fetch("https://api.navigo.example/api/v1/lead_providers/create/", {
method: "POST",
headers: {
"Authorization": `Bearer ${process.env.NAVIGO_ADMIN_JWT}`,
"Content-Type": "application/json",
},
body: JSON.stringify({
name: "Super Leads LLC",
email: "contact@superleads.com",
status: "active",
is_exclusive: false,
assigned_user: 7,
price_per_lead: "12.50",
}),
});
const provider = await res.json();
import os, requests
resp = requests.post(
"https://api.navigo.example/api/v1/lead_providers/create/",
headers={"Authorization": f"Bearer {os.environ['NAVIGO_ADMIN_JWT']}"},
json={
"name": "Super Leads LLC",
"email": "contact@superleads.com",
"status": "active",
"is_exclusive": False,
"assigned_user": 7,
"price_per_lead": "12.50",
},
timeout=15,
)
resp.raise_for_status()
provider = resp.json()
Possible errors
| Status | Reason |
|---|---|
400 | Validation error (e.g. invalid email) |
401 | JWT is invalid |
403 | No admin position |
Full format: Errors.