# Get efficiency
URL: https://docs.fluenta.io/en/docs/reference/analytics/get-efficiency
Operation: `getEfficiency`
Required permission: `read`

`GET /v1/external/organizations/{organizationId}/analytics/efficiency`

«Eficiencia» over a range of plant days: units made against the meta, per day, or per day and módulo, operario or puesto.

Groupings: day, module, operator, operation. Every puesto counts. The figure for each day, and for a módulo within it, equals Reportes › Eficiencia for that day, rounded as there; an operario’s is the «Clasificación»’s; a puesto’s is its «reporte por operación» for the day — with «El operario escoge la referencia» on, totalled by subproceso as that report does: complete units, the sum of each hour’s expected units, and every marca over that sum. Filters: one of `moduleId`, `operatorId`, `operationId` narrows the answer to that one, each row still its dashboard figure; with `groupBy=day` the rows are its own figure of each day and name it. Without a filter the answer is the whole plant’s.

### Authorization

- `apiToken` — Bearer token. An API token created in Configuración › Tokens de API, or a connected app’s access token

Send it as `Authorization: Bearer <your API token>`.

### Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `from` | query | string | yes | First plant day of the range, YYYY-MM-DD on the plant's clock, included. At most 92 days from `from` to `to`. |
| `to` | query | string | yes | Last plant day of the range, YYYY-MM-DD on the plant’s clock, included; not before `from`. |
| `groupBy` | query | string | no | One row per day, or per day and módulo / operario / puesto (`operation`) / referencia / categoría. Each figure answers the groupings the dashboard shows it by; any other is a 400 `GROUP_BY_UNSUPPORTED` that lists the ones it has. One of: `day`, `module`, `operator`, `operation`, `reference`, `category`. |
| `page` | query | number | no | 1-based page; 100 rows per page, by day then group. |
| `moduleId` | query | integer | no | Only this módulo. With `groupBy=day` (or none), its own figure of each day, each row naming it; with `module`, its rows; with `operation`, the puestos whose day is filed under it; and, for production, with `reference` or `category` too. One filter per request; a second one, or a grouping the filter does not answer, is a 400 `FILTER_UNSUPPORTED`. An id of another organization is a 404 `MODULE_NOT_FOUND`. |
| `operatorId` | query | integer | no | Only this operario: their own figure of each day (`groupBy=day`, or none) or their rows (`groupBy=operator`), as the «Clasificación» counts them. Efficiency and billing; production has no operario (400 `FILTER_UNSUPPORTED`). An id of another organization is a 404 `OPERATOR_NOT_FOUND`. |
| `operationId` | query | integer | no | Only this puesto: its own figure of each day (`groupBy=day`, or none) or its rows (`groupBy=operation`), as its «reporte por operación» totals them. Efficiency and billing; production has no puesto (400 `FILTER_UNSUPPORTED`). An id of another organization is a 404 `OPERATION_NOT_FOUND`. |
| `organizationId` | path | number | yes |  |

### Responses

| Status | Description |
| --- | --- |
| `200` | `ExternalEfficiencyPageDto` |
| `400` | `INVALID_DAY` (a day that is not a real YYYY-MM-DD), `RANGE_INVALID` (`from` after `to`), `RANGE_TOO_LARGE` (more than 92 days), `GROUP_BY_UNSUPPORTED` (a grouping this figure has no dashboard counterpart for; `supported` lists the ones it has), `FILTER_UNSUPPORTED` (a filter this figure does not have, or not under that grouping, where `supported` lists the groupings the filter answers; or more than one filter at once). |
| `401` | Missing, malformed, unknown, expired or revoked credential: `INVALID_API_TOKEN`. |
| `402` | The organization is blocked: `ORG_BLOCKED`. |
| `403` | The credential lacks the «Permiso» the route names (`INSUFFICIENT_SCOPE`), or the organization’s plan does not include what was asked (`PLAN_LIMIT`): «Conectar con IA» for a connected app, or a report or analytics route whose plan feature a Light organization lacks (a Light of plan version 1 keeps `reports`). |
| `404` | `ORGANIZATION_NOT_FOUND`; a filter’s id of another organization: `MODULE_NOT_FOUND`, `OPERATOR_NOT_FOUND`, `OPERATION_NOT_FOUND`. |
| `429` | The credential is over its rate limit: `RATE_LIMITED`. Per credential, in fixed windows of 60 seconds: 60 requests in one organization on Light and 120 on Pro; 20 on the heavy reads (the range figures, the whole floor, the month and the pauses); 300 across every organization; 60 on the routes that name no organization. Wait `Retry-After` seconds; a refused request counts against nothing. |
| `503` | `ANALYTICS_TIMEOUT`: ask a shorter range. |

### Example

```bash
curl -X GET 'https://api.fluenta.io/v1/external/organizations/{organizationId}/analytics/efficiency' \
  -H 'Authorization: Bearer <your API token>'
```