> ## Documentation Index
> Fetch the complete documentation index at: https://docs.metabind.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Restore Component

> Bring back a deleted component

Deleting a component only sets its status to `deleted`; its versions and assets stay. Restoring sets the status back: `modified` if the component was ever published (its published versions are still there, and the next package publishes a new version), otherwise `draft`. Requires the `components.delete` permission.

## Path Parameters

**organizationId** `string` *required*

Organization ID

**projectId** `string` *required*

Project ID

**id** `string` *required*

Component ID

## Request Body

Both fields are optional; an empty body restores the component under its own name.

**name** `string`

Restore under this name instead. Needed when another component has taken the deleted component's name since it was deleted.

**expectedUpdatedAt** `string`

The deleted component's `updatedAt` as you last read it. If it has changed since, the restore fails with `CONFLICT`.

```json theme={null}
{
  "name": "ProductCard (restored)"
}
```

## Response

```json theme={null}
{
  "data": {
    "id": "c123",
    "name": "ProductCard",
    "status": "modified",
    "version": null,
    "lastPublishedVersion": 3,
    "updatedAt": "2026-11-18T10:00:00Z"
  },
  "restored": true,
  "message": "Component restored as modified"
}
```

A component that is not deleted is returned unchanged with `"restored": false`.

## Error Responses

### Name Taken (409)

```json theme={null}
{
  "error": {
    "code": "COMPONENT_NAME_EXISTS",
    "message": "Component with name 'ProductCard' already exists in this project. Restore it under another name.",
    "details": { "name": "ProductCard" }
  }
}
```

### Changed Since Read (409)

```json theme={null}
{
  "error": {
    "code": "CONFLICT",
    "message": "Component c123 was modified by another request. Re-read it and reapply the change."
  }
}
```

### Not Found (404)

```json theme={null}
{
  "error": {
    "code": "NOT_FOUND",
    "message": "Component c123"
  }
}
```

## Code Examples

```bash cURL theme={null}
curl -X POST "https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/components/c123/restore" \
  -H "Authorization: Bearer YOUR_JWT" \
  -H "Content-Type: application/json" \
  -d '{}'
```

```javascript JavaScript theme={null}
const response = await fetch(
  'https://api.metabind.ai/app/v1/organizations/org123/projects/proj456/components/c123/restore',
  {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_JWT',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({})
  }
);

const { data, restored } = await response.json();
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.