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

# REST API

> Reference for the Tenderly REST API endpoints that create and manage Virtual Environments, including single-network and multi-network environments.

The Tenderly REST API exposes endpoints for creating, listing, and managing Virtual Environments. For a walkthrough of how to call them from a script, see [Create Virtual Environments via API](/virtual-environments/develop/create-virtual-environment-via-api). For the complete API surface, see the [API Reference](/api-reference).

All environment endpoints use the base URL:

```bash theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
https://api.tenderly.co/api/public/v1/account/{accountSlug}/project/{projectSlug}
```

## Authentication

All requests require an `X-Access-Key` header. Generate a key from **Account Settings → Authorization** in the Tenderly Dashboard. See [API tokens](/platform/account/projects/api-tokens).

```bash theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
X-Access-Key: <your-access-key>
```

## Create an environment

```bash theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
POST /environments
```

Creates a new environment with one or more networks. Both single-network and multi-network environments use this endpoint, pass one entry in `network_configs` for a single-network environment, or multiple entries for a multi-network one.

### Request body

| Field                                                       | Type    | Required | Description                                                                      |
| ----------------------------------------------------------- | ------- | -------- | -------------------------------------------------------------------------------- |
| `display_name`                                              | string  | yes      | Human-readable name shown in the dashboard.                                      |
| `slug`                                                      | string  | no       | URL-safe identifier. Auto-generated from `display_name` if omitted.              |
| `network_configs`                                           | array   | yes      | One entry per network in the environment.                                        |
| `network_configs[].network_id`                              | string  | yes      | Chain ID of the network to fork (e.g. `"1"` for Ethereum).                       |
| `network_configs[].block_number`                            | string  | no       | Fork point in hex. Defaults to the latest block.                                 |
| `network_configs[].chain_config_overrides.chain_id`         | string  | no       | Override the chain ID assigned to this Virtual Environment.                      |
| `network_configs[].explorer_config.enabled`                 | boolean | no       | Expose a [public explorer page](/virtual-environments/explorer#public-explorer). |
| `network_configs[].explorer_config.verification_visibility` | string  | no       | `"bytecode"`, `"abi"`, or `"source"`.                                            |
| `network_configs[].accounts`                                | array   | no       | Pre-funded accounts. Each entry has `address` and `balance` (Wei, hex-encoded).  |
| `bridge_config.enabled`                                     | boolean | no       | Enable cross-chain bridging between networks in this environment.                |
| `bridge_config.relay_mode`                                  | string  | no       | `"autoRelay"` (default) or `"delayedRelay"`.                                     |
| `bridge_config.delay_seconds`                               | integer | no       | Relay delay in seconds when using `"delayedRelay"`.                              |

### Single-network example

```json title="request.json" theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
{
  "display_name": "Staging Mainnet",
  "slug": "staging-mainnet",
  "network_configs": [
    {
      "network_id": "1",
      "block_number": "latest",
      "chain_config_overrides": { "chain_id": "73571" },
      "explorer_config": { "enabled": false, "verification_visibility": "bytecode" }
    }
  ]
}
```

### Multi-network example

```json title="request.json" theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
{
  "display_name": "Cross-chain Staging",
  "network_configs": [
    {
      "network_id": "1",
      "block_number": "latest",
      "chain_config_overrides": { "chain_id": "1" }
    },
    {
      "network_id": "42161",
      "block_number": "latest",
      "chain_config_overrides": { "chain_id": "42161" }
    },
    {
      "network_id": "8453",
      "block_number": "latest",
      "chain_config_overrides": { "chain_id": "8453" }
    }
  ],
  "bridge_config": { "enabled": true, "relay_mode": "autoRelay" }
}
```

### Response

Returns the created environment object. The `active_instance.vnets` array contains one entry per network, each with its RPC endpoints.

```json title="response.json" theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
{
  "id": "d998eea3-139d-4477-9de2-42f7739362f0",
  "display_name": "Staging Mainnet",
  "slug": "staging-mainnet",
  "created_at": "2026-06-08T10:00:00.000Z",
  "networks": [
    {
      "id": "a1b2c3d4-...",
      "network_id": "1",
      "network_name": "Ethereum Mainnet",
      "block_number": "0x168a5c6"
    }
  ],
  "active_instance": {
    "id": "e5f6a7b8-...",
    "vnets": [
      {
        "id": "f9e8d7c6-...",
        "display_name": "Staging Mainnet",
        "slug": "staging-mainnet",
        "status": "running",
        "rpcs": [
          { "name": "Admin RPC", "url": "https://virtual.mainnet.rpc.tenderly.co/..." },
          { "name": "Public RPC", "url": "https://virtual.mainnet.rpc.tenderly.co/..." }
        ],
        "fork_config": { "network_id": 1, "block_number": "0x168a5c6" }
      }
    ]
  }
}
```

The `rpcs` array on each entry contains the Admin RPC (full [cheatcode](/virtual-environments/admin-rpc) access) and the Public RPC (standard JSON-RPC).

## List environments

```bash theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
GET /environments
```

Returns all environments for the project.

## Get an environment

```bash theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
GET /environments/{environmentId}
```

Returns a single environment by ID, including its `active_instance` and RPC endpoints.

## Delete an environment

```bash theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
DELETE /environments/{environmentId}
```

Permanently deletes a single environment. Returns `204 No Content`.

## Batch delete environments

```bash theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
DELETE /environments
```

Permanently deletes multiple environments in one call. Pass the IDs in the request body.

## List transactions

```bash theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
GET /environments/{environmentId}/instance/{instanceId}/transactions
```

Returns transactions across all Virtual Environments in an environment instance. Supports pagination and optional filters by status, category, kind, and from/to address.

## Get a transaction

```bash theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
GET /environments/{environmentId}/instance/{instanceId}/transactions/{txHash}
```

Returns a single transaction from an environment instance by transaction hash.

## Send a transaction

```bash theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
POST /environments/{environmentId}/instance/{instanceId}/vnet/{vnetId}/transactions
```

Executes a transaction on a specific Virtual Environment within an environment instance. State is preserved.

## Simulate a transaction

```bash theme={"theme":{"light":"catppuccin-latte","dark":"catppuccin-mocha"}}
POST /environments/{environmentId}/instance/{instanceId}/vnet/{vnetId}/transactions/simulate
```

Simulates a transaction without preserving state. Supports block overrides, state overrides, and a custom block number. Returns a detailed simulation result including call trace, state changes, and emitted events.

## See also

* [Create Virtual Environments via API](/virtual-environments/develop/create-virtual-environment-via-api), full scripted walkthrough
* [Admin RPC reference](/virtual-environments/admin-rpc), cheatcodes available on the Admin RPC
* [API Reference](/api-reference), complete Tenderly API surface
