---
title: "Set global contract ruleset"
method: PUT
path: "/admin/contracts/ruleset"
tags: ["Admin", "Contracts"]
---

# Set global contract ruleset

`PUT /admin/contracts/ruleset`

## Request

- The document declares no server URL.
- Auth: none declared

Sets the global contract ruleset that applies to all artifacts.

## Request body

- ContractRuleSet: A set of contract rules, divided into domain and migration categories.
  - `domainRules` ContractRule[]: Rules for domain validation.
    - `name` string, required: The rule name.
    - `kind` 'CONDITION' | 'TRANSFORM', required: The rule kind.
    - `type` string, required: Rule executor type (CEL, CEL_FIELD, ENCRYPT, etc.).
    - `mode` 'WRITE' | 'READ' | 'WRITEREAD' | 'UPGRADE' | 'DOWNGRADE', required: When the rule is applied.
    - `expr` string: The rule expression.
    - `params` object: Rule parameters.
    - `tags` string[]: Tags for categorizing the rule.
    - `onSuccess` 'NONE' | 'ERROR' | 'DLQ': Action on rule success.
    - `onFailure` 'NONE' | 'ERROR' | 'DLQ': Action on rule failure.
    - `disabled` boolean: Whether the rule is disabled.
  - `migrationRules` ContractRule[]: Rules for version migration.
    - `name` string, required: The rule name.
    - `kind` 'CONDITION' | 'TRANSFORM', required: The rule kind.
    - `type` string, required: Rule executor type (CEL, CEL_FIELD, ENCRYPT, etc.).
    - `mode` 'WRITE' | 'READ' | 'WRITEREAD' | 'UPGRADE' | 'DOWNGRADE', required: When the rule is applied.
    - `expr` string: The rule expression.
    - `params` object: Rule parameters.
    - `tags` string[]: Tags for categorizing the rule.
    - `onSuccess` 'NONE' | 'ERROR' | 'DLQ': Action on rule success.
    - `onFailure` 'NONE' | 'ERROR' | 'DLQ': Action on rule failure.
    - `disabled` boolean: Whether the rule is disabled.

## Response `200`

The global contract ruleset was set.

- ContractRuleSet: A set of contract rules, divided into domain and migration categories.
  - `domainRules` ContractRule[]: Rules for domain validation.
    - `name` string, required: The rule name.
    - `kind` 'CONDITION' | 'TRANSFORM', required: The rule kind.
    - `type` string, required: Rule executor type (CEL, CEL_FIELD, ENCRYPT, etc.).
    - `mode` 'WRITE' | 'READ' | 'WRITEREAD' | 'UPGRADE' | 'DOWNGRADE', required: When the rule is applied.
    - `expr` string: The rule expression.
    - `params` object: Rule parameters.
    - `tags` string[]: Tags for categorizing the rule.
    - `onSuccess` 'NONE' | 'ERROR' | 'DLQ': Action on rule success.
    - `onFailure` 'NONE' | 'ERROR' | 'DLQ': Action on rule failure.
    - `disabled` boolean: Whether the rule is disabled.
  - `migrationRules` ContractRule[]: Rules for version migration.
    - `name` string, required: The rule name.
    - `kind` 'CONDITION' | 'TRANSFORM', required: The rule kind.
    - `type` string, required: Rule executor type (CEL, CEL_FIELD, ENCRYPT, etc.).
    - `mode` 'WRITE' | 'READ' | 'WRITEREAD' | 'UPGRADE' | 'DOWNGRADE', required: When the rule is applied.
    - `expr` string: The rule expression.
    - `params` object: Rule parameters.
    - `tags` string[]: Tags for categorizing the rule.
    - `onSuccess` 'NONE' | 'ERROR' | 'DLQ': Action on rule success.
    - `onFailure` 'NONE' | 'ERROR' | 'DLQ': Action on rule failure.
    - `disabled` boolean: Whether the rule is disabled.

## Other responses

- `500`: Common response for all operations that can fail with an unexpected server error.

## Changes

- **2026-10-31** `ff9684af2aad`: 5 info
  - added the optional property `ruleViolation/causes/items/code` to the response with the `500` status
  - added the optional property `ruleViolation/causes/items/direction` to the response with the `500` status
  - added the optional property `ruleViolation/causes/items/existing` to the response with the `500` status
  - added the optional property `ruleViolation/causes/items/proposed` to the response with the `500` status
  - …1 more
- **2026-10-29** `f17f5df4e79c`: 1 info
  - added the optional property `ruleViolation` to the response with the `500` status
- **2026-05-19** `96ff089c4fd9`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/apicurio/apis/apicurio-registry-api-v3/changes/admin/contracts/ruleset/put.md)

---

[API](https://skmtc.dev/apicurio/apis/apicurio-registry-api-v3.md) - [All operations](https://skmtc.dev/apicurio/apis/apicurio-registry-api-v3/llms.txt) - [OpenAPI document](https://skmtc.dev/apicurio/apis/apicurio-registry-api-v3/revisions/ff9684af2aad?raw)
