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

# Bulk upsert contacts

> Create or update multiple contacts at once. Existing contacts are matched by phone number.



## OpenAPI

````yaml /openapi.json post /api/contact/upsert
openapi: 3.0.0
info:
  title: GoMobile Backend API
  description: >-
    API documentation for GoMobile telephony platform - automated calling
    campaigns, interactive voice flows, and call management
  version: '1.0'
  contact: {}
servers:
  - url: http://localhost:3000
    description: Local Development
security: []
tags:
  - name: Organizations
    description: Multi-tenant organization management
  - name: Teams
    description: Team structure and hierarchy
  - name: Contacts
    description: Customer contact management (CRM)
  - name: Entities
    description: Business entities management
  - name: Audiences
    description: Contact segmentation and groups
  - name: Programs
    description: Call campaign configuration
  - name: Call Flows
    description: Interactive call flow builder
paths:
  /api/contact/upsert:
    post:
      tags:
        - Contacts
      summary: Bulk upsert contacts
      description: >-
        Create or update multiple contacts at once. Existing contacts are
        matched by phone number.
      operationId: ContactController_upsert
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpsertContactDto'
      responses:
        '201':
          description: Contacts upserted successfully
        '400':
          description: Invalid input data
components:
  schemas:
    UpsertContactDto:
      type: object
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/CreateContactDto'
      required:
        - data
    CreateContactDto:
      type: object
      properties:
        firstName:
          type: string
          example: John
        lastName:
          type: string
          example: Doe
        fullName:
          type: string
          example: John Doe
        primaryEmail:
          type: string
          example: john@example.com
        primaryPhone:
          type: string
          example: '+212612345678'
        address:
          type: string
          example: 123 Main St
        city:
          type: string
          example: Casablanca
        state:
          type: string
          example: Casablanca-Settat
        zip:
          type: string
          example: '20000'
        occupation:
          type: string
          example: Engineer
        preferredChannel:
          type: string
          example: phone
        customAttributes:
          type: object
          example:
            age: 30
            interests:
              - tech
          nullable: true
          additionalProperties: true
      required:
        - primaryPhone

````