Interview Plan Builder

Clear every draft competency

Clear every draft competency

Required scopes: interview_plans:write

Empties the competencies stage. Prune-and-report. Every cleared competency's behavioral-anchor entry is pruned in the same atomic write: the response reports pruned_behavioral_anchor_ids and the questions_and_directions stage version bumps alongside competencies. A follow-up anchor edit carrying the pre-prune questions_and_directions version returns 409 stale_source_stage.

Clearing is explicit, and it is the only way to empty a stage. Where a stage has an item-level delete_* action it refuses to remove the last item, and outcomes have no item-level delete at all, so an empty stage can only be reached through this verb. The stage is written as an empty list, its version bumps, and source_metadata.<stage>.cleared_version records the version at which it was cleared — so the emptied section still reads as addressed, not never filled in.

A cleared draft cannot be published as a new plan. Draft validation still requires items in every stage, so a draft with a cleared section will not reach validated. That is the intended shape of the verb, not a gap: the onward action is POST /v1/interview_plans/actions/modify_active, which binds the emptying onto an already-live plan.

No confirmation field. Clearing takes no acknowledgement flag. Nothing is lost at this point — the draft is a working copy, and the emptying only reaches candidates when a caller previews and binds it onto the live plan.

Verbatim edit. The draft stores exactly what you send — no AI generation, no rewriting; the same request always produces the same stored content. The response echoes the stored stage content plus the full stage_versions map.

Fetch-modify-submit with source_stage. Read the draft with GET /v1/interview_plan_drafts/{draft_id}, take the edited stage's version from stage_versions, and pass it as source_stage: {stage, version}. If the stage changed since your read, the edit returns 409 stale_source_stage instead of overwriting it. Editing a stage whose prerequisite checkpoint is missing returns 409 stage_prerequisite_missing.

Atomic write. Every mutated stage's version bumps in one write, and a validated draft rolls back to draft so validation reflects the new content.

Writes return data.audit with audit/event ids. Successful write events and audit rows include the resource type, public draft id, action key, request context, livemode partition, and a redacted payload summary. Use Idempotency-Key on retries; replayed requests return the cached response and do not duplicate draft checkpoints, audit rows, or events.

Example (curl):

curl -X POST https://api.yardstick.team/v1/interview_plan_drafts/actions/clear_competencies \
  -H 'Authorization: Bearer ys_sk_live_…' \
  -H 'Content-Type: application/json' \
  -d '{"action":"interview_plan.clear_competencies","resource":{"type":"interview_plan_draft","id":"ipd_…"},"input":{"source_stage":{"stage":"competencies","version":2}}}'

Example (TypeScript):

await fetch("https://api.yardstick.team/v1/interview_plan_drafts/actions/clear_competencies", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.YS_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
  "action": "interview_plan.clear_competencies",
  "resource": {
    "type": "interview_plan_draft",
    "id": "ipd_…"
  },
  "input": {
    "source_stage": {
      "stage": "competencies",
      "version": 2
    }
  }
}),
});
post/v1/interview_plan_drafts/actions/clear_competencies

Request

  • Base URL: https://api.yardstick.team
  • URL: https://api.yardstick.team/v1/interview_plan_drafts/actions/clear_competencies
  • Auth: HTTP bearer

Headers

Idempotency-Keystring

Supported for safe retry. Reuse the same key to receive the cached response without repeating the operation.

X-Request-Idstring

Optional caller-supplied request identifier. Values must match ^[A-Za-z0-9_-]{1,128}$; a valid value is echoed in the response X-Request-Id header, otherwise the API generates one.

Request body

action'interview_plan.clear_competencies' required

Response

Success

action'interview_plan.generate_outcomes' | 'interview_plan.confirm_outcomes' | 'interview_plan.generate_competencies' | 'interview_plan.generate_skills' | 'interview_plan.generate_rounds' | 'interview_plan.add_rounds' | 'interview_plan.update_rounds' | 'interview_plan.delete_rounds' | 'interview_plan.generate_anchors' | 'interview_plan.generate_questions_directions' | 'interview_plan.add_competencies' | 'interview_plan.update_competencies' | 'interview_plan.delete_competencies' | 'interview_plan.add_skills' | 'interview_plan.update_skills' | 'interview_plan.delete_skills' | 'interview_plan.clear_outcomes' | 'interview_plan.clear_competencies' | 'interview_plan.clear_job_skills' | 'interview_plan.clear_interview_sequence' | 'interview_plan.validate_draft' | 'interview_plan.publish' | 'interview_plan.modify_active' | 'interview_plan.add_questions' | 'interview_plan.update_questions' | 'interview_plan.delete_questions' | 'interview_plan.update_round_directions' | 'interview_plan.update_anchors' | 'interview_plan.delete_anchors' required
execution_mode'draft_write' | 'interactive_gate' | 'validate_only' | 'approval_required' | 'blocked_until_verified' required
stagestring required
next_actionsstring[] required
web_urlstring nullable required
request_idstring required

Changes

No recorded changes to this operation across all 1 revision of this API.