---
title: "Create a simulation draft"
method: POST
path: "/v2/account/{accountSlug}/project/{projectSlug}/simulation-drafts"
tags: ["Simulator"]
---

# Create a simulation draft

`POST /v2/account/{accountSlug}/project/{projectSlug}/simulation-drafts`

Store a Simulator setup (one call or a multi-call bundle, including state overrides, funded balances, and edited contract source) as a draft and receive an ID for a shareable link. Opening the link only prefills the Simulator form; nothing runs until the recipient clicks **Simulate**.

Put the returned `resource_id` in a dashboard link:

`https://dashboard.tenderly.co/simulator/new?draftId={resource_id}`

**Visibility**

- `shared: false` (default): the draft is scoped to the project in the URL. Only members of that project can open it, and the dashboard redirects them straight into the project's Simulator.
- `shared: true`: any signed-in Tenderly user can open the draft in a project of their choice (the dashboard shows a project picker first). Use it for links aimed outside your organization, for example a governance UI that prefills a proposal simulation.

**Payload handling**

The `payload` is stored as received. The API enforces only the 256 KB size limit; the payload structure is validated when the draft opens in the dashboard, and a malformed payload is rejected there with an empty form. The dashboard itself creates drafts through this endpoint with `shared: false`.

Drafts expire automatically. Learn more about [Simulator draft links](https://docs.tenderly.co/simulator-ui/draft-links).

## Path parameters

- `accountSlug` string, required
- `projectSlug` string, required

## Request body

- SimulationDraftCreateRequest — Request body for creating a simulation draft.
  - `payload` SimulationDraftPayload, required — A Simulator form snapshot. The API stores it as received; the dashboard validates it when the draft opens. A wrong `v`, an empty `rows` array, a non-string `contractAddress`, or a wrong-typed row field rejects the whole draft on open.
    - `v` 2, required — Payload schema version. Must be `2`.
    - `network` object, nullable, required — Network the draft targets, identified by chain ID as a string. Must be a network enabled on the project where the draft opens, otherwise the dashboard reports the network as unavailable and shows an empty form. `null` is accepted but skips the contract lookup and leaves the form mostly unusable.
      - `id` string, required — Chain ID as a string, for example `"1"` for Mainnet.
    - `rows` SimulationDraftRow[], required — One entry per call, in execution order. At least one row is required. Session-level settings (block selection, `from`, L2 parameters) are taken from the first row.
      - `contractAddress` string, required — The "to" address. The contract and its ABI are fetched when the draft opens.
      - `inputDataType` 'decoded' | 'raw' — Function-input mode. Use `raw` with `rawFunctionInput`, or `decoded` with `contractFunction` and `functionInputs`.
      - `rawFunctionInput` string — Hex calldata for raw mode. No ABI is needed, which makes it the most reliable option for scripts.
      - `contractFunction` object, nullable — Decoded-mode function reference. `selector` (4-byte hex) is matched exactly and is safe for overloaded functions; without it, matching falls back to `name` and may pick the wrong overload. `signature` is informational only.
        - `name` string, required
        - `selector` string — 4-byte function selector.
        - `signature` string
      - `functionInputs` union — Decoded-mode argument values. Preferred: a positional array in ABI order. Array and tuple arguments may be passed natively as nested arrays or objects. The keyed form `{ "input_0": ... }` is also accepted (it is what the dashboard emits).
        - unknown[]
          - unknown
        - object
      - `contractAbiImport` string — Prefills the in-app **Edit ABI** field. Not re-applied when the draft opens: function matching uses the fetched ABI (or the compiled edited source).
      - `from` string — Sender address.
      - `gas` union — Gas limit. `0x`-prefixed hex quantities are converted to decimal.
        - string
        - number
      - `gasPrice` union — Gas price in wei.
        - string
        - number
      - `value` union — Native-token value in wei.
        - string
        - number
      - `block` union — Block number to simulate at. Omit for the chain head.
        - string
        - number
      - `blockIndex` union — Transaction position inside the block. `null` or omitted means the start of the block.
        - string
        - number
      - `endOfBlock` boolean — `true` runs the simulated transaction after every transaction in the block (overrides `blockIndex`).
      - `usePendingBlock` boolean — `true` simulates on the pending block instead of a fixed number.
      - `depositTx` boolean — Mark as an L2 deposit transaction (OP-stack and Boba networks only).
      - `mint` string — Deposit mint amount (OP-stack and Boba networks only).
      - `blockHeaderOverrides` object — Overrides for the simulated block header.
        - `number` union
          - string
          - number
        - `timestamp` union
          - string
          - number
      - `stateOverrides` object[] — Per-contract state overrides applied before the call runs.
        - `id` string — UI row key. Optional; generated when absent.
        - `contractAddress` string, required
        - `balance` string, required — Balance override in wei. An empty string means no balance override.
        - `storage` object[]
          - `key` string, required — 32-byte hex storage slot.
          - `value` string, required — 32-byte hex value.
        - `code` string — Bytecode override.
      - `accessList` object[] — EIP-2930 access list.
        - `address` string, required
        - `storageKeys` string[], required
      - `fundAddress` object, nullable — The **Fund address** cheatcode. Use the zero address as `tokenAddress` to fund the native balance. For ERC-20 tokens the balance storage slot is resolved when the draft opens.
        - `targetAddress` string, required
        - `tokens` object[], required
          - `tokenAddress` string, required
          - `amount` string, required — Amount in the token's smallest unit, as a string.
      - `customSource` object, nullable — An applied source edit. `compilerInfo` is passed to the compiler as-is (compiler version, optimization settings, import remappings); take its shape from a draft created in the dashboard. The source is compiled when the draft opens and its ABI takes over function matching for this call.
        - `compilerInfo` object, required
        - `customSourceData` object[], required
          - `name` string, required
          - `source` string, required
          - `path` string, required
          - `contractName` string
          - `address` string
      - `contractSourceEdited` boolean — Marks the call's source as edited. Defaults to `true` when `customSource` is present.
  - `shared` boolean — `false` (default) scopes the draft to the project in the URL: only its members can open it. `true` makes the draft openable by any signed-in Tenderly user in a project of their choice.

## Response `200`

The draft was stored.

- SimulationDraftCreateResponse
  - `resource_id` string, uuid, required — ID of the stored draft. Use it as the `draftId` query parameter of the dashboard link: `https://dashboard.tenderly.co/simulator/new?draftId={resource_id}`.

## Other responses

- `400` — Bad Request
- `401` — Unauthorized
- `403` — Forbidden
- `404` — The resource was not found.
- `429` — The request was rate limited. See the [rate limits](#section/Introduction/Rate-limits) section for the current limits and how request counts expire.
- `500` — Server error.

## Changes

- **2026-08-28** `e512753e74ce` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/tenderly/apis/tenderly-api/changes/v2/account/:accountSlug/project/:projectSlug/simulation-drafts/post.md)

---

[API](https://skmtc.dev/tenderly/apis/tenderly-api.md) · [All operations](https://skmtc.dev/tenderly/apis/tenderly-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/tenderly/tenderly-api/revisions/e512753e74ce/schema)
