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

# API Integration Setup

> Learn how to set up API integration with ClickPesa, including creating applications, managing API keys, and retrieving credentials

## Authentication Overview

[Client ID](#authentication-overview) - Remains accessible in your application settings and is also required for API authentication.

[API Key](#authentication-overview) - It is required for API authentication, displayed **only once** during creation. **Copy and store it securely**

[JWT Token](#authentication-overview) - `API Key` and `Client ID` are [exchanged](/api-reference/authorization/generate-token) for a short-lived `JWT Token`, which is then used in all subsequent API calls.
The JWT token is valid for **1hr (60 Minutes)** from the time of issuance. After it expires, you must generate a new token using your `API Key` and `Client ID`.

<Warning>
  Never share your API credentials or JWT token publicly. Always use HTTPS to protect your credentials during transmission.
</Warning>

[API Rate Limits](#authentication-overview) - The ClickPesa API enforces a rate limit of **120 requests per minute** per IP address. This limit applies to **all API endpoints**. If you exceed this limit, your requests will be throttled.

[Pre-KYC API daily limit](#authentication-overview) - If your merchant account has **not completed KYC**, you are also limited to **100 API calls per day** across all third-party API requests, including **[generate-token](/api-reference/authorization/generate-token)**. The count resets every day at **midnight East Africa Time (EAT)**. After KYC approval, only the per-minute IP limit applies.

<Tip>
  Implement appropriate retry logic with exponential backoff in your application to handle rate limit responses gracefully. If you receive a daily limit response before KYC is complete, wait until the next day or complete KYC to remove the cap.
</Tip>

## Application Setup

### Step 1: Log in to the ClickPesa Dashboard

Go to the [ClickPesa Dashboard](https://merchant.clickpesa.com) and log in with your credentials.

### Step 2: Access Developer Settings

1. In the dashboard, click **Settings**.
2. Navigate to the **Developers** section.

See [Developers settings](/dashboard/settings/developers) for the full dashboard walkthrough.

### Step 3: Create a New Application

Click **Create Application** to begin the setup process.

### Step 4: Configure Application Details

When creating your application, provide the following details:

* **Application Name**: A name to identify your app.
* **Integration Type**: Select **API**.
* **Features**: Choose the required features (e.g. **Payment API**, **Payout API**).

### Step 5: Submit Your Application

Click **Create** to finalize the application setup.

## Managing API Keys

<Warning> **Important**: Keep your API credentials secure and do not share them publicly.</Warning>

### Access API Keys

1. Navigate to **Settings** in the ClickPesa dashboard.
2. Go to the **Developers** section.
3. Select the application for which you want to manage API keys.
4. Click **Manage API Keys** in the application settings.
5. A panel will appear, showing the list of existing API keys, including:
   * **Name**: Assigned name of the API key.
   * **Last Activity**: Date of last use.
   * **Revoke Button**: Option to deactivate the key.

### Adding a New API Key

1. Navigate to **Settings** in the ClickPesa dashboard.
2. Go to the **Developers** section.
3. Select the application for which you want to create an API key.
4. Click **Manage API Keys** in the application settings.
5. Click **Add API Key**.
6. A modal will appear where you can enter the required details:
   * **Name**: A label for the API key.
   * **Expiry Date**: Define when the key will expire.
7. Click **Submit** to proceed.
8. The modal will prompt you to enter your password for confirmation.
9. After successfully confirming your password, the API key will be created.
10. The modal will then display:
    * The **Client ID** and newly generated **API Key**.
    * The **Expiry Date**.
