Skip to main content
POST
/
app
/
v1
/
organizations
/
{organizationId}
/
projects
/
{projectId}
/
components
/
{id}
/
rollback
/
{version}
Rollback Component
curl --request POST \
  --url https://api.example.com/app/v1/organizations/{organizationId}/projects/{projectId}/components/{id}/rollback/{version}

Path Parameters

organizationId
string
required
Organization ID
projectId
string
required
Project ID
id
string
required
Component ID
version
number
required
Target version number to rollback to

Request Body

No request body required.

Behavior

Rollback creates a new working copy using the content from the specified version:
  1. The original version remains unchanged
  2. All package references are preserved
  3. The component status becomes modified
  4. The working copy will receive a new version number when published in a package
Rollback does not modify or delete any existing versions. It creates a working copy based on historical content that can be published as a new version.

Response

Returns the Component object with modified status.
{
  "id": "c123",
  "name": "ProductCard",
  "status": "modified",
  "version": null,
  "lastPublishedVersion": 3,
  "content": "// Content from version 2\nconst metadata = () => ({...});",
  "compiled": "...",
  "schema": {...},
  "metadata": {
    "rolledBackFrom": 2,
    "rolledBackAt": "2024-03-22T10:00:00Z",
    "rolledBackBy": "user123"
  },
  "createdAt": "2024-03-20T10:00:00Z",
  "updatedAt": "2024-03-22T10:00:00Z"
}

Error Responses

Version Not Found

{
  "error": {
    "code": "NOT_FOUND",
    "message": "Component version 5 was not found"
  }
}

Component Not Found

{
  "error": {
    "code": "NOT_FOUND",
    "message": "Component not found"
  }
}

Code Examples

curl -X POST "https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/components/c123/rollback/2" \
  -H "Authorization: Bearer YOUR_JWT"