// Create a task
const task = await verial.tasks.create({
benchmarkId: "bench_abc123",
name: "Submit Prior Auth for MRI",
taskItem: {
instruction: "Submit a prior authorization for an MRI of the lumbar spine",
},
tags: ["prior-auth", "imaging"],
});
// Attach criteria (see Criteria resource)
await verial.criteria.create({
taskId: task.id,
label: "Prior auth submitted",
weight: 1.0,
assertion: {
assert: "portal-state-match",
correlate_by: { resource: "prior_auth_requests", key: "request_id" },
assertions: [{ path: "status", expected: "submitted" }],
},
});
// List tasks for a benchmark
const tasks = await verial.tasks.list({ benchmarkId: "bench_abc123" });
// Get a specific task with its criteria
const details = await verial.tasks.get({ id: task.id });