Fitness Workout Tasks
Function-calling namespace: fitnessWorkoutTasks
- Base URL:
https://api.aivida.in - Engine endpoint:
POST /api - Auth: Stack token middleware enabled in
optionalmode. - Send token in header:
x-stack-access-token: <access_token>(orAuthorization: Bearer <access_token>). - In
optionalmode: no token is allowed; invalid token is rejected with401.
Task Workflow (Member Side)
listMyTasksto get assigned day tasks.startMyTaskwhen user begins a day.markStepStatusper checklist step (stepIndex) for each task exercise.skipExercisewhen user skips an exercise (with reason).completeMyTaskonly after all exercises arecompletedorskipped.
Notes:
- Exercise steps are copied from the exercise database at assignment time (snapshot model).
markStepStatusrecomputes exercise status from checklist completion.completeMyTaskis rejected if any exercise remains pending/in-progress.
completeMyTask
Source: backend/endpoints/fitness-workout-tasks/complete-my-task
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
taskId | string | Yes | - |
actorStackUserId | string | No | - |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "fitnessWorkoutTasks",
"apiName": "completeMyTask",
"data": {
"organizationId": "org_123",
"taskId": "task_123"
}
}'Example Response
{ "status": "ok", "data": {} }getMyTaskDetail
Source: backend/endpoints/fitness-workout-tasks/get-my-task-detail
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
taskId | string | Yes | - |
actorStackUserId | string | No | - |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "fitnessWorkoutTasks",
"apiName": "getMyTaskDetail",
"data": {
"organizationId": "org_123",
"taskId": "task_123"
}
}'Example Response
{ "status": "ok", "data": {} }listMyHistory
Source: backend/endpoints/fitness-workout-tasks/list-my-history
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
status | string | No | - |
month | string | No | - |
page | integer | No | - |
pageSize | integer | No | - |
actorStackUserId | string | No | - |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "fitnessWorkoutTasks",
"apiName": "listMyHistory",
"data": {
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }listMyTasks
Source: backend/endpoints/fitness-workout-tasks/list-my-tasks
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
fromDate | string | No | format: YYYY-MM-DD |
toDate | string | No | format: YYYY-MM-DD |
status | string | No | - |
page | integer | No | - |
pageSize | integer | No | - |
actorStackUserId | string | No | - |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "fitnessWorkoutTasks",
"apiName": "listMyTasks",
"data": {
"organizationId": "org_123"
}
}'Example Response
{ "status": "ok", "data": {} }markStepStatus
Source: backend/endpoints/fitness-workout-tasks/mark-step-status
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
taskId | string | Yes | - |
taskExerciseId | string | Yes | - |
stepIndex | integer | Yes | min: 1 |
completed | boolean | No | - |
actualDurationSec | integer | No | nullable |
actualRestSec | integer | No | nullable |
actorStackUserId | string | No | - |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "fitnessWorkoutTasks",
"apiName": "markStepStatus",
"data": {
"organizationId": "org_123",
"taskId": "task_123",
"taskExerciseId": "taskexercise_123",
"stepIndex": 1
}
}'Example Response
{ "status": "ok", "data": {} }skipExercise
Source: backend/endpoints/fitness-workout-tasks/skip-exercise
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
taskId | string | Yes | - |
taskExerciseId | string | Yes | - |
reasonCode | string | Yes | - |
reasonText | string | No | - |
actorStackUserId | string | No | - |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "fitnessWorkoutTasks",
"apiName": "skipExercise",
"data": {
"organizationId": "org_123",
"taskId": "task_123",
"taskExerciseId": "taskexercise_123",
"reasonCode": "value"
}
}'Example Response
{ "status": "ok", "data": {} }startMyTask
Source: backend/endpoints/fitness-workout-tasks/start-my-task
Input Fields
| Field | Type | Required | Constraints |
|---|---|---|---|
organizationId | string | Yes | - |
taskId | string | Yes | - |
actorStackUserId | string | No | - |
Example Request
curl -X POST https://api.aivida.in/api \
-H "Content-Type: application/json" \
-H "x-stack-access-token: <access_token_optional>" \
-d '{
"namespace": "fitnessWorkoutTasks",
"apiName": "startMyTask",
"data": {
"organizationId": "org_123",
"taskId": "task_123"
}
}'Example Response
{ "status": "ok", "data": {} }