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

# Create Batch Contact

> Create a  Batch contact. You can create a maximum of 50 contact through this API.



## OpenAPI

````yaml /openapi-v1.json post /contacts/batch
openapi: 3.1.0
info:
  title: Mailercloud Marketing API
  version: 1.0.0
  description: >-
    Campaigns, contacts, lists, segments, automations, and webhooks for the
    Mailercloud Marketing Platform.
servers:
  - url: https://cloudapi.mailercloud.com/v1
security:
  - apiKey: []
tags:
  - name: Campaigns
  - name: Contacts
  - name: Lists
  - name: Tags
  - name: Segments
  - name: Custom Properties
  - name: Senders
  - name: Templates
  - name: Automations
  - name: Webhooks
  - name: Webforms
  - name: Inbox Tracker
  - name: Account
paths:
  /contacts/batch:
    post:
      tags:
        - Contacts
      summary: Create Batch Contact
      description: >-
        Create a  Batch contact. You can create a maximum of 50 contact through
        this API.
      operationId: create-batch-contact
      parameters:
        - name: Content-Type
          in: header
          required: true
          description: Request body type
          schema:
            type: string
            default: application/json
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                contacts:
                  type: array
                  uniqueItems: true
                  minItems: 1
                  maxItems: 50
                  description: Batches of contact
                  items:
                    type: object
                    properties:
                      city:
                        type: string
                        description: |-
                          The city of the contact

                          Maximum: 100
                        maxLength: 100
                      country:
                        type: string
                        description: |-
                          The country of the contact

                          Maximum: 50
                        maxLength: 50
                      custom_fields:
                        type: object
                        description: |-
                          Json for custom property
                           
                          Text - maximum: 100

                          Textarea - maximum: 500

                          Number - Numeric values only

                          Date - maximum: 10,format = 2006-01-02 
                        properties:
                          enc_id1:
                            type: string
                            minLength: 1
                            description: 'property id : value of property'
                          enc_id2:
                            type: number
                            description: 'property id : value of property'
                      department:
                        type: string
                        description: |-
                          The department of contact

                          Maximum: 100
                        maxLength: 100
                      email:
                        type: string
                        maxLength: 200
                        description: >-
                          The email for the contact. This is required to be a
                          valid email.


                          Maximum: 200
                      industry:
                        type: string
                        description: |-
                          The industry of the contact

                          Maximum: 100
                        maxLength: 100
                      job_title:
                        type: string
                        description: |-
                          The job title of the contact 

                          Maximum: 100
                        maxLength: 100
                      last_name:
                        type: string
                        description: |-
                          The last name for the contact

                          Maximum: 25
                        maxLength: 25
                      lead_source:
                        type: string
                        description: |-
                          The lead sorce of contact

                          Maximum: 50
                        maxLength: 50
                      middle_name:
                        type: string
                        maxLength: 25
                        description: |-
                          The middle name of contact

                          Maximum: 25
                      name:
                        type: string
                        maxLength: 25
                        description: |-
                          Name of your contact

                          Maximum: 25
                      company_name:
                        type: string
                        description: |-
                          The company name of your contact

                          Maximum: 150
                        maxLength: 150
                      phone:
                        type: string
                        description: |-
                          The phone number of your contact

                          Maximum: 25
                        maxLength: 25
                      salary:
                        type: number
                        description: |-
                          The salary of your contact

                          Maximum: 15
                      state:
                        type: string
                        description: |-
                          The state of your contact

                          Maximum: 100
                        maxLength: 100
                      postal_code:
                        type: string
                        description: |-
                          The postal code of your contact

                          Maximum: 25
                        maxLength: 25
                      contact_type:
                        type: string
                        description: >-
                          Allowed values - active, bounce, abuse, unsubscribe,
                          suppressed, spam complaints


                          Default: active
                        default: active
                      tags:
                        type: array
                        items: {}
                    required:
                      - email
                list_id:
                  type: string
                  description: The contact list id to which you want to add this contact
              required:
                - contacts
                - list_id
            examples:
              example-1:
                value:
                  contacts:
                    - city: string
                      country: string
                      custom_fields:
                        enc_id1: string
                        enc_id2: 0
                      department: string
                      email: string
                      industry: string
                      job_title: string
                      last_name: string
                      lead_source: string
                      middle_name: string
                      name: string
                      company_name: string
                      phone: string
                      salary: 0
                      state: string
                      postal_code: string
                      tags:
                        - string
                  list_id: string
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                description: ''
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      inserted:
                        type: number
                      skipped:
                        type: number
                      submitted:
                        type: number
                      updated:
                        type: number
                  message:
                    type: string
                    minLength: 1
              examples:
                example-1:
                  value:
                    data:
                      inserted: 2
                      skipped: 1
                      submitted: 3
                      updated: 0
                    message: Batch contacts processed
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                description: ''
                type: object
                properties:
                  error:
                    type: object
                    properties:
                      field:
                        type: string
                        minLength: 1
                      message:
                        type: string
                        minLength: 1
              examples:
                example-1:
                  value:
                    error:
                      field: email
                      message: Invalid email
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                description: ''
                type: object
                properties:
                  errors:
                    type: array
                    uniqueItems: true
                    minItems: 1
                    items:
                      type: object
                      properties:
                        field:
                          type: string
                        message:
                          type: string
                          minLength: 1
              examples:
                example-1:
                  value:
                    errors:
                      - field: ''
                        message: Authorization failed
components:
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        Your Mailercloud API key (plain text, no Bearer prefix). Create keys in
        Settings → API.

````