{"openapi":"3.1.0","info":{"title":"РЕСПАЙ API","version":"1.0.0","description":"Отзывы, ответы и статистика точек одного кабинета. Ключ выпускает владелец или администратор: Аккаунт → API. Документация: https://respy.ru/developers"},"servers":[{"url":"https://respy.ru/api/v1"}],"security":[{"ApiKey":[]}],"paths":{"/locations":{"get":{"summary":"Точки, доступные ключу","responses":{"200":{"description":"Список","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Location"}}}}}}},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/locations/{id}/stats":{"get":{"summary":"Статистика точки за период (по умолчанию 30 дней)","parameters":[{"$ref":"#/components/parameters/Id"},{"name":"from","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","schema":{"type":"string","format":"date-time"}}],"responses":{"200":{"description":"Сводка","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Stats"}}}},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/reviews":{"get":{"summary":"Отзывы, новые сверху, страницами","parameters":[{"name":"locationId","in":"query","schema":{"type":"string","format":"uuid"}},{"name":"platform","in":"query","schema":{"type":"string","enum":["yandex","2gis","google","zoon","flamp","tripadvisor"]}},{"name":"rating","in":"query","description":"Оценка или список: 1,2","schema":{"type":"string","example":"1,2"}},{"name":"answered","in":"query","schema":{"type":"boolean"}},{"name":"status","in":"query","schema":{"type":"string","enum":["visible","hidden","deleted"]}},{"name":"from","in":"query","description":"Дата отзыва не раньше","schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","description":"Дата отзыва раньше","schema":{"type":"string","format":"date-time"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":50}},{"$ref":"#/components/parameters/Cursor"}],"responses":{"200":{"description":"Страница","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Review"}},"nextCursor":{"type":["string","null"]}}}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/reviews/{id}":{"get":{"summary":"Один отзыв и его последние ответы из РЕСПАЙ","parameters":[{"$ref":"#/components/parameters/Id"}],"responses":{"200":{"description":"Отзыв","content":{"application/json":{"schema":{"allOf":[{"$ref":"#/components/schemas/Review"},{"type":"object","properties":{"replies":{"type":"array","items":{"$ref":"#/components/schemas/Reply"}}}}]}}}},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}},"/reviews/{id}/reply":{"post":{"summary":"Отправить ответ на площадку (ключ «чтение и ответы»)","description":"Тот же путь, что из кабинета: проверка текста и стоп-слов, запись на площадку, сверка, повтор при временном отказе, журнал действий.","parameters":[{"$ref":"#/components/parameters/Id"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["text"],"properties":{"text":{"type":"string","minLength":2}}}}}},"responses":{"200":{"description":"Итог отправки","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Reply"}}}},"400":{"$ref":"#/components/responses/Error"},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"403":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"409":{"description":"На отзыв уже есть ответ или отправка идёт","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"$ref":"#/components/responses/Error"}}}},"/replies/{id}":{"get":{"summary":"Статус ответа","parameters":[{"$ref":"#/components/parameters/Id"}],"responses":{"200":{"description":"Ответ","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Reply"}}}},"401":{"$ref":"#/components/responses/Error"},"402":{"$ref":"#/components/responses/Error"},"404":{"$ref":"#/components/responses/Error"},"429":{"$ref":"#/components/responses/Error"}}}}},"webhooks":{"review.created":{"post":{"summary":"Новый отзыв","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Событие; при повторе доставки то же"},"type":{"const":"review.created"},"createdAt":{"type":"string","format":"date-time"},"data":{"type":"object","properties":{"review":{"$ref":"#/components/schemas/Review"}}}}}}}},"responses":{"200":{"description":"Любой ответ 2xx — доставлено"}}}},"reply.published":{"post":{"summary":"Ответ ушёл на площадку","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Событие; при повторе доставки то же"},"type":{"const":"reply.published"},"createdAt":{"type":"string","format":"date-time"},"data":{"type":"object","properties":{"reply":{"type":"object","properties":{"id":{"type":"string"},"text":{"type":"string"},"publishedAt":{"type":"string","format":"date-time"}}},"review":{"$ref":"#/components/schemas/Review"}}}}}}}},"responses":{"200":{"description":"Любой ответ 2xx — доставлено"}}}},"reply.failed":{"post":{"summary":"Ответ не ушёл (автоматические повторы кончились)","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string","description":"Событие; при повторе доставки то же"},"type":{"const":"reply.failed"},"createdAt":{"type":"string","format":"date-time"},"data":{"type":"object","properties":{"reply":{"type":"object","properties":{"id":{"type":"string"},"reason":{"type":["string","null"]}}},"review":{"$ref":"#/components/schemas/Review"}}}}}}}},"responses":{"200":{"description":"Любой ответ 2xx — доставлено"}}}}},"components":{"securitySchemes":{"ApiKey":{"type":"http","scheme":"bearer","description":"Authorization: Bearer rsp_…"}},"parameters":{"Id":{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}},"Cursor":{"name":"cursor","in":"query","description":"nextCursor из прошлой страницы","schema":{"type":"string"}}},"responses":{"Error":{"description":"Ошибка","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"schemas":{"Error":{"type":"object","properties":{"statusCode":{"type":"integer"},"code":{"type":"string","example":"RATE_LIMITED"},"message":{"type":"string"}}},"Location":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"name":{"type":"string"},"city":{"type":["string","null"]},"address":{"type":["string","null"]},"category":{"type":["string","null"]},"platforms":{"type":"array","items":{"type":"string"}}}},"Review":{"type":"object","required":["id","locationId","platform","rating","text","publishedAt","status"],"properties":{"id":{"type":"string","format":"uuid"},"locationId":{"type":"string","format":"uuid"},"locationName":{"type":"string"},"platform":{"type":"string","enum":["yandex","2gis","google","zoon","flamp","tripadvisor"]},"rating":{"type":"integer","minimum":1,"maximum":5},"text":{"type":"string"},"authorName":{"type":["string","null"]},"url":{"type":["string","null"],"description":"Отзыв на площадке"},"publishedAt":{"type":"string","format":"date-time"},"editedAt":{"type":["string","null"],"format":"date-time"},"status":{"type":"string","enum":["visible","hidden","under_review","missing","deleted","unknown"]},"reply":{"type":["object","null"],"properties":{"text":{"type":["string","null"]},"publishedAt":{"type":["string","null"],"format":"date-time"}}},"receivedAt":{"type":"string","format":"date-time","description":"Когда РЕСПАЙ увидел отзыв"}}},"Reply":{"type":"object","properties":{"id":{"type":"string","format":"uuid"},"reviewId":{"type":"string","format":"uuid"},"text":{"type":"string"},"status":{"type":"string","enum":["published","failed","checking","pending"],"description":"checking — площадка ответила неясно, РЕСПАЙ сверяет, дошёл ли ответ"},"failureReason":{"type":["string","null"]},"publishedAt":{"type":["string","null"],"format":"date-time"},"createdAt":{"type":"string","format":"date-time"}}},"Stats":{"type":"object","properties":{"locationId":{"type":"string"},"locationName":{"type":"string"},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"reviews":{"type":"integer"},"averageRating":{"type":["number","null"]},"answered":{"type":"integer"},"answeredShare":{"type":["number","null"]},"platforms":{"type":"array","items":{"type":"object","properties":{"platform":{"type":"string"},"reviews":{"type":"integer"},"averageRating":{"type":["number","null"]},"answered":{"type":"integer"},"ratings":{"type":"object","additionalProperties":{"type":"integer"}},"medianReplyHours":{"type":["number","null"]}}}}}}}}}