See related
No related articles

Migrate conversational assistants across instances

Last Update: Oct 2024 • Est. Read Time: 3 MIN
To check plan availability, see the pricing page.

If you have a conversational assistant set up in your sandbox or another Kustomer instance, you may find the need to copy the assistant across different organizations without having to recreate the entire conversational flow.

You can use Postman to simplify this process.

Who can access this feature?
User typesAdmins and users with access can create conversational assistants and API keys. Users with access can interact with the Kustomer API using Postman.


In this article:

Prerequisites

Before following this guide, you must sign up for a Postman account and set up your workspace: Setting up Postman.

You will also need a user account with access to create and update conversational assistants in the organizations where you are replicating the assistant.

Create a conversational assistant in the new organization

  1. Go to Settings> Kustomer IQ > Customer Assist.
  2. Select Add Assistant and then choose Lite or Premium depending on the type of assistant you need to copy over.
  3. Select Continue.
  4. Enter a name for the assistant and select the Channel from the drop-down menu.
  5. Next, select Add Assistant. The new assistant will appear with the standard preconfigured flow.
  6. Go back to the Customer Assist page and copy the public ID of the assistant you just created.

7. Open a new tab in the same browser where Kustomer is open and go to https://<your-new-org-name>.api.kustomerapp.com/v1/assistants?publicId=yourAssistantPublicID 

where:

  • your-new-org-name is the company name of the Kustomer instance you created the new assistant in 
  • yourAssistantPublicID is the public ID you copied in the previous step 

    The URI should return the assistant's data inside an array as seen in the example below. Copy the Assistant ID (which is different from the assistant publicId) and save it in a separate file for later use.

Copy the old assistant's JSON from the existing organization

  1. In the organization that contains the existing conversational assistant you want to copy, go to Settings> Kustomer IQ > Customer Assist.
  2. Copythe public ID of the assistant that will be copied.

3. On the same browser, open a new tab and go to https://<your-existing-org-name>.api.kustomerapp.com/v1/assistants?publicId=yourAssistantPublicID and replace yourAssistantPublicID with the Assistant Public ID you just copied. The org name is the company name of the Kustomer instance you have the assistant you'd like to duplicate, and the URL will return that assistant's data inside an array.

4. Copy the assistant's data, starting from start, dialogs, and all the way to the end of settings.

Update the assistant ID on the JSON

  1. In the document where you pasted the assistant's data, find the assistantId attribute inside each node of the dialogs and replace that ID with the new Assistant ID (note: not the new Assistant public ID) which you saved previously when creating the new assistant.

  2. If the conversational assistant you are migrating has a deflection interaction, find the Knowledgebase ID in the new instance that you would like to use for the deflection. You can find that ID at this endpoint https://<your-new-org-name>.api.kustomerapp.com/v1/kb/knowledge-bases of your new instance.

Send a PUT request to the assistant in the new organization

  1. In the org you are migrating the Assistant to, go to Settings > Security > API Keys and create an API key with org.admin.apps.write, org.permission.assistant.update, and org.permission.apps.update roles.

  2. Copy and paste the token that appears in a separate file for you to use in Postman.

  3. Open Postman and go to your Kustomer API workspace. Select the plus + icon in the toolbar to create a new request.
  4. In the Headers tab underneath the request URL bar, fill in the following key values:
    • Content-Type: application/json
    • Authorization: Bearer API_KEY (the space is required after the word 'Bearer'). The API_KEY is the API key you just created.
  5. In the Body tab, create a PUT request to the endpoint https://<your-new-org-name>.api.kustomerapp.com/v1/assistants/yourNewAssistantID
    where:
    • your-new-org-name is the company name of the Kustomer instance you created the new assistant in 
    • yourNewAssistantID is the Assistant ID of the new assistant and the same ID you have been adding to the old assistant's dialogs.
  6. Copy and paste the assistant data you modified in your document, starting from start and all the way to the end of settings, to the Body section in Postman.
  7. Send the request and see that it is successfully sent.

When you refresh your assistant in the new org, you will now see all the dialogs and interactions migrated over from your existing assistant.