Whether a draft can be requested for this case, and the current or latest relevant one
const url = 'https://beta-api.plune.ai/v1/test-cases/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/draft';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://beta-api.plune.ai/v1/test-cases/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/draft \ --header 'Authorization: Bearer <token>'The read behind the “Draft from code” action (SCR-01) and behind SCR-02 re-reading the record after a member leaves and returns (AC-19). available is false with a reason when AI is off or no provider is connected (AC-07), the case has no code snapshot yet, or it is a manual/eval case (AC-08); platform_not_configured is the separate, operator-only condition of SAD §7/§11. pending is the newest call for this case in ANY state, or null — independent of available/reason (review F7/F8): AI being off, unreachable, or misconfigured never hides a call still waiting on a decision. For a pending call requested by somebody else, every content and cost field is withheld and mine is false (AC-19); a reader may still call this to see whether a draft exists, but never requests one (AC-06). Called by a session or a bearer token alike — reading is not restricted to a human session.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”Responses
Section titled “ Responses ”Availability, and the current or latest relevant call if there is one
The answer to “should the draft action show, and is anything already pending” (sad.md §6 Flow 3).
object
Present exactly when available is false.
Present exactly when available is true.
Present exactly when available is true.
The newest call for this case, in any state, or null — independent of available/reason (review F7/F8): AI being off or unreachable never hides a call still waiting on a decision.
object
Whether the caller is the member who requested this call.
userId of the member who asked — resolve through GET /v1/members like TestCaseMeta.createdBy.
The drafted description, present while there is one to show (mine, and state carries text).
«Чого чернетка не бачила» — fixtures, hooks, helpers (AC-14). Never a field of the case.
Whether the case’s code snapshot changed, beyond whitespace, since this call was requested (AC-04b).
The average price per token of this call (costUsd ÷ tokens) — input and output tokens are priced apart. null means “ціна невідома” (the model has no price) or that the provider reported no tokens to price; never 0 (SAD §8 rule 6, AC-15).
null exactly when unitPriceUsd is null.
Present exactly when state is failed.
Examples
AC-01 — AI on, automated case with a snapshot, nothing pending
{ "available": true, "provider": "anthropic", "model": "claude-sonnet-5", "pending": null}AC-19 — my own draft is waiting for a decision
{ "available": true, "provider": "anthropic", "model": "claude-sonnet-5", "pending": { "id": "6f1c2b3a-0000-4000-8000-0000000000c1", "state": "awaiting_decision", "mine": true, "requestedBy": "u-member1", "requestedAt": "2026-09-16T09:12:04.151Z", "description": "Opens the checkout page with an empty cart and asserts the empty-state message.", "precondition": "A logged-in user with an empty cart.", "unseenNote": "Does not see the `beforeEach` hook, which navigates to /checkout and logs the user in.", "codeChangedSinceRequest": false, "inputTokens": 812, "outputTokens": 96, "unitPriceUsd": 0.0000031, "costUsd": 0.0028, "durationMs": 4210 }}AC-19 — a draft is pending, but a colleague requested it
{ "available": true, "provider": "anthropic", "model": "claude-sonnet-5", "pending": { "id": "6f1c2b3a-0000-4000-8000-0000000000c1", "state": "awaiting_decision", "mine": false, "requestedBy": "u-member2", "requestedAt": "2026-09-16T09:12:04.151Z" }}AC-07 — AI disabled or no provider connected
{ "available": false, "reason": "ai_disabled", "pending": null}AC-08 — automated case, no code snapshot yet
{ "available": false, "reason": "no_code_snapshot", "pending": null}No / invalid token or session
Not found or not yours
object
Example generated
{ "error": "example"}