{"openapi": "3.1.0", "info": {"title": "Лидлог API", "version": "1.3", "description": "Лидлог — дневник гипотез по рекламным кампаниям (РК) Яндекс Директа, задачник и база знаний специалиста по контекстной рекламе. Через эти инструменты можно смотреть и создавать задачи (и подзадачи), РК, записи дневника — гипотезы, А/Б-сравнения, «что сделано» (изменения в РК), снятие результатов, одну гипотезу сразу в несколько РК — и заметки в базе знаний; смотреть кампании из Яндекс Директа в проекте и подтягивать их. Работайте в пределах согласованного пользователем объёма. Можно создавать проекты, настраивать повторы задач (repeat_rule), задавать итог goal_met=yes/almost/no и удалять объекты с проверкой прав. Для импорта передавайте стабильный external_id при создании проекта, задачи, РК или записи: повторный идентичный запрос вернёт тот же объект; изменённые данные — 409, удалённая запись — 410. Для изменений используйте PATCH. Удаление РК и записей необратимо; cascade=true разрешает удаление их зависимостей. Задачи идут в корзину, проекты — в удалённые. Перед импортом сверяйте существующие повторы по исполнителю, проекту и repeat_rule. Даты — ГГГГ-ММ-ДД, время — ЧЧ:ММ."}, "servers": [{"url": "https://app.lidlog.ru/api/v1"}], "components": {"securitySchemes": {"bearer": {"type": "http", "scheme": "bearer"}}}, "security": [{"bearer": []}], "paths": {"/me": {"get": {"summary": "Кто я", "operationId": "getMe", "description": "", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "4XX": {"description": "Ошибка: {\"error\": \"…\"}"}}}}, "/projects": {"get": {"summary": "Проекты, РК и команда", "operationId": "listProjects", "description": "Проекты пользователя в Лидлоге: id, название, рекламные кампании (РК) и команда. Вызывайте перед созданием задачи, чтобы найти project_id или campaign_id.", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "4XX": {"description": "Ошибка: {\"error\": \"…\"}"}}}, "post": {"summary": "Создать проект", "operationId": "createProject", "description": "Владелец — пользователь API-ключа. external_id обеспечивает повторяемый импорт.", "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"name": {"type": "string", "minLength": 1, "maxLength": 200}, "materials": {"type": "string", "maxLength": 10000}, "external_id": {"type": "string", "minLength": 1, "maxLength": 200, "description": "Стабильный ID исходной записи с префиксом источника. Повторный идентичный POST возвращает прежний объект; другие данные — 409. После удаления — 410."}, "members": {"type": "array", "maxItems": 100, "description": "Необязательно: только пользователи, уже видимые в командах ваших проектов; пусто по умолчанию.", "items": {"type": "object", "required": ["login"], "properties": {"login": {"type": "string"}, "role": {"type": "string", "enum": ["lead", "manager", "exec"]}}}}}, "required": ["name"]}}}}, "responses": {"200": {"description": "Созданный или ранее импортированный проект"}, "409": {"description": "external_id использован с другими данными"}, "410": {"description": "Ранее импортированный объект удалён"}}}}, "/tasks": {"get": {"summary": "Задачи", "operationId": "listTasks", "description": "По умолчанию — невыполненные.", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "properties": {"tasks": {"type": "array", "items": {"type": "object", "properties": {"id": {"type": "string"}, "repeat_rule": {"description": "Расписание повтора; null — отключить. date — дата начала. Дни недели: понедельник=0.", "anyOf": [{"type": "null"}, {"type": "object", "required": ["kind"], "properties": {"kind": {"type": "string", "enum": ["weekly", "monthly"]}, "days": {"type": "array", "items": {"type": "integer", "minimum": 0, "maximum": 6}, "minItems": 1, "maxItems": 7, "uniqueItems": true}, "day": {"type": "integer", "minimum": 1, "maximum": 31}, "every": {"type": "integer", "minimum": 1, "maximum": 52}}}]}, "title": {"type": "string", "description": "Название задачи (до 300 символов)"}, "note": {"type": "string", "description": "Описание"}, "date": {"type": "string", "description": "Дата ГГГГ-ММ-ДД; пусто — без даты"}, "time": {"type": "string", "description": "Время ЧЧ:ММ (только вместе с датой)"}, "type": {"type": "string", "enum": ["action", "call", "meeting"], "description": "action — дело, call — созвон, meeting — встреча"}, "priority": {"type": "integer", "enum": [0, 1, 2, 3], "description": "0 нет, 1 низкий, 2 средний, 3 высокий"}, "estimate": {"type": "integer", "description": "Оценка времени в минутах (сколько займёт задача), 0–10000; 0 — без оценки"}, "project_id": {"type": "string", "description": "id проекта из list_projects; без проекта — задача «без проекта»"}, "campaign_id": {"type": "string", "description": "id РК из list_projects (проект подставится сам)"}, "personal": {"type": "boolean", "description": "Личная задача — видна только вам"}, "responsible": {"type": "string", "description": "Логин ответственного из команды проекта"}, "executor": {"type": "string", "description": "Логин исполнителя из команды проекта"}, "done": {"type": "boolean"}, "done_at": {"type": "string"}, "url": {"type": "string"}, "repeat": {"type": "boolean"}, "external_id": {"type": "string", "minLength": 1, "maxLength": 200, "description": "Стабильный ID исходной записи с префиксом источника. Повторный идентичный POST возвращает прежний объект; другие данные — 409. После удаления — 410."}}}}}}}}}, "4XX": {"description": "Ошибка: {\"error\": \"…\"}"}}, "parameters": [{"name": "from", "in": "query", "required": false, "description": "С даты ГГГГ-ММ-ДД", "schema": {"type": "string"}}, {"name": "to", "in": "query", "required": false, "description": "По дату ГГГГ-ММ-ДД", "schema": {"type": "string"}}, {"name": "done", "in": "query", "required": false, "description": "false (по умолчанию), true или all", "schema": {"type": "string"}}, {"name": "project_id", "in": "query", "required": false, "description": "id проекта", "schema": {"type": "string"}}, {"name": "mine", "in": "query", "required": false, "description": "true — только мои", "schema": {"type": "boolean"}}, {"name": "limit", "in": "query", "required": false, "description": "до 1000", "schema": {"type": "integer"}}, {"name": "external_id", "in": "query", "schema": {"type": "string"}}, {"name": "offset", "in": "query", "schema": {"type": "integer", "minimum": 0}}]}, "post": {"summary": "Поставить задачу", "operationId": "createTask", "description": "Поставить задачу в Лидлог. Даты — ГГГГ-ММ-ДД, время — ЧЧ:ММ (часовой пояс пользователя). parent_id — поставить подзадачу к существующей задаче.", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "properties": {"id": {"type": "string"}, "repeat_rule": {"description": "Расписание повтора; null — отключить. date — дата начала. Дни недели: понедельник=0.", "anyOf": [{"type": "null"}, {"type": "object", "required": ["kind"], "properties": {"kind": {"type": "string", "enum": ["weekly", "monthly"]}, "days": {"type": "array", "items": {"type": "integer", "minimum": 0, "maximum": 6}, "minItems": 1, "maxItems": 7, "uniqueItems": true}, "day": {"type": "integer", "minimum": 1, "maximum": 31}, "every": {"type": "integer", "minimum": 1, "maximum": 52}}}]}, "title": {"type": "string", "description": "Название задачи (до 300 символов)"}, "note": {"type": "string", "description": "Описание"}, "date": {"type": "string", "description": "Дата ГГГГ-ММ-ДД; пусто — без даты"}, "time": {"type": "string", "description": "Время ЧЧ:ММ (только вместе с датой)"}, "type": {"type": "string", "enum": ["action", "call", "meeting"], "description": "action — дело, call — созвон, meeting — встреча"}, "priority": {"type": "integer", "enum": [0, 1, 2, 3], "description": "0 нет, 1 низкий, 2 средний, 3 высокий"}, "estimate": {"type": "integer", "description": "Оценка времени в минутах (сколько займёт задача), 0–10000; 0 — без оценки"}, "project_id": {"type": "string", "description": "id проекта из list_projects; без проекта — задача «без проекта»"}, "campaign_id": {"type": "string", "description": "id РК из list_projects (проект подставится сам)"}, "personal": {"type": "boolean", "description": "Личная задача — видна только вам"}, "responsible": {"type": "string", "description": "Логин ответственного из команды проекта"}, "executor": {"type": "string", "description": "Логин исполнителя из команды проекта"}, "done": {"type": "boolean"}, "done_at": {"type": "string"}, "url": {"type": "string"}, "repeat": {"type": "boolean"}, "external_id": {"type": "string", "minLength": 1, "maxLength": 200, "description": "Стабильный ID исходной записи с префиксом источника. Повторный идентичный POST возвращает прежний объект; другие данные — 409. После удаления — 410."}}}}}}, "4XX": {"description": "Ошибка: {\"error\": \"…\"}"}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"repeat_rule": {"description": "Расписание повтора; null — отключить. date — дата начала. Дни недели: понедельник=0.", "anyOf": [{"type": "null"}, {"type": "object", "required": ["kind"], "properties": {"kind": {"type": "string", "enum": ["weekly", "monthly"]}, "days": {"type": "array", "items": {"type": "integer", "minimum": 0, "maximum": 6}, "minItems": 1, "maxItems": 7, "uniqueItems": true}, "day": {"type": "integer", "minimum": 1, "maximum": 31}, "every": {"type": "integer", "minimum": 1, "maximum": 52}}}]}, "title": {"type": "string", "description": "Название задачи (до 300 символов)"}, "note": {"type": "string", "description": "Описание"}, "date": {"type": "string", "description": "Дата ГГГГ-ММ-ДД; пусто — без даты"}, "time": {"type": "string", "description": "Время ЧЧ:ММ (только вместе с датой)"}, "type": {"type": "string", "enum": ["action", "call", "meeting"], "description": "action — дело, call — созвон, meeting — встреча"}, "priority": {"type": "integer", "enum": [0, 1, 2, 3], "description": "0 нет, 1 низкий, 2 средний, 3 высокий"}, "estimate": {"type": "integer", "description": "Оценка времени в минутах (сколько займёт задача), 0–10000; 0 — без оценки"}, "project_id": {"type": "string", "description": "id проекта из list_projects; без проекта — задача «без проекта»"}, "campaign_id": {"type": "string", "description": "id РК из list_projects (проект подставится сам)"}, "personal": {"type": "boolean", "description": "Личная задача — видна только вам"}, "responsible": {"type": "string", "description": "Логин ответственного из команды проекта"}, "executor": {"type": "string", "description": "Логин исполнителя из команды проекта"}, "external_id": {"type": "string", "minLength": 1, "maxLength": 200, "description": "Стабильный ID исходной записи с префиксом источника. Повторный идентичный POST возвращает прежний объект; другие данные — 409. После удаления — 410."}, "parent_id": {"type": "string", "description": "id родительской задачи — тогда это подзадача: проект как у родителя, дата пустая — в тот же день, что и родитель"}}, "required": ["title"]}}}}}}, "/tasks/{id}": {"get": {"summary": "Одна задача", "operationId": "getTask", "description": "", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "properties": {"id": {"type": "string"}, "repeat_rule": {"description": "Расписание повтора; null — отключить. date — дата начала. Дни недели: понедельник=0.", "anyOf": [{"type": "null"}, {"type": "object", "required": ["kind"], "properties": {"kind": {"type": "string", "enum": ["weekly", "monthly"]}, "days": {"type": "array", "items": {"type": "integer", "minimum": 0, "maximum": 6}, "minItems": 1, "maxItems": 7, "uniqueItems": true}, "day": {"type": "integer", "minimum": 1, "maximum": 31}, "every": {"type": "integer", "minimum": 1, "maximum": 52}}}]}, "title": {"type": "string", "description": "Название задачи (до 300 символов)"}, "note": {"type": "string", "description": "Описание"}, "date": {"type": "string", "description": "Дата ГГГГ-ММ-ДД; пусто — без даты"}, "time": {"type": "string", "description": "Время ЧЧ:ММ (только вместе с датой)"}, "type": {"type": "string", "enum": ["action", "call", "meeting"], "description": "action — дело, call — созвон, meeting — встреча"}, "priority": {"type": "integer", "enum": [0, 1, 2, 3], "description": "0 нет, 1 низкий, 2 средний, 3 высокий"}, "estimate": {"type": "integer", "description": "Оценка времени в минутах (сколько займёт задача), 0–10000; 0 — без оценки"}, "project_id": {"type": "string", "description": "id проекта из list_projects; без проекта — задача «без проекта»"}, "campaign_id": {"type": "string", "description": "id РК из list_projects (проект подставится сам)"}, "personal": {"type": "boolean", "description": "Личная задача — видна только вам"}, "responsible": {"type": "string", "description": "Логин ответственного из команды проекта"}, "executor": {"type": "string", "description": "Логин исполнителя из команды проекта"}, "done": {"type": "boolean"}, "done_at": {"type": "string"}, "url": {"type": "string"}, "repeat": {"type": "boolean"}, "external_id": {"type": "string", "minLength": 1, "maxLength": 200, "description": "Стабильный ID исходной записи с префиксом источника. Повторный идентичный POST возвращает прежний объект; другие данные — 409. После удаления — 410."}}}}}}, "4XX": {"description": "Ошибка: {\"error\": \"…\"}"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}]}, "patch": {"summary": "Изменить задачу или отметить выполнение", "operationId": "updateTask", "description": "Изменить задачу (перенести, переименовать, сменить проект) или отметить выполнение (done).", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object", "properties": {"id": {"type": "string"}, "repeat_rule": {"description": "Расписание повтора; null — отключить. date — дата начала. Дни недели: понедельник=0.", "anyOf": [{"type": "null"}, {"type": "object", "required": ["kind"], "properties": {"kind": {"type": "string", "enum": ["weekly", "monthly"]}, "days": {"type": "array", "items": {"type": "integer", "minimum": 0, "maximum": 6}, "minItems": 1, "maxItems": 7, "uniqueItems": true}, "day": {"type": "integer", "minimum": 1, "maximum": 31}, "every": {"type": "integer", "minimum": 1, "maximum": 52}}}]}, "title": {"type": "string", "description": "Название задачи (до 300 символов)"}, "note": {"type": "string", "description": "Описание"}, "date": {"type": "string", "description": "Дата ГГГГ-ММ-ДД; пусто — без даты"}, "time": {"type": "string", "description": "Время ЧЧ:ММ (только вместе с датой)"}, "type": {"type": "string", "enum": ["action", "call", "meeting"], "description": "action — дело, call — созвон, meeting — встреча"}, "priority": {"type": "integer", "enum": [0, 1, 2, 3], "description": "0 нет, 1 низкий, 2 средний, 3 высокий"}, "estimate": {"type": "integer", "description": "Оценка времени в минутах (сколько займёт задача), 0–10000; 0 — без оценки"}, "project_id": {"type": "string", "description": "id проекта из list_projects; без проекта — задача «без проекта»"}, "campaign_id": {"type": "string", "description": "id РК из list_projects (проект подставится сам)"}, "personal": {"type": "boolean", "description": "Личная задача — видна только вам"}, "responsible": {"type": "string", "description": "Логин ответственного из команды проекта"}, "executor": {"type": "string", "description": "Логин исполнителя из команды проекта"}, "done": {"type": "boolean"}, "done_at": {"type": "string"}, "url": {"type": "string"}, "repeat": {"type": "boolean"}, "external_id": {"type": "string", "minLength": 1, "maxLength": 200, "description": "Стабильный ID исходной записи с префиксом источника. Повторный идентичный POST возвращает прежний объект; другие данные — 409. После удаления — 410."}}}}}}, "4XX": {"description": "Ошибка: {\"error\": \"…\"}"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"done": {"type": "boolean"}, "repeat_rule": {"description": "Расписание повтора; null — отключить. date — дата начала. Дни недели: понедельник=0.", "anyOf": [{"type": "null"}, {"type": "object", "required": ["kind"], "properties": {"kind": {"type": "string", "enum": ["weekly", "monthly"]}, "days": {"type": "array", "items": {"type": "integer", "minimum": 0, "maximum": 6}, "minItems": 1, "maxItems": 7, "uniqueItems": true}, "day": {"type": "integer", "minimum": 1, "maximum": 31}, "every": {"type": "integer", "minimum": 1, "maximum": 52}}}]}, "title": {"type": "string", "description": "Название задачи (до 300 символов)"}, "note": {"type": "string", "description": "Описание"}, "date": {"type": "string", "description": "Дата ГГГГ-ММ-ДД; пусто — без даты"}, "time": {"type": "string", "description": "Время ЧЧ:ММ (только вместе с датой)"}, "type": {"type": "string", "enum": ["action", "call", "meeting"], "description": "action — дело, call — созвон, meeting — встреча"}, "priority": {"type": "integer", "enum": [0, 1, 2, 3], "description": "0 нет, 1 низкий, 2 средний, 3 высокий"}, "estimate": {"type": "integer", "description": "Оценка времени в минутах (сколько займёт задача), 0–10000; 0 — без оценки"}, "project_id": {"type": "string", "description": "id проекта из list_projects; без проекта — задача «без проекта»"}, "campaign_id": {"type": "string", "description": "id РК из list_projects (проект подставится сам)"}, "personal": {"type": "boolean", "description": "Личная задача — видна только вам"}, "responsible": {"type": "string", "description": "Логин ответственного из команды проекта"}, "executor": {"type": "string", "description": "Логин исполнителя из команды проекта"}}}}}}}, "delete": {"summary": "Переместить задачу в корзину. При наличии подзадач требуется cascade=true; таймер должен быть остановлен.", "operationId": "deleteTask", "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "cascade", "in": "query", "required": false, "schema": {"type": "boolean", "default": false}}], "responses": {"200": {"description": "Результат удаления с mode и количеством"}, "403": {"description": "Недостаточно прав"}, "409": {"description": "Есть зависимости; требуется cascade=true"}}}}, "/search": {"get": {"summary": "Поиск", "operationId": "search", "description": "Поиск по РК, записям дневника (гипотезы, А/Б), задачам и базе знаний пользователя.", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "4XX": {"description": "Ошибка: {\"error\": \"…\"}"}}, "parameters": [{"name": "q", "in": "query", "required": false, "description": "Что искать", "schema": {"type": "string"}}]}}, "/campaigns": {"get": {"summary": "РК", "operationId": "listCampaigns", "description": "Рекламные кампании (РК): id, проект, названия, номера.", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "4XX": {"description": "Ошибка: {\"error\": \"…\"}"}}, "parameters": [{"name": "project_id", "in": "query", "required": false, "description": "id проекта", "schema": {"type": "string"}}, {"name": "q", "in": "query", "required": false, "description": "Поиск", "schema": {"type": "string"}}, {"name": "external_id", "in": "query", "schema": {"type": "string"}}]}, "post": {"summary": "Завести РК", "operationId": "createCampaign", "description": "Завести РК в проекте (названия и номера из Директа).", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "4XX": {"description": "Ошибка: {\"error\": \"…\"}"}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"project_id": {"type": "string"}, "external_id": {"type": "string", "minLength": 1, "maxLength": 200, "description": "Стабильный ID исходной записи с префиксом источника. Повторный идентичный POST возвращает прежний объект; другие данные — 409. После удаления — 410."}, "names": {"type": "array", "items": {"type": "string"}, "description": "Названия РК (одна карточка может объединять несколько РК)"}, "numbers": {"type": "array", "items": {"type": "string"}, "description": "Номера РК в Директе"}, "group": {"type": "string", "description": "№ группы объявлений"}, "archived": {"type": "boolean", "description": "Скрыть РК (отключена)"}}, "required": ["project_id", "names"]}}}}}}, "/campaigns/{id}": {"patch": {"summary": "Изменить РК", "operationId": "updateCampaign", "description": "Изменить РК: названия, номера, группу, скрыть.", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "4XX": {"description": "Ошибка: {\"error\": \"…\"}"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"names": {"type": "array", "items": {"type": "string"}, "description": "Названия РК (одна карточка может объединять несколько РК)"}, "numbers": {"type": "array", "items": {"type": "string"}, "description": "Номера РК в Директе"}, "group": {"type": "string", "description": "№ группы объявлений"}, "archived": {"type": "boolean", "description": "Скрыть РК (отключена)"}}}}}}}, "delete": {"summary": "Необратимо удалить РК. Если есть записи/связи, требуется cascade=true: записи удалятся, задачи останутся без привязки к РК.", "operationId": "deleteCampaign", "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "cascade", "in": "query", "required": false, "schema": {"type": "boolean", "default": false}}], "responses": {"200": {"description": "Результат удаления с mode и количеством"}, "403": {"description": "Недостаточно прав"}, "409": {"description": "Есть зависимости; требуется cascade=true"}}}}, "/entries": {"get": {"summary": "Записи дневника", "operationId": "listEntries", "description": "Записи дневника РК: гипотезы, А/Б и задачи — с изменениями («что сделано») и результатами.", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "4XX": {"description": "Ошибка: {\"error\": \"…\"}"}}, "parameters": [{"name": "campaign_id", "in": "query", "required": false, "description": "id РК", "schema": {"type": "string"}}, {"name": "project_id", "in": "query", "required": false, "description": "id проекта", "schema": {"type": "string"}}, {"name": "type", "in": "query", "required": false, "description": "hyp, ab или task", "schema": {"type": "string"}}, {"name": "measure", "in": "query", "required": false, "description": "all, wait, due или done", "schema": {"type": "string"}}, {"name": "q", "in": "query", "required": false, "description": "Поиск", "schema": {"type": "string"}}, {"name": "limit", "in": "query", "required": false, "description": "до 500", "schema": {"type": "integer"}}, {"name": "external_id", "in": "query", "schema": {"type": "string"}}, {"name": "offset", "in": "query", "schema": {"type": "integer", "minimum": 0}}]}, "post": {"summary": "Записать в дневник", "operationId": "createEntry", "description": "Записать в дневник РК гипотезу, А/Б-сравнение (варианты A/B…) или задачу. Например, после созвона с клиентом: что решили проверить.", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "4XX": {"description": "Ошибка: {\"error\": \"…\"}"}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"external_id": {"type": "string", "minLength": 1, "maxLength": 200, "description": "Стабильный ID исходной записи с префиксом источника. Повторный идентичный POST возвращает прежний объект; другие данные — 409. После удаления — 410."}, "campaign_id": {"type": "string", "description": "id РК (list_campaigns или list_projects)"}, "type": {"type": "string", "enum": ["hyp", "ab", "task"], "description": "hyp — гипотеза (по умолчанию), ab — А/Б-сравнение, task — задача в дневнике РК"}, "previous_stage_id": {"type": ["string", "null"], "description": "ID предыдущего этапа (та же РК и тип). Если поле не передано, гипотеза автоматически продолжает последнюю цепочку этой РК. null — отдельная цепочка с этапа I."}, "first_change": {"type": "object", "description": "Первое «что сделано»", "properties": {"date": {"type": "string"}, "text": {"type": "string"}}}, "goal_met": {"type": ["string", "null"], "enum": ["yes", "almost", "no", null], "description": "Итог: цель достигнута / почти достигнута / не достигнута; null — очистить"}, "goal": {"type": "string", "description": "Цель (зачем это делаем)"}, "hypothesis": {"type": "string", "description": "Гипотеза: «Если …, то …»"}, "plan": {"type": "string", "description": "План / ожидаемый результат (в цифрах)"}, "status": {"type": "string", "enum": ["idea", "work", "done"], "description": "idea — запланировано (по умолчанию), work — в работе, done — выполнено"}, "done_date": {"type": "string", "description": "Дата выполнения ГГГГ-ММ-ДД (при status=done; по умолчанию сегодня)"}, "measure_date": {"type": "string", "description": "Когда снимать результат, ГГГГ-ММ-ДД"}, "measure_status": {"type": "string", "enum": ["no", "yes", "na"], "description": "no — не снят, yes — снят, na — снятие не нужно"}, "result": {"type": "string", "description": "Результат (цифры)"}, "conclusions": {"type": "string", "description": "Выводы"}, "ab_kind": {"type": "string", "enum": ["creatives", "headlines", "campaigns", "audiences", "other"], "description": "Только для А/Б: что сравниваем — креативы, заголовки, кампании, аудитории, другое"}, "variants": {"type": "array", "description": "Только для А/Б: варианты A, B, C… (2–10)", "items": {"type": "object", "properties": {"name": {"type": "string", "description": "Коротко: «старый», «новый»"}, "text": {"type": "string", "description": "Что в варианте: заголовок, РК, аудитория…"}}}}, "winner": {"type": "string", "description": "Только для А/Б: победил вариант — буква (A, B…) или draw (ничья)"}}}}}}}}, "/entries/{id}": {"get": {"summary": "Одна запись", "operationId": "getEntry", "description": "", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "4XX": {"description": "Ошибка: {\"error\": \"…\"}"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}]}, "patch": {"summary": "Изменить запись", "operationId": "updateEntry", "description": "Изменить запись дневника: текст, статус, дату снятия результата, варианты А/Б.", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "4XX": {"description": "Ошибка: {\"error\": \"…\"}"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"goal_met": {"type": ["string", "null"], "enum": ["yes", "almost", "no", null], "description": "Итог: цель достигнута / почти достигнута / не достигнута; null — очистить"}, "goal": {"type": "string", "description": "Цель (зачем это делаем)"}, "hypothesis": {"type": "string", "description": "Гипотеза: «Если …, то …»"}, "plan": {"type": "string", "description": "План / ожидаемый результат (в цифрах)"}, "status": {"type": "string", "enum": ["idea", "work", "done"], "description": "idea — запланировано (по умолчанию), work — в работе, done — выполнено"}, "done_date": {"type": "string", "description": "Дата выполнения ГГГГ-ММ-ДД (при status=done; по умолчанию сегодня)"}, "measure_date": {"type": "string", "description": "Когда снимать результат, ГГГГ-ММ-ДД"}, "measure_status": {"type": "string", "enum": ["no", "yes", "na"], "description": "no — не снят, yes — снят, na — снятие не нужно"}, "result": {"type": "string", "description": "Результат (цифры)"}, "conclusions": {"type": "string", "description": "Выводы"}, "ab_kind": {"type": "string", "enum": ["creatives", "headlines", "campaigns", "audiences", "other"], "description": "Только для А/Б: что сравниваем — креативы, заголовки, кампании, аудитории, другое"}, "variants": {"type": "array", "description": "Только для А/Б: варианты A, B, C… (2–10)", "items": {"type": "object", "properties": {"name": {"type": "string", "description": "Коротко: «старый», «новый»"}, "text": {"type": "string", "description": "Что в варианте: заголовок, РК, аудитория…"}}}}, "winner": {"type": "string", "description": "Только для А/Б: победил вариант — буква (A, B…) или draw (ничья)"}}}}}}}, "delete": {"summary": "Необратимо удалить запись дневника. При наличии продолжений требуется cascade=true: они также удалятся.", "operationId": "deleteEntry", "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "cascade", "in": "query", "required": false, "schema": {"type": "boolean", "default": false}}], "responses": {"200": {"description": "Результат удаления с mode и количеством"}, "403": {"description": "Недостаточно прав"}, "409": {"description": "Есть зависимости; требуется cascade=true"}}}}, "/entries/{id}/changes": {"post": {"summary": "Что сделано", "operationId": "addChange", "description": "«Что сделано»: записать изменение в РК (дата и текст) в запись дневника.", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "4XX": {"description": "Ошибка: {\"error\": \"…\"}"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"date": {"type": "string"}, "text": {"type": "string"}}, "required": ["text"]}}}}}}, "/entries/{id}/measure": {"post": {"summary": "Снять результат", "operationId": "measureResult", "description": "Снять результат гипотезы или А/Б: цифры, выводы, у А/Б — победитель.", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "4XX": {"description": "Ошибка: {\"error\": \"…\"}"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"result": {"type": "string"}, "conclusions": {"type": "string"}, "goal_met": {"type": ["string", "null"], "enum": ["yes", "almost", "no", null], "description": "Итог: цель достигнута / почти достигнута / не достигнута; null — очистить"}, "winner": {"type": "string", "description": "А/Б: A, B… или draw"}, "date": {"type": "string", "description": "Дата снятия, по умолчанию сегодня"}}}}}}}}, "/kb/folders": {"get": {"summary": "Папки базы знаний", "operationId": "listKbFolders", "description": "Папки базы знаний, куда пользователь может писать.", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "4XX": {"description": "Ошибка: {\"error\": \"…\"}"}}}}, "/kb/notes": {"post": {"summary": "Заметка в базу знаний", "operationId": "createKbNote", "description": "Заметка в базу знаний (например, итоги созвона). Текст: абзацы, списки «- », заголовки «# ».", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "4XX": {"description": "Ошибка: {\"error\": \"…\"}"}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"title": {"type": "string"}, "text": {"type": "string"}, "folder_id": {"type": "string", "description": "Папка (list_kb_folders); без неё — в корень"}}, "required": ["title", "text"]}}}}}}, "/projects/{id}/direct": {"get": {"summary": "Кампании из Директа", "operationId": "listDirectCampaigns", "description": "Кампании из Яндекс Директа в проекте (сервер подтягивает их раз в сутки): номер, название, статус (on — идёт, off — остановлена, archive — в архиве), аккаунт; campaign_id — если такая РК уже есть в Лидлоге.", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "4XX": {"description": "Ошибка: {\"error\": \"…\"}"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}]}}, "/projects/{id}/direct/sync": {"post": {"summary": "Подтянуть кампании из Директа сейчас", "operationId": "syncDirect", "description": "Подтянуть кампании из Директа в проект прямо сейчас (не чаще раза в минуту на проект) и вернуть список, как list_direct_campaigns.", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "4XX": {"description": "Ошибка: {\"error\": \"…\"}"}}, "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}]}}, "/entries/hypotheses": {"post": {"summary": "Гипотеза в несколько РК", "operationId": "createHypotheses", "description": "Одна и та же гипотеза — в несколько РК сразу: у каждой РК своя запись (дальше живут отдельно). Где в РК уже были гипотезы — это следующий этап последней.", "responses": {"200": {"description": "OK", "content": {"application/json": {"schema": {"type": "object"}}}}, "4XX": {"description": "Ошибка: {\"error\": \"…\"}"}}, "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"campaign_ids": {"type": "array", "items": {"type": "string"}, "description": "id РК (1–30)"}, "first_change": {"type": "object", "description": "Первое «что сделано»", "properties": {"date": {"type": "string"}, "text": {"type": "string"}}}, "goal_met": {"type": ["string", "null"], "enum": ["yes", "almost", "no", null], "description": "Итог: цель достигнута / почти достигнута / не достигнута; null — очистить"}, "goal": {"type": "string", "description": "Цель (зачем это делаем)"}, "hypothesis": {"type": "string", "description": "Гипотеза: «Если …, то …»"}, "plan": {"type": "string", "description": "План / ожидаемый результат (в цифрах)"}, "status": {"type": "string", "enum": ["idea", "work", "done"], "description": "idea — запланировано (по умолчанию), work — в работе, done — выполнено"}, "done_date": {"type": "string", "description": "Дата выполнения ГГГГ-ММ-ДД (при status=done; по умолчанию сегодня)"}, "measure_date": {"type": "string", "description": "Когда снимать результат, ГГГГ-ММ-ДД"}, "measure_status": {"type": "string", "enum": ["no", "yes", "na"], "description": "no — не снят, yes — снят, na — снятие не нужно"}, "result": {"type": "string", "description": "Результат (цифры)"}, "conclusions": {"type": "string", "description": "Выводы"}}, "required": ["campaign_ids", "hypothesis"]}}}}}}, "/projects/{id}": {"patch": {"summary": "Изменить проект", "operationId": "updateProject", "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}], "requestBody": {"required": true, "content": {"application/json": {"schema": {"type": "object", "properties": {"name": {"type": "string", "minLength": 1, "maxLength": 200}, "materials": {"type": "string", "maxLength": 10000}, "members": {"type": "array", "maxItems": 100, "description": "Необязательно: только пользователи, уже видимые в командах ваших проектов; пусто по умолчанию.", "items": {"type": "object", "required": ["login"], "properties": {"login": {"type": "string"}, "role": {"type": "string", "enum": ["lead", "manager", "exec"]}}}}}}}}}, "responses": {"200": {"description": "Проект"}, "403": {"description": "Нет прав на изменение"}}}, "delete": {"summary": "Переместить проект в удалённые. Только владелец; ограничения команды как в программе.", "operationId": "deleteProject", "parameters": [{"name": "id", "in": "path", "required": true, "schema": {"type": "string"}}, {"name": "cascade", "in": "query", "required": false, "schema": {"type": "boolean", "default": false}}], "responses": {"200": {"description": "Результат удаления с mode и количеством"}, "403": {"description": "Недостаточно прав"}, "409": {"description": "Есть зависимости; требуется cascade=true"}}}}}}