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

# Sign in with TechnicallyFit

> Let a teammate bring their body state and verified measurement record into your app with one consent screen, no organization contract required.

A teammate's body state and verified measurement record belong to them. With Sign in with TechnicallyFit, any app can register itself, ask the teammate for read access on one consent screen, and call `/v1/me/body-state` and `/v1/me/record` on their behalf.

No organization contract or API key is required for read access.

## Scopes

Two read-only scopes are available to self-registered apps:

| Scope | What it reads | Endpoint |
| - | - | - |
| `body_state:read` | Current readiness, fatigue and active joint status | `GET /v1/me/body-state` |
| `record:read` | Live recorded measurements and assessment results | `GET /v1/me/record` |

On the consent screen, the teammate sees each area in plain words and can allow either, both or neither. Sensitive measures never appear in these reads.

No identity token is issued: your app receives the scopes the teammate allowed, not their name or email address.

## 1. Register your app

Register your app once against the sign-in server. PKCE (`S256`) is required.

```bash theme={null}
curl -X POST https://api.technicallyfit.com/oauth/register \
  -H "Content-Type: application/json" \
  -d '{
    "client_name": "Your App Name",
    "redirect_uris": ["https://yourapp.example/callback"],
    "token_endpoint_auth_method": "none"
  }'
```

Store the returned `client_id`. Redirect URIs must use `https` (`http://localhost` and `http://127.0.0.1` are allowed for local testing).

## 2. Send the teammate to authorize

Generate a PKCE `code_verifier` and its `S256` `code_challenge`, then redirect the teammate's browser to `/oauth/authorize`:

```text theme={null}
https://api.technicallyfit.com/oauth/authorize
  ?client_id=tfc_...
  &redirect_uri=https://yourapp.example/callback
  &response_type=code
  &scope=body_state:read%20record:read
  &code_challenge=<S256 challenge>
  &code_challenge_method=S256
  &state=<random csrf token>
```

After the teammate chooses what to allow, TechnicallyFit redirects back to your `redirect_uri` with `code` and `state` (or `error=access_denied` if they cancel).

## 3. Exchange the code for a token

```bash theme={null}
curl -X POST https://api.technicallyfit.com/oauth/token \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -d "grant_type=authorization_code" \
  -d "code=<authorization code>" \
  -d "client_id=tfc_..." \
  -d "redirect_uri=https://yourapp.example/callback" \
  -d "code_verifier=<PKCE verifier>"
```

Check the `scope` field in the token response: the teammate may have allowed only one of the scopes you requested.

## 4. Call the read endpoints

Send the access token in `Authorization: Bearer <access_token>`:

```bash theme={null}
curl https://api.technicallyfit.com/v1/me/record \
  -H "Authorization: Bearer tf_at_..."

curl https://api.technicallyfit.com/v1/me/body-state \
  -H "Authorization: Bearer tf_at_..."
```

Both endpoints return the same response shapes as the organization `/v1` routes, scoped to the signed-in teammate only.

* Calling an endpoint whose scope was not granted returns `403`.
* When the teammate revokes your app in Settings, both endpoints return `401` immediately.
* Sign-in tokens use the free personal tier request limits and include `X-RateLimit-*` headers on every response.

## Under-18 teammates

Teammates under 18 cannot share their body state or verified record with external apps yet. The consent screen explains why and prevents granting either scope.

## Requesting write access

Self-registered apps start with read access only. If an app requests any write scope, the authorization server refuses the request and opens a staff review for your app. Write to `support@technicallyfit.com` with your app's `client_id` to complete the review.


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