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

# Create customer

> Creates a new customer user type.

**Required scopes:** `customers:rw`


## OpenAPI

````yaml /api/agent-chat/v3.5/openapi.json post /action/create_customer
openapi: 3.0.0
info:
  title: Agent Chat API
  description: >-
    The Agent Chat API allows you to manage chats, threads, events, and agent
    state.
  version: '3.5'
servers:
  - url: https://api.livechatinc.com/v3.5/agent
    description: Production server
security: []
paths:
  /action/create_customer:
    post:
      tags:
        - Customers
      summary: Create customer
      description: Creates a new customer user type.
      operationId: create-customer
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateCustomerRequest'
            example:
              name: Thomas Anderson
              email: t.anderson@example.com
              avatar: https://example.com/avatars/1.png
              session_fields:
                - custom_key: custom_value
                - another_custom_key: another_custom_value
      responses:
        '200':
          description: Customer created.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CreateCustomerResponse'
              example:
                customer_id: b7eff798-f8df-4364-8059-649c35c9ed0c
      security:
        - PersonalAccessToken: []
        - OAuth2BearerToken:
            - customers:rw
components:
  schemas:
    CreateCustomerRequest:
      type: object
      properties:
        name:
          type: string
          description: Customer name.
        email:
          type: string
          description: Customer email.
        avatar:
          type: string
          description: URL of the customer's avatar.
        session_fields:
          type: array
          items:
            type: object
            additionalProperties: true
          description: >-
            Array of custom object-enclosed key-value pairs. Respects the order
            of items.
    CreateCustomerResponse:
      type: object
      properties:
        customer_id:
          type: string
          description: Unique identifier of the created customer.
  securitySchemes:
    PersonalAccessToken:
      description: >-
        Use your `account ID` as the username and your personal access token
        (PAT) as the password, or pass a Base64-encoded value directly in the
        Authorization header. For more information, see the <a
        href="/authentication/personal-access-tokens">personal access tokens
        guide</a>.
      type: http
      scheme: basic
    OAuth2BearerToken:
      description: >-
        This API uses OAuth2 with the implicit grant flow. <a
        href="/authentication/oauth-authorization#implicit-grant">Learn about
        the implicit grant flow.</a>
      type: oauth2
      flows:
        implicit:
          authorizationUrl: https://accounts.livechat.com
          scopes:
            chats--all:ro: Read all chats
            chats--all:rw: Read and write all chats
            chats--access:ro: Read chats from groups the agent is a member of
            chats--access:rw: Read and write chats from groups the agent is a member of
        authorizationCode:
          authorizationUrl: https://accounts.livechat.com
          tokenUrl: https://accounts.livechat.com/token
          scopes:
            chats--all:ro: Read all chats
            chats--all:rw: Read and write all chats
            chats--access:ro: Read chats from groups the agent is a member of
            chats--access:rw: Read and write chats from groups the agent is a member of

````