{"uid":"cap_KkwLCkp7s5z_rLDnDXhHN","slug":"scheduler-withzero-xyz-soft-delete-task-and-close-payment-channel-d7dc5747","name":"Soft-Delete Task and Close Payment Channel","description":"Stop a task. Direct rail closes the payment channel and refunds remaining escrow. ZeroClick rail releases pending reservations and reports no refund because buyer billing is held by the marketplace. 📖 Full guide: https://scheduler.withzero.xyz/llms.txt","url":"https://scheduler.withzero.xyz/api/v1/tasks/{id}","method":"DELETE","headers":{},"bodySchema":{"type":"object"},"responseSchema":{"type":"object","$schema":"https://json-schema.org/draft/2020-12/schema","required":["id","status","billing_rail","channel_close_tx","seller_claimed_micros","buyer_refunded_micros"],"properties":{"id":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},"status":{"type":"string"},"billing_rail":{"enum":["direct","zeroclick","account"],"type":"string"},"channel_close_tx":{"anyOf":[{"type":"string"},{"type":"null"}]},"buyer_refunded_micros":{"type":"string"},"seller_claimed_micros":{"type":"string"}},"additionalProperties":false},"example":null,"exampleRequest":null,"tags":[],"displayCostAmount":"0","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"proven_free","priceSource":"registry","requiresHandshake":false,"reviewCount":1,"rating":{"score":"1.00","successRate":"0.98","reviews":1,"stars":"5.0","state":"rated"},"availabilityStatus":"healthy","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"metered","summary":"metered — billed by usage","primary":{"kind":"metered","protocol":"mpp","network":"tempo","amountUsd":null,"per":"call","confidence":"unknown"},"accepted":[{"kind":"metered","protocol":"mpp","network":"tempo","amountUsd":null,"per":"call","confidence":"unknown"}]},"paymentMethods":[{"uid":"pm_f0XddKR_itMbV6nl_V92J","protocol":"mpp","methodType":"crypto","chain":"tempo","mode":"charge","costAmount":"0","costPer":"request","priority":0,"asset":"0x20C000000000000000000000b9537d11c60E8b50","unit":"request","depositMicros":null,"planRef":"scheduler.tasks.delete:1"}],"brandName":"scheduler.withzero.xyz","brandSlug":"scheduler-withzero-xyz-mpp","brandBaseUrl":"https://scheduler.withzero.xyz","brandDocsUrl":null,"whatItDoes":"Soft-deletes a scheduled cron task, closes its associated payment channel, and refunds any remaining balance to the buyer.","exampleAgentPrompt":"Cancel my scheduled cron task with ID 3f2a1b4c-5d6e-7f8a-9b0c-1d2e3f4a5b6c on the zero scheduler and close the payment channel so I get my unspent USDC refunded.","exampleUseCases":null,"resultDescription":"Returns a JSON object with the task UUID, updated status, the on-chain channel close transaction hash (or null), the amount in micros claimed by the seller, and the amount in micros refunded to the buyer.","failureModes":["Task not found — 404 if the provided UUID does not exist","Unauthorized — 403 if the caller cannot prove ownership of the task","Task already deleted — 409 or similar if the task is already in a soft-deleted state","Invalid UUID format — 400 if the path parameter is not a valid UUID","Payment channel close failure — channel_close_tx may be null if on-chain settlement fails"],"whenToPreferThis":"Use this endpoint when you need to permanently cancel a recurring cron task and recover any remaining funds from the payment channel. Choose this over pause/resume when you have no intention of restarting the task and want finality with a refund.","instructions":"# Delete Task — stop + refund\n\n## Workflow\n- Terminal node of the task lifecycle (created via POST /api/v1/tasks).\n\n## Contract\n- Soft-deletes the task, closes the payment channel, and refunds the unused deposit on-chain. The ONLY way to reclaim funds.\n- To stop runs WITHOUT refunding (keep the task for later), use POST /api/v1/tasks/{id}/pause instead.","reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":222,"lastUsedAt":"2026-09-04T21:34:44.262Z","lastSuccessfullyRanAt":"2026-09-04T21:34:44.262Z","lastHealthCheckAt":"2026-09-10T17:35:03.316Z","isFirstParty":true}