# Public API

{% hint style="info" %}
**Who can use this feature?**

* Available to all users on any plan.
  {% endhint %}

### Overview

The Chatty Public API gives you direct access to your store's customer data — things like contact details, chat history timestamps, order counts, and total spend. It's useful when you want to:

* Sync Chatty contacts into a custom CRM
* Send customer segments to an email platform
* Pull data into a spreadsheet or BI tool
* Build a custom dashboard or internal integration

If you're looking for ready-made integrations, check out [Klaviyo](https://help.chatty.net/integrations/klaviyo), [Zendesk](https://help.chatty.net/integrations/zendesk), or [Joy](https://help.chatty.net/integrations/joy) instead.

***

### Generate your API key

Go to **Settings > API** in your Chatty dashboard.

<figure><img src="https://263145331-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FdHQiLAklXYfrIyImUrH0%2Fuploads%2FD8HmB6k9IGKkSaUISH8O%2Fapp%20key%20api.png?alt=media&#x26;token=3186c680-cb31-48eb-ae4b-c96083818438" alt=""><figcaption></figcaption></figure>

Click **Generate key**. You'll immediately see two credentials:

| Credential     | What it's for                                               |
| -------------- | ----------------------------------------------------------- |
| **App ID**     | Your store identifier. Include this in every API request.   |
| **Secret key** | Your private authentication key. Never share this publicly. |

{% hint style="warning" %}
**Copy your Secret key right away.** It's only shown once. If you lose it, you'll need to generate a new one — which immediately deactivates the old key.
{% endhint %}

If your key is ever compromised, click **Generate key** again to rotate it. The previous key stops working instantly.

***

### Common use cases

**Export contacts to a spreadsheet**\
Use the `customers` query with pagination to pull all contacts, then write them to a CSV.

**Sync high-value customers to an email platform**\
Filter by `totalSpent` on your side and push matching customers to your email tool via its own API.

**Build a custom CRM view**\
Use `ordersCount`, `totalSpent`, `lastChatAt`, and `channels` to segment and prioritize follow-ups.

**Track engagement over time**\
Use `lastChatAt` and `createdAt` to measure how recently customers have been active in chat.

***

### Need help?

If you run into issues with your API key or requests, contact the Chatty support team from your dashboard. For ready-made integrations without any code, see [Klaviyo](https://help.chatty.net/integrations/klaviyo), [Zendesk](https://help.chatty.net/integrations/zendesk), or [Joy](https://help.chatty.net/integrations/joy).
