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

# Send email template

> Send an email template to one email address or a comma-separated list (up to 25). Send the values for the template variables in variables as a JSON object, for example {"order_id":"A-1001"}; list the templates to see which variables each one takes. Each address is found or created as a contact (source api) and the email is sent directly through the channel sender: no campaign is created, and the email is saved in that contact email conversation. An address that unsubscribed, bounced, complained or has not confirmed yet (double opt-in) is skipped, and the sender daily limit and the monthly quota apply. The unsubscribe link is always included.

Authentication: API key via X-API-Key header (or Authorization: Bearer).
Permissions: User API key
Rate limit: api_messaging — 20 requests/min per API user.



## OpenAPI

````yaml /api-reference/workspace.openapi.json post /api/workspace/v1/email/templates/send
openapi: 3.1.0
info:
  title: Workspace API
  version: 1.0.0
  description: >-
    Manage contacts, labels, custom fields, WhatsApp messaging, and automations
    for your workspace.


    Generate your API key in the Developer Portal (profile menu → Developer) and
    send it in the `X-API-Key` header, or as `Authorization: Bearer <key>`.
    Never put the key in the URL.


    Every endpoint accepts POST with a JSON body, and also accepts GET with the
    same parameters as query-string values. All responses use the envelope `{
    success, data?, message?, error? }`.
servers:
  - url: https://YOUR_DOMAIN
    description: Your deployment, for example https://app.example.com
security: []
tags:
  - name: Channels
    description: Workspace API — Channels
  - name: Contacts
    description: Workspace API — Contacts
  - name: Custom Fields
    description: Workspace API — Custom Fields
  - name: Labels
    description: Workspace API — Labels
  - name: WhatsApp
    description: Workspace API — WhatsApp
  - name: Email
    description: Workspace API — Email
  - name: Automations
    description: Workspace API — Automations
paths:
  /api/workspace/v1/email/templates/send:
    post:
      tags:
        - Email
      summary: Send email template
      description: >-
        Send an email template to one email address or a comma-separated list
        (up to 25). Send the values for the template variables in variables as a
        JSON object, for example {"order_id":"A-1001"}; list the templates to
        see which variables each one takes. Each address is found or created as
        a contact (source api) and the email is sent directly through the
        channel sender: no campaign is created, and the email is saved in that
        contact email conversation. An address that unsubscribed, bounced,
        complained or has not confirmed yet (double opt-in) is skipped, and the
        sender daily limit and the monthly quota apply. The unsubscribe link is
        always included.


        Authentication: API key via X-API-Key header (or Authorization: Bearer).

        Permissions: User API key

        Rate limit: api_messaging — 20 requests/min per API user.
      parameters:
        - name: channelId
          in: query
          required: false
          description: Channel id. Auto-selects when omitted.
          schema:
            type: string
            example: ch_123
        - name: templateName
          in: query
          required: false
          description: Template name (case does not matter). Send this or templateId.
          schema:
            type: string
            example: order_update
        - name: templateId
          in: query
          required: false
          description: Template id from the list. Use it when two templates share a name.
          schema:
            type: string
            example: YOUR_TEMPLATEID
        - name: to
          in: query
          required: false
          description: One email address, or several separated by commas (up to 25).
          schema:
            type: string
            example: '919876543210'
        - name: variables
          in: query
          required: false
          description: >-
            Values for the variables the template takes, as a JSON object (a
            JSON text in a GET request). A variable the template needs and does
            not have a fallback for must be sent. A value can be a text with
            line breaks (one line per row in the email) or a list of texts, for
            example a change log: {"changelog":["Faster search","New export"]}
            shows one item per line.
          schema:
            type: object
            additionalProperties: true
            example: {}
        - name: listStyle
          in: query
          required: false
          description: >-
            How the items of a list value are written: plain (default), numbers
            ("1. Faster search") or dots.
          schema:
            type: string
            example: YOUR_LISTSTYLE
        - name: subject
          in: query
          required: false
          description: >-
            Replaces the subject of the template. One line, up to 300
            characters.
          schema:
            type: string
            example: YOUR_SUBJECT
        - name: senderId
          in: query
          required: false
          description: Sender connection id. The channel default sender when omitted.
          schema:
            type: string
            example: YOUR_SENDERID
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - to
              properties:
                channelId:
                  type: string
                  description: Channel id. Auto-selects when omitted.
                  example: ch_123
                templateName:
                  type: string
                  description: >-
                    Template name (case does not matter). Send this or
                    templateId.
                  example: order_update
                templateId:
                  type: string
                  description: >-
                    Template id from the list. Use it when two templates share a
                    name.
                  example: YOUR_TEMPLATEID
                to:
                  type: string
                  description: >-
                    One email address, or several separated by commas (up to
                    25).
                  example: '919876543210'
                variables:
                  type: object
                  additionalProperties: true
                  description: >-
                    Values for the variables the template takes, as a JSON
                    object (a JSON text in a GET request). A variable the
                    template needs and does not have a fallback for must be
                    sent. A value can be a text with line breaks (one line per
                    row in the email) or a list of texts, for example a change
                    log: {"changelog":["Faster search","New export"]} shows one
                    item per line.
                  example: {}
                listStyle:
                  type: string
                  description: >-
                    How the items of a list value are written: plain (default),
                    numbers ("1. Faster search") or dots.
                  example: YOUR_LISTSTYLE
                subject:
                  type: string
                  description: >-
                    Replaces the subject of the template. One line, up to 300
                    characters.
                  example: YOUR_SUBJECT
                senderId:
                  type: string
                  description: >-
                    Sender connection id. The channel default sender when
                    omitted.
                  example: YOUR_SENDERID
            example:
              templateName: Release notes
              to: asha@example.com,ravi@example.com
              variables:
                version: '2.4'
                changelog:
                  - Faster search
                  - New export to Excel
                  - Fixed the login bug
              listStyle: numbers
      responses:
        '200':
          description: 'Success. Envelope: { success:true, data, message? }.'
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                properties:
                  success:
                    type: boolean
                    example: true
                  data: {}
                  message:
                    type: string
                  pagination:
                    type: object
                  total:
                    type: number
              example:
                success: true
                data:
                  templateId: tpl_1
                  templateName: Order confirmation
                  recipients: 2
                  sent: 1
                  skipped: 1
                  failed: 0
                  results:
                    - email: asha@example.com
                      status: sent
                      messageId: msg_1
                    - email: ravi@example.com
                      status: skipped
                      reason: suppressed
                message: Sent 1 of 2
        '400':
          description: >-
            Missing/invalid parameters. Body has success:false plus error and
            message.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - error
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                  message:
                    type: string
        '401':
          description: >-
            Missing or invalid API key (or session expired for session
            endpoints).
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - error
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                  message:
                    type: string
        '403':
          description: >-
            Authenticated but not authorized — wrong permissions or cross-tenant
            resource.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - error
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                  message:
                    type: string
        '429':
          description: >-
            Rate limited. Retry after the Retry-After seconds; see RateLimit-*
            headers.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - error
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                  message:
                    type: string
        '500':
          description: >-
            Unexpected server error. Body has success:false plus error and
            message.
          content:
            application/json:
              schema:
                type: object
                required:
                  - success
                  - error
                properties:
                  success:
                    type: boolean
                    example: false
                  error:
                    type: string
                  message:
                    type: string
      security:
        - apiKeyHeader: []
        - bearerAuth: []
components:
  securitySchemes:
    apiKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
      description: Preferred. API key value directly.
    bearerAuth:
      type: http
      scheme: bearer
      description: Alternative. API key as the bearer token.

````

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