Воронки
Воронки продаж и их этапы в порядке доски.
Список воронок
GET /pipelines
Воронки продаж с этапами в порядке доски. Воронки настраивают в CRM; через API — только чтение.
Пример запроса
curl 'https://your-company.altahub.ai/api/v1/pipelines' \
-H 'Authorization: Bearer alta_…'const response = await fetch('https://your-company.altahub.ai/api/v1/pipelines', {
method: 'GET',
headers: {
Authorization: 'Bearer alta_…',
},
});
const data = await response.json();import requests
response = requests.get(
"https://your-company.altahub.ai/api/v1/pipelines",
headers={"Authorization": "Bearer alta_…"},
)
data = response.json()<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://your-company.altahub.ai/api/v1/pipelines', [
'headers' => ['Authorization' => 'Bearer alta_…'],
]);
$data = json_decode((string) $response->getBody(), true);Ответ 200
Успешный ответ.
{
"items": [
{
"id": "0192f3a1-7c2e-7b4d-9a61-00000000001e",
"name": "Продажи",
"dealPanel": {
"payment": true,
"contacts": true,
"products": false
},
"stages": [
{
"id": "0192f3a1-7c2e-7b4d-9a61-00000000001f",
"name": "Новый запрос",
"position": 1,
"kind": "open",
"color": "blue",
"durationNormSeconds": 172800
},
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000020",
"name": "Переговоры",
"position": 2,
"kind": "open",
"color": "yellow",
"durationNormSeconds": 604800
},
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000021",
"name": "Счёт выставлен",
"position": 3,
"kind": "open",
"color": "orange",
"durationNormSeconds": null
},
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000022",
"name": "Успешно",
"position": 4,
"kind": "won",
"color": "green",
"durationNormSeconds": null
},
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000023",
"name": "Отказ",
"position": 5,
"kind": "lost",
"color": "red",
"durationNormSeconds": null
}
]
}
]
}Поля ответа
itemsobject[]Вложенные поля: 4
dealPanelobjectWhich blocks the deal page shows for deals of this pipeline; each is on unless turned off.
Вложенные поля: 3
contactsbooleanThe deal page shows its contacts block: the company and the people of the deal.
paymentbooleanThe deal page shows its payment block: what was paid of the amount, and adding a payment.
productsbooleanThe deal page shows its products block: the deal's product lines.
idstring · uuidnamestringstagesobject[]Вложенные поля: 6
colorstringЗначения:
graybluetealgreenyelloworangeredpurpledurationNormSecondsinteger | nullHow long deals of the organization usually stand on this stage, in seconds (the 80th percentile of its own recent history, refreshed nightly); null while the stage has too little history.
≥ 0
idstring · uuidkindstringЗначения:
openwonlostnamestringpositioninteger≥ 1
Получить воронку
GET /pipelines/{pipelineId}
Одна воронка с этапами в порядке доски.
Параметры пути
pipelineIdstring · uuid обязательно
Пример запроса
curl 'https://your-company.altahub.ai/api/v1/pipelines/{pipelineId}' \
-H 'Authorization: Bearer alta_…'const response = await fetch('https://your-company.altahub.ai/api/v1/pipelines/{pipelineId}', {
method: 'GET',
headers: {
Authorization: 'Bearer alta_…',
},
});
const data = await response.json();import requests
response = requests.get(
"https://your-company.altahub.ai/api/v1/pipelines/{pipelineId}",
headers={"Authorization": "Bearer alta_…"},
)
data = response.json()<?php
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', 'https://your-company.altahub.ai/api/v1/pipelines/{pipelineId}', [
'headers' => ['Authorization' => 'Bearer alta_…'],
]);
$data = json_decode((string) $response->getBody(), true);Ответ 200
Успешный ответ.
{
"id": "0192f3a1-7c2e-7b4d-9a61-00000000001e",
"name": "Продажи",
"dealPanel": {
"payment": true,
"contacts": true,
"products": false
},
"stages": [
{
"id": "0192f3a1-7c2e-7b4d-9a61-00000000001f",
"name": "Новый запрос",
"position": 1,
"kind": "open",
"color": "blue",
"durationNormSeconds": 172800
},
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000020",
"name": "Переговоры",
"position": 2,
"kind": "open",
"color": "yellow",
"durationNormSeconds": 604800
},
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000021",
"name": "Счёт выставлен",
"position": 3,
"kind": "open",
"color": "orange",
"durationNormSeconds": null
},
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000022",
"name": "Успешно",
"position": 4,
"kind": "won",
"color": "green",
"durationNormSeconds": null
},
{
"id": "0192f3a1-7c2e-7b4d-9a61-000000000023",
"name": "Отказ",
"position": 5,
"kind": "lost",
"color": "red",
"durationNormSeconds": null
}
]
}Поля ответа
dealPanelobjectWhich blocks the deal page shows for deals of this pipeline; each is on unless turned off.
Вложенные поля: 3
contactsbooleanThe deal page shows its contacts block: the company and the people of the deal.
paymentbooleanThe deal page shows its payment block: what was paid of the amount, and adding a payment.
productsbooleanThe deal page shows its products block: the deal's product lines.
idstring · uuidnamestringstagesobject[]Вложенные поля: 6
colorstringЗначения:
graybluetealgreenyelloworangeredpurpledurationNormSecondsinteger | nullHow long deals of the organization usually stand on this stage, in seconds (the 80th percentile of its own recent history, refreshed nightly); null while the stage has too little history.
≥ 0
idstring · uuidkindstringЗначения:
openwonlostnamestringpositioninteger≥ 1