canonical: https://jentic.com/apis/tredict.com/tredict

# Tredict API

Tredict is a training and fitness platform. The API allows you to get and set activities, health data, planned trainings, training plans, and more via OAuth2 authentication. The API exposes 20 endpoints secured with oauth2 authentication.

## For AI agents

Programmatically oauth2 authorization, exchange authorization code or refresh token for access token. Covers 20 operations with oauth2 authentication.

## Scope

Does not handle payments, communications, or crm - use for identity and authentication only.

## Capabilities

- OAuth2 Authorization
- Exchange authorization code or refresh token for access token
- Deregister / revoke tokens
- List activities
- Get activity details
- Update an activity
- Download activity file

## Use cases

### Identity and Authentication Operations

Use the Tredict API to perform identity auth operations programmatically. The API provides 20 endpoints covering core functionality including oauth2 authorization, exchange authorization code or refresh token for access token, deregister / revoke tokens.

Example prompt: Call GET /authorization to oauth2 authorization

### Automated OAuth2 Management

Automate oauth2 operations by combining multiple Tredict API endpoints. Agents can exchange authorization code or refresh token for access token and then deregister / revoke tokens in a single workflow.

Example prompt: Call POST `/user/oauth/v2/token` to exchange authorization code or refresh token for access token, then verify the result

### AI Agent Integration via Jentic

AI agents discover and call Tredict API endpoints through Jentic without managing credentials directly. An agent searches for the required operation by intent, receives the matching endpoint schema, and executes the call with Jentic-managed authentication. This eliminates the need to read API documentation or handle oauth2 tokens manually.

Example prompt: Search Jentic for 'oauth2 authorization', load the operation schema, and execute with Jentic-managed credentials

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| GET | `/authorization` | OAuth2 Authorization |
| POST | `/user/oauth/v2/token` | Exchange authorization code or refresh token for access token |
| DELETE | `/user/oauth/v2/token` | Deregister / revoke tokens |
| GET | `/api/oauth/v2/activityList` | List activities |
| GET | `/api/oauth/v2/activity/{activityId}` | Get activity details |
| POST | `/api/oauth/v2/activity/update/{activityId}` | Update an activity |
| GET | `/api/oauth/v2/activity/file/{activityId}` | Download activity file |
| POST | `/api/oauth/v2/activity/upload` | Upload an activity file |

## Key resources

- **OAuth2** — Authentication and token management endpoints.
- **Activities** — Activity data management - list, download, upload, and update activities.
- **Planned Trainings** — Planned training management and download.
- **Health & Metrics** — Health data, body values, HRV, sleep, capacity, training efforts, and zones.
- **Training Plans** — Training plan creation and management.

## Why Jentic

- **Setup:** Wiring the Tredict API by hand means running its OAuth2 authorization-code flow with PKCE, managing token exchange and revocation, and handling errors against www.tredict.com yourself. Through Jentic you install once, import the Tredict API from the API Directory, store the credential once, and your agent calls it.
- **Permission scoping:** Tredict puts the activity id in the URL path (`/api/oauth/v2/activity/{activityId}`), so a rule can pin your agent to one activity: it can read that activity and its file and nothing else. You choose the operations it may call, so an activity update or an upload is not included unless you add it.
- **Credential handling:** Your Tredict OAuth2 credential is stored once, encrypted, by your own Jentic One instance and injected at execution time. It never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'list my activities' or 'download an activity file', and Jentic returns the matching Tredict API operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Auth0** — Alternative identity auth API
- **Okta** — Alternative identity auth API

## FAQ

### What authentication does the Tredict API use?

The Tredict API uses OAuth 2.0 for authorization. Through Jentic, these credentials are stored encrypted in your Jentic One instance and injected at execution time, so raw secrets never enter the agent context.

### Can I oauth2 authorization with the Tredict API?

Yes. Use the GET /authorization endpoint. The API returns structured JSON responses that agents can parse and act on directly.

### What are the rate limits for the Tredict API?

Rate limits are not specified in the OpenAPI spec. Check the vendor documentation for current limits. Through Jentic, rate limiting is handled automatically with retry logic built into the execution layer.

### How do I oauth2 authorization through Jentic?

Install the Jentic SDK with pip install jentic, authenticate through Jentic One, the self-hosted execution layer, then search for 'oauth2 authorization'. Jentic returns the matching Tredict API operation with its input schema. Load the schema and execute the call - credentials are injected automatically.

### How many endpoints does the Tredict API have?

The Tredict API exposes 20 endpoints covering oauth2, activities, planned trainings operations.

### Can I limit what my agent is allowed to do with the Tredict API?

Yes. Because you run Jentic One yourself, your own rules decide which Tredict operations and credentials the agent may use. Since Tredict carries the activity id in the URL path (`/api/oauth/v2/activity/{activityId}`), you can pin the agent to a single activity so it only reads that activity and downloads its file. Write operations such as updating an activity or uploading an activity file stay off unless you explicitly add them.
