> ## Knowledge Base Index
> Fetch the complete knowledge base index at: https://help.co-din.com/sitemap.xml
> Use this file to discover available pages before exploring further.
> Pure-Markdown content can be obtained by appending a '.md' suffix to the content URLs listed in the sitemap (without the trailing slash).

# How can I automatically set custom data?

Articles on: [My Contacts](/en/category/my-contacts-4e84h7/)

If you are using Crisp on a website where users are authenticated, you may want to set their data.  
  
Keys should always be lowercase. Special chars are not allowed except underscores and dashes.  
  

### Update one key/value

  
  
Using JS SDK  
  
This method uses the Crisp JavaScript SDK, that you can call from your own front-end code.  
  

``` // Feed this call with your own custom data. $crisp.push(["set", "session:data", ["order_id", "3535353214"]]);```

  
  
Of course, you need to replace order_id and 3535353214 with your own key/values!  
  
Using API  
  
This method uses the Crisp REST API, that you can call from your own backend code. To make it easier, we have [API wrappers](https://github.com/crisp-im) available in several languages.  
  
*   session data: Update Conversation Metas
  
*   contact data: Save People Data
  
  
You'll need to add your custom data in the "data" object in the request body:  
  

``` { "data": { "plan_price": "95" } }```

  
  
If you want to understand the difference between session data and contact data, please click [here](/en/article/what-is-custom-data-and-why-is-it-powerful-43jgi3/).  
  

### Update multiple key/values

  
  
Using JS SDK  
  

``` // Feed this call with your own custom data. $crisp.push(["set", "session:data", [ [ ["order_id", "3535353214"], ["last_order_at", "04 January"], ["user_id", "XXXX-XXXX"] ] ]]);```

  
  
Using API  
  
*   session data: Update Conversation Metas
  
*   contact data: Save People Data
  
  
You'll need to add your custom data in the "data" object in the request body:  
  

``` { "data": { "plan_price": "95", "profile_link": "https://mylink.com" } }```

  
  

### Delete one key

  
  
Using JS SDK  
  

``` // Set an empty value for this data $crisp.push(["set", "session:data", ["order_id", ""]]);```

  
  
Want to know more about the JS SDK and $crisp interface? Read: [How to use $crisp Javascript SDK?](https://docs.crisp.chat/guides/chatbox-sdks/web-sdk/dollar-crisp/)  
  
Using API  
  
*   session data: Update Conversation Metas
  
*   contact data: Save People Data
  
  
You'll need to submit an empty "data" object in the request body:  
  

``` { "data": {} }```

  
  

### A practical use case: how do we use custom data at Crisp?

  
  
Here is an example of custom data we use at Crisp regarding our customers.  
  
![](https://storage.crisp.chat/users/helpdesk/website/f04402e2ba46000/c5e9ff99-ca2c-4bbb-8cfa-e6c66c_135hte3.png)  
  
So you can better understand the information there, for each customer who gets in touch with us through chat, email, WhatsApp, etc. We have the following data available:  
  
*   user_id: Unique identifier that helps us to access a detailed view of the user profile.
  
*   website_id: Unique identifier that helps us to access a detailed view of the website the user is part of.
  
*   plan: The plan the user is using at the moment.
  
*   plan_price: The price the customer is currently paying for our service.
  
*   is_trialing: Whether the user is still under trial or not.
  
*   Websites: How many inboxes the customer has created.
  
  
Thanks to these key data, we're able to personalize the customer experience, a lot. Note that these data are displayed in the conversation too as you can see in the example below.  
  
![](https://storage.crisp.chat/users/helpdesk/website/9a9d30a4d92ca800/1a47dfa6-b02c-494d-adb6-0c2333_8ldm8g.png)  
  
If you want to know more about custom data and why it is important, [click here to access a dedicated article](/en/article/what-is-custom-data-and-why-is-it-powerful-43jgi3/).

Updated on: 06/01/2023