Skip to main content
POST
/
v1
/
organizations
/
{organizationId}
/
projects
/
{projectId}
/
content-types
/
{id}
/
rollback
Rollback Content Type Version
curl --request POST \
  --url https://api.example.com/v1/organizations/{organizationId}/projects/{projectId}/content-types/{id}/rollback \
  --header 'Content-Type: application/json' \
  --data '{
  "version": 123
}'
Restores a content type to a previous version’s configuration. This creates a new version with the historical configuration, rather than overwriting history.

Path Parameters

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

Request Body

version
number
required
The version number to rollback to

Example Request

{
  "version": 2
}

Response

Returns the updated ContentType object with a new version number containing the rolled-back configuration.
{
  "id": "ct123",
  "name": "Article",
  "status": "published",
  "version": 4,
  "lastPublishedVersion": 4,
  "layoutComponentId": "c123",
  "componentIdsAllowList": ["c124", "c125", "c126"],
  "packageVersion": "1.0.0",
  "schema": { ... },
  "templateContentIds": ["cont123"],
  "permissions": { ... },
  "metadata": {
    "author": "[email protected]",
    "tags": ["article"],
    "publishedAt": "2024-03-23T10:00:00Z",
    "publishedBy": "user123"
  },
  "createdAt": "2024-03-20T10:00:00Z",
  "updatedAt": "2024-03-23T10:00:00Z"
}
Rollback creates a new version (e.g., rolling back from v3 to v2 creates v4 with v2’s configuration). This preserves the complete version history.

Error Responses

Version Not Found

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

Invalid Package Version

If the historical version references a package version that is no longer available:
{
  "error": {
    "code": "PACKAGE_NOT_FOUND",
    "message": "Package version 0.9.0 referenced by version 2 is no longer available"
  }
}

Code Examples

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