---
title: "Update an Event Contract"
method: PATCH
path: "/events/contracts/{contractId}"
---

# Update an Event Contract

`PATCH /events/contracts/{contractId}`

Update an existing event contract

Patch an event contract based on its Hightouch ID

## Path parameters

- `contractId` string, required

## Request body

- EventContractUpdate — The input for updating a Contract
  - `name` string — The contract's name
  - `slug` string — The contract's slug. If not specified, one will be generated.
  - `description` string — The contract's description
  - `onUndeclaredSchema` 'ALLOW_EVENT' | 'BLOCK_EVENT' — What happens to events that aren't defined in the contract. One of ALLOW_EVENT or BLOCK_EVENT. Optional, defaults to ALLOW_EVENT.
  - `events` object[] — The definitions for the events in the contract.
    - `schema` object, required — The JSON schema that validates the event. Required.
    - `onUndeclaredFields` 'ALLOW_EVENT' | 'BLOCK_EVENT' | 'OMIT_FIELDS' — What happens to events that contain fields not in the schema. One of ALLOW_EVENT, BLOCK_EVENT, or OMIT_FIELDS. Optional, defaults to OMIT_FIELDS.
    - `onSchemaViolation` 'ALLOW_EVENT' | 'BLOCK_EVENT' — What happens to events that violate the schema. One of ALLOW_EVENT or BLOCK_EVENT. Optional, defaults to BLOCK_EVENT.
    - `version` string — The event version. Defaults to "default", optional. You probably don't need to set this.
    - `slug` string — The event's slug. If not specified, one will be generated.
    - `name` string — The event's name. Required for track events.
    - `type` 'track' | 'identify' | 'page' | 'screen' | 'group', required — The event's type. One of track, identify, page, screen, or group. Required.

## Response `200`

Ok

- union
  - EventContractUpdate — The input for updating a Contract
    - `name` string — The contract's name
    - `slug` string — The contract's slug. If not specified, one will be generated.
    - `description` string — The contract's description
    - `onUndeclaredSchema` 'ALLOW_EVENT' | 'BLOCK_EVENT' — What happens to events that aren't defined in the contract. One of ALLOW_EVENT or BLOCK_EVENT. Optional, defaults to ALLOW_EVENT.
    - `events` object[] — The definitions for the events in the contract.
      - `schema` object, required — The JSON schema that validates the event. Required.
      - `onUndeclaredFields` 'ALLOW_EVENT' | 'BLOCK_EVENT' | 'OMIT_FIELDS' — What happens to events that contain fields not in the schema. One of ALLOW_EVENT, BLOCK_EVENT, or OMIT_FIELDS. Optional, defaults to OMIT_FIELDS.
      - `onSchemaViolation` 'ALLOW_EVENT' | 'BLOCK_EVENT' — What happens to events that violate the schema. One of ALLOW_EVENT or BLOCK_EVENT. Optional, defaults to BLOCK_EVENT.
      - `version` string — The event version. Defaults to "default", optional. You probably don't need to set this.
      - `slug` string — The event's slug. If not specified, one will be generated.
      - `name` string — The event's name. Required for track events.
      - `type` 'track' | 'identify' | 'page' | 'screen' | 'group', required — The event's type. One of track, identify, page, screen, or group. Required.
  - ValidateErrorJSON
    - `message` 'Validation failed', required
    - `details` object, required
  - 'Internal Server Error'

## Other responses

- `401` — Unauthorized
- `403` — Forbidden
- `404` — Not found
- `422` — Validation Failed
- `500` — Something went wrong

---

[API](https://skmtc.net/hightouch/apis/hightouch-api.md) · [All operations](https://skmtc.net/hightouch/apis/hightouch-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/hightouch/hightouch-api/revisions/24a8012aa8c8/schema)
