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

# Resimulation

> Re-run the simulation of a pending signing request.

Re-runs the simulation of a pending signing request and returns the stored simulation. The encoding of `simulation` is described under [Simulation](/api-reference/signing-request#simulation): base64 in JSON, decoding to UTF-8 JSON text in a network-specific form, for reference only.

A successful re-run replaces the stored simulation with the result of the run. If the simulation provider returns an error, or the organization's simulation allowance is used up, the call still succeeds and `simulation` is empty. A simulation that does not finish within 5 seconds fails a custom transaction with an error, and returns the earlier stored simulation for a dApp transaction. A returned simulation therefore does not show that it was just re-run.

The request must be pending, belong to a vault the API token can access, and have been created by the same API user. Only custom transactions and EVM dApp transactions are simulated; for any other request `simulation` is empty.

| Failure | HTTP status | Message |
| - | - | - |
| `signingRequestUuid` is empty | 400 (`FailedPrecondition`) | `Signing request uuid required` |
| The request does not exist, is in another organization or an inaccessible vault, or was created by another API user | 400 (`InvalidArgument`) | `Invalid uuid` |
| The request is not pending | 400 (`FailedPrecondition`) | `Signing request already done` |


## OpenAPI

````yaml openapi.json POST /v1/resimulation
openapi: 3.1.0
info:
  title: mpcvault.platform.v1
  version: 0.0.1
servers:
  - url: https://api.mpcvault.com
    description: MPCVault API Server
security:
  - ApiKeyAuth: []
tags:
  - name: mpcvault.platform.v1.PlatformAPI
  - name: mpcvault.sweep.v1.SweepAPI
    description: >-
      Deposit address creation and TRON watch address registration for the Sweep
      product.
paths:
  /v1/resimulation:
    post:
      tags:
        - mpcvault.platform.v1.PlatformAPI
      summary: Resimulation
      description: Resimulation returns the transaction simulation.
      operationId: mpcvault.platform.v1.PlatformAPI.Resimulation
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/mpcvault.platform.v1.ResimulationRequest'
        required: true
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/mpcvault.platform.v1.ResimulationResponse'
components:
  schemas:
    mpcvault.platform.v1.ResimulationRequest:
      type: object
      properties:
        signingRequestUuid:
          type: string
          title: signing_request_uuid
          description: >-
            UUID of the signing request to be simulated. It must be pending and
            must have been created by the same API token.
          format: uuid
          example: 9f5ee5fb-07f5-470c-a2ff-081e2d6d107a
      additionalProperties: false
      required:
        - signingRequestUuid
    mpcvault.platform.v1.ResimulationResponse:
      type: object
      properties:
        simulation:
          type: string
          title: simulation
          format: byte
          description: Simulation of the signing request.
        error:
          $ref: '#/components/schemas/mpcvault.platform.v1.Error'
      additionalProperties: false
      required:
        - simulation
    mpcvault.platform.v1.Error:
      type:
        - object
        - 'null'
      additionalProperties: false
      properties:
        message:
          type: string
          title: message
        executeSigningRequestsErrorCode:
          $ref: >-
            #/components/schemas/mpcvault.platform.v1.ExecuteSigningRequestsErrorCode
        serviceErrorCode:
          $ref: '#/components/schemas/mpcvault.platform.v1.ServiceErrorCode'
      description: Exactly one of the two error code fields is set.
    mpcvault.platform.v1.ExecuteSigningRequestsErrorCode:
      type: string
      title: ExecuteSigningRequestsErrorCode
      enum:
        - EXECUTE_SIGNING_REQUESTS_ERROR_CODE_UNSPECIFIED
        - EXECUTE_SIGNING_REQUESTS_ERROR_CODE_INSUFFICIENT_FUNDS
        - EXECUTE_SIGNING_REQUESTS_ERROR_CODE_ALREADY_DENIED
    mpcvault.platform.v1.ServiceErrorCode:
      type: string
      title: ServiceErrorCode
      enum:
        - SERVICE_ERROR_CODE_UNSPECIFIED
        - SERVICE_ERROR_CODE_ORG_SUBSCRIBED_PLAN_LIMIT_EXCEED
        - SERVICE_ERROR_CODE_ORG_SUBSCRIBED_PLAN_EXPIRED
        - SERVICE_ERROR_CODE_ORG_SUBSCRIBED_PLAN_NOT_SUPPORT
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-mtoken
      description: Your API token. Required for all API requests.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.