curl -X POST "https://api.fitsociety.io/public/v1/workout/plans/assign-multiple" \
-H "Authorization: Bearer <access_token>" \
-H "Idempotency-Key: <stable_request_key>" \
-H "Content-Type: application/json" \
-d '{}'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
templatePlanId: '67f1234567890abcdef1234',
clientIds: ['67f1234567890abcdef9999', '67f1234567890abcdef8888']
})
};
fetch('https://api.fitsociety.io/public/v1/workout/plans/assign-multiple', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.fitsociety.io/public/v1/workout/plans/assign-multiple"
payload = {
"templatePlanId": "67f1234567890abcdef1234",
"clientIds": ["67f1234567890abcdef9999", "67f1234567890abcdef8888"]
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"templatePlanId": "67f1234567890abcdef1234",
"requested": 2,
"assignedCount": 2,
"failedCount": 0,
"assigned": [
{
"clientId": "67f1234567890abcdef1234",
"planId": "67f1234567890abcdef1234"
}
],
"failed": [
{
"clientId": "67f1234567890abcdef1234",
"error": "ASSIGN_FAILED"
}
]
},
"meta": {
"requestId": "4f849d7d-f4f1-45cc-b4b7-3984a3d17f83",
"rateLimit": {
"limit": 10,
"remaining": 9,
"resetSeconds": 1
},
"idempotency": {
"replayed": false
}
}
}Assign a template workout v2 plan to multiple clients at once
Assigns one template plan to many clients in a single call. Each client receives an independent Assigned copy (templateType: "Assigned", sourceTemplateId = template). Duplicate assignments are allowed and the plan name is suffixed per client (#2, #3, …). Each client is created independently, so the response reports per-client assigned[] and failed[] outcomes; a partial success still returns 200.
Requires the workout_plans:write scope. This operation maps to /app/v1/workout/plans/assign-multiple and retains its Workout V2 permission, feature-flag, and resource-scope checks.
The clientId path parameter is resolved inside the company bound to the Public API token when present.
curl -X POST "https://api.fitsociety.io/public/v1/workout/plans/assign-multiple" \
-H "Authorization: Bearer <access_token>" \
-H "Idempotency-Key: <stable_request_key>" \
-H "Content-Type: application/json" \
-d '{}'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
templatePlanId: '67f1234567890abcdef1234',
clientIds: ['67f1234567890abcdef9999', '67f1234567890abcdef8888']
})
};
fetch('https://api.fitsociety.io/public/v1/workout/plans/assign-multiple', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.fitsociety.io/public/v1/workout/plans/assign-multiple"
payload = {
"templatePlanId": "67f1234567890abcdef1234",
"clientIds": ["67f1234567890abcdef9999", "67f1234567890abcdef8888"]
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"data": {
"templatePlanId": "67f1234567890abcdef1234",
"requested": 2,
"assignedCount": 2,
"failedCount": 0,
"assigned": [
{
"clientId": "67f1234567890abcdef1234",
"planId": "67f1234567890abcdef1234"
}
],
"failed": [
{
"clientId": "67f1234567890abcdef1234",
"error": "ASSIGN_FAILED"
}
]
},
"meta": {
"requestId": "4f849d7d-f4f1-45cc-b4b7-3984a3d17f83",
"rateLimit": {
"limit": 10,
"remaining": 9,
"resetSeconds": 1
},
"idempotency": {
"replayed": false
}
}
}Authorizations
Public API access token issued by /public/v1/oauth/token. Example: Authorization: Bearer fspt_.... Each resource request rechecks the token company's current provider access. Disabling access blocks existing tokens with 403 auth.provider_unavailable.
Headers
Required for Public API write requests. Reusing the same key with the same method, path, and body replays the stored successful response; reusing it with a different request returns 409 idempotency.conflict.
1 - 200"booking-create-20260714-001"
Body
"67f1234567890abcdef1234"
Client ids to assign the plan to. Duplicates are de-duplicated.
1[
"67f1234567890abcdef9999",
"67f1234567890abcdef8888"
]
Sets week 1 of the programme. Required when the template uses multi_week or calendar_week; one date applies to every selected client, so every client gets the same treatment.
A multi_week + calendar_week template accepts ANY weekday. A mid-week date is absorbed into week 1: the stored schedule.startDate snaps back to that week's Monday, and week 1's days BEFORE the chosen weekday become rest days. Weeks 2..n land exactly where authored, and week 1's lead-in work is DROPPED rather than deferred.
Recurring templates are unchanged. A calendar_week recurring template still requires a canonical company-local Monday (anything else → 400 WORKOUTPLAN_SCHEDULE_INVALID); a sequence recurring template ignores the date.
^\d{4}-\d{2}-\d{2}$"2026-09-07"
Defaults to Active when omitted.
Active, Inactive "Active"