curl -X POST "https://api.fitsociety.io/public/v1/workout/plans/assign-multiple-plans" \
-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({
templatePlanIds: ['67f1234567890abcdef1111', '67f1234567890abcdef2222'],
clientIds: ['67f1234567890abcdef9999', '67f1234567890abcdef8888']
})
};
fetch('https://api.fitsociety.io/public/v1/workout/plans/assign-multiple-plans', 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-plans"
payload = {
"templatePlanIds": ["67f1234567890abcdef1111", "67f1234567890abcdef2222"],
"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": {
"assignedCount": 4,
"failedCount": 0,
"requestedPlans": 2,
"requestedClients": 2,
"requestedPairs": 4,
"assigned": [
{
"templatePlanId": "67f1234567890abcdef1234",
"clientId": "67f1234567890abcdef1234",
"planId": "67f1234567890abcdef1234"
}
],
"failed": [
{
"templatePlanId": "66f7b8b1e13c8d25f4d3d90a",
"clientId": "66f7b8b1e13c8d25f4d3d90a",
"error": "string"
}
],
"perPlan": [
{
"templatePlanId": "66f7b8b1e13c8d25f4d3d90a",
"assignedCount": 1,
"failedCount": 1
}
]
},
"meta": {
"requestId": "4f849d7d-f4f1-45cc-b4b7-3984a3d17f83",
"rateLimit": {
"limit": 10,
"remaining": 9,
"resetSeconds": 1
},
"idempotency": {
"replayed": false
}
}
}Assign multiple workout v2 templates to multiple clients
Creates the template/client cross product. scheduleStartDate is required when any selected template uses multi_week or calendar_week, and is validated for every resolved template before copies are created. One canonical date is applied to every selected client. A multi_week + calendar_week template accepts any weekday (the anchor snaps back to that week’s Monday and week 1’s earlier days become rest days); a calendar_week recurring template still requires a company-local Monday; sequence recurring templates ignore the date.
Requires the workout_plans:write scope. This operation maps to /app/v1/workout/plans/assign-multiple-plans 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-plans" \
-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({
templatePlanIds: ['67f1234567890abcdef1111', '67f1234567890abcdef2222'],
clientIds: ['67f1234567890abcdef9999', '67f1234567890abcdef8888']
})
};
fetch('https://api.fitsociety.io/public/v1/workout/plans/assign-multiple-plans', 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-plans"
payload = {
"templatePlanIds": ["67f1234567890abcdef1111", "67f1234567890abcdef2222"],
"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": {
"assignedCount": 4,
"failedCount": 0,
"requestedPlans": 2,
"requestedClients": 2,
"requestedPairs": 4,
"assigned": [
{
"templatePlanId": "67f1234567890abcdef1234",
"clientId": "67f1234567890abcdef1234",
"planId": "67f1234567890abcdef1234"
}
],
"failed": [
{
"templatePlanId": "66f7b8b1e13c8d25f4d3d90a",
"clientId": "66f7b8b1e13c8d25f4d3d90a",
"error": "string"
}
],
"perPlan": [
{
"templatePlanId": "66f7b8b1e13c8d25f4d3d90a",
"assignedCount": 1,
"failedCount": 1
}
]
},
"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
1[
"67f1234567890abcdef1111",
"67f1234567890abcdef2222"
]
1[
"67f1234567890abcdef9999",
"67f1234567890abcdef8888"
]
Sets week 1 of the programme. Required when any selected template uses multi_week or calendar_week. The SAME date applies to every selected plan/client pair, and each template interprets it by its own mode.
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; a sequence recurring template ignores the date. In a MIXED batch this is validated up front for every resolved template, so a mid-week date sent alongside a recurring calendar template fails the WHOLE request with 400 WORKOUTPLAN_SCHEDULE_INVALID and nothing is assigned.
^\d{4}-\d{2}-\d{2}$"2026-09-07"
Active, Inactive "Active"