kustomer-client
    Preparing search index...

    Function createCustomer

    • Create customer Creates a new customer record.

      Any one of the following roles is required for this endpoint:

      Legacy Role Equivalent Permission Set Role
      org.user.customer.write org.permission.customer.create

      Custom attributes are optional and allow you to specify custom key-value pairs.

      Kustomer uses a naming convention for custom attributes to specify the field data type with a name suffix:

      • Num number or null
      • At date-time or null
      • Str string or null, length: [ 0 .. 1024 ] characters
      • Txt string or null, length: [ 0 .. 1024 ] characters
      • Bool boolean or null
      • Url string or null, format: uri

      Type Parameters

      • ThrowOnError extends boolean = true

      Returns RequestResult<
          {
              data: {
                  attributes: {
                      activeUsers: unknown[];
                      conversationCounts: {
                          all: number;
                          done: number;
                          open: number;
                          snoozed: number;
                      };
                      createdAt: string;
                      defaultLang: string;
                      displayColor: string;
                      displayIcon: string;
                      displayName: string;
                      emails: {
                          email: string;
                          id: null
                          | string;
                          type: string;
                          verified: boolean;
                      }[];
                      externalIds: unknown[];
                      gender: string;
                      lastActivityAt: string;
                      lastConversation: { tags: unknown[] };
                      locale: string;
                      locations: { address: string; id: null | string; type: string }[];
                      modifiedAt: string;
                      name: string;
                      phones: {
                          id: null | string;
                          phone: string;
                          type: string;
                          verified: boolean;
                      }[];
                      progressiveStatus: null
                      | string;
                      recentLocation: { updatedAt: string };
                      rev: number;
                      sharedEmails: unknown[];
                      sharedExternalIds: unknown[];
                      sharedPhones: unknown[];
                      sharedSocials: unknown[];
                      socials: {
                          id: null | string;
                          type: string;
                          url: string;
                          userid: string;
                          username: string;
                          verified: boolean;
                      }[];
                      tags: string[];
                      updatedAt: string;
                      urls: { id: null
                      | string; type: string; url: string }[];
                      verified: boolean;
                      watchers: unknown[];
                  };
                  id: string;
                  links: { self: string };
                  relationships: {
                      createdBy: {
                          data: { id: string; type: string };
                          links: { self: string };
                      };
                      messages: { links: { self: string } };
                      modifiedBy: {
                          data: { id: string; type: string };
                          links: { self: string };
                      };
                      org: { data: { id: string; type: string }; links: { self: string } };
                  };
                  type: string;
              };
          },
          unknown,
          ThrowOnError,
      >