> ## Documentation Index
> Fetch the complete documentation index at: https://docs.tavus.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Patch Guardrails

> Update specific fields of a guardrail using [JSON Patch](https://jsonpatch.com/) operations. Paths must match the **current** document shape — compare against the response from [Get Guardrails](/api-reference/guardrails/get-guardrails) before patching.


<Info>
  For AI agents, use `https://docs.tavus.io/openapi.yaml` for the full HTTP API contract.
</Info>


## OpenAPI

````yaml patch /v2/guardrails/{guardrail_id}
openapi: 3.0.3
info:
  title: Tavus Developer API Collection
  version: 1.0.0
  contact: {}
servers:
  - url: https://tavusapi.com
security:
  - apiKey: []
tags:
  - name: Videos
  - name: Replicas
  - name: Voices
  - name: Conversations
  - name: Personas
  - name: Pronunciation Dictionaries
  - name: Replacements
  - name: Transcriptions
  - name: Documents
paths:
  /v2/guardrails/{guardrail_id}:
    parameters:
      - name: guardrail_id
        in: path
        required: true
        description: The unique identifier of the guardrail.
        schema:
          type: string
          example: g1234567890ab
    patch:
      tags:
        - Guardrails
      summary: Patch Guardrails
      description: >
        Update specific fields of a guardrail using [JSON
        Patch](https://jsonpatch.com/) operations. Paths must match the
        **current** document shape — compare against the response from [Get
        Guardrails](/api-reference/guardrails/get-guardrails) before patching.
      operationId: patchGuardrails
      requestBody:
        content:
          application/json:
            schema:
              type: array
              items:
                type: object
                properties:
                  op:
                    type: string
                    enum:
                      - add
                      - remove
                      - replace
                      - copy
                      - move
                      - test
                    example: replace
                  path:
                    type: string
                    description: >-
                      JSON Pointer (RFC 6901) to a field on the guardrail (e.g.
                      `/guardrail_prompt`, `/tags`, `/modality`).
                    example: /guardrail_prompt
                  value:
                    description: >-
                      The value used by the operation. Not required for
                      `remove`.
                    example: Updated prompt with stricter restrictions.
                required:
                  - op
                  - path
            examples:
              Update prompt:
                value:
                  - op: replace
                    path: /guardrail_prompt
                    value: Never discuss competitor products under any circumstances.
              Add a tag:
                value:
                  - op: add
                    path: /tags/-
                    value: compliance
              Replace all tags:
                value:
                  - op: replace
                    path: /tags
                    value:
                      - compliance
                      - healthcare
              Remove callback URL:
                value:
                  - op: remove
                    path: /callback_url
              Suppress app message:
                value:
                  - op: replace
                    path: /app_message
                    value: false
      responses:
        '200':
          description: Guardrail updated successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  uuid:
                    type: string
                    example: g1234567890ab
                  guardrail_name:
                    type: string
                  guardrail_prompt:
                    type: string
                  modality:
                    type: string
                  callback_url:
                    type: string
                  tags:
                    type: array
                    items:
                      type: string
                  app_message:
                    type: boolean
                    description: >-
                      Whether triggering this guardrail emits a real-time
                      app-message event on the conversation.
                  updated_at:
                    type: string
        '304':
          description: No changes were made to the guardrail
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Invalid patch operation
        '401':
          description: UNAUTHORIZED
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Invalid access token
        '422':
          description: Invalid JSON patch format
      security:
        - apiKey: []
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: x-api-key

````