delete_goal
Remove obsolete API-created goals to prevent duplicates on the learner dashboard. Use after regenerating a goal following a skill assessment retake.
Instructions
Delete a goal created via the API.
Use this when regenerating a goal after a learner retakes a skill assessment: call create_goal with the new suggested_goal_seed, then call delete_goal on the obsolete goal so the learner's dashboard shows the current goal instead of duplicates.
Soft delete by default (status='deleted'); the dashboard already filters these out, but a superadmin can restore them. Set hard_delete=true to permanently remove the row and cascade to steps, plans, and share links.
Scoped to api-created goals in your org -- you cannot delete goals a user created in the webapp UI. Calling twice with the same goal_id is safe (soft delete is idempotent).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| goal_id | Yes | The UUID of the goal to delete (the goalId returned by create_goal) | |
| hard_delete | No | If true, permanently delete the row instead of soft-deleting. Default false. |