Skip to main content
POST
/
v1
/
organizations
/
{organizationId}
/
projects
/
{projectId}
/
content
/
{id}
/
rollback
Rollback Content Version
curl --request POST \
  --url https://api.example.com/v1/organizations/{organizationId}/projects/{projectId}/content/{id}/rollback \
  --header 'Content-Type: application/json' \
  --data '{
  "version": 123
}'
Restores content to a previous version’s data. This creates a draft with the historical content, which can then be published as a new version.

Path Parameters

organizationId
string
required
Organization ID
projectId
string
required
Project ID
id
string
required
Content ID

Request Body

version
number
required
The version number to rollback to

Example Request

{
  "version": 2
}

Response

Returns the Content object with the rolled-back data in draft/modified status.
{
  "id": "cont123",
  "typeId": "ct123",
  "typeVersion": 2,
  "version": null,
  "lastPublishedVersion": 3,
  "packageVersion": "1.0.0",
  "name": "Getting Started Guide",
  "status": "modified",
  "isTemplate": false,
  "content": {
    "title": "Getting Started Guide v2",
    "components": [...]
  },
  "compiled": "const body = () => { ... }",
  "tags": ["Tutorial"],
  "metadata": {
    "author": "[email protected]",
    "rolledBackFrom": 2,
    "locale": "en-US"
  },
  "createdAt": "2024-03-20T10:00:00Z",
  "updatedAt": "2024-03-23T10:00:00Z"
}
Rollback creates a draft with the historical content. You must publish to make the rollback live. This preserves the complete version history.

Error Responses

Version Not Found

{
  "error": {
    "code": "VERSION_NOT_FOUND",
    "message": "Version 5 not found for content cont123"
  }
}

ContentType Version Unavailable

If the historical version used a ContentType version that has been removed:
{
  "error": {
    "code": "TYPE_VERSION_NOT_FOUND",
    "message": "ContentType version 1 referenced by version 2 is no longer available"
  }
}

Code Examples

curl -X POST "https://api.metabind.ai/v1/organizations/org123/projects/proj456/content/cont123/rollback" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "version": 2
  }'