{
  "openapi": "3.1.1",
  "info": {
    "title": "Strata API",
    "description": "Заказы, списанное время и аналитика воркспейса Strata. API только читает данные. Время — в секундах, суммы — целыми числами в сотых долях валюты воркспейса, моменты — ISO 8601 в UTC.",
    "version": "v1"
  },
  "paths": {
    "/api/v1/me": {
      "get": {
        "tags": [
          "Токен"
        ],
        "summary": "Воркспейс, ваш профиль, токен и лимиты",
        "operationId": "getMe",
        "responses": {
          "400": {
            "description": "Ошибка в параметрах запроса.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Токена нет или он больше не действует.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "По этому токену такие данные недоступны.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Слишком много запросов. Подождите и повторите.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeResource"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tasks": {
      "get": {
        "tags": [
          "Заказы"
        ],
        "summary": "Список заказов",
        "description": "Сначала давно изменённые. Чтобы забирать только изменения, передайте в updatedSince самое позднее updatedAt из прошлой выгрузки минус 5 минут.",
        "operationId": "listTasks",
        "parameters": [
          {
            "name": "updatedSince",
            "in": "query",
            "description": "Только заказы, изменённые начиная с этого момента, например 2026-09-30T10:00:00Z. «+» в смещении записывайте как %2B.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "status",
            "in": "query",
            "description": "Только заказы в этих статусах: status=done&status=cancel или status=done,cancel.",
            "schema": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Сколько записей на странице: от 1 до 100, по умолчанию 50.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "nextCursor из предыдущего ответа.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Ошибка в параметрах запроса.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Токена нет или он больше не действует.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "По этому токену такие данные недоступны.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Слишком много запросов. Подождите и повторите.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResourcePageOfTaskResource"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/tasks/{idOrKey}": {
      "get": {
        "tags": [
          "Заказы"
        ],
        "summary": "Заказ с описанием и этапами",
        "operationId": "getTask",
        "parameters": [
          {
            "name": "idOrKey",
            "in": "path",
            "description": "Id заказа или его номер, например SMCP-42.",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Ошибка в параметрах запроса.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Токена нет или он больше не действует.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "По этому токену такие данные недоступны.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Слишком много запросов. Подождите и повторите.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TaskDetailsResource"
                }
              }
            }
          },
          "404": {
            "description": "Не найдено.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/worklogs": {
      "get": {
        "tags": [
          "Время"
        ],
        "summary": "Записи времени",
        "description": "Сначала ранние.",
        "operationId": "listWorklogs",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "description": "Записи, начатые не раньше этого момента.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "Записи, начатые раньше этого момента.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "name": "memberId",
            "in": "query",
            "description": "Только записи этого сотрудника.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "taskId",
            "in": "query",
            "description": "Только записи по этому заказу.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Сколько записей на странице: от 1 до 100, по умолчанию 50.",
            "schema": {
              "type": "integer",
              "format": "int32"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "description": "nextCursor из предыдущего ответа.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Ошибка в параметрах запроса.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Токена нет или он больше не действует.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "По этому токену такие данные недоступны.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Слишком много запросов. Подождите и повторите.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResourcePageOfWorklogResource"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/analytics/summary": {
      "get": {
        "tags": [
          "Аналитика"
        ],
        "summary": "Сводка за период",
        "description": "Время и деньги по командам, видам работ, людям и статусам, сроки. Только по токену владельца, не больше 30 запросов в минуту.",
        "operationId": "getAnalyticsSummary",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "description": "Первый день периода, например 2026-09-01. Без from и to — текущая неделя.",
            "schema": {
              "type": [
                "null",
                "string"
              ],
              "format": "date"
            }
          },
          {
            "name": "to",
            "in": "query",
            "description": "День после последнего дня периода, например 2026-10-01.",
            "schema": {
              "type": [
                "null",
                "string"
              ],
              "format": "date"
            }
          }
        ],
        "responses": {
          "400": {
            "description": "Ошибка в параметрах запроса.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "401": {
            "description": "Токена нет или он больше не действует.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "403": {
            "description": "По этому токену такие данные недоступны.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "429": {
            "description": "Слишком много запросов. Подождите и повторите.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/ProblemDetails"
                }
              }
            }
          },
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnalyticsSummaryResource"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AnalyticsRowResource": {
        "required": [
          "id",
          "name",
          "tasks",
          "plannedSeconds",
          "factSeconds",
          "factCost",
          "targetSeconds",
          "targetCost"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Id команды, вида работ или сотрудника.",
            "format": "int32"
          },
          "name": {
            "type": "string"
          },
          "tasks": {
            "type": "integer",
            "description": "Сколько заказов со списанным за период временем.",
            "format": "int32"
          },
          "plannedSeconds": {
            "type": "integer",
            "description": "Запланированное на период время, секунды.",
            "format": "int64"
          },
          "factSeconds": {
            "type": "integer",
            "description": "Списанное за период время, секунды.",
            "format": "int64"
          },
          "factCost": {
            "type": "integer",
            "description": "Себестоимость списанного времени, в сотых долях валюты.",
            "format": "int64"
          },
          "targetSeconds": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Оценка тех же заказов, секунды. Есть у команд и видов работ, у сотрудников — null.",
            "format": "int64"
          },
          "targetCost": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Стоимость тех же заказов, в сотых долях валюты. Есть у команд и видов работ, у сотрудников — null.",
            "format": "int64"
          }
        },
        "description": "Строка разреза. Команда, вид работ или сотрудник."
      },
      "AnalyticsStatusResource": {
        "required": [
          "status",
          "tasks",
          "plannedSeconds",
          "factSeconds"
        ],
        "type": "object",
        "properties": {
          "status": {
            "description": "Статус: draft — черновик, backlog — бэклог, need_clarification — на уточнении, confirmed — подтверждён, in_process — в работе, under_review — на проверке, done — готов, cancel — отменён.",
            "$ref": "#/components/schemas/TaskWorkflowStatus"
          },
          "tasks": {
            "type": "integer",
            "description": "Сколько заказов в этом статусе, по которым за период списано или запланировано время.",
            "format": "int32"
          },
          "plannedSeconds": {
            "type": "integer",
            "description": "Запланированное на период время, секунды.",
            "format": "int64"
          },
          "factSeconds": {
            "type": "integer",
            "description": "Списанное за период время, секунды.",
            "format": "int64"
          }
        },
        "description": "Заказы в одном статусе."
      },
      "AnalyticsSummaryResource": {
        "required": [
          "from",
          "to",
          "total",
          "teams",
          "workTypes",
          "members",
          "statuses",
          "delivery"
        ],
        "type": "object",
        "properties": {
          "from": {
            "type": "string",
            "format": "date"
          },
          "to": {
            "type": "string",
            "format": "date"
          },
          "total": {
            "$ref": "#/components/schemas/AnalyticsTotalResource"
          },
          "teams": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsRowResource"
            },
            "description": "По командам."
          },
          "workTypes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsRowResource"
            },
            "description": "По видам работ."
          },
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsRowResource"
            },
            "description": "По сотрудникам."
          },
          "statuses": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AnalyticsStatusResource"
            },
            "description": "По статусам заказов."
          },
          "delivery": {
            "$ref": "#/components/schemas/DeliveryResource"
          }
        },
        "description": "Сводка за период. Как на дашборде аналитики: период — с from по день перед to, дни по UTC."
      },
      "AnalyticsTotalResource": {
        "required": [
          "tasks",
          "plannedSeconds",
          "factSeconds",
          "factCost"
        ],
        "type": "object",
        "properties": {
          "tasks": {
            "type": "integer",
            "description": "Сколько заказов со списанным за период временем.",
            "format": "int32"
          },
          "plannedSeconds": {
            "type": "integer",
            "description": "Запланированное на период время, секунды.",
            "format": "int64"
          },
          "factSeconds": {
            "type": "integer",
            "description": "Списанное за период время, секунды.",
            "format": "int64"
          },
          "factCost": {
            "type": "integer",
            "description": "Себестоимость списанного времени, в сотых долях валюты.",
            "format": "int64"
          }
        },
        "description": "Итог за период."
      },
      "DeliveryResource": {
        "required": [
          "created",
          "completed",
          "onTime",
          "overdue",
          "noDue",
          "openOverdue",
          "averageCycleSeconds"
        ],
        "type": "object",
        "properties": {
          "created": {
            "type": "integer",
            "format": "int32"
          },
          "completed": {
            "type": "integer",
            "format": "int32"
          },
          "onTime": {
            "type": "integer",
            "format": "int32"
          },
          "overdue": {
            "type": "integer",
            "format": "int32"
          },
          "noDue": {
            "type": "integer",
            "format": "int32"
          },
          "openOverdue": {
            "type": "integer",
            "format": "int32"
          },
          "averageCycleSeconds": {
            "type": "integer",
            "description": "Сколько в среднем проходит от создания до завершения, секунды.",
            "format": "int64"
          }
        },
        "description": "Сроки. Сколько заказов создано и завершено за период, из них в срок и с опозданием, сколько без срока и сколько просрочено сейчас."
      },
      "MeResource": {
        "required": [
          "workspace",
          "member",
          "token",
          "limits"
        ],
        "type": "object",
        "properties": {
          "workspace": {
            "$ref": "#/components/schemas/WorkspaceResource"
          },
          "member": {
            "$ref": "#/components/schemas/MemberResource"
          },
          "token": {
            "$ref": "#/components/schemas/TokenResource"
          },
          "limits": {
            "$ref": "#/components/schemas/RateLimitsResource"
          }
        },
        "description": "Токен и его воркспейс. Кто выпустил токен, сам токен и лимиты запросов."
      },
      "MemberResource": {
        "required": [
          "id",
          "name",
          "role"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "type": "string"
          },
          "role": {
            "description": "Роль: owner — владелец, manager — менеджер, viewer — наблюдатель.",
            "$ref": "#/components/schemas/WorkspaceRole"
          }
        },
        "description": "Автор токена. Запросы идут с его правами."
      },
      "NamedRef": {
        "required": [
          "id",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "type": "string"
          }
        },
        "description": "Ссылка на объект. Id и название."
      },
      "ProblemDetails": {
        "type": "object",
        "properties": {
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "title": {
            "type": [
              "null",
              "string"
            ]
          },
          "status": {
            "type": [
              "null",
              "integer"
            ],
            "format": "int32"
          },
          "detail": {
            "type": [
              "null",
              "string"
            ]
          },
          "instance": {
            "type": [
              "null",
              "string"
            ]
          },
          "code": {
            "enum": [
              "API_INVALID_QUERY",
              "API_TOKEN_INVALID",
              "API_ACCESS_DENIED",
              "API_NOT_FOUND",
              "API_METHOD_NOT_ALLOWED",
              "API_RATE_LIMITED",
              "API_INTERNAL_ERROR"
            ],
            "type": "string",
            "description": "Код ошибки. Он не меняется, в отличие от текста в detail.",
            "x-ms-enum": {
              "name": "PublicApiErrorCode",
              "modelAsString": true,
              "values": [
                {
                  "value": "API_INVALID_QUERY",
                  "description": "400 — Ошибка в параметрах запроса."
                },
                {
                  "value": "API_TOKEN_INVALID",
                  "description": "401 — Токена нет или он больше не действует."
                },
                {
                  "value": "API_ACCESS_DENIED",
                  "description": "403 — По этому токену такие данные недоступны."
                },
                {
                  "value": "API_NOT_FOUND",
                  "description": "404 — Не найдено."
                },
                {
                  "value": "API_METHOD_NOT_ALLOWED",
                  "description": "405 — API только читает данные — используйте GET."
                },
                {
                  "value": "API_RATE_LIMITED",
                  "description": "429 — Слишком много запросов. Подождите и повторите."
                },
                {
                  "value": "API_INTERNAL_ERROR",
                  "description": "500 — Что-то пошло не так на нашей стороне. Повторите позже."
                }
              ]
            }
          }
        }
      },
      "RateLimitResource": {
        "required": [
          "requests",
          "windowSeconds"
        ],
        "type": "object",
        "properties": {
          "requests": {
            "type": "integer",
            "format": "int32"
          },
          "windowSeconds": {
            "type": "integer",
            "format": "int32"
          }
        },
        "description": "Лимит запросов. Не больше requests запросов за windowSeconds секунд."
      },
      "RateLimitsResource": {
        "required": [
          "general",
          "analytics"
        ],
        "type": "object",
        "properties": {
          "general": {
            "description": "Все запросы, кроме аналитики.",
            "$ref": "#/components/schemas/RateLimitResource"
          },
          "analytics": {
            "description": "Запросы сводки аналитики.",
            "$ref": "#/components/schemas/RateLimitResource"
          }
        },
        "description": "Лимиты запросов. Общие для всех токенов воркспейса."
      },
      "ResourcePageOfTaskResource": {
        "required": [
          "items",
          "nextCursor"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/TaskResource"
            }
          },
          "nextCursor": {
            "type": [
              "null",
              "string"
            ],
            "description": "Передайте в cursor, чтобы получить следующую страницу; null — это последняя страница."
          }
        },
        "description": "Страница списка."
      },
      "ResourcePageOfWorklogResource": {
        "required": [
          "items",
          "nextCursor"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WorklogResource"
            }
          },
          "nextCursor": {
            "type": [
              "null",
              "string"
            ],
            "description": "Передайте в cursor, чтобы получить следующую страницу; null — это последняя страница."
          }
        },
        "description": "Страница списка."
      },
      "StageResource": {
        "required": [
          "id",
          "name",
          "position",
          "team",
          "assignees",
          "seconds",
          "cost",
          "executionTaskId"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "type": "string"
          },
          "position": {
            "type": "integer",
            "description": "Порядок этапа: чем меньше, тем раньше.",
            "format": "int32"
          },
          "team": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Команда этапа; null — не назначена.",
                "$ref": "#/components/schemas/NamedRef"
              }
            ]
          },
          "assignees": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/NamedRef"
            },
            "description": "Исполнители этапа."
          },
          "seconds": {
            "type": "integer",
            "description": "Оценка этапа, секунды.",
            "format": "int64"
          },
          "cost": {
            "type": "integer",
            "description": "Стоимость этапа, в сотых долях валюты.",
            "format": "int64"
          },
          "executionTaskId": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Id подзадачи этапа на доске спринтов; null — этап ещё не в работе.",
            "format": "int32"
          }
        },
        "description": "Этап заказа."
      },
      "TaskDetailsResource": {
        "required": [
          "task",
          "description",
          "discussLink",
          "stages"
        ],
        "type": "object",
        "properties": {
          "task": {
            "$ref": "#/components/schemas/TaskResource"
          },
          "description": {
            "type": [
              "null",
              "string"
            ],
            "description": "Описание заказа."
          },
          "discussLink": {
            "type": [
              "null",
              "string"
            ],
            "description": "Ссылка на обсуждение заказа вне Strata."
          },
          "stages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/StageResource"
            },
            "description": "Этапы в порядке выполнения."
          }
        },
        "description": "Заказ с описанием и этапами."
      },
      "TaskRef": {
        "required": [
          "id",
          "key"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "key": {
            "type": "string"
          }
        },
        "description": "Ссылка на заказ. Id и номер заказа."
      },
      "TaskResource": {
        "required": [
          "id",
          "key",
          "name",
          "status",
          "workType",
          "project",
          "client",
          "author",
          "quantity",
          "dueDate",
          "estimatedSeconds",
          "actualSeconds",
          "estimatedCost",
          "actualCost",
          "createdAt",
          "updatedAt",
          "statusChangedAt",
          "completedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "key": {
            "type": "string",
            "description": "Номер заказа, как в интерфейсе, например SMCP-42."
          },
          "name": {
            "type": "string"
          },
          "status": {
            "description": "Статус: draft — черновик, backlog — бэклог, need_clarification — на уточнении, confirmed — подтверждён, in_process — в работе, under_review — на проверке, done — готов, cancel — отменён.",
            "$ref": "#/components/schemas/TaskWorkflowStatus"
          },
          "workType": {
            "description": "Вид работ.",
            "$ref": "#/components/schemas/NamedRef"
          },
          "project": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Проект; null — заказ вне проекта.",
                "$ref": "#/components/schemas/NamedRef"
              }
            ]
          },
          "client": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Клиент или бренд; у бренда название вместе с клиентом: «Сбер / Маркет». null — клиент не указан.",
                "$ref": "#/components/schemas/NamedRef"
              }
            ]
          },
          "author": {
            "description": "Кто создал заказ.",
            "$ref": "#/components/schemas/NamedRef"
          },
          "quantity": {
            "type": "integer",
            "description": "Сколько единиц вида работ заказано.",
            "format": "int32"
          },
          "dueDate": {
            "type": [
              "null",
              "string"
            ],
            "description": "Срок сдачи; null — без срока.",
            "format": "date"
          },
          "estimatedSeconds": {
            "type": "integer",
            "description": "Оценка по этапам, секунды.",
            "format": "int64"
          },
          "actualSeconds": {
            "type": "integer",
            "description": "Списанное время, секунды.",
            "format": "int64"
          },
          "estimatedCost": {
            "type": "integer",
            "description": "Стоимость по этапам, в сотых долях валюты.",
            "format": "int64"
          },
          "actualCost": {
            "type": [
              "null",
              "integer"
            ],
            "description": "Себестоимость списанного времени, в сотых долях валюты. Приходит только по токену владельца, иначе null.",
            "format": "int64"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "updatedAt": {
            "type": "string",
            "description": "Когда заказ меняли в последний раз. Смена исполнителей этапов его не меняет.",
            "format": "date-time"
          },
          "statusChangedAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "Когда заказ перешёл в текущий статус; null — статус тот же, что при создании.",
            "format": "date-time"
          },
          "completedAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "Когда заказ перешёл в «Готово»; null — ещё не готов.",
            "format": "date-time"
          }
        },
        "description": "Заказ."
      },
      "TaskWorkflowStatus": {
        "enum": [
          "draft",
          "in_process",
          "backlog",
          "need_clarification",
          "confirmed",
          "under_review",
          "done",
          "cancel"
        ],
        "type": "string"
      },
      "TokenResource": {
        "required": [
          "id",
          "name",
          "expiresAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "type": "string"
          },
          "expiresAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "До какого момента действует токен; null — бессрочный.",
            "format": "date-time"
          }
        },
        "description": "Токен, которым сделан запрос."
      },
      "WorklogResource": {
        "required": [
          "id",
          "task",
          "member",
          "startedAt",
          "endedAt",
          "seconds",
          "isRunning",
          "comment",
          "updatedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "task": {
            "$ref": "#/components/schemas/TaskRef"
          },
          "member": {
            "description": "Кто списал время.",
            "$ref": "#/components/schemas/NamedRef"
          },
          "startedAt": {
            "type": "string",
            "format": "date-time"
          },
          "endedAt": {
            "type": [
              "null",
              "string"
            ],
            "description": "Конец записи; null — таймер ещё идёт.",
            "format": "date-time"
          },
          "seconds": {
            "type": "integer",
            "description": "Длительность, секунды. У идущего таймера — сколько он идёт на момент ответа.",
            "format": "int64"
          },
          "isRunning": {
            "type": "boolean",
            "description": "Идёт ли таймер."
          },
          "comment": {
            "type": [
              "null",
              "string"
            ]
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "description": "Запись времени."
      },
      "WorkspaceCurrency": {
        "enum": [
          "RUB",
          "USD",
          "EUR",
          "CNY"
        ],
        "type": "string"
      },
      "WorkspaceResource": {
        "required": [
          "id",
          "name",
          "keyPrefix",
          "currency"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int32"
          },
          "name": {
            "type": "string"
          },
          "keyPrefix": {
            "type": "string",
            "description": "Префикс номеров заказов, например SMCP."
          },
          "currency": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "description": "Валюта сумм; null — не выбрана. Суммы в ответах — целые числа в сотых долях валюты: копейках, центах.",
                "$ref": "#/components/schemas/WorkspaceCurrency"
              }
            ]
          }
        },
        "description": "Воркспейс."
      },
      "WorkspaceRole": {
        "enum": [
          "owner",
          "manager",
          "viewer"
        ],
        "type": "string"
      }
    },
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "description": "Токен из «Настройки → API»: Authorization: Bearer stk_…",
        "scheme": "bearer"
      }
    }
  },
  "security": [
    {
      "bearer": [ ]
    }
  ],
  "tags": [
    {
      "name": "Токен"
    },
    {
      "name": "Заказы"
    },
    {
      "name": "Время"
    },
    {
      "name": "Аналитика"
    }
  ]
}