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

# Save message defaults

> Saves your default text in this workspace, as Save as default does in the editor. Each section you send replaces that default; the others stay. Existing automations keep their own text.

Needs an API key with write access.



## OpenAPI

````yaml /api-reference/openapi.json patch /v1/workspaces/{workspace_id}/message-defaults
openapi: 3.1.0
info:
  title: Replier API
  version: '1'
servers:
  - url: https://api.usereplier.com
security:
  - apiKey: []
paths:
  /v1/workspaces/{workspace_id}/message-defaults:
    patch:
      tags:
        - Messages
      summary: Save message defaults
      description: >-
        Saves your default text in this workspace, as Save as default does in
        the editor. Each section you send replaces that default; the others
        stay. Existing automations keep their own text.


        Needs an API key with write access.
      operationId: update_message_defaults
      parameters:
        - name: workspace_id
          in: path
          required: true
          description: Workspace ID returned by `GET /v1/workspaces`
          schema:
            type: string
            format: uuid
            pattern: >-
              ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
        - name: Idempotency-Key
          in: header
          required: false
          description: >-
            Send the same key when you retry, and the request runs once. Without
            one, every request runs.
          schema:
            type: string
            minLength: 1
            maxLength: 128
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                opening:
                  type: object
                  properties:
                    message:
                      description: >-
                        {{name}} becomes the recipient's name and {{username}}
                        their Instagram username; each falls back to the other
                        when Meta doesn't share it and counts as 30 characters
                        toward the limit.
                      type: string
                      minLength: 1
                    button_text:
                      type: string
                      minLength: 1
                      maxLength: 20
                  required:
                    - message
                    - button_text
                  additionalProperties: false
                email:
                  type: object
                  properties:
                    message:
                      description: >-
                        {{name}} becomes the recipient's name and {{username}}
                        their Instagram username; each falls back to the other
                        when Meta doesn't share it and counts as 30 characters
                        toward the limit.
                      type: string
                      minLength: 1
                    retry_message:
                      description: >-
                        {{name}} becomes the recipient's name and {{username}}
                        their Instagram username; each falls back to the other
                        when Meta doesn't share it and counts as 30 characters
                        toward the limit.
                      type: string
                      minLength: 1
                  required:
                    - message
                    - retry_message
                  additionalProperties: false
                follow_gate:
                  type: object
                  properties:
                    message:
                      type: string
                      minLength: 1
                    button_text:
                      type: string
                      minLength: 1
                      maxLength: 20
                    retry_message:
                      type: string
                      minLength: 1
                    retry_button_text:
                      type: string
                      minLength: 1
                      maxLength: 20
                    profile_button_text:
                      description: Null or left out keeps the saved text.
                      anyOf:
                        - type: string
                          minLength: 1
                          maxLength: 20
                        - type: 'null'
                  required:
                    - message
                    - button_text
                    - retry_message
                    - retry_button_text
                  additionalProperties: false
                public_replies:
                  type: object
                  properties:
                    replies:
                      minItems: 1
                      maxItems: 5
                      type: array
                      items:
                        type: string
                        minLength: 1
                        maxLength: 300
                    selection:
                      type: string
                      enum:
                        - random
                        - round_robin
                  required:
                    - replies
                    - selection
                  additionalProperties: false
              additionalProperties: false
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                type: object
                properties:
                  workspace:
                    type: object
                    properties:
                      id:
                        type: string
                        format: uuid
                        pattern: >-
                          ^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$
                      name:
                        type: string
                      kind:
                        type: string
                        enum:
                          - personal
                          - agency
                      role:
                        type: string
                        enum:
                          - owner
                          - admin
                          - member
                    required:
                      - id
                      - name
                      - kind
                      - role
                  defaults:
                    description: >-
                      Text you saved with Save as default in the Replier editor
                      in this workspace; null where nothing is saved. New
                      automations use it when their text is left out: gates and
                      Follow Gate when they are turned on, public replies at
                      creation.
                    type: object
                    properties:
                      opening:
                        anyOf:
                          - type: object
                            properties:
                              message:
                                type: string
                              button_text:
                                type: string
                            required:
                              - message
                              - button_text
                          - type: 'null'
                      email:
                        anyOf:
                          - type: object
                            properties:
                              message:
                                type: string
                              retry_message:
                                type: string
                            required:
                              - message
                              - retry_message
                          - type: 'null'
                      follow_gate:
                        anyOf:
                          - type: object
                            properties:
                              message:
                                type: string
                              button_text:
                                type: string
                              retry_message:
                                type: string
                              retry_button_text:
                                type: string
                              profile_button_text:
                                description: Null when no profile button text is saved.
                                type:
                                  - string
                                  - 'null'
                            required:
                              - message
                              - button_text
                              - retry_message
                              - retry_button_text
                          - type: 'null'
                      public_replies:
                        anyOf:
                          - type: object
                            properties:
                              replies:
                                type: array
                                items:
                                  type: string
                              selection:
                                type: string
                                enum:
                                  - random
                                  - round_robin
                            required:
                              - replies
                              - selection
                          - type: 'null'
                    required:
                      - opening
                      - email
                      - follow_gate
                      - public_replies
                required:
                  - workspace
                  - defaults
        default:
          $ref: '#/components/responses/Error'
components:
  responses:
    Error:
      description: Refused
      content:
        application/json:
          schema:
            type: object
            required:
              - error
            properties:
              error:
                type: object
                required:
                  - code
                  - message
                properties:
                  code:
                    type: string
                    description: >-
                      Why the request was refused, such as AUTOMATION_NOT_FOUND
                      or VERSION_CONFLICT. Other fields beside it give details.
                  message:
                    type: string
                    description: The same reason, in English.
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      description: A Replier API key (rpl_...).

````

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