---
title: "🔒 Получение статистики затрат времени и денег по задаче, ошибке или фиче."
method: GET
path: "/states/entity-costs"
tags: ["States"]
---

# 🔒 Получение статистики затрат времени и денег по задаче, ошибке или фиче.

`GET /states/entity-costs`

## Request

- Base URL: `http://localhost`
- URL: `http://localhost/states/entity-costs`
- Auth: one of:
  - API key in header `sid` and API key in header `rts` and API key in header `sig`
  - HTTP bearer

Получение статистики затрат времени и денег по задаче, ошибке или фиче.

**Access:** `authorized` (10 ) · **Scope:** `read`

**Allows:** `task:read`, `feature:read`, `task:costs`, `feature:costs` (все обязательны; проверка в команде по ресурсу из запроса)

### TypeScript (copy-paste)

**`GET /states/entity-costs`**

<details open><summary><b>Params</b></summary>

```typescript
export interface StatesEntityCostsParams {
  type: states_entity_costs_type
  ID: string
  iterationKey?: number | null
}
```

</details>

<details open><summary><b>Response</b></summary>

```typescript
export type StatesEntityCostsResponse = IServerResponse<CostInfo>

export interface IServerResponse<T = any> {
  code: number
  data: T
  srvTS: number
  rkey: string
}
```

</details>

> Полный файл типов: [`/docs/types`](/docs/types) · raw: [`/docs/api-types.ts`](/docs/api-types.ts)

## Query parameters

- `type` 'task' | 'bug' | 'feature', required: `task` = "task", `bug` = "bug", `feature` = "feature"
- `ID` string, uuid, required
- `iterationKey` integer, nullable

## Headers

- `devID` string, uuid, required
- `tz` string, required
- `app` string, required
- `appVer` string, required
- `rKey` string

## Response `200`

OK — `IServerResponse<CostInfo>`

- object
  - `code` integer, required
  - `data` CostInfo, required: Schema CostInfo (inferred from ResponseData AST)
  - `srvTS` integer, required: Server timestamp (ms)
  - `rkey` string, required: Request key

## Other responses

- `400`: BadRequest: Invalid entity type provided
- `401`: Unauthorized: Active user session required
- `403`: AccessNotAllowed: privilegeRequired task:read / feature:read (params.allow)
- `404`: NotFound: Specified entity ID does not exist
- `406`: TimeResync — расхождение rts с сервером

---

[API](https://skmtc.dev/kosmodrom/apis/kosmodrom-backend-api.md) · [All operations](https://skmtc.dev/kosmodrom/apis/kosmodrom-backend-api/llms.txt) · [OpenAPI document](https://skmtc.dev/kosmodrom/apis/kosmodrom-backend-api/revisions/a143b51ba29a?raw)
