Example: Unpublish and delete a book
Withdraw a title from distribution (unpublish) versus permanently removing the book record (delete).
- Unpublish (withdraw) a book —
POSTwith optional empty JSON body; 204 on success. - Delete a book —
DELETEwith optional empty JSON body; 204 on success; 402 if the book cannot be deleted in its current state.
Replace YOUR_API_KEY and the path UUID. Use staging until you are ready for production.
When to use which
- Unpublish — stop selling / withdraw from channels while keeping the record for fixes or re-publish later.
- Delete — remove the book when your workflow allows; may fail with 402 if the backend rejects deletion for the current workflow state.
See also
- Publish a book — final validation before stores; see Example: Ebook upload for the full publish step in context.
Unpublish
curl -sS -X POST "https://api.sandbox.dev.publishdrive.com/v2/distribution/books/b2c3d4e5-f6a7-8901-bcde-f12345678901/unpublish" \
-H "apikey: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'Expect 204 with an empty body.
Delete
curl -sS -X DELETE "https://api.sandbox.dev.publishdrive.com/v2/distribution/books/b2c3d4e5-f6a7-8901-bcde-f12345678901" \
-H "apikey: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'Expect 204 on success, or 402 / 404 with a Problem JSON body (see error responses on Delete a book) when applicable.
