Developers

Quickstart

This guide walks you through creating a client and assigning a workout — the two most common operations — using curl. You will need an API key before starting.

1. Set up your environment

export TS_API_KEY="your-api-key-here"
export TS_BASE="https://api.trainerstudio.io"

2. Create a client

curl -X POST "$TS_BASE/coach/customers" \
  -H "X-API-Key: $TS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Ada Lovelace",
    "email": "ada@example.com"
  }'

The response includes the new client's _id:

{
  "_id": "665a1b2c3d4e5f6a7b8c9d0e",
  "name": "Ada Lovelace",
  "email": "ada@example.com",
  "status": "active"
}

3. List your clients

curl "$TS_BASE/coach/customers" \
  -H "X-API-Key: $TS_API_KEY"

4. Create a workout block

Workout blocks are containers for a day's training. Each block holds workout items (exercises with sets and reps).

CUSTOMER_ID="665a1b2c3d4e5f6a7b8c9d0e"

curl -X POST "$TS_BASE/coach/customers/$CUSTOMER_ID/wblocks" \
  -H "X-API-Key: $TS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Upper Body A",
    "date": "2026-05-15"
  }'

5. Add exercises to the workout

First, find an exercise from the library:

curl "$TS_BASE/exercises/unified?search=bench+press&limit=5" \
  -H "X-API-Key: $TS_API_KEY"

Then add it to the workout block:

WBLOCK_ID="the-workout-block-id"

curl -X POST "$TS_BASE/coach/customers/$CUSTOMER_ID/wblocks/$WBLOCK_ID/witems" \
  -H "X-API-Key: $TS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "exerciseId": "the-exercise-id",
    "sets": [
      { "reps": 10, "weight": 60 },
      { "reps": 8, "weight": 70 },
      { "reps": 6, "weight": 80 }
    ]
  }'

Next steps

  • API Reference — full interactive reference with all endpoints
  • AI Agents — automate this with Claude or GPT

On this page