> ## 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.

# Data use

> The two limits on every source route, who sets them, and what disconnecting a source deletes.

Every observation and logged set you send names its source route in `source.route`, for
example `org-lab` or `org-floor`. A route is yours: it is created for your organization the
first time you send it. Two limits apply to every route, and a teammate can have the route's
data deleted by asking you to disconnect it.

## The two limits

| Limit | What it means | A new route |
| - | - | - |
| `may_store` | Events from the route may be stored. Off, every event from it is rejected with `route_storage_not_allowed` and nothing from it is kept. | On |
| `vera_may_read` | VERA, TechnicallyFit's assistant, may read the route's observations and logged sets. Off, VERA never sees them, in any answer or report. | Off |

TechnicallyFit sets both limits. No endpoint, key or request changes them, and an
organization key cannot see a way to. If a source needs different limits, ask us.

`vera_may_read` is one of two checks. VERA also reads a teammate's training only when the
teammate has allowed AI use in their settings. Both have to allow it.

The TechnicallyFit routes `teammate` and `coach` are the app's own. VERA may read them, and
they cannot be disconnected.

To see what applies to a teammate, list their sources:

```bash curl theme={null}
curl "$TF_API_BASE/v1/teammates/member-1042/sources" \
  -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 sources = await tf.GET('/v1/teammates/{external_id}/sources', {
  params: { path: { external_id: 'member-1042' } },
});
for (const source of sources.data) console.log(source.route, source.state, source.may_store);
```

```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"))

sources = tf.list_teammate_sources("member-1042")
for source in sources["data"]:
    print(source["route"], source["state"], source["may_store"])
```

```json 200 theme={null}
{
  "data": [
    { "route": "org-lab", "state": "connected", "may_store": true, "vera_may_read": false }
  ]
}
```

A route is listed once you have sent one event from it for this teammate.

## Disconnecting a source

When a teammate asks you to stop sending a source, or to remove what it sent, disconnect the
route for that teammate:

```bash curl theme={null}
curl -X DELETE "$TF_API_BASE/v1/teammates/member-1042/sources/org-lab" \
  -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 result = await tf.DELETE('/v1/teammates/{external_id}/sources/{route}', {
  params: { path: { external_id: 'member-1042', route: 'org-lab' } },
});
console.log(result.deleted);
```

```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"))

result = tf.disconnect_teammate_source("member-1042", "org-lab")
print(result["deleted"])
```

```json 200 theme={null}
{
  "route": "org-lab",
  "state": "disconnected",
  "deleted": { "observations": 42, "logged_sets": 0, "events": 42 }
}
```

```json 409 theme={null}
{
  "error": {
    "code": "conflict",
    "message": "This is a TechnicallyFit route. It cannot be disconnected or reconnected.",
    "request_id": "7e3a1c5b9d2f4a6c8e0b1d3f5a7c9e2b",
    "details": {}
  }
}
```

The answer counts what was deleted. A `409` means the route is a TechnicallyFit route.

Disconnecting deletes, for that one teammate and that one route:

* every event you sent from the route, accepted or rejected;
* every observation from the route;
* every logged set from the route, from the teammate's training history.

It deletes nothing else. Another route, another teammate, the other mode (test or live) and
the teammate's own training in the TechnicallyFit app are untouched. A program change the
engine had prepared from the deleted data and that was still waiting for a coach is
withdrawn, and the program is planned again from what remains. Changes already made to a
program stay: they are its history.

The deletion is final. The deleted data no longer appears in the teammate's export, and
TechnicallyFit keeps only a record that the deletion happened, with the counts and no values.

Disconnecting is safe to repeat. A second call deletes nothing and answers zeros. It never
needs the teammate's consent: you can always delete what you sent.

After a disconnect, events from the route for that teammate are rejected with
`route_disconnected`. Each rejection is recorded with its reason and no value.

## Reconnecting

```bash curl theme={null}
curl -X PUT "$TF_API_BASE/v1/teammates/member-1042/sources/org-lab" \
  -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 result = await tf.PUT('/v1/teammates/{external_id}/sources/{route}', {
  params: { path: { external_id: 'member-1042', route: 'org-lab' } },
});
console.log(result.state);
```

```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"))

result = tf.reconnect_teammate_source("member-1042", "org-lab")
print(result["state"])
```

```json 200 theme={null}
{ "route": "org-lab", "state": "connected" }
```

Events from the route are stored again from then on. A reconnect brings nothing back: send
again whatever the teammate wants us to have. Reconnecting a connected route changes nothing.

## Errors

| Status | Code | When |
| - | - | - |
| 404 | `not_found` | You have no such teammate in this mode, or you have never sent events from the route for them. |
| 409 | `conflict` | The route is a TechnicallyFit route (`teammate`, `coach`). |

All three calls need the `events:write` scope. Listing and reconnecting also need the
teammate's `events` consent once they have claimed their account; disconnecting does not.

## Test mode

The limits apply to live keys. In test mode, the sandbox included, events are never refused
by a route limit, because test data never reaches a teammate's training history or VERA. A
disconnect in test mode still deletes that teammate's test data from the route.

## Leaving an organization is different

When a teammate leaves your organization, their data stays with them. Disconnecting a route is
the only action that deletes what a source sent.


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