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",
    "sendInvitation": false
  }'

name is required; email is optional. This example disables the invitation email while testing. The response includes the new client's _id:

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

3. List your clients

curl "$TS_BASE/coach/customers?archived=false&pageSize=20&pageNum=1" \
  -H "X-API-Key: $TS_API_KEY"

All three query parameters are required. archived accepts true or false; pageSize is an integer up to 50 (use 1–50), and pageNum is a one-based page number. Read the docs array in the response and use hasNextPage and nextPage to continue. Optional contains filters by name, surname or email. In Make, add these as query-string fields and retain the X-API-Key header; a GET request does not need a body.

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?keywords=bench+press&pageSize=5&pageNum=1" \
  -H "X-API-Key: $TS_API_KEY"

Use an exercise _id from the response docs array and the _id returned when creating the workout block. Replace the placeholders below, then add the exercise 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 '{
    "type": "EXERCISE",
    "exerciseId": "the-exercise-id",
    "exerciseSets": [
      { "type": "reps_load", "index": 1, "minPlannedReps": 10, "maxPlannedReps": 10, "load": 60 },
      { "type": "reps_load", "index": 2, "minPlannedReps": 8, "maxPlannedReps": 8, "load": 70 }
    ]
  }'

Next steps

On this page