cURL
curl --request POST \ --url https://api.example.com/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/discard
Discard unpublished changes and revert to the last published version
{ "id": "cont123", "typeId": "ct123", "typeVersion": 2, "version": 2, "lastPublishedVersion": 2, "packageVersion": "1.0.0", "name": "Getting Started Guide", "status": "published", "isTemplate": false, "content": { ... }, "compiled": "const body = () => { ... }", "tags": ["Tutorial"], "metadata": { ... }, "createdAt": "2024-03-20T10:00:00Z", "updatedAt": "2024-03-22T10:00:00Z" }
draft
modified
lastPublishedVersion
{ "error": { "code": "INVALID_STATUS", "message": "Can only discard changes for draft or modified content" } }
{ "error": { "code": "NO_PUBLISHED_VERSION", "message": "Cannot discard - content has never been published" } }
unpublished
published
curl -X POST "https://api.metabind.ai/v1/organizations/org123/projects/proj456/content/cont123/discard" \ -H "Authorization: Bearer YOUR_API_KEY"