> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cimento.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Making requests

> A worked request against the Analytics API, how to write parameters, and how to page through a list.

Every route is a `GET` under `https://api.cimento.app/v1`, answers JSON, and takes an [access token](https://docs.cimento.ai/api/authentication.md) in the `Authorization` header.

## A worked request

This asks for three figures for each month of 2026: simulations sent, links clicked, and the failure rate.

```bash theme={null}
curl -H "Authorization: Bearer $TOKEN" \
  'https://api.cimento.app/v1/phishing/analytics?metrics=sent,clicked_link,failure_rate&groupBy=event_month&startDate=2026-01-01&endDate=2026-12-31&limit=3'
```

```json 200 OK theme={null}
{
  "rows": [
    { "clicked_link": 6, "event_month": "2026-01-01T00:00:00.000Z", "failure_rate": 16, "sent": 46 },
    { "clicked_link": 29, "event_month": "2026-02-01T00:00:00.000Z", "failure_rate": 45, "sent": 142 },
    { "clicked_link": 38, "event_month": "2026-03-01T00:00:00.000Z", "failure_rate": 41, "sent": 132 }
  ],
  "totalCount": 10,
  "nextOffset": 3
}
```

Each row has one field for each metric and each `groupBy` field you asked for. `failure_rate` is a percentage of the people sent a simulation. `totalCount` says there are ten rows in all, and `nextOffset` is where the next page starts.

The route needs at least one metric. The smallest request is one figure across everything:

```bash theme={null}
curl -H "Authorization: Bearer $TOKEN" \
  'https://api.cimento.app/v1/phishing/analytics?metrics=failure_rate'
```

```json 200 OK theme={null}
{ "rows": [{ "failure_rate": 24 }], "totalCount": 1 }
```

The [API reference](https://docs.cimento.ai/api-reference/phishing/query-phishing-analytics.md) lists every metric and `groupBy` field.

## Writing parameters

* **Lists take commas.** Give a parameter that takes several values once, with commas between them: `metrics=sent,clicked_link`.
* **Give each parameter once.** A parameter given twice is refused, as `limit=2&limit=3` is.
* **Unknown parameters are refused.** A misspelled parameter answers `400` and names it, so a typo is never silently ignored.
* **Days are `YYYY-MM-DD`.** `startDate=2026-01-01` and `endDate=2026-12-31` include both days.
* **IDs are UUIDs.** Take them from a list route, such as `campaignId` from `/v1/phishing/campaigns`.

## Reading responses

* **Times are RFC 3339 in UTC**, such as `2026-10-27T17:23:46.626Z`. Parse them: the number of decimal places varies.
* **A field can be absent.** `nextOffset` and `nextCursor` are left out on the last page, and optional details are left out when Cimento has none.
* **Ignore fields you don't recognize.** Cimento may add fields to a response.
* **`appUrl` opens the record in Cimento.** Campaigns, courses and templates carry it, for linking back from your own tool.

## Paging

Lists come a page at a time. Which way a route pages depends on the route.

| Style | Routes | How it works |
| - | - | - |
| `limit` and `offset` | Every list under `/v1/phishing` and `/v1/training`, and the participants of one phishing campaign | The answer has `totalCount` and, while more remain, `nextOffset`. |
| `cursor` | `/v1/autophish/rounds` and `/v1/autophish/sends/ambiguous` | The answer has `nextCursor` while more remain. There is no total. |
| `limit` only | `/v1/autophish/activity` | It returns the most recent events and does not page. |

`limit` is at most `100` everywhere. It defaults to `20` on the `offset` routes, `50` on the `cursor` routes and `30` on `/v1/autophish/activity`.

### With limit and offset

Pass a page's `nextOffset` back as `offset` to get the next page. Stop when a page has no `nextOffset`.

```bash theme={null}
curl -H "Authorization: Bearer $TOKEN" \
  'https://api.cimento.app/v1/training/courses?limit=2&offset=2'
```

```json 200 OK theme={null}
{
  "courses": [
    {
      "courseId": "4d13f7a6-bc9a-489b-ac46-a957c8e20a4f",
      "appUrl": "https://cimento.app/admin/training/courses/4d13f7a6-bc9a-489b-ac46-a957c8e20a4f",
      "courseName": "Spotting and Reporting Phishing Emails",
      "status": "published",
      "isRequired": false,
      "totalLessons": 22,
      "settings": { "isRetakeable": false },
      "updatedAt": "2026-10-27T17:23:46.626Z"
    }
  ],
  "totalCount": 217,
  "nextOffset": 4
}
```

The example shows one of the page's two courses. `offset` can be any number from `0`: it does not have to be a multiple of `limit`. An `offset` past the end answers an empty list.

Reading one phishing campaign, `/v1/phishing/campaigns/{campaignId}`, pages its `participants` the same way. There `totalCount` counts the participants.

> [!NOTE]
>
> `/v1/phishing/analytics` works out the whole result for the first page and keeps it for about a minute for the pages after it. Read a result through without long pauses.

### With a cursor

Pass a page's `nextCursor` back as `cursor`. Stop when a page has no `nextCursor`.

```bash theme={null}
curl -H "Authorization: Bearer $TOKEN" \
  'https://api.cimento.app/v1/autophish/rounds?limit=1'
```

```json 200 OK theme={null}
{
  "rounds": [{ "period": "2026-W44", "state": "closed", "targeted": 31, "delivered": 30 }],
  "nextCursor": "MjAyNi0xMS0wMVQxODoxMTo1My41MDM2OTdafGQyMmNkYzJi"
}
```

The example shows four of a round's fields. A cursor is opaque: send it back as you got it, and don't build one yourself.

### Reading a whole list

These use the `get` function from the [Python example](https://docs.cimento.ai/api/authentication.md#get-an-access-token).

```python Python theme={null}
def all_courses(token):
    courses, offset = [], 0
    while offset is not None:
        page = get(f"/v1/training/courses?limit=100&offset={offset}", token)
        courses.extend(page["courses"])
        offset = page.get("nextOffset")
    return courses


def all_rounds(token):
    rounds, cursor = [], None
    while True:
        query = "?limit=100" + (f"&cursor={cursor}" if cursor else "")
        page = get(f"/v1/autophish/rounds{query}", token)
        rounds.extend(page["rounds"])
        cursor = page.get("nextCursor")
        if cursor is None:
            return rounds
```

A long list takes many requests. Leave about a second between them to stay inside the [rate limit](https://docs.cimento.ai/api/errors-and-rate-limits.md#rate-limits).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.