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

# Sending events

> Send what you know about a teammate as events. Each event is stored once, however often you send it, and gets its own result.

An event is one thing your organization knows about a teammate: a reading, an injury, a
change of equipment or a change of schedule. You send events in batches, and every event is
answered on its own. Your systems retry and devices sync late, so the same event will reach
us more than once. It is stored once.

Set these two values once in your terminal. Every example in these docs reads them, so
no example has a host or a key typed into it.

```bash theme={null}
export TF_API_BASE="https://api.technicallyfit.com"
export TF_API_KEY="tf_test_your_key_here"
```

Use a test key (it starts with `tf_test_`) while you build. Never paste a live key into a
page, a ticket or a chat.

```bash curl theme={null}
curl -X POST "$TF_API_BASE/v1/teammates/member-1042/events" \
  -H "X-API-Key: $TF_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "events": [
      {
        "type": "constraint",
        "idempotency_key": "inj-2026-11-17-01",
        "at": "2026-11-17T09:00:00Z",
        "data": {
          "action": "add",
          "joint": "knee",
          "side": "left",
          "constraint_type": "injury",
          "severity": "moderate"
        }
      }
    ]
  }'
```

```typescript TypeScript theme={null}
import { createClient } from '@technicallyfit/sdk';

const tf = createClient({ credential: process.env.TF_API_KEY ?? '', baseUrl: process.env.TF_API_BASE });

const answer = await tf.POST('/v1/teammates/{external_id}/events', {
  params: { path: { external_id: 'member-1042' } },
  body: {
    events: [
      {
        type: 'constraint',
        idempotency_key: 'inj-2026-11-17-01',
        at: '2026-11-17T09:00:00Z',
        data: { action: 'add', joint: 'knee', side: 'left', constraint_type: 'injury', severity: 'moderate' },
      },
    ],
  },
});
console.log(answer.results[0]?.status);
```

```python Python theme={null}
import os

from technicallyfit import Client

tf = Client(os.environ["TF_API_KEY"], base_url=os.environ.get("TF_API_BASE"))

answer = tf.send_teammate_events("member-1042", {
    "events": [
        {
            "type": "constraint",
            "idempotency_key": "inj-2026-11-17-01",
            "at": "2026-11-17T09:00:00Z",
            "data": {"action": "add", "joint": "knee", "side": "left", "constraint_type": "injury", "severity": "moderate"},
        }
    ]
})
print(answer["results"][0]["status"])
```

```json 200 theme={null}
{
  "results": [
    {
      "index": 0,
      "status": "accepted",
      "event_id": "9bd54e02-4736-46fd-88ca-f8491b2283e9",
      "type": "constraint"
    }
  ],
  "summary": {
    "accepted": 1,
    "duplicate": 0,
    "rejected": 0
  }
}
```

## Two endpoints

| Endpoint | Use it for | Events per request |
| - | - | - |
| `POST /v1/teammates/{external_id}/events` | One teammate | 1 to 500 |
| `POST /v1/events:bulk` | Many teammates in one call | 1 to 1,000 |

Both need a key with the `events:write` scope, and a request body of at most 1 MB. Both
answer `200` whenever the request itself is well formed, also when some events in it are
rejected. Read the result of each event.

> [tab] Organization key
>
> ```bash curl theme={null}
> curl -X POST "$TF_API_BASE/v1/teammates/member-1042/events" \
>   -H "X-API-Key: $TF_API_KEY" \
>   -H "Content-Type: application/json" \
>   -d '{
>     "events": [
>       {
>         "type": "observation",
>         "data": {
>           "schema": "observation/1",
>           "quantity": "set_load",
>           "value": 225,
>           "unit": "lb",
>           "at": "2026-11-17T15:02:00Z",
>           "source": { "route": "gym-floor", "record_id": "set-8f2c" },
>           "confidence": 0.9
>         }
>       },
>       {
>         "type": "constraint",
>         "idempotency_key": "inj-2026-11-17-01",
>         "at": "2026-11-17T09:00:00Z",
>         "data": {
>           "action": "add",
>           "joint": "knee",
>           "side": "left",
>           "constraint_type": "injury",
>           "severity": "moderate",
>           "note": "reported at front desk"
>         }
>       }
>     ]
>   }'
> ```
>
> ```typescript TypeScript theme={null}
> import { createClient } from '@technicallyfit/sdk';
>
> const tf = createClient({ credential: process.env.TF_API_KEY ?? '', baseUrl: process.env.TF_API_BASE });
>
> const answer = await tf.POST('/v1/teammates/{external_id}/events', {
>   params: { path: { external_id: 'member-1042' } },
>   body: {
>     events: [
>       {
>         type: 'observation',
>         data: {
>           schema: 'observation/1',
>           quantity: 'set_load',
>           value: 225,
>           unit: 'lb',
>           at: '2026-11-17T15:02:00Z',
>           source: { route: 'gym-floor', record_id: 'set-8f2c' },
>           confidence: 0.9,
>         },
>       },
>       {
>         type: 'constraint',
>         idempotency_key: 'inj-2026-11-17-01',
>         at: '2026-11-17T09:00:00Z',
>         data: {
>           action: 'add',
>           joint: 'knee',
>           side: 'left',
>           constraint_type: 'injury',
>           severity: 'moderate',
>           note: 'reported at front desk',
>         },
>       },
>     ],
>   },
> });
> console.log(answer.summary);
> ```
>
> ```python Python theme={null}
> import os
>
> from technicallyfit import Client
>
> tf = Client(os.environ["TF_API_KEY"], base_url=os.environ.get("TF_API_BASE"))
>
> answer = tf.send_teammate_events("member-1042", {
>     "events": [
>         {
>             "type": "observation",
>             "data": {
>                 "schema": "observation/1",
>                 "quantity": "set_load",
>                 "value": 225,
>                 "unit": "lb",
>                 "at": "2026-11-17T15:02:00Z",
>                 "source": {"route": "gym-floor", "record_id": "set-8f2c"},
>                 "confidence": 0.9,
>             },
>         },
>         {
>             "type": "constraint",
>             "idempotency_key": "inj-2026-11-17-01",
>             "at": "2026-11-17T09:00:00Z",
>             "data": {
>                 "action": "add",
>                 "joint": "knee",
>                 "side": "left",
>                 "constraint_type": "injury",
>                 "severity": "moderate",
>                 "note": "reported at front desk",
>             },
>         },
>     ]
> })
> print(answer["summary"])
> ```

> [tab] Teammate token
>
> A [member app](https://docs.technicallyfit.com/guides/member-apps.md) sends events for the signed-in teammate with their token
> and `@me` in place of the id. A token may send `logged_set`, `observation` and
> `visit_check_in` events.
>
> ```bash curl theme={null}
> curl -X POST "$TF_API_BASE/v1/teammates/@me/events" \
>   -H "Authorization: Bearer $TF_TEAMMATE_TOKEN" \
>   -H "Content-Type: application/json" \
>   -d '{
>     "events": [
>       {
>         "type": "logged_set",
>         "data": {
>           "at": "2026-11-17T15:02:00Z",
>           "source": { "route": "member-app", "record_id": "member-app:set:4410" },
>           "movement": { "name": "Goblet Squat" },
>           "set": { "number": 1, "reps": 10, "load": { "value": 24, "unit": "kg" }, "effort": 7 }
>         }
>       }
>     ]
>   }'
> ```
>
> ```typescript TypeScript theme={null}
> import { createClient } from '@technicallyfit/sdk';
>
> const tf = createClient({ credential: process.env.TF_TEAMMATE_TOKEN ?? '', baseUrl: process.env.TF_API_BASE });
>
> const answer = await tf.POST('/v1/teammates/{external_id}/events', {
>   params: { path: { external_id: '@me' } },
>   body: {
>     events: [
>       {
>         type: 'logged_set',
>         data: {
>           at: '2026-11-17T15:02:00Z',
>           source: { route: 'member-app', record_id: 'member-app:set:4410' },
>           movement: { name: 'Goblet Squat' },
>           set: { number: 1, reps: 10, load: { value: 24, unit: 'kg' }, effort: 7 },
>         },
>       },
>     ],
>   },
> });
> console.log(answer.results[0]?.status);
> ```
>
> ```python Python theme={null}
> import os
>
> from technicallyfit import Client
>
> tf = Client(os.environ["TF_TEAMMATE_TOKEN"], base_url=os.environ.get("TF_API_BASE"))
>
> answer = tf.send_teammate_events("@me", {
>     "events": [
>         {
>             "type": "logged_set",
>             "data": {
>                 "at": "2026-11-17T15:02:00Z",
>                 "source": {"route": "member-app", "record_id": "member-app:set:4410"},
>                 "movement": {"name": "Goblet Squat"},
>                 "set": {"number": 1, "reps": 10, "load": {"value": 24, "unit": "kg"}, "effort": 7},
>             },
>         }
>     ]
> })
> print(answer["results"][0]["status"])
> ```

The teammate in the path is your own id for them (see
[Teammates and ownership](https://docs.technicallyfit.com/guides/teammates-and-ownership.md)). Create the teammate first: an
event for a teammate you have not created is not accepted.

In the bulk endpoint each event also names its teammate:

```bash curl theme={null}
curl -X POST "$TF_API_BASE/v1/events:bulk" \
  -H "X-API-Key: $TF_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "events": [
      {
        "teammate": "member-1042",
        "type": "schedule_change",
        "idempotency_key": "sched-2026-11-17",
        "at": "2026-11-17T09:00:00Z",
        "data": { "training_weekdays": [0, 2, 4] }
      },
      {
        "teammate": "member-9999",
        "type": "equipment_change",
        "idempotency_key": "equip-2026-11-17",
        "at": "2026-11-17T09:00:00Z",
        "data": { "add": ["barbell"] }
      }
    ]
  }'
```

```typescript TypeScript theme={null}
import { createClient } from '@technicallyfit/sdk';

const tf = createClient({ credential: process.env.TF_API_KEY ?? '', baseUrl: process.env.TF_API_BASE });

const answer = await tf.POST('/v1/events:bulk', {
  body: {
    events: [
      {
        teammate: 'member-1042',
        type: 'schedule_change',
        idempotency_key: 'sched-2026-11-17',
        at: '2026-11-17T09:00:00Z',
        data: { training_weekdays: [0, 2, 4] },
      },
      {
        teammate: 'member-9999',
        type: 'equipment_change',
        idempotency_key: 'equip-2026-11-17',
        at: '2026-11-17T09:00:00Z',
        data: { add: ['barbell'] },
      },
    ],
  },
});
console.log(answer.summary);
```

```python Python theme={null}
import os

from technicallyfit import Client

tf = Client(os.environ["TF_API_KEY"], base_url=os.environ.get("TF_API_BASE"))

answer = tf.send_events({
    "events": [
        {
            "teammate": "member-1042",
            "type": "schedule_change",
            "idempotency_key": "sched-2026-11-17",
            "at": "2026-11-17T09:00:00Z",
            "data": {"training_weekdays": [0, 2, 4]},
        },
        {
            "teammate": "member-9999",
            "type": "equipment_change",
            "idempotency_key": "equip-2026-11-17",
            "at": "2026-11-17T09:00:00Z",
            "data": {"add": ["barbell"]},
        },
    ]
})
print(answer["summary"])
```

## The fields of an event

| Field | Required | Meaning |
| - | - | - |
| `type` | Yes | `observation`, `constraint`, `equipment_change`, `schedule_change`, `logged_set` or `visit_check_in`. |
| `teammate` | Bulk only | Your own id for the teammate. |
| `idempotency_key` | Every type except `observation` and `logged_set` | Your own key for this event, 1 to 128 characters. |
| `at` | Every type except `observation` and `logged_set` | When it happened: an RFC 3339 time with an offset, such as `2026-11-17T09:00:00Z`. |
| `data` | Yes | The event itself. Its fields depend on the type. |

An unknown field on an event is rejected, so a typo never passes silently.

## Event types

### observation

`data` is one observation in the `observation/1` format. [Observations](https://docs.technicallyfit.com/guides/observations.md)
lists every field, the quantities and their units.

* A quantity on the list is checked: its unit, its measure and its body location must be
  ones that quantity takes. A unit we cannot convert is rejected with
  `unit_not_convertible`, and the message lists the units the quantity takes.
* A quantity that is not on the list is accepted and kept. Its result says
  `"kind": "unknown"`.
* Every accepted observation answers `"status": "not_interpreted"`: it is stored and has
  not been used yet.
* Streams reach the API as summaries, never as raw sample lists. If you stream a session
  over [Real-time](https://docs.technicallyfit.com/guides/real-time.md), its folded summaries arrive as ordinary `observation`
  readings through this same path when the session ends.
* `data.teammate` is optional. When you send it, it must be the teammate the event is for.
* Pain, soreness and session effort are self-reports, with a scale and two routes of their
  own: `teammate` and `coach`. A value off the scale is `value_out_of_range`, and another
  quantity on those routes is `route_quantity_not_allowed`.
  [Without a device](https://docs.technicallyfit.com/guides/without-a-device.md) has the rules and examples.

### constraint

Adds or clears a limitation at a joint.

| Field | Required | Values |
| - | - | - |
| `action` | Yes | `add` or `clear`. |
| `joint` | Yes | A joint id from [Observations](https://docs.technicallyfit.com/guides/observations.md#body-location-and-sides). |
| `side` | Yes | `left`, `right` or `bilateral` for a joint with two sides, `midline` for a joint on the midline. |
| `constraint_type` | Yes | `injury`, `chronic_condition`, `mobility_limitation` or `post_surgery`. |
| `severity` | For `add` | `mild`, `moderate`, `severe` or `avoid_completely`. |
| `note` | No | Up to 500 characters. |

### equipment\_change

Changes the teammate's own equipment. Send at least one of the three lists.

| Field | Meaning |
| - | - |
| `add` | Equipment the teammate now has. |
| `remove` | Equipment the teammate no longer has. |
| `replace` | The teammate's whole equipment list, replacing what was there. |

Every entry is a token, a name or another spelling from the
[equipment reference](https://docs.technicallyfit.com/reference/equipment.md). An entry that is not on it is rejected, and
`field` names the entry.

### schedule\_change

Changes the days the teammate can train. Send at least one of the two fields.

| Field | Meaning |
| - | - |
| `availability` | A day to true or false, for any of `mon`, `tue`, `wed`, `thu`, `fri`, `sat`, `sun`. |
| `training_weekdays` | The days to train on, counted from 0 for Monday to 6 for Sunday, or `null` to clear it. |

### visit\_check\_in

A teammate's visit to one of your locations, from your app or your door system. It needs an
`idempotency_key` and `at`. See [Visit check-ins](https://docs.technicallyfit.com/guides/visit-check-ins.md).

| Field | Meaning |
| - | - |
| `location` | The `external_id` of one of your active locations in the key's mode. |

```json theme={null}
{
  "type": "visit_check_in",
  "idempotency_key": "door-7f3a9c",
  "at": "2026-11-18T07:02:11Z",
  "data": { "location": "club-014" }
}
```

A location you do not have, or one that is archived, is rejected with `unknown_location`. A
time more than five minutes ahead of our clock is rejected with `at_in_future`.

### logged\_set

One set the teammate performed: a movement, the reps, and the load, effort, duration or
distance when you have them. It is stored with the teammate's training, marked as sent by
your organization, with its source route, device, record id and confidence. Its facts (reps,
load, and any measures you send with it) are also stored as observations of the set.

```json theme={null}
{
  "type": "logged_set",
  "data": {
    "at": "2026-11-17T15:02:00Z",
    "source": { "route": "org-floor", "device": "rack-console-2", "record_id": "org-floor:set:91a7" },
    "confidence": 0.9,
    "session": { "id": "org-session-552", "planned_session_id": null },
    "movement": { "id": "0c1d6b1e-5e0f-4b7a-9a43-2f1c9e3d5a10" },
    "set": {
      "number": 2,
      "type": "working",
      "reps": 5,
      "load": { "value": 100, "unit": "kg" },
      "effort": 8,
      "duration_seconds": null,
      "distance_meters": null
    },
    "measures": [
      { "quantity": "bar_velocity", "measure": "mean", "value": 0.62, "unit": "m/s" }
    ]
  }
}
```

| Field | Required | Values |
| - | - | - |
| `at` | Yes | When the set was done: an RFC 3339 time with an offset. |
| `source.route` | Yes | Your route id, as for an observation: lower case letters, digits, `_`, `.` and `-`. |
| `source.record_id` | Yes | Your own id for this set, 1 to 160 characters. It stays the same when you send the set again. |
| `source.device` | No | The device the set was recorded on, up to 100 characters. |
| `confidence` | No | From 0 to 1. It is never stored above your route's default, which is used when you leave it out. |
| `session.id` | No | Your own id for the session the set belongs to, up to 128 characters. Sets with the same id are one session. Without it, the set's day (UTC) is its session. |
| `session.planned_session_id` | No | The TechnicallyFit session the set was done for, when you have it. It must be one of the teammate's own planned sessions. |
| `movement` | Yes | `{"id": ...}` with an id or slug from the [movement reference](https://docs.technicallyfit.com/reference/movements.md), or `{"name": ...}` (1 to 160 characters) for a movement that is not on it. |
| `set.number` | Yes | 1 to 100. |
| `set.type` | No | `working` (the default), `warmup` or `drop`. |
| `set.reps` | Yes | 0 to 1,000. |
| `set.load` | No | `{"value": ..., "unit": "kg"}` or `"lb"`, or `null` for bodyweight. The load is stored as you sent it; its observation also holds it in kg. |
| `set.effort` | No | The effort the teammate reported, 1 to 10. |
| `set.duration_seconds` | No | 0 to 86,400. |
| `set.distance_meters` | No | 0 to 1,000,000. |
| `measures` | No | Up to 10 measured extras, such as bar velocity: each a `quantity`, `measure` when the quantity takes one, `value` and `unit` from [Observations](https://docs.technicallyfit.com/guides/observations.md). Each one must be a different quantity and measure. |

* A logged set is keyed by its source, as an observation is: `source.route` together with
  `source.record_id`. Sending the same set again answers `duplicate` and stores nothing.
* A movement id that is not in the movement reference is rejected with `unknown_movement`.
  Send a `name` instead for a movement we do not list.
* A measure is checked like an observation: a unit the quantity does not take is
  `unit_not_convertible`. A quantity that needs a body location belongs in an
  `observation` event.
* The set belongs to the teammate. It counts as training they did, and it stays with them
  when they leave your organization. Sets you send earn no XP, accolades or personal
  records in the TechnicallyFit app.
* A logged set is new information only. To correct a set, send it with a new `record_id`.

## Results

The response lists one result per event, in the order you sent them, and a count of each
status. This is the answer to the organization key example above, with a third event added that sends a
load in a unit the quantity does not take:

```json 200 theme={null}
{
  "results": [
    {
      "index": 0,
      "status": "accepted",
      "event_id": "3cac0ee1-ee26-42f5-a51c-208e776a4ead",
      "type": "observation",
      "observation": {
        "kind": "work_done",
        "status": "not_interpreted"
      }
    },
    {
      "index": 1,
      "status": "accepted",
      "event_id": "9bd54e02-4736-46fd-88ca-f8491b2283e9",
      "type": "constraint"
    },
    {
      "index": 2,
      "status": "rejected",
      "event_id": "a354f1c4-bcec-4fe8-aa7e-e78150da9570",
      "type": "observation",
      "reason": {
        "code": "unit_not_convertible",
        "message": "This quantity does not take that unit. Units it takes: kg, lb.",
        "field": "data.unit"
      }
    }
  ],
  "summary": {
    "accepted": 2,
    "duplicate": 0,
    "rejected": 1
  }
}
```

| Status | Meaning |
| - | - |
| `accepted` | Stored now. |
| `duplicate` | Already stored under this key. Nothing changed, and `event_id` is the id of the first copy. |
| `rejected` | Not accepted. `reason` says why, and `reason.field` names the field. |

`index` is the position of the event in your request. `event_id` is our id for the stored
event. It is `null` for an event we could not store at all: one with no usable key, one of
an unknown type, or one for a teammate you cannot send events for.

## Idempotency

Every event has a key, and we store one event per key for each teammate.

* An `observation` and a `logged_set` are keyed by their source: `source.route` together
  with `source.record_id`.
  Give each reading a `record_id` that stays the same when you send it again.
* Every other type is keyed by the `idempotency_key` you send.

Sending the organization key example again answers:

```json 200 theme={null}
{
  "results": [
    {
      "index": 0,
      "status": "duplicate",
      "event_id": "3cac0ee1-ee26-42f5-a51c-208e776a4ead",
      "type": "observation"
    },
    {
      "index": 1,
      "status": "duplicate",
      "event_id": "9bd54e02-4736-46fd-88ca-f8491b2283e9",
      "type": "constraint"
    }
  ],
  "summary": {
    "accepted": 0,
    "duplicate": 2,
    "rejected": 0
  }
}
```

* The first accepted copy wins. A later event with the same key is a `duplicate` even when
  its content differs, so use a new key for a new fact.
* A rejected event is not final. Fix it and send it again with the same key, and it is
  accepted under the same `event_id`.
* Keys are separate per teammate and per mode. A test key and a live key never see each
  other's events.

## Rejection codes

| Code | Meaning | What to do |
| - | - | - |
| `invalid_event` | A field is missing, unknown or has a value we do not accept. `reason.field` names it. | Fix the field and send again with the same key. |
| `unknown_event_type` | `type` is not one of the event types. | Use one of the types above. |
| `missing_idempotency_key` | The type needs an `idempotency_key` and none was sent. | Add a key. |
| `schema_version_unsupported` | The observation is not `observation/1`. | Send `observation/1`. |
| `unit_not_convertible` | The quantity is on the list and does not take this unit. | Send one of the units in the message. |
| `invalid_body_location` | The joint is unknown, the side is one the joint does not have, the quantity needs a body location, or session effort names a joint. | Send a joint and side from the reference. |
| `value_out_of_range` | A self-report value is not on its scale: pain and soreness take 0 to 10, session effort 1 to 10, in whole or half points. | Send a value on the scale. |
| `route_quantity_not_allowed` | The routes `teammate` and `coach` take self-reports only, and this quantity is not one. | Send the reading on a route of your own. |
| `unknown_movement` | The logged set names a movement id that is not in the movement reference. | Use an id or slug from the movement reference, or send a `name`. |
| `session_not_found` | The logged set names a planned session that is not one of the teammate's own. | Leave `planned_session_id` out, or send one from the teammate's program. |
| `invalid_set` | A measure repeats another, repeats a fact the set already carries, or needs a body location. | Send each measure once, and send a reading at a joint as an observation. |
| `route_storage_not_allowed` | TechnicallyFit does not store events from this source route. Nothing from the event was kept. | Do not retry. See [Data use](https://docs.technicallyfit.com/guides/data-use.md). |
| `route_disconnected` | You disconnected this source route for this teammate. | Reconnect the route if the teammate wants its data sent again. See [Data use](https://docs.technicallyfit.com/guides/data-use.md). |
| `unknown_location` | The visit check-in names a location you do not have active in this mode. | Send the `external_id` of one of your active locations. |
| `at_in_future` | The visit check-in is dated in the future. | Send the time the visit happened. |
| `event_type_not_allowed` | A teammate token sent a type only your organization key may send. A member app sends `logged_set`, `observation` and `visit_check_in`. | Send it from your server with your organization key. See [Member apps](https://docs.technicallyfit.com/guides/member-apps.md#calling-me-operations). |
| `teammate_mismatch` | The teammate inside the event is not the teammate the event is for. | Send the same id in both places, or leave the inner one out. |
| `teammate_not_found` | Bulk only. You have no such teammate in this mode. | Create the teammate, then send again. |
| `consent_required` | Bulk only. The teammate claimed their account and has not allowed events. | Do not retry. The teammate switches it on in their settings. |

A `reason.message` never repeats a value you sent.

## Consent

Before a teammate claims their account, the events you send are your organization's own
data and are always accepted. After the claim you can send events only while the teammate
allows the `events` item.

* On the per-teammate endpoint the whole request answers `403` with code
  `consent_required`, or `404` with code `not_found` for a teammate you do not have.
* On the bulk endpoint those two are results of single events, and the rest of the batch
  is processed as usual.

[Teammates and ownership](https://docs.technicallyfit.com/guides/teammates-and-ownership.md#403-and-404) explains both
answers.

## Read back what you sent

With an organization key holding `events:read`, you can list the events your organization
sent, newest first by received time, for one teammate (`GET /v1/teammates/{external_id}/events`)
or across your whole organization and mode (`GET /v1/events`).

Filter by `type`, `status` (`accepted` or `rejected`), `from` (inclusive received time) and
`to` (exclusive received time), and page with `limit` (1 to 100, default 50) and `cursor`.
Each entry returns `id`, `teammate`, `type`, `status`, `key`, `occurred_at`, `received_at`,
`accepted_at`, `attempts`, `reason` (for a rejected event), and `revisions` (any program
revision that names the event, or `null` when a claimed teammate does not allow `programs`).

```bash curl theme={null}
curl "$TF_API_BASE/v1/events?status=rejected&limit=25" \
  -H "X-API-Key: $TF_API_KEY"
```

```typescript TypeScript theme={null}
import { createClient } from '@technicallyfit/sdk';

const tf = createClient({ credential: process.env.TF_API_KEY ?? '', baseUrl: process.env.TF_API_BASE });

const page = await tf.GET('/v1/events', {
  params: { query: { status: 'rejected', limit: 25 } },
});
console.log(page.data.length, page.next_cursor);
```

```python Python theme={null}
import os

from technicallyfit import Client

tf = Client(os.environ["TF_API_KEY"], base_url=os.environ.get("TF_API_BASE"))

page = tf.list_events(status="rejected", limit=25)
print(len(page["data"]), page["next_cursor"])
```

Two limits apply to the stored event log:

* A corrected resend overwrites its earlier rejected row in place; only the send count
  (`attempts`) remains from the earlier attempts.
* Disconnecting a source route deletes the events stored for that source.

## Batching and retries

* Send what you have in one request: up to 500 events for one teammate, up to 1,000 across
  teammates, at most 1 MB.
* A request over a limit is refused as a whole: `422` with code `validation_failed` for an
  empty or oversized list of events, `413` with code `payload_too_large` for a body over
  1 MB. Split it and send the parts.
* When a request fails with a `429`, a `5xx` or a network error, send the same request
  again. Events that were already stored answer `duplicate`, so a retry never stores an
  event twice.
* Events for the same teammate are decided in the order you list them.

[Errors](https://docs.technicallyfit.com/guides/errors.md) describes the body of every whole-request error.


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