---
title: "Update contract"
method: PUT
path: "/v0/contracts/{chain}/{address}"
tags: ["Contracts"]
---

# Update contract

`PUT /v0/contracts/{chain}/{address}`

## Request

- Base URL: `https://api.formo.so`
- URL: `https://api.formo.so/v0/contracts/{chain}/{address}`
- Auth: HTTP bearer

## Path parameters

- `chain` string, required
- `address` string, required

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `address` string, required
  - `chain` integer, required
  - `name` string, required
  - `abi` string, required
  - `events` object[], required
  - `start_block` integer: Block height recorded on the contract. Omit to preserve the stored value. Note: the events pipeline currently opens every source at the chain head, so this does not backfill historical events.
  - `include_in_pipeline` boolean: Whether to include this contract in the project contract-events pipeline. Omit to preserve the stored value; send false to keep the ABI cached for transaction decoding without indexing events.

## Response `200`

Contract updated

- Contract
  - `name` string, required
  - `chain` integer, required
  - `address` string, required
  - `start_block` integer
  - `abi` string, required
  - `events` object[], required
    - `anonymous` boolean, required
    - `inputs` object[], required
    - `name` string, required
    - `type` string, required
  - `include_in_pipeline` boolean, required: Whether the contract is configured for the project contract-events pipeline. This is the desired membership, not live deployment state: use the `deploy` sidecar on the contract list to see what is currently deployed.

## Other responses

- `400`: The request was rejected. `code` is either `INVALID_VALIDATION_REQUEST` (Zod schema mismatch; `details` carries a `{ fieldPath: message }` map) or `BAD_REQUEST` (semantic validation failure outside Zod, e.g. mismatched IDs, business-rule violations). Branch on `code`, not status, to tell the two apart.
- `409`: The request conflicts with current resource state, or an `Idempotency-Key` request with the same key is currently in flight.

---

[API](https://skmtc.dev/formo/apis/formo-public-api.md) · [All operations](https://skmtc.dev/formo/apis/formo-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/formo/apis/formo-public-api/revisions/67ada57df63c?raw)
