openapi: 3.0.0
info:
  title: mail2many API 1.0
  description: >-
    The mail2many API is a REST API that enables external applications to
    integrate seamlessly with mail2many. With this API, developers can create,
    read, update, and delete subscribers and subscriber groups, send
    newsletters, and retrieve statistics.</p>

    <h3>API Documentation</h3>

    <p>If you want to get started with the mail2many API, you should first
    understand the basic structure of mail2many and its key terms. The <a
    href=../../docs/category/api-dokumentation target=_blank>API
    Documentation</a> will guide you through these fundamentals.</p>

    <h3>API Usage</h3>

    <p>The <a href=../../docs/category/api-nutzung target=_blank>API Usage</a>
    section provides additional details on how to work with the mail2many
    API.</p>

    <h3>Languages</h3>

    <p>Currently the endpoint documentation is only available in english but the
    Documentation is avaiable in german and english. You can switch the language
    in the top right</p>

    <h3>Contact</h3>

    If you need further assistance, feel free to contact us. You can find the
    contact form in the footer.
  version: 1.0.0
paths:
  /api/v1/subscribers:
    summary: Class SubscriberController.
  /articles:
    post:
      tags:
        - Article
      summary: Create an new article
      description: >-
        Creates an new article and returns it. The placeholders of the article
        should be filled.
      operationId: CreateArticle
      requestBody:
        description: Article object that should be created.
        required: true
        content:
          application/json:
            schema:
              properties:
                languageIso:
                  $ref: '#/components/schemas/Article/properties/languageIso'
                name:
                  $ref: '#/components/schemas/Article/properties/name'
                templateId:
                  $ref: '#/components/schemas/Article/properties/templateId'
                canEdit:
                  $ref: '#/components/schemas/Article/properties/canEdit'
                availableFrom:
                  $ref: '#/components/schemas/Article/properties/availableFrom'
                availableUntil:
                  $ref: '#/components/schemas/Article/properties/availableUntil'
                placeholders:
                  properties:
                    texts:
                      type: array
                      items:
                        required:
                          - areaId
                          - placeholderId
                          - text
                        properties:
                          areaId:
                            description: The area of the placeholder.
                            type: integer
                            example: 1
                            nullable: false
                          placeholderId:
                            description: The placeholder to fill.
                            type: integer
                            example: 1
                            nullable: false
                          text:
                            description: The text of the placeholder.
                            type: string
                            example: Hello World!
                            nullable: true
                          href:
                            description: Link target if needed.
                            type: string
                            example: https://www.atrivio.de
                            nullable: true
                          style:
                            description: Specific style if needed.
                            type: string
                            example: font-size:16px;
                            nullable: true
                        type: object
                    buttons:
                      type: array
                      items:
                        required:
                          - areaId
                          - placeholderId
                          - text
                        properties:
                          areaId:
                            description: The area of the placeholder.
                            type: integer
                            example: 1
                            nullable: false
                          placeholderId:
                            description: The placeholder to fill.
                            type: integer
                            example: 2
                            nullable: false
                          text:
                            description: The text of the placeholder.
                            type: string
                            example: Click me
                            nullable: true
                          href:
                            description: Link target if needed.
                            type: string
                            example: https://www.atrivio.de
                            nullable: true
                          style:
                            description: Specific style if needed.
                            type: string
                            example: font-size:16px;
                            nullable: true
                        type: object
                    images:
                      type: array
                      items:
                        required:
                          - areaId
                          - placeholderId
                          - file
                        properties:
                          areaId:
                            description: The area of the placeholder.
                            type: integer
                            example: 1
                            nullable: false
                          placeholderId:
                            description: The placeholder to fill.
                            type: integer
                            example: 3
                            nullable: false
                          file:
                            description: >-
                              The image as base64 string, allowed: jpg, png,
                              gif.
                            type: string
                            example: data:image/jpg;base64,...
                            nullable: false
                          fileName:
                            description: The client name of the uploaded file.
                            type: string
                            example: macbook-pro.jpg
                            nullable: false
                          alt:
                            description: The alt tag of the image.
                            type: string
                            example: MacBook Pro 2019
                            nullable: true
                          width:
                            description: The width of the destination image.
                            type: integer
                            example: 600
                            nullable: false
                          height:
                            description: >-
                              The height of the destination image, if empty
                              height will be calculcated.
                            type: integer
                            example: 335
                            nullable: false
                          x:
                            description: The x position of the cropping frame.
                            type: integer
                            example: 0
                            nullable: false
                          'y':
                            description: The y position of the cropping frame.
                            type: integer
                            example: 100
                            nullable: false
                          w:
                            description: The width of the cropping frame.
                            type: integer
                            example: 1920
                            nullable: false
                          h:
                            description: The height of the cropping frame.
                            type: integer
                            example: 1080
                            nullable: false
                          href:
                            description: Link target if needed.
                            type: string
                            example: https://www.atrivio.de
                            nullable: true
                          style:
                            description: Specific style if needed.
                            type: string
                            example: border:1px solid black;
                            nullable: true
                        type: object
                  type: object
              type: object
      responses:
        '200':
          description: The article was created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Article'
        '422':
          description: The given data was invalid.
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    example: error
                  code:
                    type: integer
                    example: 1002
                  message:
                    type: string
                    example: The given data was invalid.
                  errors:
                    type: object
                    example:
                      languageIso:
                        - The language iso field is required.
                type: object
      security:
        - BasicAuth: []
  /articles/{id}:
    put:
      tags:
        - Article
      summary: Update an article
      description: >-
        Updates an article and returns it. The placeholders of the article can
        be updated.
      operationId: UpdateArticle
      parameters:
        - name: id
          in: path
          description: Id of the article
          required: true
          schema:
            type: integer
      requestBody:
        description: Article object that should be updated.
        required: true
        content:
          application/json:
            schema:
              properties:
                name:
                  $ref: '#/components/schemas/Article/properties/name'
                availableFrom:
                  $ref: '#/components/schemas/Article/properties/availableFrom'
                availableUntil:
                  $ref: '#/components/schemas/Article/properties/availableUntil'
                placeholders:
                  properties:
                    texts:
                      type: array
                      items:
                        required:
                          - areaId
                          - placeholderId
                          - text
                        properties:
                          areaId:
                            description: The area of the placeholder.
                            type: integer
                            example: 1
                            nullable: false
                          placeholderId:
                            description: The placeholder to fill.
                            type: integer
                            example: 1
                            nullable: false
                          text:
                            description: The text of the placeholder.
                            type: string
                            example: Hello World!
                            nullable: true
                          href:
                            description: Link target if needed.
                            type: string
                            example: https://www.atrivio.de
                            nullable: true
                          style:
                            description: Specific style if needed.
                            type: string
                            example: font-size:16px;
                            nullable: true
                        type: object
                    buttons:
                      type: array
                      items:
                        required:
                          - areaId
                          - placeholderId
                          - text
                        properties:
                          areaId:
                            description: The area of the placeholder.
                            type: integer
                            example: 1
                            nullable: false
                          placeholderId:
                            description: The placeholder to fill.
                            type: integer
                            example: 2
                            nullable: false
                          text:
                            description: The text of the placeholder.
                            type: string
                            example: Click me
                            nullable: true
                          href:
                            description: Link target if needed.
                            type: string
                            example: https://www.atrivio.de
                            nullable: true
                          style:
                            description: Specific style if needed.
                            type: string
                            example: font-size:16px;
                            nullable: true
                        type: object
                    images:
                      type: array
                      items:
                        required:
                          - areaId
                          - placeholderId
                          - file
                        properties:
                          areaId:
                            description: The area of the placeholder.
                            type: integer
                            example: 1
                            nullable: false
                          placeholderId:
                            description: The placeholder to fill.
                            type: integer
                            example: 3
                            nullable: false
                          file:
                            description: >-
                              The image as base64 string, allowed: jpg, png,
                              gif.
                            type: string
                            example: data:image/jpg;base64,...
                            nullable: false
                          fileName:
                            description: The client name of the uploaded file.
                            type: string
                            example: macbook-pro.jpg
                            nullable: false
                          alt:
                            description: The alt tag of the image.
                            type: string
                            example: MacBook Pro 2019
                            nullable: true
                          width:
                            description: The width of the destination image.
                            type: integer
                            example: 600
                            nullable: false
                          height:
                            description: >-
                              The height of the destination image, if empty
                              height will be calculcated.
                            type: integer
                            example: 335
                            nullable: false
                          x:
                            description: The x position of the cropping frame.
                            type: integer
                            example: 0
                            nullable: false
                          'y':
                            description: The y position of the cropping frame.
                            type: integer
                            example: 100
                            nullable: false
                          w:
                            description: The width of the cropping frame.
                            type: integer
                            example: 1920
                            nullable: false
                          h:
                            description: The height of the cropping frame.
                            type: integer
                            example: 1080
                            nullable: false
                          href:
                            description: Link target if needed.
                            type: string
                            example: https://www.atrivio.de
                            nullable: true
                          style:
                            description: Specific style if needed.
                            type: string
                            example: border:1px solid black;
                            nullable: true
                        type: object
                  type: object
              type: object
      responses:
        '200':
          description: The article was updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Article'
        '422':
          description: The given data was invalid.
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    example: error
                  code:
                    type: integer
                    example: 1002
                  message:
                    type: string
                    example: The given data was invalid.
                  errors:
                    type: object
                    example:
                      languageIso:
                        - The language iso field is required.
                type: object
      security:
        - BasicAuth: []
  /whoami:
    get:
      tags:
        - Authentication
      summary: Get the account of the api key.
      description: >-
        Every api key is assigned to an account. This endpoint returns the
        account.
      operationId: Whoami
      parameters:
        - name: include
          in: query
          description: >-
            What relations should be included. Available relations: channels,
            languages
          required: false
          schema:
            type: string
            example: channels, languages
      responses:
        '200':
          description: The account of the api key.
          content:
            application/json:
              schema:
                properties:
                  data:
                    description: Account object
                    type: object
                    example:
                      data:
                        objectType: Account
                        id: 1
                        type: S
                        name: Account A
                        createdAt: '2024-02-27 10:35:34'
                    nullable: false
                type: object
      security:
        - BasicAuth: []
  /channels:
    get:
      tags:
        - Channel
      summary: Get all channels
      description: >-
        Returns the available channels of the account. Returns all and not a
        pagination.
      operationId: GetAllChannels
      responses:
        '200':
          description: The requested channels.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Channel'
      security:
        - BasicAuth: []
  /customerFields:
    get:
      tags:
        - CustomerField
      summary: Get all customer fields
      description: >-
        Returns all existing customer fields. If you want to include the
        defaults, you have to set the include parameter.
      operationId: getAllCustomerFields
      parameters:
        - name: include
          in: query
          description: 'Which relations should be included. Available: defaults.'
          required: false
          schema:
            type: string
      responses:
        '200':
          description: An array with customer fields.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerField'
      security:
        - BasicAuth: []
  /customerFields/{id}/defaults:
    put:
      tags:
        - CustomerField
      summary: Sets defaults for a customer field
      description: >-
        Sets the default value for a customer field and returns it. Only
        defaults for account fields can be set. Other types will be skipped. If
        the account uses multiple languages, the default value can be set for
        every language. If the default for a language is missing, the global
        value is used.
               <br><br>Keep in mind that this endpoint returns the customer field. If you want to return the defaults as well, you have to set the include parameter.
      operationId: SetDefaults
      parameters:
        - name: id
          in: path
          description: Id of the customer field
          required: true
          schema:
            type: integer
        - name: include
          in: query
          description: 'Which relations should be included. Available: defaults.'
          required: false
          schema:
            type: string
      requestBody:
        description: The defaults which should be set.
        required: true
        content:
          application/json:
            schema:
              properties:
                value:
                  description: Value for the customer field.
                  type: string
                  example: Müller GmbH
                translations:
                  description: Translations for the value of the customer field.
                  type: object
                  example:
                    de:
                      name: Müller GmbH
                    en:
                      name: Muller GmbH
              type: object
      responses:
        '200':
          description: The defaults were set.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerField'
        '422':
          description: The given data was invalid.
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    example: error
                  code:
                    type: integer
                    example: 1002
                  message:
                    type: string
                    example: The given data was invalid.
                  errors:
                    type: object
                    example:
                      email:
                        - The email field is required.
                type: object
      security:
        - BasicAuth: []
  /customerFields/defaults/batch:
    put:
      tags:
        - CustomerField
      summary: Sets defaults for multiple customer fields
      description: >-
        Sets the default values for multiple customer fields and returns it.
        Only defaults for account fields can be set. Other types will be
        skipped. If the account uses multiple languages, the default value can
        be set for every language. If the default for a language is missing, the
        global value is used.
               <br><br>Keep in mind that this endpoint returns the customer fields. If you want to return the defaults as well, you have to set the include parameter.
      operationId: SetDefaultsAsBatch
      parameters:
        - name: include
          in: query
          description: 'Which relations should be included. Available: defaults.'
          required: false
          schema:
            type: string
      requestBody:
        description: The defaults which should be set.
        required: true
        content:
          application/json:
            schema:
              properties:
                defaults:
                  type: array
                  items:
                    required:
                      - id
                      - value
                    properties:
                      id:
                        $ref: '#/components/schemas/CustomerField/properties/id'
                      value:
                        description: Value for the customer field.
                        type: string
                        example: Müller GmbH
                      translations:
                        description: Translations for the value of the customer field.
                        type: object
                        example:
                          de:
                            name: Müller GmbH
                          en:
                            name: Muller GmbH
                    type: object
              type: object
      responses:
        '200':
          description: The defaults were set.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerField'
        '422':
          description: The given data was invalid.
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    example: error
                  code:
                    type: integer
                    example: 1002
                  message:
                    type: string
                    example: The given data was invalid.
                  errors:
                    type: object
                    example:
                      email:
                        - The defaults field is required.
                type: object
      security:
        - BasicAuth: []
  /mailings:
    get:
      tags:
        - Mailing
      summary: Get all mailings
      description: >-
        Returns all mailings. Newsletters can be included with the paramater
        ?include=newsletters. You can search and filter the mailings with query
        parameters.
      operationId: GetAllMailings
      parameters:
        - name: include
          in: query
          description: 'What relations should be included. Available relations: newsletters'
          required: false
          schema:
            type: string
            example: newsletters
      responses:
        '200':
          description: >-
            An array with mailings and meta data. In the meta data the
            pagination information is returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Mailing'
      security:
        - BasicAuth: []
  /mailings/sent:
    get:
      tags:
        - Mailing
      summary: Get sent mailings
      description: >-
        Returns all sent mailings. Newsletters can be included with the
        paramater ?include=newsletters.
      operationId: GetAllSentMailings
      parameters:
        - name: include
          in: query
          description: 'What relations should be included. Available relations: newsletters'
          required: false
          schema:
            type: string
            example: newsletters
      responses:
        '200':
          description: >-
            An array with mailings and meta data. In the meta data the
            pagination information is returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Mailing'
      security:
        - BasicAuth: []
  /mailings/trigger/{id}:
    get:
      tags:
        - Mailing
      summary: Get created trigger mailing
      description: |-
        Returns the data of a existing trigger mailing.
               <br /><br />The fields isScheduled, isRunning and transferedAt tells the current state of the transmission.
      operationId: GetTriggerMailing
      parameters:
        - name: id
          in: path
          description: Id of the trigger mailing
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: The requested mailing.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Mailing'
      security:
        - BasicAuth: []
  /mailings/trigger:
    post:
      tags:
        - Mailing
      summary: Create a new trigger mailing
      description: >-
        Creates a new trigger mailing with the given trigger type and returns
        it. The next step is to add receivers.
      operationId: CreateTriggerMailing
      requestBody:
        description: Mailing object that should be created.
        required: true
        content:
          application/json:
            schema:
              properties:
                triggerTypeId:
                  description: The id of the trigger type to send.
                  type: integer
                  example: 1
                languageIso:
                  $ref: '#/components/schemas/Mailing/properties/languageIso'
                senderName:
                  $ref: '#/components/schemas/Mailing/properties/senderName'
                name:
                  $ref: '#/components/schemas/Mailing/properties/name'
                subject:
                  description: The subject for all newsletters of the mailing.
                  type: string
                  example: Special offer
                foreignId:
                  description: >-
                    The id of a third-party system. Will be returned in the
                    tracking.
                  type: integer
                  example: 1
              type: object
      responses:
        '200':
          description: The mailing was created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Mailing'
        '422':
          description: The given data was invalid.
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    example: error
                  code:
                    type: integer
                    example: 1002
                  message:
                    type: string
                    example: The given data was invalid.
                  errors:
                    type: object
                    example:
                      languageIso:
                        - The language iso field is required.
                type: object
      security:
        - BasicAuth: []
  /mailings/trigger/{id}/receivers:
    post:
      tags:
        - Mailing
      summary: Add receivers to created trigger mailing
      description: >-
        Adds multiple receivers to the created trigger mailing. 100 can be added
        with a single request. If all are added the trigger mailing can be
        scheduled.
      operationId: AddTriggerReceivers
      parameters:
        - name: id
          in: path
          description: Id of the trigger mailing
          required: true
          schema:
            type: integer
      requestBody:
        description: Receivers array that should be added.
        required: true
        content:
          application/json:
            schema:
              properties:
                receivers:
                  type: array
                  items:
                    required:
                      - email
                    properties:
                      email:
                        $ref: '#/components/schemas/Subscriber/properties/email'
                      firstname:
                        $ref: '#/components/schemas/Subscriber/properties/firstname'
                      lastname:
                        $ref: '#/components/schemas/Subscriber/properties/lastname'
                      subject:
                        description: The unique subject for the subscriber.
                        type: string
                        example: Happy Birthday Erika
                      placeholders:
                        description: >-
                          The placeholders for the receiver. They are defined
                          for every triggerType.
                        type: object
                        example:
                          button:
                            text: To Atrivio
                            url: https://www.atrivio.de
                    type: object
              type: object
      responses:
        '200':
          description: The receivers were added.
          content:
            application/json:
              schema:
                properties:
                  success:
                    type: boolean
                    example: true
                  added:
                    type: array
                    items:
                      properties:
                        email:
                          $ref: '#/components/schemas/Subscriber/properties/email'
                        firstname:
                          $ref: '#/components/schemas/Subscriber/properties/firstname'
                        lastname:
                          $ref: '#/components/schemas/Subscriber/properties/lastname'
                      type: object
                  countAdded:
                    type: integer
                    example: 100
                  notAdded:
                    type: array
                    items:
                      properties:
                        email:
                          $ref: '#/components/schemas/Subscriber/properties/email'
                        firstname:
                          $ref: '#/components/schemas/Subscriber/properties/firstname'
                        lastname:
                          $ref: '#/components/schemas/Subscriber/properties/lastname'
                      type: object
                  countNotAdded:
                    type: integer
                    example: 100
                type: object
        '422':
          description: The given data was invalid.
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    example: error
                  code:
                    type: integer
                    example: 1002
                  message:
                    type: string
                    example: The given data was invalid.
                  errors:
                    type: object
                    example:
                      languageIso:
                        - The language iso field is required.
                type: object
      security:
        - BasicAuth: []
  /mailings/trigger/{id}/schedule:
    post:
      tags:
        - Mailing
      summary: Schedule created trigger mailing
      description: >-
        Schedules a existing trigger mailing after all receivers were added. It
        can either be scheduled for now or for a date in the future.
               <br /><br />After scheduling mail2many will take care of the transmission. The status can be retrieved with the read route and the statistic can be read with the tracking route.
      operationId: ScheduleTriggerMailing
      parameters:
        - name: id
          in: path
          description: Id of the trigger mailing
          required: true
          schema:
            type: integer
      requestBody:
        description: Date when the trigger mailing should be send.
        required: true
        content:
          application/json:
            schema:
              properties:
                sendNow:
                  description: If the mailing should be send immediately.
                  type: boolean
                  example: true
                sendAt:
                  description: The date and time the mailing should be send as UTC time.
                  type: string
                  example: 2020-07-23 08:00
              type: object
      responses:
        '200':
          description: The mailing was scheduled.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Mailing'
        '422':
          description: The given data was invalid.
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    example: error
                  code:
                    type: integer
                    example: 1002
                  message:
                    type: string
                    example: The given data was invalid.
                  errors:
                    type: object
                    example:
                      languageIso:
                        - The language iso field is required.
                type: object
      security:
        - BasicAuth: []
  /mailings/trigger/{id}/abort:
    post:
      tags:
        - Mailing
      summary: Abort created trigger mailing
      description: >-
        Aborts the transmission of the given trigger mailing. If no mails where
        sent out yet the mailing will be set back to draft. If mails were
        already sent the mailing will be set to sent.
      operationId: AbortTriggerMailing
      parameters:
        - name: id
          in: path
          description: Id of the trigger mailing
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: The mailing was aborted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Mailing'
      security:
        - BasicAuth: []
  /mailings/singleTrigger:
    post:
      tags:
        - Mailing
      summary: Send a single trigger mailing to a single subscriber
      description: Sends a trigger mailing to a single subscriber within one request.
      operationId: SendSingleTriggerMailing
      requestBody:
        description: SingleTrigger object that should be sent.
        required: true
        content:
          application/json:
            schema:
              properties:
                triggerTypeId:
                  description: The id of the trigger type to send.
                  type: integer
                  example: 1
                  nullable: false
                languageIso:
                  description: The language of the trigger mailing.
                  type: string
                  example: de
                  nullable: false
                senderName:
                  $ref: '#/components/schemas/Mailing/properties/senderName'
                receiver:
                  required:
                    - email
                  properties:
                    email:
                      $ref: '#/components/schemas/Subscriber/properties/email'
                    firstname:
                      $ref: '#/components/schemas/Subscriber/properties/firstname'
                    lastname:
                      $ref: '#/components/schemas/Subscriber/properties/lastname'
                    subject:
                      description: The unique subject for the subscriber.
                      type: string
                      example: Happy Birthday Erika
                    placeholders:
                      description: >-
                        The placeholders for the receiver. They are defined for
                        every triggerType.
                      type: object
                      example:
                        button:
                          text: To Atrivio
                          url: https://www.atrivio.de
                    attachments:
                      description: >-
                        The attachments for the receiver. Allowed file types
                        are: pdf, doc, docx, txt, ics, csv.
                      type: array
                      items:
                        required:
                          - file
                          - fileName
                        properties:
                          file:
                            description: >-
                              The file as base64 string inlucing the mime type
                              with max 25MB.
                            type: string
                            example: data:application/pdf;base64,attachment-as-base-64
                            nullable: false
                          fileName:
                            description: The filenname which should be used for the mail.
                            type: string
                            example: my-file.pdf
                            nullable: false
                        type: object
                      nullable: true
                  type: object
              type: object
      responses:
        '200':
          description: The single trigger mailing was sent.
          content:
            application/json:
              schema:
                properties:
                  success:
                    type: boolean
                    example: true
                type: object
        '422':
          description: The given data was invalid.
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    example: error
                  code:
                    type: integer
                    example: 1002
                  message:
                    type: string
                    example: The given data was invalid.
                  errors:
                    type: object
                    example:
                      languageIso:
                        - The email field is required.
                type: object
      security:
        - BasicAuth: []
  /mailings/singleTrigger/batch:
    post:
      tags:
        - Mailing
      summary: Send a single trigger mailing to multiple subscribers
      description: >-
        Sends a trigger mailing to multiple subscribers within one request. 100
        can be send with a single request.
      operationId: SendSingleTriggerMailingAsBatch
      requestBody:
        description: SingleTrigger object that should be sent.
        required: true
        content:
          application/json:
            schema:
              properties:
                triggerTypeId:
                  description: The id of the trigger type to send.
                  type: integer
                  example: 1
                  nullable: false
                languageIso:
                  description: The language of the trigger mailing.
                  type: string
                  example: de
                  nullable: false
                senderName:
                  $ref: '#/components/schemas/Mailing/properties/senderName'
                subject:
                  description: A global subject for all receivers.
                  type: string
                  example: Happy Birthday
                  nullable: true
                receivers:
                  type: array
                  items:
                    required:
                      - email
                    properties:
                      email:
                        $ref: '#/components/schemas/Subscriber/properties/email'
                      firstname:
                        $ref: '#/components/schemas/Subscriber/properties/firstname'
                      lastname:
                        $ref: '#/components/schemas/Subscriber/properties/lastname'
                      subject:
                        description: The unique subject for the subscriber.
                        type: string
                        example: Happy Birthday Erika
                      placeholders:
                        description: >-
                          The placeholders for the receiver. They are defined
                          for every triggerType.
                        type: object
                        example:
                          button:
                            text: To Atrivio
                            url: https://www.atrivio.de
                      attachments:
                        description: >-
                          The attachments for the receiver. Allowed file types
                          are: pdf, doc, docx, txt, ics, csv
                        type: array
                        items:
                          required:
                            - file
                            - fileName
                          properties:
                            file:
                              description: >-
                                The file as base64 string inlucing the mime type
                                with max 25MB.
                              type: string
                              example: >-
                                data:application/pdf;base64,attachment-as-base-64
                              nullable: false
                            fileName:
                              description: The filenname which should be used for the mail.
                              type: string
                              example: my-file.pdf
                              nullable: false
                          type: object
                        nullable: true
                    type: object
              type: object
      responses:
        '200':
          description: The trigger mailings were sent.
          content:
            application/json:
              schema:
                properties:
                  success:
                    type: boolean
                    example: true
                  sent:
                    type: array
                    items:
                      properties:
                        email:
                          $ref: '#/components/schemas/Subscriber/properties/email'
                        firstname:
                          $ref: '#/components/schemas/Subscriber/properties/firstname'
                        lastname:
                          $ref: '#/components/schemas/Subscriber/properties/lastname'
                      type: object
                  countSent:
                    type: integer
                    example: 100
                  notSent:
                    type: array
                    items:
                      properties:
                        email:
                          $ref: '#/components/schemas/Subscriber/properties/email'
                        firstname:
                          $ref: '#/components/schemas/Subscriber/properties/firstname'
                        lastname:
                          $ref: '#/components/schemas/Subscriber/properties/lastname'
                      type: object
                  countNotSent:
                    type: integer
                    example: 100
                type: object
        '422':
          description: The given data was invalid.
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    example: error
                  code:
                    type: integer
                    example: 1002
                  message:
                    type: string
                    example: The given data was invalid.
                  errors:
                    type: object
                    example:
                      languageIso:
                        - The email field is required.
                type: object
      security:
        - BasicAuth: []
  /newsletters/{id}/subscribers:
    get:
      tags:
        - Newsletter
      summary: Get all newsletter subscribers.
      description: Returns all subscribers from the given newsletter.
      operationId: GetNewsletterSubscribers
      parameters:
        - name: id
          in: path
          description: Id of the newsletter
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: List of all subscribers from the given newsletter.
          content:
            application/json:
              schema:
                properties:
                  data:
                    type: array
                    items:
                      properties:
                        id:
                          $ref: '#/components/schemas/Subscriber/properties/id'
                        email:
                          $ref: '#/components/schemas/Subscriber/properties/email'
                        sentAt:
                          type: string
                          example: '2021-11-02 12:25:20'
                          nullable: true
                        openedAt:
                          type: string
                          example: '2021-11-02 12:25:20'
                          nullable: true
                        clickedAt:
                          type: string
                          example: '2021-11-02 12:25:20'
                          nullable: true
                        openingCountDesktop:
                          type: integer
                          example: 1
                          nullable: false
                        openingCountTablet:
                          type: integer
                          nullable: false
                        openingCountPhone:
                          type: integer
                          example: 2
                          nullable: false
                        openingCountUnknown:
                          type: integer
                          nullable: false
                        privacyId:
                          type: integer
                          example: 3
                          nullable: false
                      type: object
                type: object
      security:
        - BasicAuth: []
  /optInTypes:
    get:
      tags:
        - OptInType
      summary: Get all opt-in types
      description: Returns all existing opt-in types which can be used.
      operationId: getAllOptInTypes
      responses:
        '200':
          description: An array with existing opt-in types.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OptInType'
      security:
        - BasicAuth: []
  /parameter/{p}:
    get:
      tags:
        - Parameter
      summary: Get data from parameter p
      description: Returns data related with the given parameter p.
      operationId: GetParameter
      parameters:
        - name: p
          in: path
          description: The parameter p of a mail2many request.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The requested parameter data.
          content:
            application/json:
              schema:
                properties:
                  subscriberId:
                    type: integer
                    example: 1
                  newsletterId:
                    type: integer
                    example: 4
                  accountId:
                    type: integer
                    example: 2
                type: object
        '404':
          description: The resource is not existing.
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    example: error
                  code:
                    type: integer
                    example: 1020
                  message:
                    type: string
                    example: Could not find the resource.
                  statusCode:
                    type: integer
                    example: 404
                type: object
      security: []
  /statistics/newsletters/{id}:
    get:
      tags:
        - Statistic
      summary: Get newsletter statistics.
      description: Returns the newsletter statistics data.
      operationId: GetNewsletterStatistics
      parameters:
        - name: id
          in: path
          description: Id of the newsletter
          required: true
          schema:
            type: integer
        - name: statistics
          in: query
          description: List of statistics
          required: true
          schema:
            type: string
          examples:
            string:
              summary: All Statistics
              value:
                details: []
                baseData: []
                bounces: []
                devices: []
                totalOpenings: []
                totalClicks: []
                activity:
                  range: 4
                openingHours: []
                articleClicks: []
                privacy: []
                optouts: []
      responses:
        '200':
          description: The requested statistics.
          content:
            application/json:
              schema:
                properties:
                  data:
                    description: Statistics object
                    type: object
                    example: []
                    nullable: false
                type: object
      security:
        - BasicAuth: []
  /subscribers:
    get:
      tags:
        - Subscriber
      summary: Get all subscribers
      description: >-
        Returns all existing subscribers as pagination. The pagination can be
        found in the meta key.
      operationId: getAllSubscribers
      parameters:
        - name: page
          in: query
          description: The page to show starting with 1.
          required: false
          schema:
            type: integer
          example: 1
        - name: limit
          in: query
          description: How many entries should be returned.
          required: false
          schema:
            type: integer
          example: 10
        - name: include
          in: query
          description: >-
            Which relations should be included. Available: subscriberGroups,
            newsletters, channels.
          required: false
          schema:
            type: string
      responses:
        '200':
          description: An array with existing subscribers.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subscriber'
      security:
        - BasicAuth: []
    post:
      tags:
        - Subscriber
      summary: Create a single subscriber if not already existing
      description: >-
        Creates a new subscriber and returns it. The status and statusAddition
        must be set correctly, check herefore the subscriber schema. If the
        subscriber is already existing an error will be returned.
               <br /><br />A typical use case for this route is a registration form on a website.
      operationId: CreateSubscriber
      parameters:
        - name: include
          in: query
          description: >-
            Which relations should be included. Available: subscriberGroups,
            newsletters, channels.
          required: false
          schema:
            type: string
      requestBody:
        description: Subscriber object that should be created.
        required: true
        content:
          application/json:
            schema:
              required:
                - email
              properties:
                email:
                  $ref: '#/components/schemas/Subscriber/properties/email'
                status:
                  $ref: '#/components/schemas/Subscriber/properties/status'
                statusAddition:
                  $ref: '#/components/schemas/Subscriber/properties/statusAddition'
                sendOptIn:
                  description: >-
                    If an opt-in should be send to the subscriber. Will only be
                    send if status=2 and statusAddition=1
                  type: boolean
                  example: true
                optInLanguageIso:
                  description: >-
                    The language of the opt-in. If not available optInSent=false
                    will be returned.
                  type: string
                  example: de
                genderId:
                  $ref: '#/components/schemas/Subscriber/properties/genderId'
                languageIso:
                  $ref: '#/components/schemas/Subscriber/properties/languageIso'
                countryIso:
                  $ref: '#/components/schemas/Subscriber/properties/countryIso'
                reference:
                  $ref: '#/components/schemas/Subscriber/properties/reference'
                title:
                  $ref: '#/components/schemas/Subscriber/properties/title'
                firstname:
                  $ref: '#/components/schemas/Subscriber/properties/firstname'
                lastname:
                  $ref: '#/components/schemas/Subscriber/properties/lastname'
                salutationType:
                  $ref: '#/components/schemas/Subscriber/properties/salutationType'
                salutation:
                  $ref: '#/components/schemas/Subscriber/properties/salutation'
                company:
                  $ref: '#/components/schemas/Subscriber/properties/company'
                street:
                  $ref: '#/components/schemas/Subscriber/properties/street'
                postcode:
                  $ref: '#/components/schemas/Subscriber/properties/postcode'
                city:
                  $ref: '#/components/schemas/Subscriber/properties/city'
                phoneNumber:
                  $ref: '#/components/schemas/Subscriber/properties/phoneNumber'
                birthday:
                  $ref: '#/components/schemas/Subscriber/properties/birthday'
                optInComment:
                  $ref: '#/components/schemas/Subscriber/properties/optInComment'
                subscriberGroupIds:
                  description: The subscriber groups which should be assigned.
                  type: array
                  items:
                    type: integer
                  example:
                    - 1
                    - 2
                subscriberGroupNames:
                  description: >-
                    The subscriber groups which should be assigned (case
                    sensitive!). If the group with the given name doesn`t
                    exists, it will be created.
                  type: array
                  items:
                    type: string
                  example:
                    - Group A
                    - Group B
                customerFields:
                  description: >-
                    The customer fields of the subscriber. The ids of the
                    customer fields must be known.
                  type: array
                  items:
                    type: string
                  example:
                    '1': Nepal
                    '2': 2
                    '3': '2018-06-01'
                    '4': true
              type: object
      responses:
        '200':
          description: The subscriber was created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subscriber'
        '409':
          description: The subscriber is already existing.
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    example: error
                  code:
                    type: integer
                    example: 1024
                  message:
                    type: string
                    example: The resource is already existing.
                  statusCode:
                    type: integer
                    example: 409
                type: object
        '422':
          description: The given data was invalid.
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    example: error
                  code:
                    type: integer
                    example: 1002
                  message:
                    type: string
                    example: The given data was invalid.
                  errors:
                    type: object
                    example:
                      email:
                        - The email field is required.
                type: object
      security:
        - BasicAuth: []
    delete:
      tags:
        - Subscriber
      summary: Delete or archive multiple subscribers via ids or emails
      description: >-
        Deletes the subscribers with the given ids or email addresses. Only
        subscribers who never received a newsletter are deleted. The others will
        be set to archived.
      operationId: DeleteSubscribers
      requestBody:
        description: >-
          An array with subscribers which should be deleted. Either ids or
          emails can be passed.
        required: true
        content:
          application/json:
            schema:
              properties:
                subscriberIds:
                  description: The subscribers ids which should be deleted.
                  type: array
                  items:
                    type: integer
                    example: 1
                  nullable: true
                subscriberEmails:
                  description: The subscribers emails which should deleted.
                  type: array
                  items:
                    type: string
                    example: info@example.com
                  nullable: true
              type: object
      responses:
        '200':
          description: Resources successfully processed.
          content:
            application/json:
              schema:
                properties:
                  deletedSubscriberIds:
                    description: The subscribers ids which were deleted.
                    type: array
                    items:
                      type: string
                      example: info@example.com
                  archivedSubscriberIds:
                    description: The subscribers ids which were archived.
                    type: array
                    items:
                      type: string
                      example: mail@example.com
                  deletedSubscriberEmails:
                    description: The subscribers emails which were deleted.
                    type: array
                    items:
                      type: string
                      example: info@example.com
                  archivedSubscriberEmails:
                    description: The subscribers emails which were archived.
                    type: array
                    items:
                      type: string
                      example: mail@example.com
                type: object
        '404':
          description: The resource is not existing.
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    example: error
                  code:
                    type: integer
                    example: 1020
                  message:
                    type: string
                    example: Could not find the resource.
                  statusCode:
                    type: integer
                    example: 404
                type: object
      security:
        - BasicAuth: []
  /subscribers/{id}:
    get:
      tags:
        - Subscriber
      summary: Get a single subscriber via id, email or uuid
      description: Returns the subscriber with the given id, email or uuid.
      operationId: GetSubscriber
      parameters:
        - name: id
          in: path
          description: Id, email or uuid of the subscriber
          required: true
          schema:
            type: string
        - name: include
          in: query
          description: >-
            Which relations should be included. Available: subscriberGroups,
            newsletters, channels.
          required: false
          schema:
            type: string
      responses:
        '200':
          description: The requested subscriber.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subscriber'
        '404':
          description: The resource is not existing.
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    example: error
                  code:
                    type: integer
                    example: 1020
                  message:
                    type: string
                    example: Could not find the resource.
                  statusCode:
                    type: integer
                    example: 404
                type: object
      security:
        - BasicAuth: []
    put:
      tags:
        - Subscriber
      summary: Update a single subscriber via id or email
      description: >-
        Updates the subscriber with the given id or email. Only fields which
        should be updated should be passed. The status and statusAddition must
        be set correctly, check herefore the subscriber schema. If the
        subscriber is not existing an error will be returned.
      operationId: UpdateSubscriber
      parameters:
        - name: id
          in: path
          description: Id or email of the subscriber
          required: true
          schema:
            type: string
        - name: include
          in: query
          description: >-
            Which relations should be included. Available: subscriberGroups,
            newsletters, channels.
          required: false
          schema:
            type: string
      requestBody:
        description: Subscriber object that should be created.
        required: true
        content:
          application/json:
            schema:
              properties:
                status:
                  $ref: '#/components/schemas/Subscriber/properties/status'
                statusAddition:
                  $ref: '#/components/schemas/Subscriber/properties/statusAddition'
                genderId:
                  $ref: '#/components/schemas/Subscriber/properties/genderId'
                languageIso:
                  $ref: '#/components/schemas/Subscriber/properties/languageIso'
                countryIso:
                  $ref: '#/components/schemas/Subscriber/properties/countryIso'
                reference:
                  $ref: '#/components/schemas/Subscriber/properties/reference'
                title:
                  $ref: '#/components/schemas/Subscriber/properties/title'
                firstname:
                  $ref: '#/components/schemas/Subscriber/properties/firstname'
                lastname:
                  $ref: '#/components/schemas/Subscriber/properties/lastname'
                salutationType:
                  $ref: '#/components/schemas/Subscriber/properties/salutationType'
                salutation:
                  $ref: '#/components/schemas/Subscriber/properties/salutation'
                company:
                  $ref: '#/components/schemas/Subscriber/properties/company'
                street:
                  $ref: '#/components/schemas/Subscriber/properties/street'
                postcode:
                  $ref: '#/components/schemas/Subscriber/properties/postcode'
                city:
                  $ref: '#/components/schemas/Subscriber/properties/city'
                phoneNumber:
                  $ref: '#/components/schemas/Subscriber/properties/phoneNumber'
                birthday:
                  $ref: '#/components/schemas/Subscriber/properties/birthday'
                detachSubscriberGroups:
                  description: >-
                    If the existing subscriber groups should be detached and
                    only the new ones assigned.
                  type: boolean
                  example: false
                subscriberGroupIds:
                  description: The subscriber groups which should be assigned.
                  type: array
                  items:
                    type: integer
                  example:
                    - 1
                    - 2
                customerFields:
                  description: >-
                    The customer fields of the subscriber. The ids of the
                    customer fields must be known.
                  type: array
                  items:
                    type: string
                  example:
                    '1': Nepal
                    '2': 2
                    '3': '2018-06-01'
                    '4': true
              type: object
      responses:
        '200':
          description: The subscriber was updated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subscriber'
        '409':
          description: The subscriber is already existing.
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    example: error
                  code:
                    type: integer
                    example: 1024
                  message:
                    type: string
                    example: The resource is already existing.
                  statusCode:
                    type: integer
                    example: 409
                type: object
        '422':
          description: The given data was invalid.
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    example: error
                  code:
                    type: integer
                    example: 1002
                  message:
                    type: string
                    example: The given data was invalid.
                  errors:
                    type: object
                    example:
                      email:
                        - The email field is required.
                type: object
      security:
        - BasicAuth: []
    delete:
      tags:
        - Subscriber
      summary: Delete or archive a single subscriber via id or email
      description: >-
        Deletes the subscriber with the given id or email. He is only deleted
        when he never received a newsletter. Otherwise he will be set to
        archived.
      operationId: DeleteSubscriber
      parameters:
        - name: id
          in: path
          description: Id or email of the subscriber
          required: true
          schema:
            type: string
      responses:
        '202':
          description: Resource successfully deleted.
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                    example: Resource successfully deleted.
                type: object
        '404':
          description: The resource is not existing.
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    example: error
                  code:
                    type: integer
                    example: 1020
                  message:
                    type: string
                    example: Could not find the resource.
                  statusCode:
                    type: integer
                    example: 404
                type: object
      security:
        - BasicAuth: []
  /subscribers/parameter/{p}:
    get:
      tags:
        - Subscriber
      summary: Get a single subscriber via parameter p
      description: Returns the subscriber related with the given parameter p.
      operationId: GetSubscriberByParameter
      parameters:
        - name: p
          in: path
          description: The parameter p of a mail2many request.
          required: true
          schema:
            type: string
        - name: include
          in: query
          description: >-
            Which relations should be included. Available: subscriberGroups,
            newsletters, channels.
          required: false
          schema:
            type: string
      responses:
        '200':
          description: The requested subscriber.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subscriber'
        '404':
          description: The resource is not existing.
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    example: error
                  code:
                    type: integer
                    example: 1020
                  message:
                    type: string
                    example: Could not find the resource.
                  statusCode:
                    type: integer
                    example: 404
                type: object
      security:
        - BasicAuth: []
  /subscribers/register:
    post:
      tags:
        - Subscriber
      summary: Registers a single subscriber
      description: >-
        Registers the given subscriber in the account. If the subscriber is not
        existing, he will be created and an opt-in will be send. If he is
        existing, he will be updated and an opt-in will send, when he is not
        already receive-ready.
               <br /><br />A typical use case for this route is a registration form on a website. You can allways call this route and mail2many takes care of the necessary steps.
      operationId: RegisterSubscriber
      parameters:
        - name: include
          in: query
          description: >-
            Which relations should be included. Available: subscriberGroups,
            newsletters, channels.
          required: false
          schema:
            type: string
      requestBody:
        description: Subscriber that should be registered.
        required: true
        content:
          application/json:
            schema:
              required:
                - email
              properties:
                email:
                  $ref: '#/components/schemas/Subscriber/properties/email'
                optInLanguageIso:
                  description: >-
                    The language of the opt-in. If not available optInSent=false
                    will be returned.
                  type: string
                  example: de
                genderId:
                  $ref: '#/components/schemas/Subscriber/properties/genderId'
                languageIso:
                  $ref: '#/components/schemas/Subscriber/properties/languageIso'
                countryIso:
                  $ref: '#/components/schemas/Subscriber/properties/countryIso'
                reference:
                  $ref: '#/components/schemas/Subscriber/properties/reference'
                title:
                  $ref: '#/components/schemas/Subscriber/properties/title'
                firstname:
                  $ref: '#/components/schemas/Subscriber/properties/firstname'
                lastname:
                  $ref: '#/components/schemas/Subscriber/properties/lastname'
                salutationType:
                  $ref: '#/components/schemas/Subscriber/properties/salutationType'
                salutation:
                  $ref: '#/components/schemas/Subscriber/properties/salutation'
                company:
                  $ref: '#/components/schemas/Subscriber/properties/company'
                street:
                  $ref: '#/components/schemas/Subscriber/properties/street'
                postcode:
                  $ref: '#/components/schemas/Subscriber/properties/postcode'
                city:
                  $ref: '#/components/schemas/Subscriber/properties/city'
                phoneNumber:
                  $ref: '#/components/schemas/Subscriber/properties/phoneNumber'
                birthday:
                  $ref: '#/components/schemas/Subscriber/properties/birthday'
                detachSubscriberGroups:
                  description: >-
                    If the existing subscriber groups should be detached and
                    only the new ones assigned.
                  type: boolean
                  example: false
                subscriberGroupIds:
                  description: The subscriber groups which should be assigned.
                  type: array
                  items:
                    type: integer
                  example:
                    - 1
                    - 2
                subscriberGroupNames:
                  description: >-
                    The subscriber groups which should be assigned (case
                    sensitive!). If the group with the given name doesn`t
                    exists, it will be created.
                  type: array
                  items:
                    type: string
                  example:
                    - Group A
                    - Group B
                customerFields:
                  description: >-
                    The customer fields of the subscriber. The ids of the
                    customer fields must be known.
                  type: array
                  items:
                    type: string
                  example:
                    '1': Nepal
                    '2': 2
                    '3': '2018-06-01'
                    '4': true
                forceOptIn:
                  description: If an opt-in should be forced for existing subscribers.
                  type: boolean
                  example: true
              type: object
      responses:
        '200':
          description: The subscriber was registered.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Subscriber'
        '422':
          description: The given data was invalid.
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    example: error
                  code:
                    type: integer
                    example: 1002
                  message:
                    type: string
                    example: The given data was invalid.
                  errors:
                    type: object
                    example:
                      email:
                        - The email field is required.
                type: object
      security:
        - BasicAuth: []
  /subscribers/multiple:
    put:
      tags:
        - Subscriber
      summary: Updates multiple subscriber via id or email
      description: >-
        Updates the given subscribers via id or email. He should pass either id
        or email for every subscriber. The id will be checked first. Only fields
        which should be updated should be passed. The status and statusAddition
        must be set correctly, check herefore the subscriber schema. If the
        subscriber is not existing he will be ignored.
               <br /><br />If all subscribers should be added to the same subscriber groups the subscriberGroupIds should be passed at the first level and removed from the subscribers array for performance increase.
               <br /><br />The rights of the api key will be checked here. If the key has not the right to set unsubscribed subscribers to receive-ready, the old status will be kept.
      operationId: UpdateSubscribers
      parameters:
        - name: include
          in: query
          description: >-
            Which relations should be included. Available: subscriberGroups,
            newsletters, channels.
          required: false
          schema:
            type: string
      requestBody:
        description: Subscribers that should be updated.
        required: true
        content:
          application/json:
            schema:
              properties:
                subscribers:
                  description: The subscribers which should updated.
                  type: array
                  items:
                    required:
                      - email
                    properties:
                      id:
                        $ref: '#/components/schemas/Subscriber/properties/id'
                      email:
                        $ref: '#/components/schemas/Subscriber/properties/email'
                      status:
                        $ref: '#/components/schemas/Subscriber/properties/status'
                      statusAddition:
                        $ref: >-
                          #/components/schemas/Subscriber/properties/statusAddition
                      genderId:
                        $ref: '#/components/schemas/Subscriber/properties/genderId'
                      languageIso:
                        $ref: '#/components/schemas/Subscriber/properties/languageIso'
                      countryIso:
                        $ref: '#/components/schemas/Subscriber/properties/countryIso'
                      reference:
                        $ref: '#/components/schemas/Subscriber/properties/reference'
                      title:
                        $ref: '#/components/schemas/Subscriber/properties/title'
                      firstname:
                        $ref: '#/components/schemas/Subscriber/properties/firstname'
                      lastname:
                        $ref: '#/components/schemas/Subscriber/properties/lastname'
                      salutationType:
                        $ref: >-
                          #/components/schemas/Subscriber/properties/salutationType
                      salutation:
                        $ref: '#/components/schemas/Subscriber/properties/salutation'
                      company:
                        $ref: '#/components/schemas/Subscriber/properties/company'
                      street:
                        $ref: '#/components/schemas/Subscriber/properties/street'
                      postcode:
                        $ref: '#/components/schemas/Subscriber/properties/postcode'
                      city:
                        $ref: '#/components/schemas/Subscriber/properties/city'
                      phoneNumber:
                        $ref: '#/components/schemas/Subscriber/properties/phoneNumber'
                      birthday:
                        $ref: '#/components/schemas/Subscriber/properties/birthday'
                      subscriberGroupIds:
                        description: >-
                          The subscriber groups which should be assigned to this
                          subscriber.
                        type: array
                        items:
                          type: integer
                        example:
                          - 1
                          - 2
                      customerFields:
                        description: >-
                          The customer fields of the subscriber. The ids of the
                          customer fields must be known.
                        type: array
                        items:
                          type: string
                        example:
                          '1': Nepal
                          '2': 2
                          '3': '2018-06-01'
                          '4': true
                    type: object
                detachSubscriberGroups:
                  description: >-
                    If the existing subscriber groups should be detached and
                    only the new ones assigned.
                  type: boolean
                  example: false
                subscriberGroupIds:
                  description: >-
                    The subscriber groups which should be assigned to every
                    subscriber. Should be used when every subscriber must be
                    added in the same group.
                  type: array
                  items:
                    type: integer
                  example:
                    - 1
                    - 2
              type: object
      responses:
        '200':
          description: The subscribers which were updated, invalid or failed.
          content:
            application/json:
              schema:
                properties:
                  updated:
                    type: array
                    items:
                      $ref: '#/components/schemas/Subscriber'
                  invalid:
                    type: array
                    items:
                      $ref: '#/components/schemas/Subscriber'
                  failed:
                    type: array
                    items:
                      $ref: '#/components/schemas/Subscriber'
                type: object
        '422':
          description: The given data was invalid.
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    example: error
                  code:
                    type: integer
                    example: 1002
                  message:
                    type: string
                    example: The given data was invalid.
                  errors:
                    type: object
                    example:
                      subscribers:
                        - The subscribers field is required.
                type: object
      security:
        - BasicAuth: []
    post:
      tags:
        - Subscriber
      summary: Create multiple subscribers if not already existing
      description: >-
        Creates the given subscribers if not existing. The status and
        statusAddition must be set correctly, check herefore the subscriber
        schema. If the subscriber is already existing he will be ignored.
               <br /><br />If all subscribers should be added to the same subscriber groups the subscriberGroupIds should be passed at the first level and removed from the subscribers array for performance increase.
      operationId: CreateSubscribers
      parameters:
        - name: include
          in: query
          description: >-
            Which relations should be included. Available: subscriberGroups,
            newsletters, channels.
          required: false
          schema:
            type: string
      requestBody:
        description: Subscribers that should be created.
        required: true
        content:
          application/json:
            schema:
              properties:
                subscribers:
                  description: The subscribers which should created.
                  type: array
                  items:
                    required:
                      - email
                    properties:
                      email:
                        $ref: '#/components/schemas/Subscriber/properties/email'
                      status:
                        $ref: '#/components/schemas/Subscriber/properties/status'
                      statusAddition:
                        $ref: >-
                          #/components/schemas/Subscriber/properties/statusAddition
                      genderId:
                        $ref: '#/components/schemas/Subscriber/properties/genderId'
                      languageIso:
                        $ref: '#/components/schemas/Subscriber/properties/languageIso'
                      countryIso:
                        $ref: '#/components/schemas/Subscriber/properties/countryIso'
                      reference:
                        $ref: '#/components/schemas/Subscriber/properties/reference'
                      title:
                        $ref: '#/components/schemas/Subscriber/properties/title'
                      firstname:
                        $ref: '#/components/schemas/Subscriber/properties/firstname'
                      lastname:
                        $ref: '#/components/schemas/Subscriber/properties/lastname'
                      salutationType:
                        $ref: >-
                          #/components/schemas/Subscriber/properties/salutationType
                      salutation:
                        $ref: '#/components/schemas/Subscriber/properties/salutation'
                      company:
                        $ref: '#/components/schemas/Subscriber/properties/company'
                      street:
                        $ref: '#/components/schemas/Subscriber/properties/street'
                      postcode:
                        $ref: '#/components/schemas/Subscriber/properties/postcode'
                      city:
                        $ref: '#/components/schemas/Subscriber/properties/city'
                      phoneNumber:
                        $ref: '#/components/schemas/Subscriber/properties/phoneNumber'
                      birthday:
                        $ref: '#/components/schemas/Subscriber/properties/birthday'
                      sendOptIn:
                        description: >-
                          If an opt-in should be send to the subscriber. Will
                          only be send if status=2 and statusAddition=1
                        type: boolean
                        example: true
                      subscriberGroupIds:
                        description: >-
                          The subscriber groups which should be assigned to this
                          subscriber.
                        type: array
                        items:
                          type: integer
                        example:
                          - 1
                          - 2
                      customerFields:
                        description: >-
                          The customer fields of the subscriber. The ids of the
                          customer fields must be known.
                        type: array
                        items:
                          type: string
                        example:
                          '1': Nepal
                          '2': 2
                          '3': '2018-06-01'
                          '4': true
                    type: object
                subscriberGroupIds:
                  description: >-
                    The subscriber groups which should be assigned to every
                    subscriber. Should be used when every subscriber must be
                    added in the same group.
                  type: array
                  items:
                    type: integer
                  example:
                    - 1
                    - 2
              type: object
      responses:
        '200':
          description: The subscribers which were created, invalid or failed.
          content:
            application/json:
              schema:
                properties:
                  created:
                    type: array
                    items:
                      $ref: '#/components/schemas/Subscriber'
                  invalid:
                    type: array
                    items:
                      $ref: '#/components/schemas/Subscriber'
                  failed:
                    type: array
                    items:
                      $ref: '#/components/schemas/Subscriber'
                type: object
        '422':
          description: The given data was invalid.
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    example: error
                  code:
                    type: integer
                    example: 1002
                  message:
                    type: string
                    example: The given data was invalid.
                  errors:
                    type: object
                    example:
                      subscribers:
                        - The subscribers field is required.
                type: object
      security:
        - BasicAuth: []
  /subscribers/optOuts:
    get:
      tags:
        - Subscriber
      summary: Returns the optOuts of subscribers in a period
      description: >-
        Returns the optOuts of the subscribers. An period should be send in the
        search field.
      operationId: GetSubscriberOptOuts
      parameters:
        - name: search
          in: query
          description: The search to apply.
          required: false
          schema:
            type: string
            example:
              - timestamp:
                  condition: '>'
                  value: '2019-09-30 00:00:00'
              - timestamp:
                  condition: <
                  value: '2019-09-30 06:00:00'
      responses:
        '200':
          description: The subscriber actions with the optOut action.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriberAction'
      security:
        - BasicAuth: []
  /subscribers/upsert:
    post:
      tags:
        - Subscriber
      summary: >-
        Update existing subscribers via id or email or create new subscribers if
        not existing
      description: >-
        Send an array of subscribers to mail2many. Existing subscribers will be
        updated and new subscribers created. The status and statusAddition must
        be set correctly, check herefore the subscriber schema.
               <br /><br />If all subscribers should be added to the same subscriber groups the subscriberGroupIds should be passed at the first level and removed from the subscribers array for performance increase.
               <br /><br />A typical use case for this route is a data synchronization between a third-party-system and mail2many.
               <br /><br />The rights of the api key will be checked here. If the key has not the right to set unsubscribed subscribers to receive-ready, the old status will be kept.
      operationId: UpsertSubscriber
      parameters:
        - name: include
          in: query
          description: >-
            Which relations should be included. Available: subscriberGroups,
            newsletters, channels.
          required: false
          schema:
            type: string
      requestBody:
        description: Subscribers that should be created or updated.
        required: true
        content:
          application/json:
            schema:
              properties:
                subscribers:
                  description: The subscribers which should be created or updated.
                  type: array
                  items:
                    required:
                      - email
                    properties:
                      email:
                        $ref: '#/components/schemas/Subscriber/properties/email'
                      status:
                        $ref: '#/components/schemas/Subscriber/properties/status'
                      statusAddition:
                        $ref: >-
                          #/components/schemas/Subscriber/properties/statusAddition
                      genderId:
                        $ref: '#/components/schemas/Subscriber/properties/genderId'
                      languageIso:
                        $ref: '#/components/schemas/Subscriber/properties/languageIso'
                      countryIso:
                        $ref: '#/components/schemas/Subscriber/properties/countryIso'
                      reference:
                        $ref: '#/components/schemas/Subscriber/properties/reference'
                      title:
                        $ref: '#/components/schemas/Subscriber/properties/title'
                      firstname:
                        $ref: '#/components/schemas/Subscriber/properties/firstname'
                      lastname:
                        $ref: '#/components/schemas/Subscriber/properties/lastname'
                      salutationType:
                        $ref: >-
                          #/components/schemas/Subscriber/properties/salutationType
                      salutation:
                        $ref: '#/components/schemas/Subscriber/properties/salutation'
                      company:
                        $ref: '#/components/schemas/Subscriber/properties/company'
                      street:
                        $ref: '#/components/schemas/Subscriber/properties/street'
                      postcode:
                        $ref: '#/components/schemas/Subscriber/properties/postcode'
                      city:
                        $ref: '#/components/schemas/Subscriber/properties/city'
                      phoneNumber:
                        $ref: '#/components/schemas/Subscriber/properties/phoneNumber'
                      birthday:
                        $ref: '#/components/schemas/Subscriber/properties/birthday'
                      sendOptIn:
                        description: >-
                          If an opt-in should be send to the subscriber. Will
                          only be send if status=2 and statusAddition=1
                        type: boolean
                        example: true
                      optInLanguageIso:
                        description: >-
                          The language of the opt-in. If not available
                          optInSent=false will be returned.
                        type: string
                        example: de
                      optInComment:
                        $ref: >-
                          #/components/schemas/Subscriber/properties/optInComment
                      subscriberGroupIds:
                        description: The subscriber groups which should be assigned.
                        type: array
                        items:
                          type: integer
                        example:
                          - 1
                          - 2
                      customerFields:
                        description: >-
                          The customer fields of the subscriber. The ids of the
                          customer fields must be known.
                        type: array
                        items:
                          type: string
                        example:
                          '1': Nepal
                          '2': 2
                          '3': '2018-06-01'
                          '4': true
                    type: object
                detachSubscriberGroups:
                  description: >-
                    If the existing subscriber groups should be detached and
                    only the new ones assigned.
                  type: boolean
                  example: false
                subscriberGroupIds:
                  description: The subscriber groups which should be assigned.
                  type: array
                  items:
                    type: integer
                  example:
                    - 1
                    - 2
              type: object
      responses:
        '200':
          description: The subscribers were created or updated.
          content:
            application/json:
              schema:
                properties:
                  created:
                    type: array
                    items:
                      $ref: '#/components/schemas/Subscriber'
                  updated:
                    type: array
                    items:
                      $ref: '#/components/schemas/Subscriber'
                  invalid:
                    type: array
                    items:
                      $ref: '#/components/schemas/Subscriber'
                  failed:
                    type: array
                    items:
                      $ref: '#/components/schemas/Subscriber'
                type: object
        '422':
          description: The given data was invalid.
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    example: error
                  code:
                    type: integer
                    example: 1002
                  message:
                    type: string
                    example: The given data was invalid.
                  errors:
                    type: object
                    example:
                      subscribers:
                        - The subscribers field is required.
                type: object
      security:
        - BasicAuth: []
  /subscribers/archive:
    put:
      tags:
        - Subscriber
      summary: Archive one or multiple subscribers via id or email
      description: >-
        Archives the given subscribers in the given channels. If no channel ids
        are given, the subscribers will be archived in all assigned channels.
               <br /><br />It is possible to archive subscribers by their ids or by their emails. If both ids and emails are given, both will be used to archive the subscribers. You should select one of the two options.
      operationId: ArchiveSubscribers
      requestBody:
        description: Subscribers that should be archived.
        required: true
        content:
          application/json:
            schema:
              properties:
                subscriberIds:
                  description: The subscriber ids which should be archived.
                  type: array
                  items:
                    type: integer
                  example:
                    - 2
                    - 4
                subscriberEmails:
                  description: The subscriber emails which should be archived.
                  type: array
                  items:
                    type: integer
                  example:
                    - mail@example.com
                    - test@example.com
                channelIds:
                  description: The channel ids which should be archived.
                  type: array
                  items:
                    type: integer
                  example:
                    - 1
                    - 2
              type: object
      responses:
        '200':
          description: The subscribers were archived.
          content:
            application/json:
              schema:
                properties:
                  totalCount:
                    type: integer
                    example: 2
                  processedCount:
                    type: integer
                    example: 2
                type: object
      security:
        - BasicAuth: []
  /subscriberGroups:
    get:
      tags:
        - SubscriberGroup
      summary: Get all subscriber groups
      description: Returns all existing subscriber groups.
      operationId: getAllSubscriberGroups
      parameters:
        - name: returnAll
          in: query
          description: >-
            If all groups should be returned. By default entries are returned
            paginated.
          required: false
          schema:
            type: boolean
            example: false
      responses:
        '200':
          description: >-
            An array with subscriber groups and meta data. In the meta data the
            pagination information is returned.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriberGroup'
      security:
        - BasicAuth: []
    post:
      tags:
        - SubscriberGroup
      summary: Create a new subscriber group
      description: >-
        Creates a new subscriber group and returns it. Subscribers can be added
        to the group by id or email. If the subscriberGroup with the given name
        is already existing an error will be returned.
      operationId: CreateSubscriberGroup
      requestBody:
        description: >-
          SubscriberGroup object that should be created. The name field is
          required, the other fields are optional.
        required: true
        content:
          application/json:
            schema:
              properties:
                name:
                  $ref: '#/components/schemas/SubscriberGroup/properties/name'
                type:
                  $ref: '#/components/schemas/SubscriberGroup/properties/type'
                subscriberIds:
                  description: The subscribers which should be added to the group by id.
                  type: array
                  items:
                    type: integer
                    example: 1
                  nullable: true
                subscriberEmails:
                  description: The subscribers which should be added to the group by email.
                  type: array
                  items:
                    type: string
                    example: info@example.com
                  nullable: true
                canEdit:
                  $ref: '#/components/schemas/SubscriberGroup/properties/canEdit'
                canDelete:
                  $ref: '#/components/schemas/SubscriberGroup/properties/canDelete'
                canAssign:
                  $ref: '#/components/schemas/SubscriberGroup/properties/canAssign'
                isCalculating:
                  $ref: >-
                    #/components/schemas/SubscriberGroup/properties/isCalculating
              type: object
      responses:
        '200':
          description: The subscriberGroup was created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriberGroup'
        '409':
          description: The resource is already existing.
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    example: error
                  code:
                    type: integer
                    example: 1024
                  message:
                    type: string
                    example: The resource is already existing.
                  statusCode:
                    type: integer
                    example: 409
                type: object
        '422':
          description: The given data was invalid.
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    example: error
                  code:
                    type: integer
                    example: 1002
                  message:
                    type: string
                    example: The given data was invalid.
                  errors:
                    type: object
                    example:
                      name:
                        - The name field is required.
                type: object
      security:
        - BasicAuth: []
  /subscriberGroups/{id}:
    get:
      tags:
        - SubscriberGroup
      summary: Get a existing group
      description: Returns the subscriber group with the given id.
      operationId: GetSubscriberGroup
      parameters:
        - name: id
          in: path
          description: Id of the group
          required: true
          schema:
            type: integer
      responses:
        '200':
          description: The requested subscriber group.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriberGroup'
        '404':
          description: The resource is not existing.
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    example: error
                  code:
                    type: integer
                    example: 1020
                  message:
                    type: string
                    example: Could not find the resource.
                  statusCode:
                    type: integer
                    example: 404
                type: object
      security:
        - BasicAuth: []
    put:
      tags:
        - SubscriberGroup
      summary: Update an existing subscriber group
      description: >-
        Updates an existing subscriberGroup and returns it. Subscribers can be
        added to the group by id or email. If the subscriberGroup with the given
        name is already existing an error will be returned.
      operationId: UpdateSubscriberGroup
      parameters:
        - name: id
          in: path
          description: Id of the group
          required: true
          schema:
            type: integer
      requestBody:
        description: >-
          SubscriberGroup object that should be updated. All fields are
          optional.
        required: true
        content:
          application/json:
            schema:
              properties:
                name:
                  description: The unique name of the group
                  type: string
                  maxLength: 155
                  minLength: 1
                  example: Contest 2019
                  nullable: true
                subscriberIds:
                  description: The subscribers which should be added to the group by id.
                  type: array
                  items:
                    type: integer
                    example: 1
                  nullable: true
                subscriberEmails:
                  description: The subscribers which should be added to the group by email.
                  type: array
                  items:
                    type: string
                    example: info@example.com
                  nullable: true
                detach:
                  description: >-
                    If the given subscribers should be detached from the group
                    instead of attached.
                  type: boolean
                  example: false
                sync:
                  description: >-
                    All subscribers will be detached from the given group and
                    only the given subscribers get attached.
                  type: boolean
                  example: true
                canEdit:
                  $ref: '#/components/schemas/SubscriberGroup/properties/canEdit'
                canDelete:
                  $ref: '#/components/schemas/SubscriberGroup/properties/canDelete'
                canAssign:
                  $ref: '#/components/schemas/SubscriberGroup/properties/canAssign'
                isCalculating:
                  $ref: >-
                    #/components/schemas/SubscriberGroup/properties/isCalculating
              type: object
      responses:
        '200':
          description: The subscriberGroup was upated.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SubscriberGroup'
        '404':
          description: The resource is not existing.
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    example: error
                  code:
                    type: integer
                    example: 1020
                  message:
                    type: string
                    example: Could not find the resource.
                  statusCode:
                    type: integer
                    example: 404
                type: object
        '409':
          description: The resource is already existing.
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    example: error
                  code:
                    type: integer
                    example: 1024
                  message:
                    type: string
                    example: The resource is already existing.
                  statusCode:
                    type: integer
                    example: 409
                type: object
        '422':
          description: The given data was invalid.
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    example: error
                  code:
                    type: integer
                    example: 1002
                  message:
                    type: string
                    example: The given data was invalid.
                  errors:
                    type: object
                    example:
                      name:
                        - The name must be a string.
                type: object
      security:
        - BasicAuth: []
    delete:
      tags:
        - SubscriberGroup
      summary: Delete a existing subscriber group
      description: Deletes the subscriber group with the given id.
      operationId: DeleteSubscriberGroup
      parameters:
        - name: id
          in: path
          description: Id of the group
          required: true
          schema:
            type: integer
      responses:
        '202':
          description: Resource successfully deleted.
          content:
            application/json:
              schema:
                properties:
                  message:
                    type: string
                    example: Resource successfully deleted.
                type: object
        '404':
          description: The resource is not existing.
          content:
            application/json:
              schema:
                properties:
                  status:
                    type: string
                    example: error
                  code:
                    type: integer
                    example: 1020
                  message:
                    type: string
                    example: Could not find the resource.
                  statusCode:
                    type: integer
                    example: 404
                type: object
      security:
        - BasicAuth: []
  /trackings:
    get:
      tags:
        - Tracking
      summary: Get all trackings
      description: >-
        Returns the trackings data of all mailings. The trackings can be
        filtered and sorted. Check the developers guide to see how this works.
      operationId: GetAllTrackings
      parameters:
        - name: page
          in: query
          description: The page to show starting with 1.
          required: false
          schema:
            type: integer
          example: 1
        - name: limit
          in: query
          description: How many entries should be returned.
          required: false
          schema:
            type: integer
          example: 10
      responses:
        '200':
          description: The requested trackings.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Tracking'
      security:
        - BasicAuth: []
  /triggerTypes:
    get:
      tags:
        - TriggerType
      summary: Get all trigger types
      description: >-
        Returns the available trigger types of the account and if a mailing for
        the type is existing and activated. Returns all and not a pagination.
      operationId: GetAllTriggerTypes
      responses:
        '200':
          description: The requested trackings.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TriggerType'
      security:
        - BasicAuth: []
components:
  schemas:
    Article:
      title: Article
      description: Articles are content blocks of newsletters.
      required:
        - languageIso
        - name
        - templateId
      properties:
        id:
          description: The id of the article
          type: integer
          example: 1
        languageIso:
          description: The language of the article
          type: string
          maxLength: 5
          minLength: 5
          example: de
          nullable: false
        name:
          description: The internal name of the article
          type: string
          maxLength: 191
          minLength: 2
          example: MacBook Pro 2019
          nullable: false
        templateId:
          description: The template of the article.
          type: integer
          example: 1
          nullable: false
        canEdit:
          description: If the article can be edited.
          type: boolean
          default: true
        availableFrom:
          description: From which date the article is available in UTC.
          type: string
          default: null
          example: '2019-08-28 08:00:00'
          nullable: true
        availableUntil:
          description: Until which date the article is available in UTC.
          type: string
          default: null
          example: '2019-09-03 23:59:59'
          nullable: true
      type: object
    Channel:
      title: Channel
      description: Channels are output channels for the mailings / subscribers.
      properties:
        id:
          description: The id of the channel.
          type: integer
          example: 1
          nullable: false
        isDefault:
          description: Indicates if channel is default.
          type: boolean
          example: true
          nullable: false
        type:
          description: 'The type of the channel: 1=marketing, 2=transaction'
          type: integer
          example: 1
        translations:
          description: The translation of the channel
          type: array
          items:
            type: object
          example:
            de:
              name: Marketing
              description: Kanal für Marketing Mails.
            en:
              name: Marketing
              description: Channels for marketing mails.
        createdAt:
          description: When the channel was created in UTC.
          type: string
          example: '2019-09-27 10:51:00'
        updatedAt:
          description: When the channel was updated in UTC.
          type: string
          example: '2019-09-27 10:52:00'
      type: object
    CustomerField:
      title: CustomerField
      description: Customer fields are specific fields created for a customer.
      properties:
        id:
          description: >-
            The id of the field: 1=string, 2=integer, 3=date, 4=boolean,
            5=string list
          type: integer
          example: 1
        fieldType:
          description: 'The field type: 1=subscriber, 2=account, 3=mailing'
          type: integer
          example: 1
        type:
          description: 'The data type of the field: 1=string, 2=integer, 3=date, 4=boolean'
          type: integer
          example: 1
        isAvailableForImport:
          description: If the field can be imported.
          type: boolean
          example: true
        isAvailableForExport:
          description: If the field can be exported.
          type: boolean
          example: true
        isEditable:
          description: If the value of the field can be edited.
          type: boolean
          example: true
        inputId:
          description: The id of the input field
          type: integer
          example: 1
        translations:
          description: The translation of the field
          type: array
          items:
            type: object
          example:
            de:
              name: Lieblingsland
              description: Das Lieblingsland eines Empfängers.
        value:
          description: The value if the field is an account field.
          type: string
          example: Nepal
        createdAt:
          description: When the field was created in UTC.
          type: string
          example: '2019-09-27 10:51:00'
        updatedAt:
          description: When the field was updated in UTC.
          type: string
          example: '2019-09-27 10:52:00'
      type: object
    Mailing:
      title: Mailing
      description: Mailings contain newsletters.
      properties:
        id:
          description: The id of the mailing
          type: integer
          example: 1
        languageIso:
          description: The language of the mailing
          type: string
          maxLength: 5
          minLength: 5
          example: de
          nullable: false
        mailingTemplateId:
          description: The id of the mailing template
          type: integer
          example: 1
          nullable: false
        oldVersionFrom:
          description: The id of the old version of the mailing
          type: integer
          example: null
          nullable: true
        name:
          description: The internal name of the mailing
          type: string
          maxLength: 191
          minLength: 2
          example: MacBook Pro 2022
          nullable: false
        senderName:
          description: The sender name of the mailing
          type: string
          maxLength: 191
          minLength: 2
          example: Atrivio
          nullable: true
        customerFields:
          description: The customer fields of the mailing
          type: object
          example:
            '1': 1234
          nullable: true
        availableFrom:
          description: From which date the mailing is available in UTC.
          type: string
          default: null
          example: '2019-08-28 08:00:00'
          nullable: true
        availableUntil:
          description: Until which date the mailing is available in UTC.
          type: string
          default: null
          example: '2019-09-03 23:59:59'
          nullable: true
        activeSince:
          description: From which date the event mailing is active in UTC.
          type: string
          default: null
          example: null
          nullable: true
        inactiveSince:
          description: From which date the event mailing is inactive in UTC.
          type: string
          default: null
          example: null
          nullable: true
        subscriberChannelId:
          description: The id of the subscriber channel
          type: integer
          example: 1
          nullable: false
        isScheduled:
          description: If the mailing is currently scheduled.
          type: boolean
          default: false
          example: false
          nullable: false
        isRunning:
          description: If the mailing is currently running.
          type: boolean
          default: false
          example: false
          nullable: false
        transferedAt:
          description: If and when the mailing was transfered in UTC.
          type: string
          default: null
          example: '2019-09-03 23:59:59'
          nullable: true
      type: object
    Newsletter:
      title: Newsletter
      description: Newsletters contain articles and are send to subscribers..
      properties:
        id:
          description: The id of the newsletter
          type: integer
          example: 1
        themeId:
          description: The theme of the newsletter.
          type: integer
          example: 1
          nullable: false
        languageIso:
          description: The language of the newsletter
          type: string
          maxLength: 5
          minLength: 5
          example: de
          nullable: false
        subject:
          description: The subject of the newsletter
          type: string
          maxLength: 191
          minLength: 2
          example: MacBook Pro 2019 im Angebot
          nullable: false
        preHeader:
          description: The pre header of the newsletter
          type: string
          maxLength: 191
          minLength: 2
          example: 'Nur heute im Angebot: das neue MacBook Pro 2019'
          nullable: false
        sentAt:
          description: When the newsletter was sent in UTC.
          type: string
          default: null
          example: '2019-09-03 23:59:59'
          nullable: true
        subscriberCount:
          description: The total number of subscribers.
          type: integer
          example: 15
          nullable: false
        screenshotUrl:
          description: The url to the screenshot of the newsletter.
          type: string
          example: >-
            https://mail2many.localhost/cdn/screenshots/V24rmekYQWZX/yxA9p0aRmX8o.jpg
          nullable: true
        screenshotThumbUrl:
          description: The url to a thumbnail of the screenshot of the newsletter in jpg.
          type: string
          example: >-
            https://mail2many.localhost/cdn/screenshots/V24rmekYQWZX/yxA9p0aRmX8o-thumb.jpg
          nullable: true
        screenshotThumbUrlWebp:
          description: The url to a thumbnail of the screenshot of the newsletter in webp.
          type: string
          example: >-
            https://mail2many.localhost/cdn/screenshots/V24rmekYQWZX/yxA9p0aRmX8o-thumb.webp
          nullable: true
        onlineVersionUrl:
          description: The url to the online version of the newsletter.
          type: string
          example: https://mail2many.localhost/newsletter.php?p=parameter
          nullable: true
      type: object
    OptInType:
      title: OptInType
      description: >-
        OptInTypes are different types of opt-ins a subscriber can get. A
        mailing is assigned to the type.
      properties:
        shortcut:
          description: The name of the type.
          type: string
          example: voucher
        translations:
          description: The translation of the type
          type: array
          items:
            type: object
          example:
            de:
              name: Voucher
              description: Sends an voucher after opt-in confirmation.
      type: object
    Subscriber:
      title: Subscriber
      description: Subscribers are receivers of mailings.
      required:
        - email
      properties:
        id:
          description: The id of the subscriber.
          type: integer
          example: 1
        email:
          description: The email of the subscriber.
          type: string
          maxLength: 155
          minLength: 1
          example: mail@example.com
        status:
          description: >-
            The status of the subscriber: 1=receive ready, 2=not receive ready,
            3=archived.
          type: integer
          enum:
            - 1
            - 2
            - 3
          example: 2
        statusAddition:
          description: >-
            An addition to the status. For the status=1(receive ready) the
            addition should be null. Possible Additions for status=2(not receive
            ready): 1=Opt-in pending, 2=no Opt-in, 3=transaction. Possible
            Additions for status=3(archived): 4=unsubscribed, 5=hard bounced,
            6=manual.
          type: integer
          enum:
            - 1
            - 2
            - 3
            - 4
            - 5
            - 6
          example: 1
          nullable: true
        genderId:
          description: >-
            The gender of the subscriber: 1=male, 2=female, 3=non-binary, 4=not
            specified.
          type: integer
          enum:
            - 1
            - 2
            - 3
            - 4
          example: 4
          nullable: false
        languageIso:
          description: The language of the subscriber as ISO 639-1
          type: string
          example: de
          nullable: true
        countryIso:
          description: The country of the subscriber as ISO 3166-2
          type: string
          example: de
          nullable: true
        reference:
          description: >-
            An dynamic reference for the subscriber. Can be used in different
            ways: Store-Id, Dealer-Id.
          type: string
          example: '123456'
          nullable: true
        title:
          description: The academic title of the subscriber.
          type: string
          maxLength: 191
          minLength: 1
          example: Dr.
          nullable: true
        firstname:
          description: The firstname of the subscriber.
          type: string
          maxLength: 191
          minLength: 1
          example: Florian
          nullable: true
        lastname:
          description: The lastname of the subscriber.
          type: string
          maxLength: 191
          minLength: 1
          example: Reichart
          nullable: true
        salutationType:
          description: >-
            The salutation type for the automatic greeting: 1=formal,
            2=personal, 3=individual
          type: integer
          enum:
            - 1
            - 2
            - 3
          example: 1
          nullable: false
        salutation:
          description: An individual salutation for the subscriber.
          type: string
          maxLength: 155
          minLength: 1
          example: Hi Florian
          nullable: true
        company:
          description: The company of the subscriber.
          type: string
          maxLength: 191
          minLength: 1
          example: Atrivio
          nullable: true
        street:
          description: The street of the subscriber.
          type: string
          maxLength: 191
          minLength: 1
          example: Albert-Einstein-Str. 6
          nullable: true
        postcode:
          description: The postcode of the subscriber.
          type: string
          maxLength: 191
          minLength: 1
          example: '87437'
          nullable: true
        city:
          description: The city of the subscriber.
          type: string
          maxLength: 191
          minLength: 1
          example: Kempten
          nullable: true
        phoneNumber:
          description: The phone number of the subscriber.
          type: string
          maxLength: 191
          minLength: 1
          example: +49 831 512999-0
          nullable: true
        birthday:
          description: The birthday of the subscriber in Y-m-d.
          type: string
          maxLength: 191
          minLength: 1
          example: '1970-01-01'
          nullable: true
        optInComment:
          description: An opt-in comment for the subscriber.
          type: string
          maxLength: 191
          minLength: 1
          example: Opt-in was given
          nullable: true
        optInSent:
          description: If the opt-in could be send.
          type: boolean
          example: true
          nullable: true
        customerFields:
          description: >-
            The customer fields of the subscriber. The ids of the customer
            fields must be known.
          type: array
          items:
            type: string
          example:
            '1': Nepal
            '2': 2
            '3': '2018-06-01'
            '4': true
          nullable: true
        createdAt:
          description: When the subscriber was created in UTC.
          type: string
          example: '2019-09-27 10:51:00'
        updatedAt:
          description: When the subscriber was updated in UTC.
          type: string
          example: '2019-09-27 10:52:00'
      type: object
    SubscriberAction:
      title: SubscriberAction
      description: SubscriberActions are actions done from subscribers.
      properties:
        id:
          description: The unique action id.
          type: integer
          example: 1
        action:
          description: The logged action.
          type: string
          example: optOut
        email:
          description: The email of the subscriber.
          type: string
          example: florian.reichart@atrivio.de
        newsletterId:
          description: In which newsletter the action was done.
          type: integer
          example: 1
          nullable: true
        timestamp:
          description: When the action was done in UTC.
          type: string
          example: '2019-09-30 06:00:00'
        ip:
          description: From which ip the action was done.
          type: string
          example: 127.0.0.1
      type: object
    SubscriberGroup:
      title: SubscriberGroup
      description: SubscriberGroups are holding subscribers.
      required:
        - name
      properties:
        id:
          description: The id of the group
          type: integer
          example: 1
        name:
          description: The unique name of the group
          type: string
          maxLength: 155
          minLength: 1
          example: Contest 2019
          nullable: false
        type:
          description: 'The type of the group: 1 = static, 2 = dynamic, 3 = external'
          type: integer
          example: 3
          nullable: false
        subscriberCount:
          description: How many subscribers the group has
          type: integer
          example: 1
          nullable: false
        receiveReadyCount:
          description: How many receive ready subscribers the group has
          type: integer
          example: 1
          nullable: false
        canEdit:
          description: If the group can be edited from the user
          type: boolean
          example: true
          nullable: false
        canDelete:
          description: If the group can be deleted from the user
          type: boolean
          example: true
          nullable: false
        canAssign:
          description: If the user can assign subscribers to the group
          type: boolean
          example: true
          nullable: false
        pluginId:
          description: The id of the plugin created the group
          type: integer
          example: 1
          nullable: true
        isCalculating:
          description: If the subscribers are currently calculating
          type: boolean
          example: false
          nullable: false
        createdAt:
          description: When the group was created in UTC.
          type: string
          example: '2019-09-27 10:51:00'
        updatedAt:
          description: When the group was updated in UTC.
          type: string
          example: '2019-09-27 10:52:00'
      type: object
    Tracking:
      title: Tracking
      description: Trackings are user actions like opening, click, unsubscribe.
      properties:
        id:
          description: >-
            The id of the tracking. The is only unique in combination with type
            because the tracking types are saved independent.
          type: integer
          example: 1
          nullable: false
        type:
          description: >-
            The type of tracking: sent, opening, click, unsubscribe, softbounce,
            hardbounce.
          type: string
          example: click
          nullable: false
        isFirst:
          description: If it was the first click or opening of the subscriber.
          type: boolean
          example: true
          nullable: true
        subscriberId:
          description: The id of the subscriber.
          type: integer
          example: 1
          nullable: false
        subscriberEmail:
          description: The email of the subscriber if the subscriber is still existing.
          type: string
          example: mail@example.com
          nullable: true
        mailingId:
          description: The id of the mailing where the tracking occured.
          type: integer
          example: 1
          nullable: true
        foreignId:
          description: The id of a third-party system.
          type: integer
          example: 1
          nullable: true
        newsletterId:
          description: The id of the newsletter where the tracking occured.
          type: integer
          example: 1
          nullable: true
        articleId:
          description: The id of the article where the tracking occured.
          type: integer
          example: 1
          nullable: true
        areaId:
          description: The id of the area where the tracking occured.
          type: integer
          example: 1
          nullable: true
        placeholderId:
          description: The id of the placeholder where the tracking occured.
          type: integer
          example: 1
          nullable: true
        timestamp:
          description: When the tracking occured in UTC.
          type: string
          example: '2019-09-03 23:59:59'
          nullable: false
        target:
          description: The target of the clicked link.
          type: string
          example: https://www.atrivio.de
          nullable: true
        userAgent:
          description: The user agent of the user.
          type: string
          example: Chrome
          nullable: true
        platform:
          description: The platform where the tracking happened.
          type: string
          example: OS X
          nullable: true
        deviceType:
          description: >-
            The device type of the user: 1=desktop, 2=tablet, 3=mobile,
            4=unknown.
          type: integer
          example: 1
          nullable: true
      type: object
    TriggerType:
      title: TriggerType
      description: >-
        Trigger types are different types of exterrnal triggers like birthay,
        forgot password.
      properties:
        id:
          description: The id of the triggerType. It is unique cross-account.
          type: integer
          example: 1
          nullable: false
        shortcut:
          description: An unique shortcut of the trigger type.
          type: string
          example: birthday
          nullable: false
        usages:
          description: The usages of the trigger types.
          type: array
          items:
            type: object
          example:
            de: true
            en: false
        translations:
          description: The translation of the trigger type
          type: array
          items:
            type: object
          example:
            de:
              name: Geburtstag
              description: Trigger zum Versand einer Sendung an einem Geburtstag.
        createdAt:
          description: When the trigger type was created in UTC.
          type: string
          example: '2019-09-27 10:51:00'
        updatedAt:
          description: When the trigger type was updated in UTC.
          type: string
          example: '2019-09-27 10:52:00'
      type: object
  securitySchemes:
    BasicAuth:
      type: http
      description: Send your credentials as basic auth.
      scheme: basic
tags:
  - name: Authentication
    description: Routes for authentication.
  - name: Article
    description: Articles are content blocks of newsletters.
  - name: Channel
    description: Channels are different output channels for the mailings / subscribers.
  - name: CustomerField
    description: Customer fields are specific fields created for a customer.
  - name: Mailing
    description: Mailings exists of one or many newsletters.
  - name: Newsletter
    description: Newsletters are send to subscribers.
  - name: OptInType
    description: OptInTypes are used to select an optin type for a subscriber.
  - name: Parameter
    description: Parameters are per subscriber encrypted data in the newsletters.
  - name: Statistic
    description: Statistics are collected for newsletters.
  - name: Subscriber
    description: Subscribers are receivers of mailings.
  - name: SubscriberGroup
    description: SubscriberGroups are used to group subscriber.
  - name: Tracking
    description: Trackings are user actions like opening, click, unsubscribe.
  - name: TriggerType
    description: >-
      Trigger types are different types of external triggers like birthay,
      forgot password.
