POST /api/pro/work/:id/validate

Checks the document against its schema, whether it answers its order, and the review rules, and answers every finding with where it is. Changes nothing.

Surface: professional. Who may call: professional. Key: professional.work.part.validate.

Example request

curl -X POST https://caremcp.com/api/pro/work/7d1f0a0e-2c4b-4c7e-9a6e-000000000001/validate \
  -H "Authorization: Bearer <session or access token>" \
  -H "Content-Type: application/json" \
  -d '{"profession":"plan","document":{"goalEvaluation":"Realistic: most people add a set or a few kilos a week at the start.","fitnessAim":"Two dumbbell sessions a week at home, built so the wrist stays neutral under load.","weeks":[{"focus":"Steady weeks: learn the movements and the meals.","workouts":[{"title":"Full body","focus":"The goblet squat, steady and deep enough.","phases":[{"name":"Main","exercises":[{"exercise":"dumbbell-goblet-squat","comment":"3 x 10, two reps left, 90 s rest."}]}]}]},{"focus":"Steady weeks: learn the movements and the meals.","workouts":[{"title":"Full body","focus":"The goblet squat, steady and deep enough.","phases":[{"name":"Main","exercises":[{"exercise":"dumbbell-goblet-squat","comment":"3 x 10, two reps left, 90 s rest."}]}]}]},{"focus":"Steady weeks: learn the movements and the meals.","workouts":[{"title":"Full body","focus":"The goblet squat, steady and deep enough.","phases":[{"name":"Main","exercises":[{"exercise":"dumbbell-goblet-squat","comment":"3 x 10, two reps left, 90 s rest."}]}]}]},{"focus":"Steady weeks: learn the movements and the meals.","workouts":[{"title":"Full body","focus":"The goblet squat, steady and deep enough.","phases":[{"name":"Main","exercises":[{"exercise":"dumbbell-goblet-squat","comment":"3 x 10, two reps left, 90 s rest."}]}]}]},{"focus":"Steady weeks: learn the movements and the meals.","workouts":[{"title":"Full body","focus":"The goblet squat, steady and deep enough.","phases":[{"name":"Main","exercises":[{"exercise":"dumbbell-goblet-squat","comment":"3 x 10, two reps left, 90 s rest."}]}]}]},{"focus":"Steady weeks: learn the movements and the meals.","workouts":[{"title":"Full body","focus":"The goblet squat, steady and deep enough.","phases":[{"name":"Main","exercises":[{"exercise":"dumbbell-goblet-squat","comment":"3 x 10, two reps left, 90 s rest."}]}]}]},{"focus":"Steady weeks: learn the movements and the meals.","workouts":[{"title":"Full body","focus":"The goblet squat, steady and deep enough.","phases":[{"name":"Main","exercises":[{"exercise":"dumbbell-goblet-squat","comment":"3 x 10, two reps left, 90 s rest."}]}]}]},{"focus":"Steady weeks: learn the movements and the meals.","workouts":[{"title":"Full body","focus":"The goblet squat, steady and deep enough.","phases":[{"name":"Main","exercises":[{"exercise":"dumbbell-goblet-squat","comment":"3 x 10, two reps left, 90 s rest."}]}]}]}],"howToProgress":"When every set reaches 10 with two reps left, add two kilos next time.","whenLifeHappens":"A missed session: do it next time; the order waits.","painRules":"An ache up to 3 of 10 is fine if it settles within a day; sharp pain, stop and see someone.","referral":"None."}}'

Example input

{
  "id": "7d1f0a0e-2c4b-4c7e-9a6e-000000000001",
  "profession": "plan",
  "document": {
    "goalEvaluation": "Realistic: most people add a set or a few kilos a week at the start.",
    "fitnessAim": "Two dumbbell sessions a week at home, built so the wrist stays neutral under load.",
    "weeks": [
      {
        "focus": "Steady weeks: learn the movements and the meals.",
        "workouts": [
          {
            "title": "Full body",
            "focus": "The goblet squat, steady and deep enough.",
            "phases": [
              {
                "name": "Main",
                "exercises": [
                  {
                    "exercise": "dumbbell-goblet-squat",
                    "comment": "3 x 10, two reps left, 90 s rest."
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "focus": "Steady weeks: learn the movements and the meals.",
        "workouts": [
          {
            "title": "Full body",
            "focus": "The goblet squat, steady and deep enough.",
            "phases": [
              {
                "name": "Main",
                "exercises": [
                  {
                    "exercise": "dumbbell-goblet-squat",
                    "comment": "3 x 10, two reps left, 90 s rest."
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "focus": "Steady weeks: learn the movements and the meals.",
        "workouts": [
          {
            "title": "Full body",
            "focus": "The goblet squat, steady and deep enough.",
            "phases": [
              {
                "name": "Main",
                "exercises": [
                  {
                    "exercise": "dumbbell-goblet-squat",
                    "comment": "3 x 10, two reps left, 90 s rest."
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "focus": "Steady weeks: learn the movements and the meals.",
        "workouts": [
          {
            "title": "Full body",
            "focus": "The goblet squat, steady and deep enough.",
            "phases": [
              {
                "name": "Main",
                "exercises": [
                  {
                    "exercise": "dumbbell-goblet-squat",
                    "comment": "3 x 10, two reps left, 90 s rest."
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "focus": "Steady weeks: learn the movements and the meals.",
        "workouts": [
          {
            "title": "Full body",
            "focus": "The goblet squat, steady and deep enough.",
            "phases": [
              {
                "name": "Main",
                "exercises": [
                  {
                    "exercise": "dumbbell-goblet-squat",
                    "comment": "3 x 10, two reps left, 90 s rest."
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "focus": "Steady weeks: learn the movements and the meals.",
        "workouts": [
          {
            "title": "Full body",
            "focus": "The goblet squat, steady and deep enough.",
            "phases": [
              {
                "name": "Main",
                "exercises": [
                  {
                    "exercise": "dumbbell-goblet-squat",
                    "comment": "3 x 10, two reps left, 90 s rest."
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "focus": "Steady weeks: learn the movements and the meals.",
        "workouts": [
          {
            "title": "Full body",
            "focus": "The goblet squat, steady and deep enough.",
            "phases": [
              {
                "name": "Main",
                "exercises": [
                  {
                    "exercise": "dumbbell-goblet-squat",
                    "comment": "3 x 10, two reps left, 90 s rest."
                  }
                ]
              }
            ]
          }
        ]
      },
      {
        "focus": "Steady weeks: learn the movements and the meals.",
        "workouts": [
          {
            "title": "Full body",
            "focus": "The goblet squat, steady and deep enough.",
            "phases": [
              {
                "name": "Main",
                "exercises": [
                  {
                    "exercise": "dumbbell-goblet-squat",
                    "comment": "3 x 10, two reps left, 90 s rest."
                  }
                ]
              }
            ]
          }
        ]
      }
    ],
    "howToProgress": "When every set reaches 10 with two reps left, add two kilos next time.",
    "whenLifeHappens": "A missed session: do it next time; the order waits.",
    "painRules": "An ache up to 3 of 10 is fine if it settles within a day; sharp pain, stop and see someone.",
    "referral": "None."
  }
}

Input schema

{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "type": "object",
 "properties": {
  "id": {
   "type": "string",
   "format": "uuid",
   "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
  },
  "profession": {
   "type": "string",
   "minLength": 1,
   "description": "Which part: \"plan\", the one part for the whole order."
  },
  "document": {
   "type": "object",
   "propertyNames": {
    "$ref": "#/$defs/__schema0"
   },
   "additionalProperties": {
    "$ref": "#/$defs/__schema1"
   },
   "description": "The document under the schema work_draft_get gives: a plan, an evaluation or a plan review."
  }
 },
 "required": [
  "id",
  "profession",
  "document"
 ],
 "$defs": {
  "__schema0": {
   "type": "string"
  },
  "__schema1": {}
 }
}

Output schema

{
 "$schema": "https://json-schema.org/draft/2020-12/schema",
 "type": "object",
 "properties": {
  "ok": {
   "type": "boolean"
  },
  "issues": {
   "type": "array",
   "items": {
    "type": "object",
    "properties": {
     "path": {
      "type": "string"
     },
     "message": {
      "type": "string"
     }
    },
    "required": [
     "path",
     "message"
    ],
    "additionalProperties": false
   }
  }
 },
 "required": [
  "ok",
  "issues"
 ],
 "additionalProperties": false
}