GuidesScaling
Automate with the API
If you use a CRM, a lead capture website, or any other external tool, you can connect it to TrainerStudio through the API. This allows you to create and manage clients without opening the app.
Create an API key
- Go to Settings > Developers.
- Click Create API Key.
- Give it a descriptive name (for example, "My CRM" or "Zapier").
- Copy the generated key and store it in a safe place.
The API key gives full access to your account. Treat it like a password: don't share it, and revoke it if you suspect it has been compromised.
Full example: create and archive a client
The following example shows the complete flow: creating a new client and archiving them when they stop training with you. Include the X-API-Key header to authenticate.
curl -X POST https://api.trainerstudio.io/coach/customers \
-H "X-API-Key: ts_ak_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"name": "Laura",
"surname": "Garcia",
"email": "laura@example.com"
}'
# Response:
# {
# "_id": "663f1a2b4c...",
# "name": "Laura",
# "surname": "Garcia",
# "email": "laura@example.com",
# "role": "CUSTOMER",
# "customerRoleData": {
# "isArchived": false,
# "customerType": "REAL"
# },
# "firstAccessToken": "3f09812a-..."
# }
#
# Save the _id to manage this client later.# Use the _id returned in the previous step.
# The client will no longer appear in your active list but is not deleted.
curl -X PUT https://api.trainerstudio.io/coach/customers/archive \
-H "X-API-Key: ts_ak_your_key_here" \
-H "Content-Type: application/json" \
-d '{
"id": "663f1a2b4c..."
}'Revoke a key
If you no longer need a key or believe it has been leaked:
- Go to Settings > Developers.
- Click the trash icon next to the key.
- Confirm the revocation.
Any integrations using that key will stop working immediately.
Use cases
- CRM: Automatically create clients when a lead converts in your CRM.
- Web form: Connect your sign-up form to TrainerStudio via Zapier or Make.
- Automatic offboarding: Archive clients when they cancel their subscription in your payment gateway.