> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://developer.jelliu.co/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://developer.jelliu.co/_mcp/server.

# List evaluation criteria results across voice and text

GET https://api.jelliu.co/api/analytics/analysis/criteria

Success-evaluation verdicts per criterion over calls AND text conversations created in the
window, with a `bySource` split (`voice` = calls, `text` = conversations). The analysis evaluates
a WhatsApp thread with the same criteria as a call, so the totals here cover the whole
operation. Only records that carry evaluation results count. Criteria are sorted by id.

Each verdict is counted once per record: `total = success + failure + unknown`, and
`bySource.voice` + `bySource.text` add up to the totals. A verdict other than
`success` / `failure` / `unknown` is counted as `unknown` rather than dropped. Deleted calls are
excluded. With `agentId`, calls are attributed to the agent that handled them (manual calls
included) and conversations to their agent. For text-only numbers with a success rate, use
`GET /api/analytics/conversations/criteria`.

**No data.** `criteria` is an empty array when nothing in range was evaluated; counts are
integers, never `null`.

**Idempotency.** Read-only; safe to retry.

**Access**
- **Required scope:** `read`. No role or plan gate: any signed-in member of the workspace can read it.
- **Rate limit:** General API — per plan: 120 (Starter / no plan), 200 (Growth), 300 (Business), 600 (Enterprise) requests/min per workspace. The 30/min analytics limiter does not apply to this route. See [Rate limits](/rate-limits).
- **Plan:** Available on every plan.


Reference: https://developer.jelliu.co/api-reference/analytics/get-analytics-analysis-criteria

## Authentication

- `Authorization` header (bearer token, required) — Workspace API key: `jl_` followed by 64 lowercase hex characters, created by the workspace owner in the dashboard (**Settings → API Keys**) and sent as `Authorization: Bearer jl_...`. The plaintext is shown once, at creation; Jelliu stores only a SHA-256 hash. A workspace can hold up to 25 active keys. | Scope | GET / HEAD | POST / PUT / PATCH / DELETE | Admin-only routes | | --- | --- | --- | --- | | `read` | Yes | No | No | | `write` | Yes | Yes | No | | `full` | Yes | Yes | Yes | Operations restricted to admins or owners reject keys without the `full` scope with `403`, and say so in their description. No key, whatever its scope, can mint or revoke API keys or rotate a webhook secret — that requires a signed-in owner session. A revoked key stops authenticating within about 10 seconds. See [Authentication](/authentication).

## Request

### Query parameters

- `days` (integer, optional, default: 30) — Window in days ending now. Never rejected: a value outside 1-365, `0` or a non-numeric value falls back to 30, and decimals are floored.
- `agentId` (string, optional) — Restrict to one agent (see `GET /api/agents`). A malformed id is a `400` — it is never silently ignored, because ignoring it would return the whole workspace's numbers. An empty value means no filter.

## Response

### 200

Criteria roll-up.

- `data` (object, optional)
  - `windowDays` (integer, optional) — The window that was applied, after fallback.
  - `agentId` (string, optional, nullable) — The agent filter that was applied, or `null` for the whole workspace.
  - `criteria` (list of object, optional) — One entry per criterion id, sorted by id.
    - `id` (string, optional) — Criterion id as configured on the agent.
    - `success` (integer, optional) — Records judged a success.
    - `failure` (integer, optional) — Records judged a failure.
    - `unknown` (integer, optional) — Records the model could not judge (or with an unrecognised verdict).
    - `total` (integer, optional) — success + failure + unknown.
    - `bySource` (object, optional) — The same counts split by source.
      - `voice` (object, optional) — Counts over calls.
        - `success` (integer, optional) — Calls judged a success.
        - `failure` (integer, optional) — Calls judged a failure.
        - `unknown` (integer, optional) — Calls not judged.
        - `total` (integer, optional) — Calls evaluated on this criterion.
      - `text` (object, optional) — Counts over text conversations.
        - `success` (integer, optional) — Conversations judged a success.
        - `failure` (integer, optional) — Conversations judged a failure.
        - `unknown` (integer, optional) — Conversations not judged.
        - `total` (integer, optional) — Conversations evaluated on this criterion.

## Errors

### 400 Bad Request Error

`agentId` is not a UUID.

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields).
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps) or `tier` and `feature` (feature gates).

### 401 Unauthorized Error

No usable credential. Either the `Authorization` header is missing or is not a well-formed `Bearer jl_…` key, or the key is unknown, revoked or expired. Do not retry with the same key. See [Authentication](/authentication#401-unauthorized).

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields).
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps) or `tier` and `feature` (feature gates).

### 403 Forbidden Error

An API key without the `read` scope, or a suspended workspace.

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields).
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps) or `tier` and `feature` (feature gates).

### 429 Too Many Requests Error

General API budget spent for this minute.

- `error` (object, required) — The error object. Always has `code` and `message`.
  - `code` (string, required) — Stable machine-readable error code (for example `VALIDATION_FAILED`, `UNAUTHORIZED`, `FORBIDDEN`, `NOT_FOUND`, `BILLING_ERROR`, `COMPLIANCE_BLOCKED`, `RATE_LIMIT_EXCEEDED`, `INTERNAL_ERROR`). Switch on this, not on `message`. See [Errors](/errors).
  - `message` (string, required) — Human-readable explanation. English or Spanish depending on the route; may change without notice.
  - `details` (object or list of object, optional) — Present on `VALIDATION_FAILED` only. Its shape depends on how the route validates: * a field map, either Zod's `flatten()` output (`{ "formErrors": [], "fieldErrors": { "name": ["..."] } }`) or just its `fieldErrors` part (`{ "name": ["..."] }`); * an issue list, where each issue has at least `path`, `message` and `code`. `path` is a dot-separated string on routes that let the schema throw, and an array of keys on routes that forward Zod's raw issues (those also carry Zod's extra issue fields).
    - Field map
      - `formErrors` (list of string, optional)
      - `fieldErrors` (map from string to list of string, optional)
  - `metadata` (map from string to any, optional) — Structured detail exposed for a small allowlist of codes only — for example `BILLING_ERROR` carries `limit`, `current` and `tier` (resource caps) or `tier` and `feature` (feature gates).

## Examples

**Response**

```json
{
  "data": {
    "windowDays": 30,
    "agentId": "5b8e2c14-9a3d-4f67-b0e1-7d2c9a4f6e38",
    "criteria": [
      {
        "id": "consulta_resuelta",
        "success": 180,
        "failure": 34,
        "unknown": 12,
        "total": 226,
        "bySource": {
          "voice": {
            "success": 62,
            "failure": 13,
            "unknown": 3,
            "total": 78
          },
          "text": {
            "success": 118,
            "failure": 21,
            "unknown": 9,
            "total": 148
          }
        }
      },
      {
        "id": "datos_veraces",
        "success": 201,
        "failure": 5,
        "unknown": 20,
        "total": 226,
        "bySource": {
          "voice": {
            "success": 70,
            "failure": 2,
            "unknown": 6,
            "total": 78
          },
          "text": {
            "success": 131,
            "failure": 3,
            "unknown": 14,
            "total": 148
          }
        }
      }
    ]
  }
}
```

**SDK Code**

```python Analytics_getAnalyticsAnalysisCriteria_example
import requests

url = "https://api.jelliu.co/api/analytics/analysis/criteria"

querystring = {"agentId":"5b8e2c14-9a3d-4f67-b0e1-7d2c9a4f6e38","days":"30"}

headers = {"Authorization": "Bearer <token>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript Analytics_getAnalyticsAnalysisCriteria_example
const url = 'https://api.jelliu.co/api/analytics/analysis/criteria?agentId=5b8e2c14-9a3d-4f67-b0e1-7d2c9a4f6e38&days=30';
const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Analytics_getAnalyticsAnalysisCriteria_example
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.jelliu.co/api/analytics/analysis/criteria?agentId=5b8e2c14-9a3d-4f67-b0e1-7d2c9a4f6e38&days=30"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Analytics_getAnalyticsAnalysisCriteria_example
require 'uri'
require 'net/http'

url = URI("https://api.jelliu.co/api/analytics/analysis/criteria?agentId=5b8e2c14-9a3d-4f67-b0e1-7d2c9a4f6e38&days=30")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'

response = http.request(request)
puts response.read_body
```

```java Analytics_getAnalyticsAnalysisCriteria_example
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.jelliu.co/api/analytics/analysis/criteria?agentId=5b8e2c14-9a3d-4f67-b0e1-7d2c9a4f6e38&days=30")
  .header("Authorization", "Bearer <token>")
  .asString();
```

```php Analytics_getAnalyticsAnalysisCriteria_example
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.jelliu.co/api/analytics/analysis/criteria?agentId=5b8e2c14-9a3d-4f67-b0e1-7d2c9a4f6e38&days=30', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

echo $response->getBody();
```

```csharp Analytics_getAnalyticsAnalysisCriteria_example
using RestSharp;

var client = new RestClient("https://api.jelliu.co/api/analytics/analysis/criteria?agentId=5b8e2c14-9a3d-4f67-b0e1-7d2c9a4f6e38&days=30");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift Analytics_getAnalyticsAnalysisCriteria_example
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.jelliu.co/api/analytics/analysis/criteria?agentId=5b8e2c14-9a3d-4f67-b0e1-7d2c9a4f6e38&days=30")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```