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

# Identify Customer



## OpenAPI

````yaml post /customers/identify
openapi: 3.0.0
info:
  title: Flock API
  description: API Documentation for Flock
  version: '1.0'
  contact: {}
servers:
  - url: https://api-dev.withflock.com
security: []
tags: []
paths:
  /customers/identify:
    post:
      tags:
        - Customer
      operationId: CustomerController_identifyCustomer
      parameters: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/IdentifyCustomerDTO'
      responses:
        '201':
          description: Customer identified successfully.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CustomerResponseDTO'
      security:
        - accessKey: []
components:
  schemas:
    IdentifyCustomerDTO:
      type: object
      properties:
        externalUserId:
          type: string
          description: The customer external ID, usually the user ID in your system
          example: customer_123
        email:
          type: string
        name:
          type: string
          description: Name is required for communication purposes
        environment:
          type: object
          description: 'Possible values: `production` or `test`'
        customProperties:
          type: object
          description: Additional data to be stored with the customer
      required:
        - externalUserId
        - email
        - name
        - environment
        - customProperties
    CustomerResponseDTO:
      type: object
      properties:
        id:
          type: string
        externalUserId:
          type: string
        email:
          type: string
        name:
          type: string
        referredBy:
          description: The customer who referred this customer
          nullable: true
          allOf:
            - $ref: '#/components/schemas/ReferredByDTO'
        referredById:
          type: object
          nullable: true
        referredByReferralId:
          type: string
          nullable: true
        referredInCampaignId:
          type: string
          nullable: true
        visitedReferralsCount:
          type: number
        convertedReferralsCount:
          type: number
        referralCode:
          type: string
        createdAt:
          format: date-time
          type: string
        updatedAt:
          format: date-time
          type: string
        deletedAt:
          format: date-time
          type: string
          nullable: true
        organizationId:
          type: string
        applicationId:
          type: string
        customProperties:
          type: object
          nullable: true
          additionalProperties: false
        environment:
          type: string
          enum:
            - production
            - test
      required:
        - id
        - externalUserId
        - email
        - name
        - referredBy
        - referredById
        - referredByReferralId
        - referredInCampaignId
        - visitedReferralsCount
        - convertedReferralsCount
        - referralCode
        - createdAt
        - updatedAt
        - deletedAt
        - organizationId
        - applicationId
        - customProperties
        - environment
    ReferredByDTO:
      type: object
      properties:
        id:
          type: string
        externalUserId:
          type: string
        email:
          type: string
        name:
          type: string
      required:
        - id
        - externalUserId
        - email
        - name
  securitySchemes:
    accessKey:
      type: apiKey
      in: header
      name: Authorization

````