# Replaces **PATCH /v1/{contextId}/rules/add** Replaces or updates an existing rule within the context ## Servers - Cloud hosted production server: https://api.brease.run (Cloud hosted production server) - Development server: http://localhost:4400 (Development server) ## Parameters ### Path parameters - **contextId** (string) The parent context ID, for example, "contextID1/rules/{rule_id}/versions" ### Query parameters - **updateMask** (string(field-mask)) The update mask applies to the resource. For the `FieldMask` definition, see https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#fieldmask ### Body: application/json (object) - **id** (string) example:"rule_01h89qfdhbejtb3jwqq1gazbm5" - **sequence** (integer(uint32)) The sequence number of the rule within the context - **description** (string) - **actions** (array[object]) - **expression** (object) A variadic condition expression Expression: type: object oneOf: - $ref: '#/components/schemas/And' - $ref: '#/components/schemas/Or' - $ref: '#/components/schemas/Condition' ## Responses ### 200 OK #### Body: application/json (object) - **id** (string) example:"rule_01h89qfdhbejtb3jwqq1gazbm5" - **version** (string) - **sequence** (integer(uint32)) The sequence number of the rule within the context - **description** (string) - **actions** (array[object]) - **expression** (object) A variadic condition expression Expression: type: object oneOf: - $ref: '#/components/schemas/And' - $ref: '#/components/schemas/Or' - $ref: '#/components/schemas/Condition' ### default Default error response #### Body: application/json (object) - **code** (integer(int32)) The status code, which should be an enum value of [google.rpc.Code][google.rpc.Code]. - **message** (string) A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the [google.rpc.Status.details][google.rpc.Status.details] field, or localized by the client. - **details** (array[object]) A list of messages that carry the error details. There is a common set of message types for APIs to use. [Powered by Bump.sh](https://bump.sh)