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

# Sync a batch of customers



## OpenAPI

````yaml /openapi.json post /sync/businesses/{business_id}/customers/batch
openapi: 3.0.3
info:
  title: Pocketflows API
  version: 0.0.4
servers:
  - url: https://api.pocketflows.com
    description: Production server
security:
  - HttpBasicAuth: []
paths:
  /sync/businesses/{business_id}/customers/batch:
    post:
      tags:
        - Sync
      summary: Sync a batch of customers
      parameters:
        - in: path
          name: business_id
          schema:
            type: string
          description: The ID of the business
          required: true
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                customers:
                  type: array
                  items:
                    anyOf:
                      - type: object
                        properties:
                          id:
                            type: string
                            description: The ID of the customer
                          external_id:
                            type: string
                            nullable: true
                            description: The external ID of the customer
                          phone_number:
                            type: string
                            nullable: true
                            description: The phone number of the customer
                          email_address:
                            type: string
                            nullable: true
                            description: The email address of the customer
                          metadata:
                            type: object
                            additionalProperties: true
                            description: The metadata of the customer
                          full_name:
                            type: string
                            nullable: true
                            description: The full name of the customer
                        required:
                          - id
                      - type: object
                        properties:
                          external_id:
                            type: string
                            description: The external ID of the customer
                          phone_number:
                            type: string
                            nullable: true
                            description: The phone number of the customer
                          email_address:
                            type: string
                            nullable: true
                            description: The email address of the customer
                          metadata:
                            type: object
                            additionalProperties: true
                            description: The metadata of the customer
                          full_name:
                            type: string
                            nullable: true
                            description: The full name of the customer
                        required:
                          - external_id
                  description: The customers to sync
              required:
                - customers
      responses:
        '200':
          description: The customers that were synced
          content:
            application/json:
              schema:
                type: object
                properties:
                  customers:
                    type: array
                    items:
                      $ref: '#/components/schemas/Customer'
                      nullable: true
                    description: >-
                      The customers that were synced. Will be `null` for
                      customers that had errors
                  errors:
                    type: array
                    items: {}
                    description: The errors that occurred during the sync
                required:
                  - customers
                  - errors
components:
  schemas:
    Customer:
      type: object
      properties:
        id:
          type: string
          description: The ID of the customer
        external_id:
          type: string
          nullable: true
          description: The external ID of the customer
        email_address:
          type: string
          nullable: true
          description: The email address of the customer
        phone_number:
          type: string
          nullable: true
          description: The phone number of the customer
        full_name:
          type: string
          nullable: true
          description: The full name of the customer
        metadata:
          type: object
          additionalProperties: true
          description: The metadata associated with this customer
        unsubscribed:
          type: string
          enum:
            - future
            - campaign
          nullable: true
          description: The unsubscribe status of the customer
      required:
        - id
        - external_id
        - email_address
        - phone_number
        - full_name
        - metadata
        - unsubscribed
      title: The Customer object
  securitySchemes:
    HttpBasicAuth:
      type: http
      scheme: basic

````