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

# Update a macro

> Partially update an org-wide macro (saved reply): its title, body, options, or whether it can be suggested. Only the fields you send change.

Changing the `title`, `content`, or `options` refreshes the macro's translations in the background, so there is nothing to translate by hand. Translations are never edited directly; change the wording here instead. Set `exclude_from_suggestions` to `true` to keep the macro out of the suggestions agents see (they can still search for it).


## OpenAPI

````yaml patch /macros/{id}
openapi: 3.1.0
info:
  title: OpenCX API
  description: >

    OpenCX is an AI-powered, all-in-one platform for customer support and
    outbound communications.


    Use this API to manage your OpenCX organization's AI agents, actions,
    conversations, contacts, and more.


    To get started, generate a new API key from the dashboard.


    ## Authentication

    All API endpoints require authentication using a Bearer token. You can
    generate an API key from your OpenCX dashboard.


    ## Rate Limiting

    API requests are rate limited to ensure fair usage. The current limits are:

    - 100 requests per minute for standard endpoints

    - 1000 requests per minute for streaming endpoints


    ## Error Handling

    The API uses standard HTTP status codes and returns detailed error messages
    in the response body.
  version: 1.0-beta
  license:
    name: MIT
    url: https://opensource.org/licenses/MIT
servers:
  - url: http://localhost:8080
    description: Development
  - url: https://api.open.cx
    description: Production
security:
  - bearerAuth: []
paths:
  /macros/{id}:
    patch:
      summary: Update a macro
      description: >-
        Partially update a saved-reply macro. Attachments are dashboard-authored
        and cannot be changed via the public API; text-only updates leave
        attachments and options untouched.
      operationId: updateMacro
      parameters:
        - schema:
            type: string
          in: path
          name: id
          required: true
          description: Macro ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateMacroInput'
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SavedReplyDto'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDto'
components:
  schemas:
    UpdateMacroInput:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/UpdateMacroInputInput'
      type: object
      properties:
        category:
          type: string
        title:
          type: string
        content:
          type: string
          maxLength: 20000
          description: >-
            Macro body as HTML, limited to what every channel can carry: <p>,
            <br>, <strong>, <em>, <s>, <a href>, <ul>/<ol start>/<li> and inline
            images as `<img src="…">` pointing at a file uploaded for this
            organization. Other markup is dropped (its text is kept); escape
            literal < and & as HTML entities, and use <br> or <p> for line
            breaks. Reference variables with {{variable}} syntax.
        options:
          description: >-
            Up to 3 options the customer can tap instead of typing, sent with
            the macro on channels that show them. Each `label` is up to 20
            characters. `type` is `text` (the tap reaches the session as the
            customer's reply) or `workflow` (the tap runs the macro's Macro
            Option Clicked workflows and the AI doesn't reply). This is the full
            list: on update, pass an existing option's `id` to keep it
            (workflows branching on that id keep working); options left out are
            removed, `[]` removes all, and omitting the field leaves them
            untouched. A macro with options needs body text.
          maxItems: 3
          type: array
          items:
            $ref: '#/components/schemas/MacroOptionInputDto'
        exclude_from_suggestions:
          description: >-
            When true, this macro is never suggested to agents. They can still
            search for it and use it.
          type: boolean
    SavedReplyDto:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/SavedReplyDto'
      type: object
      properties:
        id:
          type: string
        org_id:
          type: string
        category:
          type: string
        title:
          type: string
        content:
          type: string
          description: Macro body as channel-safe HTML, with {{variable}} references.
        attachments:
          type: array
          items:
            $ref: '#/components/schemas/MacroAttachmentDto'
        options:
          type: array
          items:
            $ref: '#/components/schemas/MessageOptionDto'
        user_id:
          anyOf:
            - type: number
            - type: 'null'
        overrides_saved_reply_id:
          anyOf:
            - type: string
            - type: 'null'
        exclude_from_suggestions:
          type: boolean
        source_language:
          anyOf:
            - type: string
            - type: 'null'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - id
        - org_id
        - category
        - title
        - content
        - attachments
        - options
        - user_id
        - overrides_saved_reply_id
        - exclude_from_suggestions
        - source_language
        - created_at
        - updated_at
      additionalProperties: false
    ErrorDto:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          type: string
        error:
          type: string
    MacroOptionInputDto:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/MacroOptionInputDtoInput'
      type: object
      properties:
        id:
          type: string
        label:
          type: string
          minLength: 1
          maxLength: 20
        type:
          $ref: '#/components/schemas/MessageOptionType'
      required:
        - label
        - type
    MacroAttachmentDto:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/MacroAttachmentDto'
      type: object
      properties:
        id:
          type: string
        name:
          type: string
        size:
          type: number
        type:
          type: string
        url:
          type: string
      required:
        - id
        - name
        - size
        - type
        - url
      additionalProperties: false
    MessageOptionDto:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/MessageOptionDto'
      type: object
      properties:
        id:
          type: string
        label:
          type: string
        type:
          $ref: '#/components/schemas/MessageOptionType'
      required:
        - id
        - label
        - type
      additionalProperties: false
    MessageOptionType:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/MessageOptionType'
      type: string
      enum:
        - text
        - workflow
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.