> ## 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 Contact

> API for creating contact. For creating a contact, email and list id is required. If you try to create a contact that already exists, it gives an "already exists" message . You can add custom property data by mapping the property id : value. You can add contacts until your contact quota limit is reached. If you create a contact in a suppressed list and if this contact is also present in the active list,  the contact will be removed from the active list to the suppressed list.



## OpenAPI

````yaml /openapi-v1.json post /contacts
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:
    post:
      tags:
        - Contacts
      summary: Create Contact
      description: >-
        API for creating contact. For creating a contact, email and list id is
        required. If you try to create a contact that already exists, it gives
        an "already exists" message . You can add custom property data by
        mapping the property id : value. You can add contacts until your contact
        quota limit is reached. If you create a contact in a suppressed list and
        if this contact is also present in the active list,  the contact will be
        removed from the active list to the suppressed list.
      operationId: create-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
              required:
                - email
                - list_id
              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: |2-
                         property id : value of property
                         string can store upto 100 characters
                    enc_id2:
                      type: number
                      description: |2-
                         property id : value of property
                         Number field can store numbers with 30 characters long
                department:
                  type: string
                  minLength: 1
                  description: |-
                    The department of contact

                    Maximum: 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
                list_id:
                  type: string
                  minLength: 1
                  description: The contact list id to which you want to add this contact
                middle_name:
                  type: string
                  maxLength: 25
                  description: |-
                    The middle name of contact

                    Maximum: 25
                first_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
                  minLength: 1
                  description: |-
                    The phone number of your contact

                    Maximum: 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
                  description: |
                    The tags of your contact
                  items: {}
            examples:
              example-1:
                value:
                  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
                  list_id: string
                  middle_name: string
                  first_name: string
                  company_name: string
                  phone: string
                  salary: 0
                  state: string
                  postal_code: string
                  contact_type: active
                  tags:
                    - string
      responses:
        '201':
          description: Created
          content:
            application/json:
              schema:
                description: ''
                type: object
                properties: {}
              examples:
                example-1:
                  value:
                    id: xc
        '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: Bad Request
          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.

````