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

# Quickstart

> Make your first calls to the TechnicallyFit API with curl, TypeScript or Python: create a key in your personal or organization workspace, check it, then read reference data.

> [!NOTE]
>
> Any verified TechnicallyFit account can create API keys in a free personal developer
> workspace at [app.technicallyfit.com/developer](https://app.technicallyfit.com/developer),
> with no organization required. Organization plans unlock multi-teammate live operations
> and organization features.

This page takes you from a new API key to two working calls. Every call is shown with
`curl`, the [TypeScript SDK](https://docs.technicallyfit.com/sdks/typescript.md) and the [Python SDK](https://docs.technicallyfit.com/sdks/python.md); pick
one tab and the page remembers it. It takes about five minutes.

```bash curl theme={null}
curl "$TF_API_BASE/v1/organization" \
  -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 organization = await tf.GET('/v1/organization');
console.log(organization.kind, organization.mode);
```

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

organization = tf.get_organization()
print(organization["kind"], organization["mode"])
```

```json 200 theme={null}
{
  "id": "4b1f6a2e-8c3d-4e5f-9a7b-2c1d0e9f8a76",
  "name": "Northside Strength (sandbox)",
  "kind": "organization",
  "plan": "organization",
  "mode": "test",
  "key": {
    "id": "9d2e7c41-3b6a-4f08-8e15-6a7b2c9d0e13",
    "prefix": "tf_test_8kq2",
    "scopes": ["reference:read", "teammates:write", "events:write", "programs:read", "webhooks:write"]
  }
}
```

```json 401 theme={null}
{
  "error": {
    "code": "unauthorized",
    "message": "A valid API key is required.",
    "request_id": "7c3e9a1f5b2d4e8a9c0b1d2e3f4a5b6c",
    "details": {}
  }
}
```

**1. Create a test key in the developer portal**

Sign in to TechnicallyFit at
[app.technicallyfit.com/developer](https://app.technicallyfit.com/developer) with any
verified account. Your **Personal** developer workspace is created automatically with
no organization required (owners and admins of an organization can also switch to their
organization workspace). Open **API keys** with **Test** selected, and create a key
that holds the `reference:read` scope. Copy the key when it is shown: it is shown only
once. The portal also shows the base URL to use.
[Authentication](https://docs.technicallyfit.com/guides/authentication.md) explains workspaces, plans, modes and scopes.

**2. Set your base URL and key**

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.

To use an SDK instead of `curl`, install it once. The SDKs read the same two values.

```bash TypeScript theme={null}
npm install @technicallyfit/sdk
```

```bash Python theme={null}
pip install technicallyfit
```

**3. Check your key**

Ask the API which workspace your key belongs to. This call works with any personal or
organization key and needs no scope.

```bash curl theme={null}
# example: quickstart-organization
curl "$TF_API_BASE/v1/organization" \
  -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 organization = await tf.GET('/v1/organization');
console.log(organization.name, organization.mode);
```

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

organization = tf.get_organization()
print(organization["name"], organization["mode"])
```

The response names your workspace, its `kind` (`personal` or `organization`), its
`plan` (`free` or `organization`), the mode of the key (`test` or `live`) and the
scopes the key holds. If `mode` is not `test`, stop and switch to a test key.

**4. Read reference data**

List three exercises from the catalog. This call needs the `reference:read` scope.

```bash curl theme={null}
# example: quickstart-exercises
curl "$TF_API_BASE/v1/exercises?limit=3" \
  -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/exercises', { params: { query: { limit: 3 } } });
for (const exercise of page.exercises) console.log(exercise.name);
```

```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_exercises(limit=3)
for exercise in page["exercises"]:
    print(exercise["name"])
```

The response holds an `exercises` list, the `total` number of exercises that match,
and `has_more`, which says whether there is another page. Ask for the next page with
`offset`.

## Run a full loop in the sandbox

Test mode (`tf_test_*`) gives full sandbox access on both personal and organization
workspaces. With the same test key you can watch your integration react to a teammate who
trains, without a real person. The key needs `teammates:write`, `events:write`,
`programs:read` and, for the webhook, `webhooks:write`.

**1. Listen for program changes**

Register a webhook endpoint with your test key and subscribe it to `program.revised`.
[Webhooks](https://docs.technicallyfit.com/guides/webhooks.md) explains endpoints and signatures. Test events reach only
test endpoints (personal workspaces support up to 2 active test webhook endpoints).

```bash curl theme={null}
curl -X POST "$TF_API_BASE/v1/webhook-endpoints" \
  -H "X-API-Key: $TF_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://hooks.example.com/technicallyfit", "events": ["program.revised"], "description": "Quickstart"}'
```

```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 endpoint = await tf.POST('/v1/webhook-endpoints', {
  body: {
    url: 'https://hooks.example.com/technicallyfit',
    events: ['program.revised'],
    description: 'Quickstart',
  },
});
// Store the secret now: it is shown only in this response.
console.log(endpoint.id, endpoint.secret);
```

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

endpoint = tf.create_webhook_endpoint(
    {
        "url": "https://hooks.example.com/technicallyfit",
        "events": ["program.revised"],
        "description": "Quickstart",
    }
)
# Store the secret now: it is shown only in this response.
print(endpoint["id"], endpoint["secret"])
```

The response holds the endpoint `id` and its signing `secret`, which is shown only once.

**2. Create a simulated teammate**

```bash curl theme={null}
# example: quickstart-sandbox-create
curl -X POST "$TF_API_BASE/v1/sandbox/teammates" \
  -H "X-API-Key: $TF_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"external_id": "quickstart-sim", "preset": "new_to_training", "seed": 1}'
```

```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 created = await tf.POST('/v1/sandbox/teammates', {
  body: { external_id: 'quickstart-sim', preset: 'new_to_training', seed: 1 },
});
console.log(created.program_job_id);
```

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

created = tf.create_sandbox_teammate({"external_id": "quickstart-sim", "preset": "new_to_training", "seed": 1})
print(created["program_job_id"])
```

```json 201 theme={null}
{
  "teammate": {
    "external_id": "quickstart-sim",
    "preset": "new_to_training",
    "seed": 1,
    "simulated": true,
    "weeks_simulated": 0
  },
  "history": {
    "weeks": 1,
    "events": 14,
    "results": {
      "accepted": 14,
      "duplicate": 0,
      "rejected": 0
    }
  },
  "program_job_id": "pj_5e2a9c7d-1b3f-4e60-9a2c-7d1b3f4e60a8",
  "simulated_now": "2026-11-23T14:12:05.000Z"
}
```

The teammate starts with a week of history, and its first program is built as a job
named in `program_job_id`. Poll `GET /v1/program-jobs/{job_id}` until it succeeds. When
the program starts, your endpoint receives `program.revised`.

```bash curl theme={null}
curl "$TF_API_BASE/v1/program-jobs/pj_5e2a9c7d-1b3f-4e60-9a2c-7d1b3f4e60a8" \
  -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 job = await tf.GET('/v1/program-jobs/{job_id}', {
  params: { path: { job_id: 'pj_5e2a9c7d-1b3f-4e60-9a2c-7d1b3f4e60a8' } },
});
console.log(job.status, job.result?.program_id);
```

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

job = tf.get_program_job("pj_5e2a9c7d-1b3f-4e60-9a2c-7d1b3f4e60a8")
print(job["status"], job["result"] and job["result"]["program_id"])
```

```json 200 theme={null}
{
  "id": "pj_5e2a9c7d-1b3f-4e60-9a2c-7d1b3f4e60a8",
  "teammate": "quickstart-sim",
  "status": "succeeded",
  "created_at": "2026-11-23T14:12:05.412Z",
  "finished_at": "2026-11-23T14:12:11.087Z",
  "result": {
    "program_id": "0c9b7e2a-4d1f-4a3e-8b6c-5f2e1d0a9b84",
    "outcome": "started",
    "proposal_id": null,
    "engine_version": "ab5787734209",
    "inputs_ignored": []
  },
  "error": null
}
```

**3. Simulate a week**

```bash curl theme={null}
# example: quickstart-sandbox-simulate
curl -X POST "$TF_API_BASE/v1/sandbox/teammates/quickstart-sim/simulate" \
  -H "X-API-Key: $TF_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"behavior": "on_plan"}'
```

```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 week = await tf.POST('/v1/sandbox/teammates/{simulated_id}/simulate', {
  params: { path: { simulated_id: 'quickstart-sim' } },
  body: { behavior: 'on_plan' },
});
console.log(week.week.number, week.events.accepted);
```

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

week = tf.simulate_sandbox_week("quickstart-sim", {"behavior": "on_plan"})
print(week["week"]["number"], week["events"]["accepted"])
```

```json 200 theme={null}
{
  "week": {
    "number": 1,
    "from": "2026-11-23",
    "to": "2026-11-29"
  },
  "events": {
    "accepted": 16,
    "duplicate": 0,
    "rejected": 0
  },
  "program_id": "0c9b7e2a-4d1f-4a3e-8b6c-5f2e1d0a9b84",
  "replan_requested": true,
  "simulated_now": "2026-11-30T06:00:00.000Z"
}
```

The week's logged sets and effort reports go through the normal event path.
[Sandbox](https://docs.technicallyfit.com/guides/sandbox.md) covers presets, behaviors, the simulated clock, resets,
personal workspace limits and what you will not see yet.

## Moving to live mode

When you create a live key (`tf_live_*`), what you can call depends on your workspace plan:

* **Personal workspace (`plan: "free"`):** Call `reference:read` endpoints and your own
  data under `/v1/teammates/@me` and `/v1/teammates/@me/*` with implicit self-consent.
* **Organization workspace (`plan: "organization"`):** Unlocks live operations for other
  teammates, live webhooks, bulk events, locations, insights, organization settings and
  member-app OAuth clients. Calling these in live mode with a personal key returns
  `403 plan_required`.

## If a call fails

Every error has the same body, with a stable `code` to branch on and a `request_id` to
send to support.

* A `401` means the key is missing or not valid. Check the `X-API-Key` header.
* A `403` means the key does not hold the scope the endpoint needs (`forbidden`), or the
  live-mode feature requires an Organization plan (`plan_required`).
* A `429` means the key is over its rate limit (or a personal workspace reached its daily
  engine-heavy write cap). Wait, then try again.

[Errors](https://docs.technicallyfit.com/guides/errors.md) lists every code and says which ones to retry.
[Rate limits](https://docs.technicallyfit.com/guides/rate-limits.md) explains per-key limits, personal workspace caps and
how to slow down and recover.

## Where to go next

> [card] [Authentication](https://docs.technicallyfit.com/guides/authentication.md)
>
> Personal and organization workspaces, test and live keys, scopes, rotation and revocation.

> [card] [Rate limits](https://docs.technicallyfit.com/guides/rate-limits.md)
>
> Per-key limits, personal workspace caps and what to do when you reach a limit.

> [card] [Errors](https://docs.technicallyfit.com/guides/errors.md)
>
> The one error body, every code and which errors to retry.

> [card] [SDKs](https://docs.technicallyfit.com/sdks.md)
>
> Client libraries for the API.

Every endpoint is listed under **Endpoints** in the sidebar, each with a panel where you
can send a request from the page. Paste test keys only.


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