# restore

URL: /business/nouns/thing/restore · Id: `verb:Thing.restore` · Call: `await $.Thing.restore({ … })` (SDK) or the `do` tool at `https://api.sb/mcp`. Inputs says what to pass, Outputs what returns, When it waits who approves.

> Restore brings back a deleted Thing, or one an undone Action removed, with its history and Relationships intact.

Restore brings back a deleted [Thing](/business/nouns/thing), or one an undone [Action](/business/nouns/action) removed, with its history and [Relationships](/business/nouns/relationship) intact.

## Inputs
| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `thing` | [Thing](/business/nouns/thing) | Yes | The deleted Thing. |

## Outputs
| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `thing` | [Thing](/business/nouns/thing) | Yes | The Thing, back in every list and query it left. |

## Effects
| Fact | Value |
| --- | --- |
| Action class | None: it runs within its seat's Limits |
| Door | Two-way: it runs at once |
| Modes | `try` previews it and stores nothing; `send` returns a pending Action; `do` (default) waits for the result |
| Idempotent | With a key: a repeat with the same `Idempotency-Key` returns the first Action, and a repeat without one runs again |
| Undo | [Action.undo](/business/nouns/action/undo) reverses it |
| Emits | [`Thing.restored`](/business/events/Thing.restored) |

- Refuses when the Thing is not deleted.
- Nothing is ever purged, so every deleted Thing can be restored.

## Refuses when
| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
| The Thing is not deleted | [`refused`](/code/api/errors/refused) | Clear what the check names, then call it again. | None. |

## When it waits
| Gate | Default |
| --- | --- |
| Decision class | Low: two-way, nothing at stake |
| [Delay window](/systems/trust-and-governance/controls/one-way-windows) | None: it runs once review passes. |
| Limit | The call [Limit](/business/nouns/limit) of the [Permission](/business/nouns/permission) it runs under. |
| Over the Limit | It waits `pending` for an [Approval](/business/nouns/approval) from the [Founder](/agents/founding/founder). Approved, it runs; refused, it ends `refused` with [`limit-exceeded`](/code/api/errors/limit-exceeded); unanswered by its deadline, it ends `canceled`. |

## Example

**Ask**

```text
Restore the latest thing.
```

**API**

```bash
curl -X POST https://api.sb/leaseline.app/things/thing_8ds0r9vvRl/restore \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
```

```json
{
  "api": "https://api.sb/leaseline.app",
  "thing": {
    "$id": "https://api.sb/leaseline.app/things/thing_8ds0r9vvRl",
    "$type": "Thing",
    "id": "Example id",
    "type": [
      "noun_v0akLUrXCN"
    ]
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Thing.restore",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}
```

**SDK**

```ts
import { $ } from 'startup-builder'

const thing = await $.Thing.restore({ thing: 'thing_8ds0r9vvRl' })
```

**CLI**

```bash
npx startup-builder do Thing.restore --json '{"thing":"thing_8ds0r9vvRl"}'
```

**MCP**

```json
{
  "name": "do",
  "arguments": {
    "code": "return await $.Thing.restore({ thing: 'thing_8ds0r9vvRl' })"
  }
}
```

Guides that call it: [Bring back something deleted](/agents/restore-something-deleted).