---
updatedAt: 2026-06-16T07:09:53.000Z
agentTools:
  projectIndex: https://docs.webengage.com/llms.txt
---

# Getting Started

REST API allows you to programmatically transfer information over the internet using a predefined schema. WebEngage offers endpoints with specific requirements that perform actions and return data.

> 🚧 Support for Personal API Keys will be discontinued soon. We recommend migrating to Service Accounts for continued API access.
>
> Know more about [Service Accounts](https://knowledgebase.webengage.com/docs/service-accounts).

With the WebEngage APIs you can:

* Track each user's preferences and their actions as *[User Attributes](rest-api-tracking-users)* and *[Events](rest-api-tracking-events),* respectively.

* Get [survey data](rest-api-on-site-survey) from WebEngage.

* Pass data to WebEngage from third-party platforms like *LeadSquare, Salesforce,* or any other *CRM/Lead Management system* you're using.

* Trigger highly personalized *[Transactional campaigns](https://knowledgebase.webengage.com/docs/campaigns#transactional-campaigns)* through *Push, SMS, Web Push, and Email* in your dashboard. *[(How it works)](sending-transactional-campaigns)*

* Personalize a [Journey campaign](https://knowledgebase.webengage.com/docs/journeys#what-is-a-journey) with real-time data from your servers OR update user details as per their journey experience. *[(How it works)](https://knowledgebase.webengage.com/docs/journey-creation-concepts#call-api)*

* Send *Business Events* data to build *[Relays](https://knowledgebase.webengage.com/docs/relays)* that enables you to automate product/platform communication. *[(How it works)](https://knowledgebase.webengage.com/docs/relays-getting-started#using-rest-api-to-create-business-events)*

*And much more!*

Let's walk you through the basics:

## User Authentication

> 🚧 Important!
>
> REST API calls can be authenticated by using the `key` of only those \_Admins\_who have *Account Management* and *Update Data* permissions. Please check with the account owner if your API requests return the error, `Unauthorized`.

* WebEngage follows *Bearer Authentication Scheme* for API access.

* A unique REST API key is automatically created for each *WebEngage Account Admin.* Your `key` acts as the authorization bearer token and must be passed in the header of each API call. The token is valid for the entire lifetime of an Account Admin.

* In case your *API key* is accidentally compromised or shared with a third-party, a new key can be requested from your *Customer Success Manager* or by dropping us an email at <support@webengage.com>.

### Getting Your Credentials

As shown below, navigate to **Data Paltform> Integrations > REST API** in your dashboard to access your unique *REST API Key* and *WebEngage Account License Code.*

<Image align="center" alt={1425} caption="Click to enlarge" title="access-api-key-license.gif" src="https://files.readme.io/1e51193-access-api-key-license.gif" />

* **License Code:** Replace the placeholder, `YOUR_WEBENGAGE_LICENSE_CODE` in all API calls to build the API endpoint URL for your account. Adding the incorrect code will cause the API call to fail *(indicated by[error code 404](rest-api-getting-started#error-status-codes) in response).*

* **API Key:** Add it to the `Authorization: Bearer <YOUR_API_KEY>` header (by replacing the placeholder) in all API calls to authenticate the request. Adding the incorrect key or not adding one will cause the call to fail *(indicated by[error code 401](rest-api-getting-started#error-status-codes) in response).*

### Example

In the below code snippet, we're calling the [`/user` API](rest-api-tracking-users) to update the *unique User ID, First Name, and Last Name* for a user in WebEngage from an external source.

```curl /user API Sample Request
curl -X POST <HOST>/v1/accounts/<YOUR_WEBENGAGE_LICENSE_CODE>/users 
    --header 'Authorization: Bearer <YOUR_API_KEY>' 
    --header 'Content-Type: application/json' 
    --data '{
    "userId": "johndoe21#",
    "firstName": "John",
    "lastName": "Doe"
    }'
```

Thus, we will:

* Replace `<HOST>` with the applicable host mentioned [here](https://docs.webengage.com/docs/rest-api-getting-started#api-endpoint-host) to build the resource endpoint URL.

* Replace `<YOUR_WEBENGAGE_LICENSE_CODE>` with the respective [account's license code](rest-api-getting-started#getting-your-credentials) to build the API resource endpoint.

* Replace`<YOUR_API_KEY>` with our [unique API key](rest-api-getting-started#getting-your-credentials) to authenticate the API call.

This is what the actual POST API call will look like:

```curl Building /user API Request with Actual API Key, License Code & Host URL
curl -X POST https://api.webengage.com/v1/accounts/va1w264d/users 
    --header 'Authorization: Bearer f414139-3cb9-4ed2-8od3-b8bbae8e7f8xY' 
    --header 'Content-Type: application/json' 
    --data '{
    "userId": "johndoe21#",
    "firstName": "John",
    "lastName": "Doe"
    }'
```

### Revoking API KEY

Team members with roles *Admin, Manager* or any *Custom Role* with *Update Data Management* permission can choose to revoke API Key permissions of a specific team member. This can be done by:

* Deleting the user
* Changing their role. For more details on how to change the role of the team member or view the role permissions, kindly refer to *[Role-Based Access Control](https://knowledgebase.webengage.com/docs/role-based-access-control).*

> 👍 Highly Recommended!
>
> If the respective admin's API Key is being used in active API requests, then we highly recommend that you change the authorization bearer token for all API calls and use your API KEY to authenticate the calls.
>
> Failing to do so will cause API call failure (`unauthorized error`). This could potentially disrupt transactional campaign delivery, message personalization, real-time data sync with WebEngage, and much more (depending on your usage of WebEngage APIs).

## API Endpoint `<HOST>`

All available resources (`/users`, `/events`, `/transaction`, `/survey/response/`) can be accessed over `HTTPS` via the respective URLs listed below. The host URL serves as the parent link of the actual API resource endpoint and differs, depending on the WebEngage data center you're using for your account.

> 🚧 Please Note
>
> *WebEngage API Endpoint* differs for [updating Business Events](https://knowledgebase.webengage.com/docs/relays-getting-started#using-rest-api-to-create-business-events), CSV data uploads, and [making API calls through Journeys](https://knowledgebase.webengage.com/docs/journey-creation-concepts#call-api). Please refer to the respective docs for more details.

### Global Data Center

If your WebEngage dashboard URL starts with `dashboard.webengage.com`, then it means you're using our *Global Data Center.* Please use the following host to access resources via API:

```text Global Data Center Host
https://api.webengage.com/
```

### India Data Center

If your WebEngage dashboard URL starts with `dashboard.in.webengage.com`, then it means you're using our *India Data Center.* Please use the following host to access resources via API:

```text India Data Center Host
https://api.in.webengage.com/
```

### Saudi Arabia Data Center

If your WebEngage dashboard URL starts with `dashboard.ksa.webengage.com`, then it means you're using our *Kingdom of Saudi Arabia Data Center.* Please use the following host to access resources via API:

```text Saudi Arabia Data Center Host
https://api.ksa.webengage.com/
```

### Europe (Frankfurt) Data Center

If your WebEngage dashboard URL starts with `dashboard.eug.webengage.com`, then it means you're using our *Europe (Frankfurt) Data Center.* Please use the following host to access resources via API:

```text Europe (Frankfurt) Data Center Host
https://api.eug.webengage.com/
```

##

## API Call Rate Limit

The default rate limits for each API endpoint is mentioned in the table below. An HTTP response code of 429 would be sent if you exceed these limits.

| Endpoint                                                                                                                             | Rate Limit       |
| :----------------------------------------------------------------------------------------------------------------------------------- | :--------------- |
| [User Data](rest-api-tracking-users) Update                                                                                          | 5,000 per minute |
| [Event Data](rest-api-tracking-events) Update                                                                                        | 5,000 per minute |
| Creating [Business Events](https://knowledgebase.webengage.com/docs/relays-getting-started#using-rest-api-to-create-business-events) | 1 per minute     |
| [Transactional Campaign API](sending-transactional-campaigns) Request                                                                | 100 per minute   |

You will also get the following headers in the response for you to programmatically keep a track of the limits:

| Header Name           | What It Means                                      | Sample Value |
| :-------------------- | :------------------------------------------------- | :----------- |
| X-RateLimit-Limit     | The per minute API rate limit for that endpoint    | 5000         |
| X-RateLimit-Remaining | How many more requests you can make in that minute | 4990         |

## Response

The data can be sent in either `JSON` or `XML` format. To select this, the `format` parameter can be passed in the URL as `json` or `xml`. Data is sent in `JSON` format by default. Any parameters can be passed as `HTTP` query string parameters in the API URLs.

### Date

All timestamps are returned in `yyyy-MM-ddTHH:mm:ssZ` format.

<Callout icon="👍" theme="okay">
  Example: _2013-01-26T07:31+0000_
</Callout>

### Response Container

```json
{
	"response" : {
		"data" : {
			...
		},
		"message" : "success",
		"status" : "success"
	}
}
```

Each API response is wrapped in the main `response` container. It contains the following properties:

* `status` - Value can be `success` or `error`, depending on the server response.

* `message` - Explains the reason for the corresponding `status`.

* `data` - Contains the data for the requested resource.

### Error Status Codes

Errors are returned using standard HTTP error code syntax. The response body is always in JSON.

<Table align={["left","left","left"]}>
  <thead>
    <tr>
      <th>
        Code
      </th>

      <th>
        What It Means
      </th>

      <th>
        How to Resolve
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        400
      </td>

      <td>
        Invalid resource/parameters
      </td>

      <td>
        * _Step 1:_* Please cross-check that you're using the correct [License Code](rest-api-getting-started#getting-your-credentials) as a path parameter in the API resource endpoint.
        * _Step 2:_* Please cross-check that you're accessing a valid WebEngage resource which can be either of the following: `/users`, `/events`, `/transaction`, `/survey/response/`
        * _Step 2:_* Please drop in a few lines at [support@webengage.com](mailto:support@webengage.com) if the issue persists.
      </td>
    </tr>

    <tr>
      <td>
        401
      </td>

      <td>
        Invalid authentication/access | Unauthorized access
      </td>

      <td>
        * _Step 1:_* Please reach out to [support@webengage.com](mailto:support@webengage.com), mentioning the API Key being used. We will help you identify the _Account Admin_ to whom the _API Key_ in question, belongs.
        * _Step 2:_* Once Identified, go to _Profile > Account Admins_ to cross-check if the respective admin has sufficient access permissions to _Account Management_ and _Update Data_ to authenticate _REST API calls._
        * _Step 3 (If the Account Admin doesn't have sufficient permissions):_* You can edit their access permissions by clicking _Edit > Selecting Account Management and Update Data > Save._
        * _Step 3 (If the Account Admin has been remove from your WebEngage dashboard):_* Please replace the invalid API Key in all active and future API calls with the Key of an admin that has sufficient permissions to authenticate the call.
      </td>
    </tr>

    <tr>
      <td>
        404
      </td>

      <td>
        Invalid URL
      </td>

      <td>
        * _Step 1:_* Please cross-check if you're using the correct `host` _([as per your WebEngage data center](rest-api-getting-started#api-endpoint-host))_ as the parent URL for building the resource endpoint in your API call.
        * _Step 2:_* Please drop in a few lines at [support@webengage.com](mailto:support@webengage.com) if the issue persists.
      </td>
    </tr>
  </tbody>
</Table>

Please feel free to drop in a few lines at *<support@webengage.com>* in case you have further queries. We're always just an email away!