---
sidebar_label: Recreate a non-functional scope
doc_id: 182f9645-a1fb-45e6-9e0d-0e388d74bc73
description: >-
  Restore a non-functional agent-backed scope by recreating it with the same
  configuration and settings.
keywords:
  - scope recreation
  - infrastructure recovery
  - agent-backed scope
  - troubleshooting
  - deployment
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Recreate a non-functional scope

If an agent-backed scope becomes non-functional due to infrastructure issues, you can trigger a recreation to restore it. This works for any agent-backed scope, regardless of the underlying provider.

:::warning Important:

- Recreating a scope **causes downtime**.
- It may leave behind **residual or unstable infrastructure**.
- The recreated scope is **not automatically deployed**, so you need to deploy it manually after the process.
:::

## How it works

Recreating a scope attempts to **delete the broken scope** and its associated infrastructure, and then **creates a new scope** using the same configuration.

The newly created scope:

- Uses the **same scope ID** and **slug**.
- Retains the **same configuration** as the original.
- Preserves its **custom domain and DNS settings**, if configured.

## Recreate a scope

### 1. Trigger the recreation

Use the UI, CLI, or API to start the recreation.

<Tabs
  defaultValue="recreate-ui"
  values={[
    { label: 'UI', value: 'recreate-ui' },
    { label: 'CLI', value: 'recreate-cli' },
    { label: 'cURL', value: 'recreate-curl' },
  ]}>
  <TabItem value="recreate-ui">

  1. Go to **Development > Scopes**.
  2. Click **Actions > Recreate** for the scope you want to recreate.

  <img alt="Recreate scopes from the UI" src="/img/scope/recreate-scope-ui.png" width="100%" className="helper-image" />

  </TabItem>
  <TabItem value="recreate-cli">

  Patch the scope's status to `recreating`:

  ```bash
  np scope patch --id "$SCOPE_ID" --body '{"status": "recreating"}'
  ```

  </TabItem>
  <TabItem value="recreate-curl">

  Send a [PATCH request](/docs/api/scope-update) to set the scope's status to `recreating`:

  ```bash
  curl -L -X PATCH 'https://api.nullplatform.com/scope/:id' \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer <token>' \
  -d '{
    "status": "recreating"
  }'
  ```

  </TabItem>
</Tabs>

### 2. Deploy the recreated scope

Once the recreation completes, you need to redeploy the scope to make it functional:

1. Go to **Development > Scopes**.
2. Click **Deploy** for the scope you just recreated.
