---
title: "Audit a contract computation"
method: POST
path: "/api/v1/contracts/{contract_id}/audit"
tags: ["Contracts", "Schema", "Audit"]
---

# Audit a contract computation

`POST /api/v1/contracts/{contract_id}/audit`

Execute a contract computation with given inputs and return the results.

## Path parameters

- `contract_id` string, required

## Request body

- AuditRequest — Request to audit/execute a contract computation with given inputs.
  - `scope_name` string, nullable — The scope to execute. If not provided, uses the contract's main scope.
  - `inputs` object, required — Input values for the computation. Keys are field names, values match the expected types.

## Response `200`

Successful Response

- AuditResponse — Response from auditing a contract computation.
  - `success` boolean, required — Whether the computation succeeded
  - `contract_id` string, required — The contract that was audited
  - `scope_executed` string, required — The scope that was executed
  - `inputs_provided` object, required — The inputs that were provided
  - `outputs` object, required — The computed output values from the main scope
  - `all_scopes` object — All variable values organized by scope (for detailed audit trail)
  - `error` string, nullable — Error message if computation failed
  - `execution_time_ms` integer, nullable — Execution time in milliseconds

## Other responses

- `422` — Validation Error

## Changes

- **2026-03-17** `68622707ed43` — 2 info
  - the endpoint scheme security `APIKeyHeader` was added to the API
  - the endpoint scheme security `HTTPBearer` was added to the API

[Change history](https://skmtc.dev/benchify/apis/benchify-contract-api/changes/api/v1/contracts/:contract_id/audit/post.md)

---

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