---
title: "Adds a transition new rules to the document."
method: POST
path: "/v2/documents/{document_id}/transition_rules"
tags: ["Documents"]
---

# Adds a transition new rules to the document.

`POST /v2/documents/{document_id}/transition_rules`

Adds a new transition rules to the document.

## Path parameters

- `document_id` string, required

## Headers

- `authorization` string, required

## Request body

- PendingAddTransitionRules
  - `attribute_rules` PendingAttributeRule[]
    - `key_label` string — attribute key label
    - `role_id` string — roleID is 32 byte role ID in hex. RoleID should already be part of the document.
  - `compute_fields_rules` PendingComputeFieldsRule[]
    - `attribute_labels` string[] — AttributeLabels that are passed to the WASM for execution
    - `target_attribute_label` string — TargetAttributeLabel is the label of the attribute which holds the result from the executed WASM. This attribute is automatically added and updated everytime document is updated.
    - `wasm` string

## Response `200`

OK

- V2TransitionRules
  - `rules` V2TransitionRule[]
    - `action` string
    - `attribute_labels` string[]
    - `field` string
    - `roles` string[]
    - `rule_id` string
    - `target_attribute_label` integer[]
    - `wasm` string

## Other responses

- `400` — Bad Request
- `403` — Forbidden
- `404` — Not Found

---

[API](https://skmtc.net/centrifuge/apis/centrifuge-os-node-api.md) · [All operations](https://skmtc.net/centrifuge/apis/centrifuge-os-node-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/centrifuge/centrifuge-os-node-api/revisions/36808f8744e0/schema)
