> ## 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 an email channel's template

> Set an email address's reply template. Every reply sent from the address uses the new version immediately.

Send `null` or an empty string to reset the address to the default template. A template without `{{content}}` is rejected with `400`. Requires the `email:write` scope.

See [Reply Templates](https://docs.open.cx/email/reply-templates.md) for every variable, including the per-agent `{{agent_name}}`, `{{agent_title}}`, `{{agent_email}}`, `{{agent_phone}}` and `{{agent_profile_url}}`.


## OpenAPI

````yaml patch /email/channels/{emailChannelId}
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:
  /email/channels/{emailChannelId}:
    patch:
      summary: Update an email channel's template
      description: >-
        Set the HTML template of one inbox; null or an empty string resets it to
        the built-in default. Applies to every reply sent from the inbox from
        then on.
      operationId: updateEmailChannelTemplate
      parameters:
        - schema:
            type: string
          in: path
          name: emailChannelId
          required: true
          description: Email channel ID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdatePublicEmailChannelTemplateDto'
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicEmailChannelDto'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorDto'
components:
  schemas:
    UpdatePublicEmailChannelTemplateDto:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/UpdatePublicEmailChannelTemplateDtoInput'
      type: object
      properties:
        html_template:
          description: >-
            Full HTML template wrapping outbound emails. When null/empty, falls
            back to a built-in default. Required slot: {{content}}. Optional
            slots: {{ticket_number}}, {{zendesk_ticket_id}},
            {{session.language}}, {{agent_name}}, {{agent_title}},
            {{agent_email}}, {{agent_phone}}, {{agent_profile_url}},
            {{quoted_content}}. Agent slots are empty while only the AI has
            handled the session; contact details (email, work phone and profile
            link) are also empty when an alias masks the agent (showing first
            names only does not hide it). Supports {{#if
            expr}}...{{else}}...{{/if}} conditionals.
          type:
            - string
            - 'null'
    PublicEmailChannelDto:
      $schema: https://json-schema.org/draft/2020-12/schema
      $id: '#/components/schemas/PublicEmailChannelDto'
      type: object
      properties:
        id:
          type: string
        email:
          type: string
        connection_status:
          type: string
          enum:
            - connected
            - failed
            - pending
        is_default:
          type: boolean
        sender_name:
          type:
            - string
            - 'null'
        html_template:
          type:
            - string
            - 'null'
        sender_signature:
          type:
            - string
            - 'null'
      required:
        - id
        - email
        - connection_status
        - is_default
        - sender_name
        - html_template
        - sender_signature
      additionalProperties: false
    ErrorDto:
      type: object
      properties:
        statusCode:
          type: integer
        message:
          type: string
        error:
          type: string
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````

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