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

# POST /api/admin/content/templates/batch-send

> Send messages to a batch of users using a message template.



## OpenAPI

````yaml post /api/admin/content/templates/batch-send
openapi: 3.1.0
info:
  title: Dittofeed API
  description: Dittofeed API Swagger Documentation
  version: 0.0.1
servers: []
security: []
paths:
  /api/admin/content/templates/batch-send:
    post:
      tags:
        - Content
      description: Send messages to a batch of users using a message template.
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - type: object
                  properties:
                    workspaceId:
                      type: string
                    templateId:
                      type: string
                    subscriptionGroupId:
                      type: string
                    users:
                      type: array
                      items:
                        type: object
                        properties:
                          id:
                            type: string
                          messageId:
                            description: >-
                              Message Id to set on the tracked event. If not
                              provided, a message id will be generated.
                            type: string
                          properties:
                            description: >-
                              User property values to be rendered in the
                              message, keyed by name. Will override values
                              present on the user.
                            type: object
                            additionalProperties: {}
                          context:
                            description: >-
                              Context values for this specific user's events.
                              Will override batch-level context values.
                            type: object
                            additionalProperties: {}
                        required:
                          - id
                          - properties
                    context:
                      type: object
                      additionalProperties: {}
                    channel:
                      type: string
                      enum:
                        - Email
                    provider:
                      anyOf:
                        - type: string
                          enum:
                            - SendGrid
                        - type: string
                          enum:
                            - AmazonSes
                        - type: string
                          enum:
                            - Resend
                        - type: string
                          enum:
                            - PostMark
                        - type: string
                          enum:
                            - Smtp
                        - type: string
                          enum:
                            - Test
                        - type: string
                          enum:
                            - MailChimp
                        - type: string
                          enum:
                            - Gmail
                  required:
                    - workspaceId
                    - templateId
                    - users
                    - channel
                - type: object
                  properties:
                    workspaceId:
                      type: string
                    templateId:
                      type: string
                    subscriptionGroupId:
                      type: string
                    users:
                      type: array
                      items:
                        type: object
                        properties:
                          id:
                            type: string
                          messageId:
                            description: >-
                              Message Id to set on the tracked event. If not
                              provided, a message id will be generated.
                            type: string
                          properties:
                            description: >-
                              User property values to be rendered in the
                              message, keyed by name. Will override values
                              present on the user.
                            type: object
                            additionalProperties: {}
                          context:
                            description: >-
                              Context values for this specific user's events.
                              Will override batch-level context values.
                            type: object
                            additionalProperties: {}
                        required:
                          - id
                          - properties
                    context:
                      type: object
                      additionalProperties: {}
                    channel:
                      type: string
                      enum:
                        - Sms
                    provider:
                      anyOf:
                        - type: string
                          enum:
                            - Twilio
                        - type: string
                          enum:
                            - SignalWire
                        - type: string
                          enum:
                            - Test
                  required:
                    - workspaceId
                    - templateId
                    - users
                    - channel
                - type: object
                  properties:
                    workspaceId:
                      type: string
                    templateId:
                      type: string
                    subscriptionGroupId:
                      type: string
                    users:
                      type: array
                      items:
                        type: object
                        properties:
                          id:
                            type: string
                          messageId:
                            description: >-
                              Message Id to set on the tracked event. If not
                              provided, a message id will be generated.
                            type: string
                          properties:
                            description: >-
                              User property values to be rendered in the
                              message, keyed by name. Will override values
                              present on the user.
                            type: object
                            additionalProperties: {}
                          context:
                            description: >-
                              Context values for this specific user's events.
                              Will override batch-level context values.
                            type: object
                            additionalProperties: {}
                        required:
                          - id
                          - properties
                    context:
                      type: object
                      additionalProperties: {}
                    channel:
                      type: string
                      enum:
                        - Webhook
                    provider:
                      type: 'null'
                  required:
                    - workspaceId
                    - templateId
                    - users
                    - channel
      responses:
        '200':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  results:
                    type: array
                    items:
                      anyOf:
                        - type: object
                          properties:
                            userId:
                              type: string
                            type:
                              type: string
                              enum:
                                - Success
                            messageId:
                              type: string
                          required:
                            - userId
                            - type
                            - messageId
                        - type: object
                          properties:
                            userId:
                              type: string
                            type:
                              type: string
                              enum:
                                - Skipped
                            reason:
                              type: string
                            messageId:
                              type: string
                          required:
                            - userId
                            - type
                            - reason
                            - messageId
                        - type: object
                          properties:
                            userId:
                              type: string
                            type:
                              type: string
                              enum:
                                - RetryableError
                            messageId:
                              type: string
                            error:
                              type: object
                              properties:
                                message:
                                  type: string
                              required:
                                - message
                          required:
                            - userId
                            - type
                            - messageId
                            - error
                        - type: object
                          properties:
                            userId:
                              type: string
                            type:
                              type: string
                              enum:
                                - NonRetryableError
                            messageId:
                              type: string
                            error:
                              anyOf:
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - DFBadWorkspaceConfiguration
                                    variant:
                                      anyOf:
                                        - type: object
                                          properties:
                                            type:
                                              type: string
                                              enum:
                                                - MessageTemplateNotFound
                                          required:
                                            - type
                                        - type: object
                                          properties:
                                            type:
                                              type: string
                                              enum:
                                                - MessageTemplateMisconfigured
                                            message:
                                              type: string
                                          required:
                                            - type
                                            - message
                                        - type: object
                                          properties:
                                            type:
                                              type: string
                                              enum:
                                                - MessageTemplateRenderError
                                            field:
                                              type: string
                                            error:
                                              type: string
                                          required:
                                            - type
                                            - field
                                            - error
                                        - type: object
                                          properties:
                                            type:
                                              type: string
                                              enum:
                                                - JourneyNotFound
                                          required:
                                            - type
                                        - type: object
                                          properties:
                                            type:
                                              type: string
                                              enum:
                                                - SubscriptionGroupNotFound
                                          required:
                                            - type
                                        - type: object
                                          properties:
                                            type:
                                              type: string
                                              enum:
                                                - IdentifierNotFound
                                          required:
                                            - type
                                        - type: object
                                          properties:
                                            type:
                                              type: string
                                              enum:
                                                - SubscriptionSecretNotFound
                                          required:
                                            - type
                                        - type: object
                                          properties:
                                            type:
                                              type: string
                                              enum:
                                                - MessageServiceProviderNotFound
                                          required:
                                            - type
                                        - type: object
                                          properties:
                                            type:
                                              type: string
                                              enum:
                                                - MessageServiceProviderMisconfigured
                                            message:
                                              type: string
                                          required:
                                            - type
                                  required:
                                    - type
                                    - variant
                                - type: object
                                  properties:
                                    type:
                                      type: string
                                      enum:
                                        - DFMessageFailure
                                    variant:
                                      anyOf:
                                        - type: object
                                          properties:
                                            type:
                                              type: string
                                              enum:
                                                - Email
                                            provider:
                                              anyOf:
                                                - type: object
                                                  properties:
                                                    type:
                                                      type: string
                                                      enum:
                                                        - SendGrid
                                                    status:
                                                      type: number
                                                    body:
                                                      type: string
                                                  required:
                                                    - type
                                                - type: object
                                                  properties:
                                                    type:
                                                      type: string
                                                      enum:
                                                        - MailChimp
                                                    message:
                                                      type: string
                                                    name:
                                                      type: string
                                                  required:
                                                    - type
                                                    - message
                                                    - name
                                                - type: object
                                                  properties:
                                                    type:
                                                      type: string
                                                      enum:
                                                        - AmazonSes
                                                    message:
                                                      type: string
                                                  required:
                                                    - type
                                                - type: object
                                                  properties:
                                                    type:
                                                      type: string
                                                      enum:
                                                        - Resend
                                                    message:
                                                      type: string
                                                    name:
                                                      type: string
                                                  required:
                                                    - type
                                                    - message
                                                    - name
                                                - type: object
                                                  properties:
                                                    type:
                                                      type: string
                                                      enum:
                                                        - PostMark
                                                    message:
                                                      type: string
                                                    name:
                                                      type: string
                                                  required:
                                                    - type
                                                    - message
                                                    - name
                                                - type: object
                                                  properties:
                                                    type:
                                                      type: string
                                                      enum:
                                                        - Smtp
                                                    message:
                                                      type: string
                                                  required:
                                                    - type
                                                    - message
                                                - anyOf:
                                                    - type: object
                                                      properties:
                                                        type:
                                                          type: string
                                                          enum:
                                                            - Gmail
                                                        errorType:
                                                          type: string
                                                          enum:
                                                            - NonRetryableGoogleError
                                                        message:
                                                          type: string
                                                        statusCode:
                                                          anyOf:
                                                            - type: string
                                                            - type: number
                                                            - type: 'null'
                                                        googleErrorCode:
                                                          anyOf:
                                                            - type: string
                                                            - type: 'null'
                                                        googleErrorDescription:
                                                          anyOf:
                                                            - type: string
                                                            - type: 'null'
                                                        details: {}
                                                      required:
                                                        - type
                                                        - errorType
                                                        - message
                                                    - type: object
                                                      properties:
                                                        type:
                                                          type: string
                                                          enum:
                                                            - Gmail
                                                        errorType:
                                                          type: string
                                                          enum:
                                                            - ConfigurationError
                                                        message:
                                                          type: string
                                                        details: {}
                                                      required:
                                                        - type
                                                        - errorType
                                                        - message
                                                    - type: object
                                                      properties:
                                                        type:
                                                          type: string
                                                          enum:
                                                            - Gmail
                                                        errorType:
                                                          type: string
                                                          enum:
                                                            - ConstructionError
                                                        message:
                                                          type: string
                                                        details: {}
                                                      required:
                                                        - type
                                                        - errorType
                                                        - message
                                                    - type: object
                                                      properties:
                                                        type:
                                                          type: string
                                                          enum:
                                                            - Gmail
                                                        errorType:
                                                          type: string
                                                          enum:
                                                            - UnknownError
                                                        message:
                                                          type: string
                                                        details: {}
                                                      required:
                                                        - type
                                                        - errorType
                                                        - message
                                          required:
                                            - type
                                            - provider
                                        - type: object
                                          properties:
                                            type:
                                              type: string
                                              enum:
                                                - Sms
                                            provider:
                                              anyOf:
                                                - type: object
                                                  properties:
                                                    type:
                                                      type: string
                                                      enum:
                                                        - Twilio
                                                    message:
                                                      type: string
                                                  required:
                                                    - type
                                                - type: object
                                                  properties:
                                                    type:
                                                      type: string
                                                      enum:
                                                        - SignalWire
                                                    errorCode:
                                                      type: string
                                                    errorMessage:
                                                      type: string
                                                    status:
                                                      type: string
                                                  required:
                                                    - type
                                                    - errorCode
                                                    - status
                                          required:
                                            - type
                                            - provider
                                        - type: object
                                          properties:
                                            type:
                                              type: string
                                              enum:
                                                - Webhook
                                            code:
                                              type: string
                                            response:
                                              type: object
                                              properties:
                                                status:
                                                  type: number
                                                headers:
                                                  type: object
                                                  additionalProperties:
                                                    anyOf:
                                                      - type: string
                                                      - type: number
                                                      - type: array
                                                        items:
                                                          type: string
                                                      - type: 'null'
                                                      - type: boolean
                                                body: {}
                                          required:
                                            - type
                                  required:
                                    - type
                                    - variant
                          required:
                            - userId
                            - type
                            - messageId
                            - error
                required:
                  - results
        '500':
          description: Default Response
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                required:
                  - message

````