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

# Post v1contactsupsert



## OpenAPI

````yaml https://api.comm.com/docs/api.json post /v1/contacts/upsert
openapi: 3.1.0
info:
  title: Commvoice API
  version: '1'
servers:
  - url: https://api.comm.com/api
    description: Live
security:
  - http: []
paths:
  /v1/contacts/upsert:
    post:
      tags:
        - Contacts
      operationId: contacts.upsertContacts
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                webhook_request_id:
                  type: string
                  format: uuid
                contacts:
                  type: array
                  items:
                    type: object
                    properties:
                      contact_id:
                        type: string
                        format: uuid
                      phone_normalized:
                        type:
                          - string
                          - 'null'
                      email_normalized:
                        type:
                          - string
                          - 'null'
                        description: >-
                          'contacts.*.phone_is_good' => 'nullable|numeric',

                          'contacts.*.phone_is_good_reason' =>
                          'nullable|numeric',
                      email_is_good:
                        type:
                          - number
                          - 'null'
                      email_is_good_reason:
                        type:
                          - number
                          - 'null'
                      name:
                        type:
                          - string
                          - 'null'
                      country:
                        type: string
                        description: ISO 3166-1 alpha-2 country code
                      state_id:
                        type:
                          - number
                          - 'null'
                      state_id_reason:
                        type:
                          - number
                          - 'null'
                      custom_fields:
                        type: array
                        items:
                          type: object
                          properties:
                            name:
                              type: string
                            value:
                              type: string
                            type:
                              $ref: '#/components/schemas/CustomFieldTypeEnum'
                              description: >-
                                if type is set, custom field will be created if
                                it doesn't exist
                          required:
                            - name
                            - value
                      network_brand:
                        type:
                          - string
                          - 'null'
                        description: |-
                          'contacts.*.custom1_str' => 'nullable|string',
                          'contacts.*.custom2_str' => 'nullable|string',
                          'contacts.*.custom3_str' => 'nullable|string',
                          'contacts.*.custom4_str' => 'nullable|string',
                          'contacts.*.custom5_str' => 'nullable|string',
                          'contacts.*.custom1_int' => 'nullable|numeric',
                          'contacts.*.custom2_int' => 'nullable|numeric',
                          'contacts.*.custom3_int' => 'nullable|numeric',
                          'contacts.*.custom4_int' => 'nullable|numeric',
                          'contacts.*.custom5_int' => 'nullable|numeric',
                          'contacts.*.custom1_dec' => 'nullable|numeric',
                          'contacts.*.custom2_dec' => 'nullable|numeric',
                          'contacts.*.custom1_datetime' => 'nullable|string',
                          'contacts.*.custom2_datetime' => 'nullable|string',
                          'contacts.*.custom3_datetime' => 'nullable|string',
                          'contacts.*.custom4_datetime' => 'nullable|string',
                          'contacts.*.custom5_datetime' => 'nullable|string',
                      mcc:
                        type:
                          - string
                          - 'null'
                      mnc:
                        type:
                          - string
                          - 'null'
                      foreign_id:
                        type: string
                      raw_response:
                        type:
                          - string
                          - 'null'
                        description: '''contacts.*.network_brand_id'' => ''sometimes|string'','
                    required:
                      - country
                  maxItems: 1000
              required:
                - contacts
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: Job dispatched
                  jobs_count:
                    type: string
                  automation_run_id:
                    type: string
                  webhook_request_id:
                    type: string
                  contacts_count:
                    type: string
                required:
                  - message
                  - jobs_count
                  - automation_run_id
                  - webhook_request_id
                  - contacts_count
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    CustomFieldTypeEnum:
      type: string
      enum:
        - string
        - number
        - datetime
        - boolean
      title: CustomFieldTypeEnum
  responses:
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors
  securitySchemes:
    http:
      type: http
      scheme: bearer
      bearerFormat: JWT

````