Generate draft outcomes
Generate draft outcomes
Required scopes: interview_plans:write
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.
Seeding from a Source Job. Pass source_job_id (a Job in the same organization, as its job_<base32> display id or its raw UUID) to seed the draft's role_context from the Job (title, description, group_id/department_label, location, location_type). Caller-provided role_context keys override the seeded values per-field; overriding the department emits a non-blocking department_mismatch warning in the response warnings array. Jobs outside the caller organization, and Jobs in a department the caller cannot read, return 404 Source Job not found. source_job_id cannot be combined with resource.id (returns 400) and is only accepted on generate_outcomes; later stages return 400.
Naming the plan. role_context.title sets the plan title recruiters see in the app, and this is the only place a caller can set it — no later stage action, and no publish or modify_active input, accepts a title. Omit it and the plan falls back to a title derived from the role. It is distinct from role_context.role_title, which describes the role being hired for and feeds generation.
Example (seed-only):
curl -X POST https://api.yardstick.team/v1/interview_plan_drafts/actions/generate_outcomes \\
-H 'Authorization: Bearer ys_sk_live_…' \\
-H 'Content-Type: application/json' \\
-H 'Idempotency-Key: $(uuidgen)' \\
-d '{"action":"interview_plan.generate_outcomes","input":{"source_job_id":"00000000-0000-0000-0000-000000000123","role_context":{}}}'
Example (seed + override):
curl -X POST https://api.yardstick.team/v1/interview_plan_drafts/actions/generate_outcomes \\
-H 'Authorization: Bearer ys_sk_live_…' \\
-H 'Content-Type: application/json' \\
-H 'Idempotency-Key: $(uuidgen)' \\
-d '{"action":"interview_plan.generate_outcomes","input":{"source_job_id":"00000000-0000-0000-0000-000000000123","role_context":{"location":"Remote"}}}'
Example (curl):
curl -X POST https://api.yardstick.team/v1/interview_plan_drafts/actions/generate_outcomes \
-H 'Authorization: Bearer ys_sk_live_…' \
-H 'Content-Type: application/json' \
-H 'Idempotency-Key: 7c3a…' \
-d '{"action":"interview_plan.generate_outcomes","input":{"role_context":{"role_title":"Account Executive","title":"Account Executive — Enterprise"}}}'
Example (TypeScript):
await fetch("https://api.yardstick.team/v1/interview_plan_drafts/actions/generate_outcomes", {
method: "POST",
headers: {
Authorization: `Bearer ${process.env.YS_API_KEY}`,
"Content-Type": "application/json",
"Idempotency-Key": crypto.randomUUID(),
},
body: JSON.stringify({
action: "interview_plan.generate_outcomes",
input: {
role_context: {
role_title: "Account Executive",
title: "Account Executive — Enterprise",
},
},
}),
});
Request
- Base URL: https://api.yardstick.team
- URL: https://api.yardstick.team/v1/interview_plan_drafts/actions/generate_outcomes
- Auth: HTTP bearer
Headers
Supported for safe retry. Reuse the same key to receive the cached response without repeating the operation.
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
Response
Success
Changes
No recorded changes to this operation across all 2 revisions of this API.