Send the lead status back to Yuboraman from any CRM
A lead goes to your own system through an HTTP address, and your system sends the lead status back to one secret URL: qualified lead, sold or rejected. The sale amount sits next to your ad spend in “Finance”, and with CAPI on, sales go back to Meta — the ads look for buyers.
How to connect any CRM by API
Let the lead go to your system through an HTTP address
In the Integration, under “Where does the lead go?” pick “Other website” and enter your system’s API address. A status comes back only to leads delivered to your system this way.
Add the “API (any CRM)” connection
In the “Connections” section pick “Connect a profile” → “API (any CRM)”, enter the connection name and click “Add”. The URL for statuses appears right there — copy it whole. You can open it again later with “Show”.
Pick the Integrations
Tick the Integrations whose leads go to this system. An Integration with amoCRM or Bitrix24 statuses on cannot be picked: one Integration takes its status from one place.
Amount and Meta settings
Under “Where the amount comes from” pick “Amount sent by the CRM” or “Fixed amount”. If you want sales to go back to your ads, turn on “Send sales to Facebook (CAPI)” and click “Save”.
Put the URL into your system
If your system sends by the “Yuboraman standard”, there is nothing to set up — the URL and the “For developers” section below are enough. If your CRM or CPA network sends its own template, take one test request with “Capture a sample” and pick the fields in “Field mapping”.
What you get
Any CRM or order system
No need to wait for a ready-made connection: any system that can send an HTTP request can send the lead status back.
Its own template works too
GET parameters, JSON, a plain form or a CPA network’s template with macros — you map the fields once, no developer needed.
Sales in “Finance”
A sold lead counts with its amount: the amount sent by the CRM or the one sale amount you set. In sum or in dollars.
Your ads see the buyer
With CAPI on, qualified leads and sales go to Meta as conversions, and rejected leads only if you turn that on.
Sending again is safe
Even if one status arrives twice, it counts once — your system can safely send it again when unsure.
A secret URL, easy to rotate
The key sits inside the URL itself, no header needed. After “Rotate URL” the old URL stops working at once.
Frequently asked questions
Which CRMs does this work with?
With any system that accepts a lead by HTTP request and can send an HTTP request when a status changes: your own CRM, your order system, your backend or a CPA network. Bitrix24 and amoCRM have their own ready-made connections.
My CRM sends its own format — does that work?
Yes. In the connection settings click “Start capturing”, send one test request from your CRM, pick the sample and mark the status and ID fields in “Field mapping”. Then map each of your CRM’s status words in “Status values”.
Which leads does the status come back to?
To leads that an Integration bound to the connection delivered to your system through “Other website” (HTTP address), except test leads. A lead that went only to Telegram, Google Sheets, Bitrix24 or a CPA network is not found.
Can I bind an Integration with amoCRM or Bitrix24 statuses on?
No. One Integration takes the lead status from one place: turn the statuses off there first, or pick another Integration.
How does a sale get back to my Facebook ads?
Turn on “Send sales to Facebook (CAPI)” in the connection settings — it is off by default. A qualified lead goes to Meta as QualifiedLead, and a sale as Purchase with its amount.
What if the URL leaks?
The URL holds a secret key: do not post it publicly. If it leaks, click “Rotate URL” — you get a new URL and the old one stops working at once. Put the new one into your system.
Can I test the connection without touching real leads?
Yes, with the “Yuboraman standard”. With dry_run: true in the request, the answer shows the result for every status, but nothing is saved.
For developers: the status API
This section is for the developer connecting your system. When a lead status changes, your system sends one GET or POST request to the connection’s secret URL; the answer carries a result for every status.
How a lead comes in and how it is found
The lead a status attaches to must first have been delivered from Yuboraman to your system through “Other website” (HTTP address), and it must not be a test lead. You find the lead by one of two IDs.
crm_id- The ID your system returned in its answer when Yuboraman sent the lead to your HTTP address — usually the order, lead or deal ID. A number or a string both work.
lead_id- If the lead comes from your site: the id or lead_id value in the body your site sent to the Integration address.
POST https://yuboraman.uz/api/v1/sites/webhook/…/- The address for site leads: “Your own site” → “Get the address” in the Integration gives it, and its ending is unique to each Integration. It accepts a JSON or a plain form body.
The URL
Statuses go to one URL with GET or POST (with the trailing /). The key sits inside the URL itself — no header needed. Copy the whole URL from the connection screen. Keep it secret: do not post it publicly, and if it leaks, rotate it at once.
https://yuboraman.uz/api/v1/crm-api/in/<TOKEN>/- <TOKEN> is the connection’s secret key. Copy the whole URL from the connection screen without changing it.
“Show”, “Rotate URL”- “Show” opens the URL again. “Rotate URL” gives a new URL, and the old one stops working at once.
“Yuboraman standard”- No setup: POST, a JSON body with the field names below.
Your own template- Any other shape, for example a CPA network’s request with macros: map the fields on the connection screen first.
POST https://yuboraman.uz/api/v1/crm-api/in/ybr_crm_YOUR_TOKEN/
Content-Type: application/jsonRequest body: the “Yuboraman standard”
One request carries one or more statuses. Too many statuses answers too_many_records, and a body that is too large answers 413: split the statuses into smaller requests. If the body is not this shape (another key, no events) and no mapping is saved, it answers no_mapping. Once a mapping is saved, the standard is not read: “Back to the standard” brings it back.
events- The list of statuses, at least one.
dry_run- Optional: true or false. With true the answer returns the result for every status, but nothing is written.
{
"dry_run": true,
"events": [
{
"event_id": "order-1042-delivered",
"crm_id": "1042",
"status": "delivered",
"amount": 450000,
"currency": "UZS",
"updated_at": "2026-11-21T14:30:00+05:00"
},
{
"event_id": "site-7781-accepted",
"lead_id": "7781",
"status": "accepted"
}
]
}Status fields
At least one of crm_id and lead_id is required; with both, crm_id is looked up first. IDs may hold Latin letters, digits, spaces and plain symbols — no double quote ("), apostrophe ('), &, < or >. Send a long numeric ID as a string: a large number can lose precision in JSON. A field not on the list gets the status refused.
event_id- Optional, but send event_id (or at least updated_at) with every status. The status’s own ID: a status that arrives again with the same ID is not counted a second time, so sending again is safe. Without both, resending the newest applied status answers duplicate and is not written; a return to an earlier status — for example accepted, then cancelled, then accepted again — is written as a new status.
crm_id- A string or a whole number above 0. Within one connection a crm_id must not repeat: it has to be unique across the CRM IDs and the CPA order IDs bound to that connection.
lead_id- A string or a whole number above 0.
status- Required: pending, accepted, delivered, cancelled or archived.
amount- Optional, the order price: a JSON number (not a string), above 0; rounded to 2 decimals.
currency- Optional: UZS or USD (case does not matter). If missing — the connection’s currency (the same for “Finance” and for Meta), and if that is missing too, UZS. In any other currency the status is written but the amount you sent is not counted.
updated_at- Optional, ISO 8601 with a time zone, for example 2026-11-21T14:30:00+05:00. If missing — the time the request arrived. A status that is too old is not written; a time in the future is taken as now.
Your own template: field mapping
If your CRM or CPA network sends the status in its own shape, no developer is needed: you map the fields once on the connection screen. A mapped request has no test mode — it is always written.
Accepted shapes- GET parameters; a JSON object or array; a list inside JSON (for example data.leads — “Records list”); application/x-www-form-urlencoded; multipart/form-data text fields (a file part answers unsupported_format).
1. “Capture a sample”- Click “Start capturing”: the capture window stays open for a short time. During it your CRM sends one test request to this URL — click “Use this sample”.
2. “Field mapping”- Required: “Status” and “Order ID in the CRM” or “Yuboraman lead ID”. Optional: “Amount” (with “Amount format”; a mapped amount of 0 means “no amount”, the status still applies), the currency (“Currency field” or “Fixed currency”), “Changed at” (Unix seconds or Unix milliseconds, ISO 8601, or date and time without a time zone + a time zone) and “Event ID”.
3. “Status values”- Map each status word your CRM sends to one of the five words, or mark it Ignore. A new value that is not mapped yet answers unmapped; once you map and save it, those events are applied again.
“Back to the standard”- Deletes the saved mapping — the connection works by the “Yuboraman standard” again.
Macros- In a JSON template put every macro in double quotes, even a numeric one. Otherwise the body is not valid JSON and answers bad_json; the sample then shows the hint “Put every macro in quotes — then the CRM sends valid JSON.”
{
"id": "{order_id}",
"status": "{status}",
"sum": "{sum}"
}What the statuses mean
“Send sales to Facebook (CAPI)” is off by default. When it is on, the status goes to Meta as a conversion and the amount becomes the Purchase value — so the amount must be what the customer paid: a CPA payout is the webmaster’s income, not the price.
pending- The lead is still in progress: the status sent earlier is cleared.
accepted- Qualified lead. Counts with its amount in “Finance”; QualifiedLead in Meta.
delivered- Sold. Counts with its amount in “Finance”; Purchase with its amount in Meta.
cancelled, archived- Rejected or closed. DisqualifiedLead in Meta — only if you turn that on.
Answer
With a valid URL the answer is always HTTP 200 and “Qabul qilindi!”. data.results gives one result per record: index — the record’s place in the request (from 0), result — the result, code — only on invalid. After a 200 do not resend the request automatically, even if a result is invalid: fix the cause first, then send.
applied- The status was written. Nothing else to do.
currency_unsupported- The status was written, but the amount you sent was not counted (in “Fixed amount” mode the fixed amount is counted anyway). Send UZS or USD in later statuses.
duplicate- This event was already received — with the same event_id, or, when event_id is absent, with the same fields — whatever its first result was. An event_id conflict always answers duplicate, even if the event arrives with another status or amount. If that first answer was unmatched or ambiguous, resending the same event answers duplicate: after fixing the cause, send it with a new event_id. Otherwise ignore it.
unmatched- Lead not found: check the ID — or the lead did not go to your HTTP address through an Integration bound to this connection. Send the fixed status with a new event_id.
ambiguous- The ID matched more than one lead. Send it with a more precise ID (usually crm_id) and a new event_id.
stale- The status is too old, or a newer status is already written for this lead. Ignore it.
other_source- Another source runs this lead’s status. Ignore it.
test- The lead is a test lead — nothing was written. Ignore it.
invalid- The status is wrong, the reason is in code. Fix it and send it again.
unmapped- The status value of a mapped request is not mapped in “Status values” yet. The status is applied once you map and save the value. Send again any statuses that stay unapplied for long.
ignored- The status value is mapped as Ignore — skipped. Ignore it.
{
"success": true,
"message": "Qabul qilindi!",
"data": {
"dry_run": true,
"results": [
{ "index": 0, "result": "applied" },
{ "index": 1, "result": "unmatched" }
]
}
}Whole-request results
If the request cannot be split into records, the answer is still 200, but data.results carries a single result — index 0. No status was written: fix the cause and send it again.
no_mapping- The body is not in the “Yuboraman standard” shape, and no mapping is saved yet. Switch to the standard or map the fields.
bad_json- The POST body is not a form, and it cannot be read as JSON either. The usual cause is a macro without quotes.
unsupported_format- This format is not supported: for example, a file was sent, the text is not UTF-8, or no list of objects was found at the “Records list”.
too_many_records- Too many records in one request. Split it into smaller requests.
too_deep- The JSON is nested too deeply.
too_large- Too many or too long values. Shorten them or split the request into smaller ones.
{
"success": true,
"message": "Qabul qilindi!",
"data": {
"dry_run": false,
"results": [{ "index": 0, "result": "no_mapping" }]
}
}invalid codes
These codes refuse the status: fix it and send it again.
not_object- The status is not a JSON object.
unknown_field- There is a field not on the list.
missing_id- Neither crm_id nor lead_id is there.
missing_status- In a mapped request the status field is missing or empty.
bad_event_id, bad_crm_id, bad_lead_id- The ID has the wrong type, its length is out of bounds, or it has a character that is not allowed.
bad_status- status is not one of the five words on the list (in a mapped request: too long, or true/false).
bad_amount- amount is not a number (a string, true/false), is 0 or negative, or is too large. In a mapped request: it does not fit the “Amount format”.
bad_currency- currency is not a currency code in Latin letters (for example UZS or USD).
bad_updated_at- The date is not ISO 8601, has no time zone, or its year is wrong. In a mapped request: it does not fit the “Time format”.
Errors and limits
These are the only answers other than HTTP 200. After 401, 413 or 429 nothing was written. After a 5xx answer or a network error send the same request again with the same event_id values: statuses already written answer duplicate, so nothing counts twice.
401 «Ruxsat yo'q!»- The key in the URL is wrong, outdated (from before “Rotate URL”), or the connection is inactive — the answer is the same in every case. Check the URL — retrying will not help.
413- The body is too large. Split the statuses into smaller requests.
429- Too many requests. Wait a little and send again; if the answer has a Retry-After header, wait the time it gives. The body of this answer may not be JSON.
5xx- The fault is ours. Sending the same request again is safe only if every status carried an event_id (“Event ID”).
{
"success": false,
"message": "So'rovlar soni limitdan oshib ketdi!"
}Code samples
curl
curl -X POST https://yuboraman.uz/api/v1/crm-api/in/ybr_crm_YOUR_TOKEN/ \
-H "Content-Type: application/json" \
-d '{"events":[{"event_id":"order-1042-delivered","crm_id":"1042","status":"delivered","amount":450000,"currency":"UZS"}]}'JavaScript
const response = await fetch('https://yuboraman.uz/api/v1/crm-api/in/ybr_crm_YOUR_TOKEN/', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
events: [
{
event_id: 'order-1042-delivered',
crm_id: '1042',
status: 'delivered',
amount: 450000,
currency: 'UZS',
},
],
}),
});
const answer = await response.json();
console.log(response.status, answer.data?.results);PHP
<?php
$payload = json_encode([
'events' => [[
'event_id' => 'order-1042-delivered',
'crm_id' => '1042',
'status' => 'delivered',
'amount' => 450000,
'currency' => 'UZS',
]],
]);
$curl = curl_init('https://yuboraman.uz/api/v1/crm-api/in/ybr_crm_YOUR_TOKEN/');
curl_setopt_array($curl, [
CURLOPT_POST => true,
CURLOPT_HTTPHEADER => ['Content-Type: application/json'],
CURLOPT_POSTFIELDS => $payload,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 10,
]);
$answer = curl_exec($curl);
$status = curl_getinfo($curl, CURLINFO_HTTP_CODE);
curl_close($curl);
echo $status, ' ', $answer;GET (own template)
# With a saved mapping: id → “Order ID in the CRM”, status → “Status”,
# and confirmed mapped to accepted in “Status values”.
curl "https://yuboraman.uz/api/v1/crm-api/in/ybr_crm_YOUR_TOKEN/?id=123&status=confirmed"Other destinations
Let your sales show up in your ad results
No code needed: sign up, connect your Facebook Page and switch on your first integration.
