> ## Documentation Index
> Fetch the complete documentation index at: https://moengage.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# API Key Dashboard

> Manage API keys in MoEngage for authentication and data access. View workspace ID, generate keys, and control permissions from the dashboard.

<Note>
  This is an Early Access feature. To enable it for your account, please contact your MoEngage Customer Success Manager (CSM) or the Support team.
</Note>

# Overview

API keys are typically used as an authentication or authorization mechanism. They are unique identifiers associated with a user or an application with access to API resources.

The API keys serve as a way for the API provider to track and control access to their resources. They help ensure the security and accountability of API access and allow providers to manage and monitor usage effectively.

<Info>
  The multikey feature is currently supported by data, segmentation, and push APIs.
</Info>

To send data to MoEngage, you can use the Workspace ID and API key for that particular data. The API key used for sending user data differs from the API key used for sending events. Whenever a key is regenerated, the old key expires immediately, and it takes some time for the new key to become functional, leading to possible downtimes. As a solution, MoEngage provides multiple API keys, which help you to:

* **Generate a new key while the existing key is still available**: With the multi-key support, the existing key can be used until the new key becomes functional. This helps you rotate your keys for security purposes and avoid downtime. Consider a scenario in which your internal team creates a new key, and it takes some time for the team to integrate it into the system. Because the old key is still functional, your team has the time to integrate the new key into the system. After integrating the new key, you can deprecate the old key. This avoids downtime when sending data to MoEngage.
* **Use different keys for different teams**: Consider a scenario where an enterprise customer works with various vendors. This enterprise customer can share a key with one of its vendors to fulfill a business use case, which restricts the other vendors from fulfilling the same use case for security reasons. Using this feature, all vendors can fulfill the same use case by accessing it using different keys. Furthermore, as an enterprise customer, you can use different keys for different internal teams based on their functionalities.

# Create a Key

<Info>
  * After the multi-API key feature is enabled, the existing API keys in the API dashboard are migrated to your new API key dashboard as legacy keys.
  * You can view the legacy key details and continue to use them. But you cannot archive, edit, or regenerate them.
  * MoEngage recommends creating and utilizing new keys because legacy keys will be deprecated in the future.
</Info>

Perform the following steps to create a key:

1. On the left navigation menu in the MoEngage dashboard, go to **Settings** > **Account** > **API keys**.
2. Click **+ Create new key**. <img src="https://mintcdn.com/moengage/_eUNBDpGCEXI_sgZ/images/moengage_a5e237.png?fit=max&auto=format&n=_eUNBDpGCEXI_sgZ&q=85&s=6ee4d31fbd24a823229990bfa72a6437" alt="create new key.png" width="2860" height="1398" data-path="images/moengage_a5e237.png" />
3. In the **Create new key** page, enter the following details:
   1. In the **Key name** box,  type a name for your key to facilitate easy identification.
   2. In the **Select APIs for access** check box list, select the APIs you want to access using this key. <img src="https://mintcdn.com/moengage/prFQLkdcYp4xSt9t/images/moengage_685ea1.png?fit=max&auto=format&n=prFQLkdcYp4xSt9t&q=85&s=5a8d4c5bf8ebff22204fb3e3d9e2e041" alt="Screenshot 2024-09-25 at 12.41.17 PM.png" width="1192" height="1396" data-path="images/moengage_685ea1.png" />
4. Click **Save**. After saving, this key is listed under **Active** **API keys**.
   <Info>
     The **API Access** is **Full** if all listed APIs can be accessed using this key; otherwise, it is **Partial**.
   </Info>
5. Click **View archived keys** to view the list of archived keys.
6. On the **API Keys** page, clicking <Icon icon="ellipsis-stroke-vertical" />for each API key displays the following options: <img src="https://mintcdn.com/moengage/SBG7um9Fqotw1CFo/images/moengage_b6852d.png?fit=max&auto=format&n=SBG7um9Fqotw1CFo&q=85&s=0c2b06c1f013a3555ba92d37e4c84528" alt="multi key.png" width="2370" height="692" data-path="images/moengage_b6852d.png" />
   | Option           | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
   | ---------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
   | View key details | Click this option to view the key details. You can access the edit key and regenerate key options from the **View key details** page.  <img alt="Screenshot 2024-09-25 at 1.09.12 PM.png" src="https://mintcdn.com/moengage/fUSb9kG75-iJ0JuL/images/moengage_e3fbf9.png?fit=max&auto=format&n=fUSb9kG75-iJ0JuL&q=85&s=5c1b7ca02ffd5a1164325507715b0a7a" width="1198" height="1402" data-path="images/moengage_e3fbf9.png" /> |
   | Regenerate key   | Click this optionto regenerate a new key.  **Note**: The old key expires immediately after regenerating. To avoid errors, replace the old key with the regenerated key.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         |
   | Edit key details | Click this option to edit the key name or access to your APIs.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |
   | Archive key      | Click this option to archive your keys. After archiving them once, you cannot unarchive keys.  **Note**: A maximum of 10 archived keys is maintained under the archived key list.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               |

# Audit Logs

<img src="https://mintcdn.com/moengage/UX7SFw6G5JwoHWFq/images/moengage_620fc6.png?fit=max&auto=format&n=UX7SFw6G5JwoHWFq&q=85&s=6715a4d3e91577fe2245dd9372fd06c2" alt="Screenshot 2024-11-13 at 5.44.37 PM (1).png" width="2380" height="696" data-path="images/moengage_620fc6.png" />

Admins use audit logs to understand the various actions performed in the MoEngage dashboard. Similarly, the audit logs also list any actions related to API keys. This helps admins know who performed what actions related to API keys. The following actions are supported in **Audit logs**:

* Click <Icon icon="bars-filter" />  to filter audit logs based on **Team(s)**, **Action**, **Actor**, and **Date time Range**.
* Type the value in the **Search logs by** search bar for which you want to fetch the audit logs.
* Click **Export audit logs** to receive the audit log report in your email. You can download the report from the email.

Note that, for all the actions related to API keys, the **Entity** column in **Audit logs** displays **API Keys**. You can view the following actions related to API keys in audit logs, in the **Action** column:

* **Create** is displayed when an API key is created successfully.
* **Update** is displayed when:
  * A key name is updated.
  * The API access for a key is updated.
  * A key is regenerated.
* **Delete** is displayed when a key is archived.
