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

# Create customers in bulk

> Creates up to 1,000 customers in one request. Each customer is attributed the same way as
when you create one customer, but brands are identified by `externalBrandId`.
Customers without an `externalId` are skipped.
            
One failing customer doesn't stop the others. Check the counts in the response, and
`firstFailureMessage` for the reason the first failure was rejected.



## OpenAPI

````yaml https://platform.affelios.com/swagger/v1/swagger.json post /api/v1/customer/bulk
openapi: 3.0.4
info:
  title: Affelios Platform API
  description: >-
    Send customers and transactions to Affelios, and read your affiliate
    program's data. Authenticate every request with an API key in the X-Api-Key
    header. Create keys in the dashboard under Settings > API keys.
  version: v1
servers:
  - url: https://platform.affelios.com
security:
  - ApiKey: []
tags:
  - name: Affiliates
    description: >-
      Affiliate accounts in your program, their collaborators and their
      commission plan assignments.
  - name: Customers
    description: >-
      Customers referred by affiliates. Create a customer with the click key
      from the landing page to credit the affiliate who referred them.
  - name: Mcp Connection
  - name: Testimonials
    description: Affiliate testimonials and the published list shown on public pages.
  - name: Transactions
    description: >-
      Customer activity such as deposits, revenue and wagering. Commission is
      calculated from transactions.
paths:
  /api/v1/customer/bulk:
    post:
      tags:
        - Customers
      summary: Create customers in bulk
      description: >-
        Creates up to 1,000 customers in one request. Each customer is
        attributed the same way as

        when you create one customer, but brands are identified by
        `externalBrandId`.

        Customers without an `externalId` are skipped.
                    
        One failing customer doesn't stop the others. Check the counts in the
        response, and

        `firstFailureMessage` for the reason the first failure was rejected.
      operationId: CustomerBulkPost
      requestBody:
        description: The customers to create, at most 1,000.
        content:
          application/json:
            schema:
              type: array
              items:
                $ref: '#/components/schemas/ExternalAffiliateCustomerItem'
      responses:
        '200':
          description: How many customers were created, skipped as duplicates, or failed.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AffiliateCustomerImportResponse'
        '400':
          description: >-
            The list is empty, has more than 1,000 customers, or a customer has
            no `externalBrandId`.
        '401':
          description: The X-Api-Key header is missing or the key is not valid.
        '403':
          description: The API key is valid but does not have permission for this endpoint.
components:
  schemas:
    ExternalAffiliateCustomerItem:
      required:
        - externalBrandId
        - externalId
        - regDate
      type: object
      properties:
        externalId:
          minLength: 1
          type: string
          description: Your unique ID for the customer. Customers without one are skipped.
        externalBrandId:
          minLength: 1
          type: string
          description: >-
            The External ID of the brand the customer registered with, as set on
            the brand in Affelios.
        regDate:
          minLength: 1
          type: string
          description: >-
            When the customer registered, as a date and time string in UTC, for
            example `2026-11-17T09:12:00Z`.
        clickKey:
          type: string
          description: >-
            The click key your site stored when the customer arrived from an
            affiliate link.
          nullable: true
        externalProductId:
          type: string
          description: The External ID of the product the customer signed up for, if any.
          nullable: true
        username:
          type: string
          description: A display name for the customer, shown in reports.
          nullable: true
        country:
          type: string
          description: The customer's country name.
          nullable: true
        country_code:
          type: string
          description: The customer's country as an ISO country code, for example `GB`.
          nullable: true
      additionalProperties: false
      description: A customer in a bulk request.
    AffiliateCustomerImportResponse:
      type: object
      properties:
        numImported:
          type: integer
          description: Customers created.
          format: int32
        numDuplicates:
          type: integer
          description: >-
            Customers skipped because one with the same external ID already
            exists.
          format: int32
        numFailed:
          type: integer
          description: Customers that could not be created.
          format: int32
        firstFailureId:
          type: string
          description: >-
            The external ID of the last customer that failed. When several fail,
            this may not be the customer `firstFailureMessage` describes.
          nullable: true
        firstFailureMessage:
          type: string
          description: Why the first failed customer was rejected.
          nullable: true
      additionalProperties: false
      description: The result of creating or importing customers in bulk.
  securitySchemes:
    ApiKey:
      type: apiKey
      description: >-
        Your Affelios API key. Create one in the dashboard under Settings > API
        keys.
      name: X-Api-Key
      in: header

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.