curl -X PATCH "https://api.fitsociety.io/public/v1/workout/clients/{clientId}/plans/template/{templateId}/weeks/reorder" \
-H "Authorization: Bearer <access_token>" \
-H "Idempotency-Key: <stable_request_key>" \
-H "Content-Type: application/json" \
-d '{}'const options = {
method: 'PATCH',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({weeks: [4, 2, 3, 1]})
};
fetch('https://api.fitsociety.io/public/v1/workout/clients/{clientId}/plans/template/{templateId}/weeks/reorder', 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/clients/{clientId}/plans/template/{templateId}/weeks/reorder"
payload = { "weeks": [4, 2, 3, 1] }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)Reorder the weeks of the client's own multi-week programme
Reorder the WEEKS of the client’s own multi-week programme. A week’s whole CONTENT travels with it — all seven of its days, their isRestDay flags and every entry in items[] (workouts and activities) — so the weeks are rearranged, never rewritten. Swapping week 1 with week 4 moves week 1’s seven days into slot 4 and week 4’s seven days into slot 1.
weeks[i] is the week whose content moves to week number i + 1. So a plan with weeks 1..4 and body [4, 2, 3, 1] swaps weeks 1 and 4 (weeks 2 and 3 stay). Every existing week number must be listed exactly once, which keeps the request idempotent and lets one call express any rearrangement.
Both week-number stores are remapped together: the calendar definition (schedule.weeks[].weekNumber, whose days and items ride along because they are nested inside the week) and each plan moment’s own weekNumber (a workout item points at a plan moment, which records the week it belongs to).
Multi-week only: a recurring plan is a single repeating week with nothing to reorder. The plan is pinned to the caller’s own ASSIGNED multi-week calendar programme, so a client can never reorder a library template or another client’s plan.
Requires the workout_client_plans:write scope. This operation maps to /app/v1/workout/plans/client/template/:templateId/weeks/reorder and retains its Workout V2 permission, feature-flag, and resource-scope checks.
The clientId path parameter identifies the client represented by the request context.
curl -X PATCH "https://api.fitsociety.io/public/v1/workout/clients/{clientId}/plans/template/{templateId}/weeks/reorder" \
-H "Authorization: Bearer <access_token>" \
-H "Idempotency-Key: <stable_request_key>" \
-H "Content-Type: application/json" \
-d '{}'const options = {
method: 'PATCH',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({weeks: [4, 2, 3, 1]})
};
fetch('https://api.fitsociety.io/public/v1/workout/clients/{clientId}/plans/template/{templateId}/weeks/reorder', 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/clients/{clientId}/plans/template/{templateId}/weeks/reorder"
payload = { "weeks": [4, 2, 3, 1] }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)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"
Path Parameters
The client's own assigned multi-week calendar plan.
"67f1234567890abcdef1234"
Client in the company bound to the Public API token.
^[a-fA-F0-9]{24}$Body
A permutation of the plan's current week numbers, in their new order. weeks[i] moves to week i + 1.
1x >= 1[4, 2, 3, 1]