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

# BuddyPT API

BuddyPT is a coaching platform API that helps personal trainers and fitness coaches manage clients, workouts, exercises, training programs, nutrition plans, group challenges, and Stripe-backed subscriptions on prod-api.buddypt.com. The spec covers trainer and customer authentication, workout and exercise libraries, program-to-customer assignment, nutrition planning, customer metrics, Zapier webhook hooks, and trainer revenue reporting. It is the integration entry point for trainer back-office tooling, white-label coaching apps, and CRM-to-coaching syncs.

## For AI agents

Manage personal-training clients, workouts, programs, nutrition plans, and Stripe subscriptions on the BuddyPT coaching platform.

## Scope

Does not handle wearable device data ingest, video coaching delivery, or general gym membership management - use for trainer-led client, workout, program, and subscription management on BuddyPT only.

## Capabilities

- Authenticate trainers and customers via `/api/auth/signin` and obtain bearer tokens
- Build a reusable workout and exercise library and assign workouts to clients
- Save or update training programs and map them to specific customers
- Manage nutrition plans and assign them alongside training programs
- Import customers in bulk via `/api/customer/import` for trainer onboarding
- Track per-customer metrics and update customer status across the trainer roster
- Run trainer revenue reports and create Stripe subscriptions for paid coaching

## Use cases

### Bulk Client Onboarding

Onboard a roster of clients at the start of a new coaching cohort by importing them in bulk via `/api/customer/import` rather than creating each client manually. After import, each customer can be mapped to a program with `/api/program/program-customer-map` and a nutrition plan with the nutrition save-or-update endpoint. End-to-end onboarding moves from days of manual work to minutes for a 50-client cohort.

Example prompt: POST a list of clients to `/api/customer/import`, then for each returned customer ID call mapProgramToCustomer with the relevant program ID

### Programmatic Program and Nutrition Assignment

Assign training programs and nutrition plans to clients programmatically based on their goals or quiz responses. saveOrUpdateProgram persists a program template and mapProgramToCustomer attaches it to one client, while saveOrUpdateNutritionPlan handles the matching meal plan. Useful for white-label coaching apps where the assignment logic lives outside the BuddyPT UI.

Example prompt: Call saveOrUpdateProgram with the strength template, then mapProgramToCustomer with the customer ID, then saveOrUpdateNutritionPlan with the matching meal plan

### Trainer Revenue Reporting

Pull trainer earnings into BI tools or accounting systems via `/api/trainer/revenue-report` so the trainer can see paid versus refunded sessions for the month. Combined with `/api/stripe/subscription` for active subscription state, this powers a trainer's monthly close-out without exporting CSVs from the BuddyPT dashboard.

Example prompt: Call `/api/trainer/revenue-report` with the date range for last month and aggregate the result by customer for the trainer's books

### AI Agent Coaching Through Jentic

Allow an AI agent to act on behalf of a trainer to assign workouts, send messages, or check customer metrics without holding the trainer's bearer token. Through Jentic, the agent searches by intent, loads the relevant operation schema, and executes against `/api/workouts`, `/api/message`, or `/api/customer-metrics.` The token is exchanged through `/api/auth/signin` and stored in your Jentic One instance for the duration of the session.

Example prompt: Use Jentic to search 'create a BuddyPT workout', load the createWorkout schema, and execute against `/api/workouts` with the planned exercises

## Key endpoints

| Method | Path | Description |
| --- | --- | --- |
| POST | `/api/auth/signin` | Authenticate a user and return a bearer token |
| POST | `/api/workouts` | Create a workout |
| POST | `/api/customer` | Create a customer |
| POST | `/api/customer/import` | Import customers in bulk |
| POST | `/api/program/save-or-update` | Save or update a training program |
| POST | `/api/program/program-customer-map` | Map a program to a customer |
| POST | `/api/nutrition` | Save or update a nutrition plan |
| GET | `/api/trainer/revenue-report` | Run a trainer revenue report |

## Key resources

- **Authentication** — Sign up, sign in, and obtain bearer tokens for trainers and customers
- **Workouts and Exercises** — Create and manage the workout and exercise library, plus per-customer workout status
- **Customers** — Create, update, import, and update status on trainer customers
- **Programs and Nutrition** — Save training programs and nutrition plans and map them to customers
- **Trainer** — Manage trainer profile and run revenue reports
- **Groups, Challenges, Events** — Group customers, run challenges, and schedule events
- **Messaging and Documents** — Send messages and share documents with customers
- **Stripe and Zapier** — Create Stripe subscriptions and integrate via Zapier webhooks

## Why Jentic

- **Setup:** Wiring BuddyPT by hand means calling `/api/auth/signin` against prod-api.buddypt.com to exchange credentials for a bearer token and refreshing it before it expires yourself. Through Jentic you install once, import BuddyPT from the API Directory, store the credential once, and your agent calls it.
- **Permission scoping:** BuddyPT identifies clients, workouts, and programs in the request body rather than the URL path, so scope the agent by the operations it needs, such as creating a workout or saving a program. Because you choose the allowed operations, it can build training content without being able to pull the trainer revenue report unless you add that.
- **Credential handling:** Your BuddyPT credential is stored once, encrypted, by your own Jentic One instance, exchanged for a bearer token server-side, and only the token is injected at execution time. The raw password never enters the agent's prompt, logs, or context.
- **Discovery method:** Agents search Jentic by intent such as 'create a BuddyPT workout' or 'import a client', and Jentic returns the matching BuddyPT operation with its input schema so the agent calls the right endpoint without browsing the reference docs.

## Related APIs

- **Bubble Data API** — Stores BuddyPT customer IDs and program metadata in a no-code Bubble app for trainer dashboards
- **Buckaroo Checkout JSON Gateway API** — European payment gateway used as an alternative to Stripe for collecting coaching fees
- **Buffer API** — Schedules trainer marketing posts that promote BuddyPT challenges and programs

## FAQ

### What authentication does the BuddyPT API use?

BuddyPT uses HTTP bearer tokens. POST credentials to `/api/auth/signin` to receive an access token, then send Authorization: Bearer <token> on subsequent requests. New trainers or customers can register via `/api/auth/signup.` Through Jentic the credentials are stored encrypted in the vault and the sign-in exchange runs server-side so they never enter the agent's context.

### Can I import a list of clients into BuddyPT?

Yes. POST a structured client list to `/api/customer/import` to create multiple customers in one request. After the import, map each customer to a program with `/api/program/program-customer-map.` This is the standard onboarding path for trainers migrating from spreadsheets or another coaching tool.

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

BuddyPT does not publish a global per-second rate limit in the spec. Production traffic is shaped by the trainer's plan and abuse-protection limits applied to the platform. If a request is throttled the API returns an error response and clients should back off before retrying.

### How do I create a workout through Jentic?

Install the SDK with pip install jentic, search for 'create a BuddyPT workout', load the createWorkout schema, and execute it against `/api/workouts` with the workout fields (name, exercises, sets, reps, scheduling). Jentic injects the bearer token from the vault and returns the created workout's ID.

### Does BuddyPT integrate with Stripe and Zapier?

Yes. `/api/stripe/subscription` creates Stripe subscriptions for paid coaching, and `/api/zapier/webhook`/* exposes Zapier-compatible webhook entry points for events like customer-create. `/api/zapier/token` mints the token Zapier uses to authenticate incoming webhook calls.

### Can I run a revenue report for a trainer?

Yes. GET `/api/trainer/revenue-report` with a date range query returns the trainer's earnings, refunds, and active subscriptions over that period. This supports monthly close-out and BI dashboards without manual exports from the BuddyPT UI.

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

Yes. Because you self-host Jentic One, your own rules decide which BuddyPT operations and credentials the agent may use. BuddyPT identifies clients, workouts, and programs in the request body rather than the URL path, so you scope the agent by the operations it needs, such as creating a workout with `/api/workouts` or saving a program with `/api/program/save-or-update.` Since you choose the allowed operations, an agent can build training content without being able to pull the trainer revenue report at `/api/trainer/revenue-report` unless you add that.
