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

# Migrate contacts

> Migrate contacts in bulk from an external system to Masivo. This endpoint allows you to import up to 10,000 contacts at once.



## OpenAPI

````yaml POST /contacts/migrate
openapi: 3.0.1
info:
  title: Masivo's REST API
  description: Learn how to use Masivo's REST API
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://app.masivo.ai/api/storefront/v1
security:
  - bearerAuth: []
paths:
  /contacts/migrate:
    post:
      description: >-
        Migrate contacts in bulk from an external system to Masivo. This
        endpoint allows you to import up to 10,000 contacts at once.
      parameters:
        - in: header
          name: x-account-id
          description: Your account ID
          required: true
          schema:
            type: string
            format: uuid
        - in: header
          name: x-timezone
          description: Timezone for processing (e.g., 'America/New_York', 'UTC')
          required: true
          schema:
            type: string
            example: UTC
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - contacts
              properties:
                contacts:
                  type: array
                  description: Array of contacts to migrate
                  minItems: 1
                  maxItems: 10000
                  items:
                    $ref: '#/components/schemas/ContactInsert'
            example: {}
      responses:
        '201':
          description: Contacts batch enqueued successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      message:
                        type: string
                        example: Contacts batch enqueued successfully
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '422':
          description: Unprocessable Content - Invalid contact data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    ContactInsert:
      type: object
      properties:
        created_at:
          type: string
          format: date-time
          description: Contact creation timestamp
        updated_at:
          type: string
          format: date-time
          description: Contact last update timestamp
        deleted_at:
          type: string
          format: date-time
          nullable: true
          description: Contact deletion timestamp (soft delete)
        external_id:
          type: string
          nullable: true
          description: External contact ID
        first_name:
          type: string
          nullable: true
          description: Contact first name
        second_name:
          type: string
          nullable: true
          description: Contact second name
        last_name:
          type: string
          nullable: true
          description: Contact last name
        second_last_name:
          type: string
          nullable: true
          description: Contact second last name
        email:
          type: string
          format: email
          description: Contact email address
        email_verified:
          type: boolean
          default: false
          description: Whether the email is verified
        dob:
          type: string
          format: date
          nullable: true
          description: Date of birth (YYYY-MM-DD)
        gender:
          type: string
          nullable: true
          enum:
            - MALE
            - FEMALE
          description: Contact gender
        country:
          type: string
          nullable: true
          description: Contact country
        city:
          type: string
          nullable: true
          description: Contact city
        phone:
          type: string
          nullable: true
          description: Contact phone number
        is_anonymous:
          type: boolean
          default: false
          description: Whether the contact is anonymous
        source:
          type: string
          nullable: true
          description: Contact source
        channel:
          type: string
          nullable: true
          description: Contact channel
        phone_verified:
          type: boolean
          default: false
          description: Whether the phone is verified
        document_type:
          type: string
          nullable: true
          description: Document type
        document_number:
          type: string
          nullable: true
          description: Document number
        status:
          type: string
          default: ACTIVE
          description: Contact status
        tags:
          type: object
          nullable: true
          description: Custom tags
        addresses:
          type: array
          nullable: true
          description: Contact addresses
          items:
            type: object
            required:
              - street_1
            properties:
              street_1:
                type: string
                description: Street 1
              street_2:
                type: string
                description: Street 2
              street_number:
                type: string
                description: Street number
              reference:
                type: string
                description: Reference
              alias:
                type: string
                description: Alias
              zip_code:
                type: string
                description: Zip code
              city:
                type: string
                description: City
              state:
                type: string
                description: State
              country:
                type: string
                description: Country
        billing_info:
          type: array
          nullable: true
          description: Billing information
          items:
            type: object
            required:
              - document_number
              - document_type
              - legal_name
            properties:
              document_number:
                type: string
                description: Document number
              document_type:
                type: string
                description: Document type
              legal_name:
                type: string
                description: Legal name
              alias:
                type: string
                description: Alias
              street_1:
                type: string
                description: Street 1
              street_2:
                type: string
                description: Street 2
              street_number:
                type: string
                description: Street number
              city:
                type: string
                description: City
              state:
                type: string
                description: State
              country:
                type: string
                description: Country
              zip_code:
                type: string
                description: Zip code
              phone:
                type: string
                description: Phone
              email:
                type: string
                description: Email
        payments:
          type: array
          nullable: true
          description: Payment information
          items:
            type: object
            required:
              - method
            properties:
              method:
                type: string
                enum:
                  - CREDIT
                  - DEBIT
                  - CASH
                  - BANK_TRANSFER
                  - OTHER
              last_four:
                type: string
                description: Last four digits of the card number
              card_holder:
                type: string
                description: Card holder name
              card_brand:
                type: string
                description: Card brand
              alias:
                type: string
                description: Alias for the payment method
              expiry_month:
                type: number
                description: Expiry month
              expiry_year:
                type: number
                description: Expiry year
        order:
          nullable: true
          description: >-
            Optional order information associated with contact creation. Extends
            Order schema with brand_id field. When provided, this will be stored
            internally in the data field along with identity resolution
            information.
          allOf:
            - $ref: '#/components/schemas/Order'
            - type: object
              properties:
                brand_id:
                  type: string
                  nullable: true
                  description: The brand id associated with this order
    Error:
      required:
        - error
        - details
      type: object
      properties:
        error:
          type: string
        details:
          type: string
    Order:
      type: object
      required:
        - purchase_id
        - value
        - products
        - payment_method
      properties:
        purchase_id:
          type: string
          description: The id of a placed order in your system
        channel_id:
          type: string
          description: >-
            The channel unique identifier in your system. Used to match campaign
            and reward e-commerce channel restrictions.
        store_id:
          type: string
          description: >-
            The store unique identifier in your system. Used to match campaign
            and reward e-commerce store restrictions.
        value:
          type: number
          description: The order total or subtotal
          example: 20.95
        discounted_value:
          type: number
          description: The order total or subtotal after discounts
          example: 10.95
        products:
          type: array
          description: >-
            Products in the order. Product sku values are used to match campaign
            and reward e-commerce product restrictions.
          minimum: 1
          items:
            $ref: '#/components/schemas/OrderProduct'
        shipping:
          $ref: '#/components/schemas/Shipping'
          description: The shipping information of the order
        payment_method:
          type: string
          description: The payment method used in the order
          enum:
            - CREDIT
            - DEBIT
            - CASH
            - BANK_TRANSFER
            - OTHER
        redeem:
          type: array
          description: The rewards to redeem in the order
          items:
            $ref: '#/components/schemas/RedemptionReward'
        metadata:
          type: object
          description: The metadata of the order
    OrderProduct:
      type: object
      required:
        - sku
        - amount
        - value
      properties:
        sku:
          type: string
          description: >-
            The product sku. Used to match campaign and reward e-commerce
            product restrictions.
        amount:
          type: number
          description: The quantity of the product
        value:
          type: number
          description: The total or subtotal of the product
        discounted_value:
          type: number
          description: The total or subtotal of the product after discounts
        redeem:
          type: array
          description: The rewards to redeem in the product
          items:
            $ref: '#/components/schemas/RedemptionReward'
        tags:
          type: object
          description: Include your conditions event tags here
        metadata:
          type: object
          description: Include any additional info here
    Shipping:
      type: object
      properties:
        value:
          type: number
          description: The shipping cost
          example: 3.25
        discounted_value:
          type: number
          description: The shipping cost after discounts
          example: 2.25
        redeem:
          type: array
          description: The rewards to redeem in the shipping
          items:
            $ref: '#/components/schemas/RedemptionReward'
        tags:
          type: object
          description: Include your conditions event tags here
        metadata:
          type: object
          description: Include any additional info here
    RedemptionReward:
      type: object
      properties:
        id:
          type: string
          description: The reward id to redeem
          format: uuid
        amount:
          type: number
          description: The amount of the reward to redeem. (Per product if applicable)
          example: 1
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````