curl -X PATCH "https://api.fitsociety.io/public/v1/workout/clients/{clientId}/plans/template/{templateId}/weeks/{weekNumber}/days/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({weekdays: [7, 1, 2, 3, 4, 5, 6]})
};
fetch('https://api.fitsociety.io/public/v1/workout/clients/{clientId}/plans/template/{templateId}/weeks/{weekNumber}/days/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/{weekNumber}/days/reorder"
payload = { "weekdays": [7, 1, 2, 3, 4, 5, 6] }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"data": {
"planId": "67f1234567890abcdef1234",
"weekNumber": 1,
"weekdays": [
7,
1,
2,
3,
4,
5,
6
],
"days": [
{
"weekday": 2,
"isRestDay": false,
"items": [
{
"_id": "67f1234567890abcdef1234",
"type": "workout",
"order": 1,
"startTime": "",
"plannedDurationMinutes": 23,
"planMomentId": "67f1234567890abcdef1234"
}
]
}
]
},
"meta": {
"requestId": "4f849d7d-f4f1-45cc-b4b7-3984a3d17f83",
"rateLimit": {
"limit": 10,
"remaining": 9,
"resetSeconds": 1
},
"idempotency": {
"replayed": false
}
}
}Reorder the days inside one week of the client's own programme
Reorder the DAYS INSIDE ONE WEEK of the client’s own multi-week programme, leaving every other week untouched. A day’s whole CONTENT travels with it — its isRestDay flag and every entry in items[], workouts and activities alike — so the week’s work is rearranged, never rewritten.
weekdays[i] is the weekday whose content moves to weekday i + 1. So [7, 1, 2, 3, 4, 5, 6] rotates the week — what sat on Sunday moves to Monday and everything else shifts one day later. All seven weekdays must be listed exactly once, which keeps the request idempotent and lets one call express any rearrangement.
Stored days[] is SPARSE (a week holds an entry only for the weekdays that have been authored), so the permutation is applied as an old→new weekday remap over whatever is stored: slots with no stored day contribute nothing and no empty days are invented. The response therefore returns only the weekdays this week actually stores, in their new order.
The client counterpart of PATCH /app/v1/workout/plans/template/{planId}/weeks/{weekNumber}/days/reorder — same body, same remap rule, same response shape. It differs only in who it lets in: 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.
Independent of PATCH /app/v1/workout/plans/client/template/{templateId}/reorder-days, which permutes the plan moments’ own dayOrder; this endpoint touches only the calendar placement.
Requires the workout_client_plans:write scope. This operation maps to /app/v1/workout/plans/client/template/:templateId/weeks/:weekNumber/days/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/{weekNumber}/days/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({weekdays: [7, 1, 2, 3, 4, 5, 6]})
};
fetch('https://api.fitsociety.io/public/v1/workout/clients/{clientId}/plans/template/{templateId}/weeks/{weekNumber}/days/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/{weekNumber}/days/reorder"
payload = { "weekdays": [7, 1, 2, 3, 4, 5, 6] }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"data": {
"planId": "67f1234567890abcdef1234",
"weekNumber": 1,
"weekdays": [
7,
1,
2,
3,
4,
5,
6
],
"days": [
{
"weekday": 2,
"isRestDay": false,
"items": [
{
"_id": "67f1234567890abcdef1234",
"type": "workout",
"order": 1,
"startTime": "",
"plannedDurationMinutes": 23,
"planMomentId": "67f1234567890abcdef1234"
}
]
}
]
},
"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"
Path Parameters
The client's own assigned multi-week calendar plan.
"67f1234567890abcdef1234"
The 1-based week of the multi-week schedule to reorder.
x >= 11
Client in the company bound to the Public API token.
^[a-fA-F0-9]{24}$Body
A permutation of 1..7 — the week's weekday slots in their new order. weekdays[i] moves to weekday i + 1.
7 elements1 <= x <= 7[7, 1, 2, 3, 4, 5, 6]