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

# Update a customer



## OpenAPI

````yaml https://dev.flextell.ai/docs/api.json put /v1/customers/{id}
openapi: 3.1.0
info:
  title: Flextell API
  version: 0.0.1
  description: '## Flextell API'
servers:
  - url: https://dev.flextell.ai/api
security:
  - oauth2: []
  - bearer: []
paths:
  /v1/customers/{id}:
    put:
      tags:
        - Customer
      summary: Update a customer
      operationId: customer.update
      parameters:
        - name: id
          in: path
          required: true
          description: The customer identifier
          schema:
            type: integer
        - name: X-Tenant
          in: header
          required: true
          description: >-
            Tenant identifier. Send the Tenant ID in the `X-Tenant` header to
            scope API requests to a specific tenant.
          schema:
            type: number
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CustomerUpdateRequest'
      responses:
        '200':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: string
                  data:
                    $ref: '#/components/schemas/CustomerResource'
                required:
                  - success
                  - data
        '401':
          $ref: '#/components/responses/AuthenticationException'
        '403':
          $ref: '#/components/responses/AuthorizationException'
        '404':
          description: ''
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: string
                  data:
                    type: object
                    properties:
                      message:
                        type: string
                        const: Customer not found
                    required:
                      - message
                required:
                  - success
                  - data
        '422':
          $ref: '#/components/responses/ValidationException'
components:
  schemas:
    CustomerUpdateRequest:
      type: object
      properties:
        first_name:
          type: string
          description: Customer's first name.
          maxLength: 255
        last_name:
          type: string
          description: Customer's last name.
          maxLength: 255
        phone_number:
          type: string
          description: Customer's phone number.
          maxLength: 20
        email:
          type:
            - string
            - 'null'
          format: email
          description: Customer's email address.
          maxLength: 255
        date_of_birth:
          type:
            - string
            - 'null'
          format: date-time
          description: Customer's date of birth.
        gender:
          type:
            - string
            - 'null'
          description: Customer's gender.
          enum:
            - male
            - female
            - other
        country_id:
          type:
            - integer
            - 'null'
          description: Customer's country identifier.
        identity_number:
          type:
            - string
            - 'null'
          description: Customer's identity number.
        job:
          type:
            - string
            - 'null'
          description: Customer's job title.
          maxLength: 255
        address:
          type:
            - string
            - 'null'
          description: Customer's address.
          maxLength: 1000
        default_channel_id:
          type:
            - integer
            - 'null'
          description: The customer's preferred default channel.
        user_id:
          type:
            - integer
            - 'null'
          description: Assigned user identifier.
        tags:
          type:
            - array
            - 'null'
          description: Tag identifiers to attach to the customer (full replace via sync).
          items:
            type: integer
            description: A tag ID.
      title: CustomerUpdateRequest
    CustomerResource:
      type: object
      properties:
        id:
          type: integer
        first_name:
          type:
            - string
            - 'null'
        last_name:
          type:
            - string
            - 'null'
        phone_number:
          type:
            - string
            - 'null'
        email:
          type:
            - string
            - 'null'
        date_of_birth:
          type:
            - string
            - 'null'
          format: date-time
        gender:
          anyOf:
            - $ref: '#/components/schemas/Gender'
            - type: 'null'
        country_name:
          type: string
        identity_number:
          type:
            - string
            - 'null'
        job:
          type:
            - string
            - 'null'
        address:
          type:
            - string
            - 'null'
        default_channel_id:
          type:
            - integer
            - 'null'
        avatar_url:
          type:
            - string
            - 'null'
        related_user:
          $ref: '#/components/schemas/RelatedUserResource'
        tags:
          type: array
          items:
            $ref: '#/components/schemas/TagResource'
        created_at:
          type:
            - string
            - 'null'
          format: date-time
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
        deleted_at:
          type:
            - string
            - 'null'
          format: date-time
      required:
        - id
        - first_name
        - last_name
        - phone_number
        - email
        - date_of_birth
        - gender
        - country_name
        - identity_number
        - job
        - address
        - default_channel_id
        - avatar_url
        - related_user
        - created_at
        - updated_at
        - deleted_at
      title: CustomerResource
    Gender:
      type: string
      enum:
        - male
        - female
        - other
      title: Gender
    RelatedUserResource:
      type: object
      properties:
        id:
          type: integer
        name:
          type: string
      required:
        - id
        - name
      title: RelatedUserResource
    TagResource:
      type: object
      properties:
        id:
          type: integer
        tenant_id:
          type: integer
        name:
          type: string
        color:
          type: string
        created_at:
          type:
            - string
            - 'null'
          format: date-time
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
        deleted_at:
          type:
            - string
            - 'null'
          format: date-time
      required:
        - id
        - tenant_id
        - name
        - color
        - created_at
        - updated_at
        - deleted_at
      title: TagResource
  responses:
    AuthenticationException:
      description: Unauthenticated
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    AuthorizationException:
      description: Authorization error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Error overview.
            required:
              - message
    ValidationException:
      description: Validation error
      content:
        application/json:
          schema:
            type: object
            properties:
              message:
                type: string
                description: Errors overview.
              errors:
                type: object
                description: A detailed description of each field that failed validation.
                additionalProperties:
                  type: array
                  items:
                    type: string
            required:
              - message
              - errors
  securitySchemes:
    oauth2:
      type: oauth2
      flows:
        authorizationCode:
          authorizationUrl: https://dev.flextell.ai/oauth/authorize
          tokenUrl: https://dev.flextell.ai/oauth/token
          scopes:
            '*': all
    bearer:
      type: http
      scheme: bearer

````