← All primitives

Stack

selected P0 /v1/stacks

Why it matters: Keeps execution frames, undo records, and backtracking state without treating them as leased jobs.

Durable, account-scoped LIFO collection with atomic push, pop, and peek operations.

API endpoints

MethodPathDescription
POST/v1/stacksCreate a stack
POST/v1/stacks/:id/itemsPush an item
POST/v1/stacks/:id/popAtomically pop the newest item
GET/v1/stacks/:id/peekRead the newest item without removing it

Examples

Push a backtracking frame

curl -X POST https://cloudharness.ai/v1/stacks/STACK_ID/items \\n  -H "Authorization: Bearer ***" \\n  -H "Content-Type: application/json" \\n  -d '{"value":{"step":"research","attempt":2}}'