> ## 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.

# Create a simulation draft

> 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).



## OpenAPI

````yaml /api-reference/openapi.json post /v2/account/{accountSlug}/project/{projectSlug}/simulation-drafts
openapi: 3.1.0
info:
  version: 1.0.0
  title: Tenderly API
  description: >
    # Introduction


    The Tenderly API provides a programmatic interface for managing Tenderly
    resources using standard HTTP requests.

    It mirrors many functionalities available through the Tenderly Dashboard,
    enabling you to script complex actions. The API documentation includes a
    design and technology overview, followed by detailed endpoint information.


    [Log into your Tenderly account](https://dashboard.tenderly.co/login) to
    automatically populate your API credentials in the documentation. Your
    account ID and project slug will be pre-filled across the documentation,
    excluding the API access token for security reasons. 


    Base URL: `https://api.tenderly.co/api`


    ## Authentication


    The Tenderly API requires an access token to authenticate your requests.
    Learn how to [generate and manage your API access
    keys](https://docs.tenderly.co/account/projects/how-to-generate-api-access-token).


    Add `X-Access-Key` to each request header, e.g.:


    ```bash

    curl
    'https://api.tenderly.co/api/v1/account/${TENDERLY_ACCOUNT_SLUG}/project/${TENDERLY_PROJECT_SLUG}/simulate'
    \
      -H 'X-Access-Key: ${TENDERLY_ACCESS_KEY}' \
      ...
    ```


    Do not share your secret API keys in publicly accessible areas such as
    GitHub, client-side code, and so forth.


    Authentication to the API is performed via HTTP Basic Auth. Provide your API
    key as the basic auth username value. You do not need to provide a password.


    If you need to authenticate via bearer auth (e.g., for a cross-origin
    request), use:


    ```bash

    curl
    'https://api.tenderly.co/api/v1/account/${TENDERLY_ACCOUNT_SLUG}/project/${TENDERLY_PROJECT_SLUG}/simulate'
    \
      -H 'Authorization: Bearer <TENDERLY_TOKEN>' \
      ...
    ```


    All API requests must be made over HTTPS. Calls made over plain HTTP will
    fail. API requests without authentication will also fail.


    ## Requests


    Any tool capable of making HTTP requests can interact with the API by
    requesting the appropriate URI. Requests should be made using the HTTPS
    protocol to ensure that traffic is encrypted. 


    The API's response varies with the request method used.


    |Method|Usage|

    |--- |--- |

    |GET|Used to retrieve information about your account, project, or resources.
    The requested information is returned as a JSON object. The attributes
    defined by the JSON object can be used to form additional requests. Requests
    made using the GET method are read-only and will not affect the objects you
    are querying.|

    |DELETE|Used to destroy a resource and remove it from your account and
    project. This methods removes the specified object if it is found. If it is
    not found, the operation will return a response indicating that the object
    was not found. You do not have to check if the resource is available prior
    to issuing a DELETE command. The final state will be the same regardless of
    its existence.|

    |PUT|Used to update the information about a resource in your account. The
    PUT method sets the state of the target using the provided values,
    regardless of their current values. Requests using the PUT method do not
    need to check the current attributes of the object.|

    |PATCH|Some resources support partial modification. In these cases, the
    PATCH method is available. Unlike PUT which generally requires a complete
    representation of a resource, a PATCH request is a set of instructions on
    how to modify a resource updating only specific attributes.|

    |POST|Used to create a new object. The POST request includes all of the
    attributes necessary to create a new object.|


    ## Errors


    The API responds with standard HTTP statuses, including error codes that
    indicate the outcome of requests. In the event of a problem, the status will
    contain the error code, while the

    body of the response will usually contain additional information about the
    problem.


    |Status Code|Type|Description|

    |--- |--- |--- |

    |200|OK|Everything worked as expected.|

    |400|Bad Request|The request was unacceptable, often due to missing a
    required parameter.|

    |401|Unauthorized|No valid API key provided.|

    |402|Request Failed|The parameters were valid but the request failed.|

    |403|Forbidden|The API key doesn’t have permissions to perform the request.|

    |404|Not Found|The requested resource doesn’t exist.|

    |429|Too Many Requests|Too many requests hit the API too quickly. We
    recommend an exponential backoff of your requests.|

    |500, 502, 503, 504|Server Errors|Something went wrong on Tenderly’s end.|


    Both 400 and 500 level errors return a JSON object in the response body,
    containing specific attributes detailing the error.


    |Name|Type|Description|

    |--- |--- |--- |

    |id|string|Endpoints include an error ID that should be provided when
    reporting bugs or opening support tickets to help identify the issue.|

    |slug|string|A short identifier corresponding to the HTTP status code
    returned. For example, the ID for a response returning a 404 status code
    would be "not_found."|

    |message|string|A message providing additional information about the error,
    including details to help resolve it when possible.|


    ### Example error response


    HTTP/1.1 404 Bad request

    ```json

    {

    "error": {
      "id": "596b1dc7-af60-477b-aab3-6c93eb92ddfa",
      "slug": "bad_request",
      "message": "Bad request input parameters"
     }
    }

    ```


    ## Responses


    When a request is successful, a response body will typically be sent back in

    the form of a JSON object. An exception to this is when a DELETE request is

    processed, which will result in a successful HTTP 204 status and an empty

    response body.


    The value of these keys will generally be a JSON object for a request on a

    single object and an array of objects for a request on a collection of

    objects.


    ### Response for a single object


    ```json

    {
      "simulation": {
        "id": "123"
        "...": "..."
      }
    }

    ```


    ### Response for an object collection


    ```json

    {
      "simulations": [
        {
          "id": "123"
          "...": "..."
        },
        {
          "id": "1234"
          "...": "..."
        }
      ]
    }

    ```


    ## Pagination


    By default, 20 objects are returned per page per request.

    You can customize this behavior using the following parameters:


    * **Pagination Limit (perPage)**: To change the number of items per page,

    append `?perPage=[number]` to your request. For example, `?perPage=2` limits

    the results to two items per page. The maximum limit is 100 items per page.

    * **Page Offset (page)**: To navigate through paginated results, use the

    `?page=[number]` parameter. For instance, `?page=3` will take you to the
    third page of the results.

    Only positive integers are valid for this parameter.


    Remember:


    * You can combine these parameters. For example, `?perPage=10&page=2` will
    show the second page with 10 items per page.

    * The maximum number of results per page (`perPage`) is 100.


    ## Rate limits


    Requests through the API are rate limited per `X-Access-Key` API key.
    Current rate limits:


    * **Non-authenticated users:** 100 requests per minute

    * **Authenticated users:** 400 requests per minute


    Once you exceed either limit, you will be rate limited until the next cycle

    starts. Space out any requests that you would otherwise issue in bursts for

    the best results.


    The rate limiting information is contained within the response headers of

    each request. The relevant headers are:


    * **X-Tdly-Limit**: The number of requests that can be made per minute.

    * **X-Tdly-Remaining**: The number of requests that remain before you hit
    your request limit. See the information below for how the request limits
    expire.

    * **X-Tdly-Reset-Timestamp**: This represents the time when the oldest
    request will expire. The value is given in [Unix epoch
    time](http://en.wikipedia.org/wiki/Unix_time). See below for more
    information about how request limits expire.


    As long as the `X-Tdly-Remaining` count is above zero, you will be able

    to make additional requests.


    The way that a request expires and is removed from the current limit count

    is important to understand. Rather than counting all of the requests for a

    minute and resetting the `X-Tdly-Remaining` value at the end of the minute,

    each request instead has its own timer.


    This means that each request contributes toward the `X-Tdly-Remaining`

    count for one complete minute after the request is made. When that request's

    timer runs out, it is no longer counted toward the request limit.


    This has implications on the meaning of the `X-Tdly-Reset-Timestamp` header
    as

    well. Because the entire rate limit is not reset at one time, the value of

    this header is set to the time when the _oldest_ request will expire.


    Keep this in mind if you see your `X-Tdly-Reset-Timestamp` value change, but
    not

    move an entire minute into the future.


    If the `X-Tdly-Remaining` reaches zero, subsequent requests will receive

    a 429 error code until the request reset has been reached. 


    `X-Tdly-Remaining` reaching zero can also indicate that the "burst limit" of
    250 

    requests per minute limit was met, even if the 400 requests per minute limit
    was not. 


    You can see the format of the response in the examples. 


    **Note:** Some endpoints may have special rate limit requirements that

    are independent of the limits defined above.


    ### Sample rate limit headers


    ```bash

    'X-Tdly-Limit': 100

    'X-Tdly-Remaining': 79

    'X-Tdly-Reset-Timestamp': 1402425459

    ```


    ### Sample rate exceeded response


    429 Too Many Requests

    ```bash

    {
      id: "too_many_requests",
      message: "API Rate limit exceeded."
    }

    ```


    ## Parameters


    There are two different ways to pass parameters in a request to the API.


    When passing parameters to create or update an object, parameters should be

    passed as a JSON object containing the appropriate attribute names and

    values as key-value pairs. When you use this format, you should specify that

    you are sending a JSON object in the header. This is done by setting the

    `Content-Type` header to `application/json`. This ensures that your request

    is interpreted correctly.


    When passing parameters to filter a response on GET requests, parameters can

    be passed using standard query attributes. In this case, the parameters

    would be embedded into the URI itself by appending a `?` to the end of the

    URI and then setting each attribute with an equal sign. Attributes can be

    separated with a `&`. Tools like `curl` can create the appropriate URI when

    given parameters and values; this can also be done using the `-F` flag and

    then passing the key and value as an argument. The argument should take the

    form of a quoted string with the attribute being set to a value with an

    equal sign.


    ### Pass parameters as a JSON object


    ```bash

    curl
    'https://api.tenderly.co/api/v1/account/${TENDERLY_ACCOUNT_SLUG}/project/${TENDERLY_PROJECT_SLUG}/simulate'
    \
      -H 'X-Access-Key: ${TENDERLY_ACCESS_KEY}' \
      -H 'content-type: application/json' \
      --data-raw '{"network_id":"1","block_number":null,"transaction_index":null,"from":"0x0000000000000000000000000000000000000000","input":"0x42966c68000000000000000000000000000000000000000000000000000000000000022b","to":"0x94c87a7b26980ae7aaa361c5c7e03e632ab36e6c","gas":8000000,"gas_price":"0","value":"0","access_list":[],"generate_access_list":true,"save":true,"block_header":null}' \
      --compressed
    ```


    ### Pass filter parameters as a query string


    ```bash

    curl
    'https://api.tenderly.co/api/v1/account/${TENDERLY_ACCOUNT_SLUG}/project/${TENDERLY_PROJECT_SLUG}/simulations?page=1&perPage=20'
    \
      -H 'X-Access-Key: ${TENDERLY_ACCESS_KEY}' \
      --compressed
    ```


    ## Cross origin resource sharing


    In order to make requests to the API from other domains, the API implements

    Cross Origin Resource Sharing (CORS) support.


    CORS support is generally used to create AJAX requests outside of the domain

    that the request originated from. This is necessary to implement projects

    like control panels utilizing the API. This tells the browser that it can

    send requests to an outside domain.


    The procedure that the browser initiates in order to perform these actions

    (other than GET requests) begins by sending a "preflight" request. This sets

    the `Origin` header and uses the `OPTIONS` method. The server will reply

    with the methods it allows and some of the limits it imposes. The

    client then sends the actual request if it falls within the allowed

    constraints.


    This process is usually done by the browser in the background, but you can

    use curl to emulate this process. The headers that will be set to show the
    constraints are:


    * **Access-Control-Allow-Origin**: This is the domain that is sent by the
    client or browser as the origin of the request. It is set through an
    `Origin` header.

    * **Access-Control-Allow-Methods**: This specifies the allowed options for
    requests from that domain. This will generally be all available methods.

    * **Access-Control-Expose-Headers**: This will contain the headers that will
    be available to requests from the origin domain.

    * **Access-Control-Max-Age**: This is the length of time that the access is
    considered valid. After this expires, a new preflight should be sent.

    * **Access-Control-Allow-Credentials**: This will be set to `true`. It
    basically allows you to send your Access token for authentication.


    You should not need to be concerned with the details of these headers,

    because the browser will typically do all of the work for you.
  license:
    name: Apache 2.0
    url: https://www.apache.org/licenses/LICENSE-2.0.html
  contact:
    name: Tenderly Support
    email: support@tenderly.co
  termsOfService: https://tenderly.co/terms-of-service
servers:
  - url: https://api.tenderly.co/api
    description: production
security:
  - ApiKeyAuth: []
  - BearerAuth: []
tags:
  - name: Contracts
    description: >-
      Tenderly allows you to add verified and unverified smart contracts to your
      project to use in development. Once you add a contract, you can start
      inspecting and debugging transactions, simulating transactions with
      modified parameters, or monitoring contract usage.


      Learn more about managing [Smart
      Contracts](https://docs.tenderly.co/monitoring/smart-contracts).
  - name: Wallets
    description: >-
      Similar to contracts, you can also add any public wallet addresses to your
      Tenderly projects. This allows you to keep track of wallet activity, view
      all transactions, simulate transactions, set up wallet alerts, and more.


      Learn more about managing
      [Wallets](https://docs.tenderly.co/monitoring/wallets).
  - name: Simulator
    description: >-
      Transaction Simulations let you preview the exact outcomes of transactions
      before they are sent to the live network. Transactions are simulated on an
      exact replica of the latest state of the specific network, providing the
      most accurate simulation results. 


      The Tenderly API supports simulating single or bundled transactions
      through a single request. 


      **Common use cases for simulations**


      - [Asset and balance
      changes](https://docs.tenderly.co/simulations/asset-balance-changes): Get
      exact dollar values for all balance and asset changes that will happen.

      - [Gas estimation](https://docs.tenderly.co/simulations/gas-estimation):
      Accurately predict the gas costs before sending the transaction.

      - [State overrides](https://docs.tenderly.co/simulations/state-overrides):
      Modify blockchain conditions like timestamps and contract data to test
      different scenarios.

      - [Preview transaction
      outcomes](https://docs.tenderly.co/simulations/transaction-preview):
      Identify and fix issues that could cause transactions to fail.

      - Access lists: Create lists of addresses and storage slots the
      transaction will access.

      - Human-readable errors: Get complex errors decoded into explanations that
      you can easily understand.


      Learn more about [Transaction
      Simulations](https://docs.tenderly.co/simulations).
  - name: Alerts
    description: >-
      Alerts listen for specific on-chain events and send real-time
      notifications to your desired destination when the event occurs. This can
      be email, your favorite messaging app, an incident monitoring system, or
      webhooks and Web3 Actions.


      Learn more about
      [Alerts](https://docs.tenderly.co/alerts/intro-to-alerts).
  - name: Delivery Channels
    description: >-
      When the desired event triggers your Alert, Tenderly will send the data
      about the event to a designated Alert Destination. The Destination
      (Delivery Channel) will use this data to send you an email notification,
      Discord, or Slack message or send it to another Tenderly system like Web3
      Actions or a Webhook.


      Learn more about [Delivery
      Channels](https://docs.tenderly.co/alerts/configuring-alert-destinations).
  - name: Actions
    description: >-
      Web3 Actions allow you to execute custom code in response to on-chain and
      off-chain events. They work as programmable hooks for smart contracts. A
      Web3 Action is a regular JS/TS function that is executed on our
      infrastructure. 


      Learn more about [Web3
      Actions](https://docs.tenderly.co/web3-actions/intro-to-web3-actions).
  - name: Virtual Environments
    description: >-
      Virtual Environments are simulated blockchain networks, designed to
      replicate real networks for various stages of dapp development. Use them
      as risk-free development and staging infrastructure that fully tracks real
      network state without the need to use real cryptocurrency or assets.


      Environments are multi-chain groupings of Virtual Environments, providing
      a coordinated set of simulated networks for end-to-end cross-chain
      testing. Each environment contains a Virtual Environment per configured
      network, and an active instance manages the current state across all
      chains.


      Environments support cross-chain bridge simulation, allowing you to test
      bridging and messaging protocols across networks in a fully isolated and
      reproducible setup.
  - name: Other
    description: >-
      This section contains miscellaneous endpoints that do not fit into other
      categories, such as checking supported networks on the Tenderly platform.
paths:
  /v2/account/{accountSlug}/project/{projectSlug}/simulation-drafts:
    post:
      tags:
        - Simulator
      summary: Create a simulation draft
      description: >-
        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).
      operationId: createSimulationDraft
      parameters:
        - name: accountSlug
          in: path
          schema:
            type: string
          required: true
          description: Account slug of the user
          example: me
        - name: projectSlug
          in: path
          schema:
            type: string
          required: true
          description: Project slug of the account
          example: project
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/simulation-draft-create-request'
            examples:
              raw_calldata_single_call:
                $ref: '#/components/examples/simulation_draft_raw_calldata_request'
              shared_bundle_with_overrides:
                $ref: '#/components/examples/simulation_draft_shared_bundle_request'
      responses:
        '200':
          $ref: '#/components/responses/simulation_drafts_post'
        '400':
          $ref: '#/components/responses/bad_request'
        '401':
          $ref: '#/components/responses/unauthorized'
        '403':
          $ref: '#/components/responses/forbidden'
        '404':
          $ref: '#/components/responses/not_found'
        '429':
          $ref: '#/components/responses/too_many_requests'
        '500':
          $ref: '#/components/responses/server_error'
      x-codeSamples:
        - lang: cURL
          source: >-
            curl
            'https://api.tenderly.co/api/v2/account/${TENDERLY_ACCOUNT_SLUG}/project/${TENDERLY_PROJECT_SLUG}/simulation-drafts'
            \
              -X 'POST' \
              -H 'X-Access-Key: ${TENDERLY_ACCESS_KEY}' \
              -H 'content-type: application/json' \
              --data-raw '{
                "payload": {
                  "v": 2,
                  "network": { "id": "1" },
                  "rows": [
                    {
                      "contractAddress": "0xdac17f958d2ee523a2206206994597c13d831ec7",
                      "from": "0xab5801a7d398351b8be11c439e05c5b3259aec9b",
                      "inputDataType": "raw",
                      "rawFunctionInput": "0xa9059cbb000000000000000000000000ab5801a7d398351b8be11c439e05c5b3259aec9b00000000000000000000000000000000000000000000000000000000000f4240"
                    }
                  ]
                }
              }' \
              --compressed
components:
  schemas:
    simulation-draft-create-request:
      title: Simulation draft create request
      type: object
      description: Request body for creating a simulation draft.
      properties:
        payload:
          $ref: '#/components/schemas/simulation-draft-payload'
        shared:
          title: Shared
          description: >-
            `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.
          type: boolean
          default: false
          example: false
      required:
        - payload
    simulation-draft-payload:
      title: Simulation draft payload
      type: object
      description: >-
        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.
      properties:
        v:
          title: Schema version
          description: Payload schema version. Must be `2`.
          type: integer
          enum:
            - 2
          example: 2
        network:
          title: Network
          description: >-
            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.
          type:
            - object
            - 'null'
          properties:
            id:
              title: Chain ID
              description: Chain ID as a string, for example `"1"` for Mainnet.
              type: string
              example: '1'
          required:
            - id
        rows:
          title: Rows
          description: >-
            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.
          type: array
          minItems: 1
          items:
            $ref: '#/components/schemas/simulation-draft-row'
      required:
        - v
        - network
        - rows
    simulation-draft-create-response:
      title: Simulation draft create response
      type: object
      properties:
        resource_id:
          title: Resource ID
          description: >-
            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}`.
          type: string
          format: uuid
          example: 3f2a6c1e-8f1b-4c8e-9a2d-6b1e0f7c4d21
      required:
        - resource_id
    error:
      type: object
      properties:
        error:
          type: object
          properties:
            id:
              description: >-
                Endpoints include an error ID that should be  provided when
                reporting bugs or opening support tickets to help  identify the
                issue.
              type: string
              example: 4d9d8375-3c56-4925-a3e7-eb137fed17e9
            slug:
              description: >-
                A short identifier corresponding to the HTTP status code
                returned. For  example, the ID for a response returning a 404
                status code would be "not_found."
              type: string
              example: not_found
            message:
              description: >-
                A message providing additional information about the error,
                including  details to help resolve it when possible.
              type: string
              example: The resource you were accessing could not be found.
            data:
              description: Additional context about the error.
              type: object
              properties:
                rid:
                  description: >-
                    Resource identifier indicating which resource type caused
                    the error.
                  type: string
                  enum:
                    - rid:account
                    - rid:project
                    - rid:alert
                    - rid:contract
                    - rid:delivery_channel
                    - rid:network
                    - rid:simulation
                    - rid:simulation_draft
                    - rid:vnet
                    - rid:wallet
                    - rid:action
                    - rid:action_call
                  example: rid:project
              additionalProperties: true
          required:
            - id
            - slug
            - message
      required:
        - error
    simulation-draft-row:
      title: Simulation draft row
      type: object
      description: >-
        One call in a simulation draft. Only `contractAddress` is required.
        Omitted fields keep the Simulator form defaults; unknown fields are
        ignored.
      properties:
        contractAddress:
          title: Contract address
          description: >-
            The "to" address. The contract and its ABI are fetched when the
            draft opens.
          type: string
          example: '0xdac17f958d2ee523a2206206994597c13d831ec7'
        inputDataType:
          title: Input data type
          description: >-
            Function-input mode. Use `raw` with `rawFunctionInput`, or `decoded`
            with `contractFunction` and `functionInputs`.
          type: string
          enum:
            - decoded
            - raw
          example: raw
        rawFunctionInput:
          title: Raw function input
          description: >-
            Hex calldata for raw mode. No ABI is needed, which makes it the most
            reliable option for scripts.
          type: string
          example: >-
            0xa9059cbb000000000000000000000000ab5801a7d398351b8be11c439e05c5b3259aec9b00000000000000000000000000000000000000000000000000000000000f4240
        contractFunction:
          title: Contract function
          description: >-
            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.
          type:
            - object
            - 'null'
          properties:
            name:
              title: Name
              type: string
              example: transfer
            selector:
              title: Selector
              description: 4-byte function selector.
              type: string
              example: '0xa9059cbb'
            signature:
              title: Signature
              type: string
              example: transfer(address,uint256)
          required:
            - name
        functionInputs:
          title: Function inputs
          description: >-
            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).
          oneOf:
            - type: array
              items: {}
            - type: object
              additionalProperties: true
          example:
            - '0xab5801a7d398351b8be11c439e05c5b3259aec9b'
            - '1000000'
        contractAbiImport:
          title: Contract ABI import
          description: >-
            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).
          type: string
        from:
          title: From
          description: Sender address.
          type: string
          example: '0xab5801a7d398351b8be11c439e05c5b3259aec9b'
        gas:
          title: Gas
          description: Gas limit. `0x`-prefixed hex quantities are converted to decimal.
          type:
            - string
            - number
          example: '8000000'
        gasPrice:
          title: Gas price
          description: Gas price in wei.
          type:
            - string
            - number
          example: '0'
        value:
          title: Value
          description: Native-token value in wei.
          type:
            - string
            - number
          example: '0'
        block:
          title: Block
          description: Block number to simulate at. Omit for the chain head.
          type:
            - string
            - number
          example: '21088736'
        blockIndex:
          title: Block index
          description: >-
            Transaction position inside the block. `null` or omitted means the
            start of the block.
          type:
            - string
            - number
            - 'null'
        endOfBlock:
          title: End of block
          description: >-
            `true` runs the simulated transaction after every transaction in the
            block (overrides `blockIndex`).
          type: boolean
        usePendingBlock:
          title: Use pending block
          description: '`true` simulates on the pending block instead of a fixed number.'
          type: boolean
        depositTx:
          title: Deposit transaction
          description: Mark as an L2 deposit transaction (OP-stack and Boba networks only).
          type: boolean
        mint:
          title: Mint
          description: Deposit mint amount (OP-stack and Boba networks only).
          type: string
        blockHeaderOverrides:
          title: Block header overrides
          description: Overrides for the simulated block header.
          type: object
          properties:
            number:
              title: Number
              type:
                - string
                - number
                - 'null'
            timestamp:
              title: Timestamp
              type:
                - string
                - number
                - 'null'
        stateOverrides:
          title: State overrides
          description: Per-contract state overrides applied before the call runs.
          type: array
          items:
            type: object
            properties:
              id:
                title: ID
                description: UI row key. Optional; generated when absent.
                type: string
              contractAddress:
                title: Contract address
                type: string
                example: '0x6b175474e89094c44da98b954eedeac495271d0f'
              balance:
                title: Balance
                description: >-
                  Balance override in wei. An empty string means no balance
                  override.
                type: string
                example: ''
              storage:
                title: Storage
                type: array
                items:
                  type: object
                  properties:
                    key:
                      title: Key
                      description: 32-byte hex storage slot.
                      type: string
                    value:
                      title: Value
                      description: 32-byte hex value.
                      type: string
                  required:
                    - key
                    - value
              code:
                title: Code
                description: Bytecode override.
                type: string
            required:
              - contractAddress
              - balance
        accessList:
          title: Access list
          description: EIP-2930 access list.
          type: array
          items:
            type: object
            properties:
              address:
                title: Address
                type: string
              storageKeys:
                title: Storage keys
                type: array
                items:
                  type: string
            required:
              - address
              - storageKeys
        fundAddress:
          title: Fund address
          description: >-
            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.
          type:
            - object
            - 'null'
          properties:
            targetAddress:
              title: Target address
              type: string
              example: '0xab5801a7d398351b8be11c439e05c5b3259aec9b'
            tokens:
              title: Tokens
              type: array
              items:
                type: object
                properties:
                  tokenAddress:
                    title: Token address
                    type: string
                    example: '0x0000000000000000000000000000000000000000'
                  amount:
                    title: Amount
                    description: Amount in the token's smallest unit, as a string.
                    type: string
                    example: '1000000000000000000'
                required:
                  - tokenAddress
                  - amount
          required:
            - targetAddress
            - tokens
        customSource:
          title: Custom source
          description: >-
            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.
          type:
            - object
            - 'null'
          properties:
            compilerInfo:
              title: Compiler info
              type: object
              additionalProperties: true
            customSourceData:
              title: Custom source data
              type: array
              items:
                type: object
                properties:
                  name:
                    title: Name
                    type: string
                  source:
                    title: Source
                    type: string
                  path:
                    title: Path
                    type: string
                  contractName:
                    title: Contract name
                    type: string
                  address:
                    title: Address
                    type: string
                required:
                  - name
                  - source
                  - path
          required:
            - compilerInfo
            - customSourceData
        contractSourceEdited:
          title: Contract source edited
          description: >-
            Marks the call's source as edited. Defaults to `true` when
            `customSource` is present.
          type: boolean
      required:
        - contractAddress
  examples:
    simulation_draft_raw_calldata_request:
      summary: Single call with raw calldata
      description: >-
        A project-scoped draft for one call. Raw calldata needs no ABI, which
        makes it the most reliable shape for CI and tooling.
      value:
        payload:
          v: 2
          network:
            id: '1'
          rows:
            - contractAddress: '0xdac17f958d2ee523a2206206994597c13d831ec7'
              from: '0xab5801a7d398351b8be11c439e05c5b3259aec9b'
              inputDataType: raw
              rawFunctionInput: >-
                0xa9059cbb000000000000000000000000ab5801a7d398351b8be11c439e05c5b3259aec9b00000000000000000000000000000000000000000000000000000000000f4240
    simulation_draft_shared_bundle_request:
      summary: Shared two-call bundle with a state override
      description: >-
        A `shared` draft that any signed-in Tenderly user can open in a project
        of their choice. The first call is decoded (function reference plus
        positional inputs) and carries a DAI storage override; the second call
        uses raw calldata.
      value:
        payload:
          v: 2
          network:
            id: '1'
          rows:
            - contractAddress: '0x6b175474e89094c44da98b954eedeac495271d0f'
              from: '0xab5801a7d398351b8be11c439e05c5b3259aec9b'
              inputDataType: decoded
              contractFunction:
                name: mint
                selector: '0x40c10f19'
                signature: mint(address,uint256)
              functionInputs:
                - '0xab5801a7d398351b8be11c439e05c5b3259aec9b'
                - '1000000000000000000000'
              stateOverrides:
                - contractAddress: '0x6b175474e89094c44da98b954eedeac495271d0f'
                  balance: ''
                  storage:
                    - key: >-
                        0xedd7d04419e9c48ceb6055956cbb4e2091ae310313a4d1fa7cbcfe7561616e03
                      value: >-
                        0x0000000000000000000000000000000000000000000000000000000000000001
            - contractAddress: '0x6b175474e89094c44da98b954eedeac495271d0f'
              from: '0xab5801a7d398351b8be11c439e05c5b3259aec9b'
              inputDataType: raw
              rawFunctionInput: >-
                0xa9059cbb000000000000000000000000e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e2e200000000000000000000000000000000000000000000003635c9adc5dea00000
        shared: true
    simulation_drafts_post_response:
      summary: Draft created
      description: >-
        The ID to place in the dashboard link
        `https://dashboard.tenderly.co/simulator/new?draftId={resource_id}`.
      value:
        resource_id: 3f2a6c1e-8f1b-4c8e-9a2d-6b1e0f7c4d21
  responses:
    simulation_drafts_post:
      description: The draft was stored.
      headers:
        X-Tdly-Limit:
          $ref: '#/components/headers/ratelimit-limit'
        X-Tdly-Remaining:
          $ref: '#/components/headers/ratelimit-remaining'
        X-Tdly-Reset-Timestamp:
          $ref: '#/components/headers/ratelimit-reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/simulation-draft-create-response'
          examples:
            created:
              $ref: '#/components/examples/simulation_drafts_post_response'
    bad_request:
      description: Bad Request
      headers:
        X-Tdly-Limit:
          $ref: '#/components/headers/ratelimit-limit'
        X-Tdly-Remaining:
          $ref: '#/components/headers/ratelimit-remaining'
        X-Tdly-Reset-Timestamp:
          $ref: '#/components/headers/ratelimit-reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
          example:
            error:
              id: 596b1dc7-af60-477b-aab3-6c93eb92ddfa
              slug: bad_request
              message: Bad request input parameters
    unauthorized:
      description: Unauthorized
      headers:
        X-Tdly-Limit:
          $ref: '#/components/headers/ratelimit-limit'
        X-Tdly-Remaining:
          $ref: '#/components/headers/ratelimit-remaining'
        X-Tdly-Reset-Timestamp:
          $ref: '#/components/headers/ratelimit-reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
          example:
            error:
              id: 596b1dc7-af60-477b-aab3-6c93eb92ddfa
              slug: unauthorized
              message: Unauthorized
    forbidden:
      description: Forbidden
      headers:
        X-Tdly-Limit:
          $ref: '#/components/headers/ratelimit-limit'
        X-Tdly-Remaining:
          $ref: '#/components/headers/ratelimit-remaining'
        X-Tdly-Reset-Timestamp:
          $ref: '#/components/headers/ratelimit-reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
          example:
            error:
              id: 596b1dc7-af60-477b-aab3-6c93eb92ddfa
              slug: insufficient_permissions
              message: Insufficient permissions
    not_found:
      description: The resource was not found.
      headers:
        X-Tdly-Limit:
          $ref: '#/components/headers/ratelimit-limit'
        X-Tdly-Remaining:
          $ref: '#/components/headers/ratelimit-remaining'
        X-Tdly-Reset-Timestamp:
          $ref: '#/components/headers/ratelimit-reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
          example:
            error:
              id: 596b1dc7-af60-477b-aab3-6c93eb92ddfa
              slug: resource_not_found
              message: The resource you requested could not be found.
    too_many_requests:
      description: >-
        The request was rate limited. See the [rate
        limits](#section/Introduction/Rate-limits) section for the current
        limits and how request counts expire.
      headers:
        X-Tdly-Limit:
          $ref: '#/components/headers/ratelimit-limit'
        X-Tdly-Remaining:
          $ref: '#/components/headers/ratelimit-remaining'
        X-Tdly-Reset-Timestamp:
          $ref: '#/components/headers/ratelimit-reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
          example:
            error:
              id: 9a7bbe06-7f6f-4a45-8c78-8d64b9a9d0e1
              slug: too_many_requests
              message: API Rate limit exceeded.
    server_error:
      description: Server error.
      headers:
        X-Tdly-Limit:
          $ref: '#/components/headers/ratelimit-limit'
        X-Tdly-Remaining:
          $ref: '#/components/headers/ratelimit-remaining'
        X-Tdly-Reset-Timestamp:
          $ref: '#/components/headers/ratelimit-reset'
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/error'
          example:
            error:
              id: 596b1dc7-af60-477b-aab3-6c93eb92ddfa
              slug: internal_server_error
              message: Internal server error
  headers:
    ratelimit-limit:
      schema:
        type: integer
      example: 100
      description: >-
        The default limit on number of requests that can be made per minute.
        Current rate limits are:

        * **Non-authenticated users:** 100 requests per minute

        * **Authenticated users:** 400 requests per minute
    ratelimit-remaining:
      schema:
        type: integer
      example: 16
      description: >-
        The number of requests in your quota that remain before you hit your
        request limit.
    ratelimit-reset:
      schema:
        type: integer
      example: 1444931833
      description: >-
        The time when the oldest request will expire. The value is given in Unix
        epoch time.
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      name: X-Access-Key
      in: header
      description: >-
        An API key is a token that a client provides when making API calls. Send
        it as the `X-Access-Key` request header on any endpoint:


        ```bash

        curl '<API_ENDPOINT>' \
          -H 'X-Access-Key: ${TENDERLY_ACCESS_KEY}' \
          ...
        ```


        Learn how to generate API access tokens at [Tenderly
        Docs](https://docs.tenderly.co/account/projects/how-to-generate-api-access-token).
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        Bearer authentication (also called token authentication) is an HTTP
        authentication scheme that involves security tokens called bearer
        tokens.

        The bearer token is a cryptic string, usually generated by the server in
        response to a login request. The client must send this token in

        the Authorization header when making requests to protected resources:


        ```bash

        curl '<API_ENDPOINT>' \
          -H 'Authorization: Bearer <TENDERLY_TOKEN>' \
          ...
        ```


        **Note**: Bearer tokens cannot be revoked and expire after 30 days.

````