kustomer-client
    Preparing search index...

    Function customerArchiveSearch

    • Create customer archive search Searches across all customer data with criteria based on a limited number of attributes on standard objects, including Message, Conversation, and Company objects, and on custom objects. Returns standard objects and custom objects older than 2 years ago that are unavailable in standard searches.

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

      Legacy Role Equivalent Permission Set Role
      org.user.search.read org.permission.search.create
      org.admin.search.read org.permission.search.update
      org.permission.search_global.create
      org.permission.search_preview.create

      You can filter by dates in either a local date YYYY-MM-DD format or a UTC date format. If you include a timezone in the query, a local date will be adjusted to account for the included timezone. UTC dates will not be timezone adjusted.

      {
      "and": [
      {
      "conversation_created_at": {
      "lte": "2020-11-19"
      }
      }
      ],
      "queryContext": "conversation",
      "timeZone": "America/New_York"
      }

      The default GMT timezone is applied when you exclude a timezone.

      {
      "and": [
      {
      "conversation_created_at": {
      "lte": "2020-11-20T16:34:00.000Z"
      }
      }
      ],
      "queryContext": "conversation"
      }

      For a list of available standard attributes, see Standard attributes JSON schema.

      [
      {"conversation_updated_at": {"gte": "2016-06-24" }},
      {"conversation_customer_id": {"equals": "65f49506237963001f01a391" }}
      ]

      You can sort based on the following attributes:

      conversation_created_at
      conversation_updated_at
      conversation_customer_id
      conversation_deleted
      customer_companyId
      customer_created_at
      customer_updated_at
      customer_deleted
      message_id
      message_created_at
      message_updated_at
      kobject_created_at
      kobject_updated_at
      ^kobject.*_created_at$
      ^kobject.*_updated_at$
      company_created_at
      company_updated_at
      {"sort": [{"conversation_created_at": "asc"}]}
      {"sort": [{"message_id": "asc"}, {"message_created_at": "asc"}]}

      Sorting based on other standard Object attributes is unavailable.

      There is a hard limit of 100 for the maximum number of pages.

      There may be cases where you want to page through more records. For example, let's say you'd like to get an initial snapshot of data and then update the data.

      To work around the pagination limit, you can write a query based on the updated_at attribute for a standard Object. You can then use the returned information in following API requests based on the last updated_at value from the response.

      {
      "type": "object",
      "properties": {
      "customer_any_text_new": {
      "type": "string",
      "operator": "any"
      },
      "customer_id": {
      "type": "string",
      "operator": "string_notanalyzed"
      },
      "customer_created_at": {
      "type": "string",
      "format": "date-time",
      "operator": "datetime"
      },
      "customer_updated_at": {
      "type": "string",
      "format": "date-time",
      "operator": "datetime"
      },
      "customer_companyId": {
      "type": "string",
      "operator": "string_notanalyzed"
      },
      "company_created_at": {
      "type": "string",
      "format": "date-time",
      "operator": "datetime"
      },
      "company_updated_at": {
      "type": "string",
      "format": "date-time",
      "operator": "datetime"
      },
      "message_any_text": {
      "type": "string",
      "operator": "any"
      },
      "message_created_at": {
      "type": "string",
      "format": "date-time",
      "operator": "datetime"
      },
      "message_updated_at": {
      "type": "string",
      "format": "date-time",
      "operator": "datetime"
      },
      "message_conversation_id": {
      "type": "string",
      "operator": "string_notanalyzed"
      },
      "conversation_any_text": {
      "type": "string",
      "operator": "any"
      },
      "conversation_created_at": {
      "type": "string",
      "format": "date-time",
      "operator": "datetime"
      },
      "conversation_updated_at": {
      "type": "string",
      "format": "date-time",
      "operator": "datetime"
      },
      "conversation_customer_id": {
      "type": "string",
      "operator": "string_notanalyzed"
      },
      "kobject_any_text": {
      "type": "string",
      "operator": "any"
      },
      "kobject_created_at": {
      "type": "string",
      "format": "date-time",
      "operator": "datetime"
      },
      "kobject_updated_at": {
      "type": "string",
      "format": "date-time",
      "operator": "datetime"
      },
      },
      "additionalProperties": false
      }

      Type Parameters

      • ThrowOnError extends boolean = true

      Returns RequestResult<
          {
              data: {
                  attributes: {
                      createdAt: string;
                      displayName: string;
                      lastActivityAt: string;
                      name: string;
                      rev: number;
                      updatedAt: string;
                      verified: boolean;
                  };
                  id: string;
                  links: { self: string };
                  relationships: {
                      org: { data: { id: string; type: string }; links: { self: string } };
                  };
                  type: string;
              }[];
              links: {
                  first: string;
                  last: string;
                  next: string;
                  prev: null
                  | string;
                  self: string;
              };
              meta: {
                  aggregations: { [key: string]: unknown };
                  page: number;
                  pageSize: number;
                  total: number;
                  totalPages: number;
              };
          },
          unknown,
          ThrowOnError,
      >