Getting started

REST API allows you to programatically transfer information over the internet using a predefined schema. WebEngage offers endpoints with specific requirements which perform actions and/or return data. Using this API, you can track your users and their actions, along with accessing your on-site feedback and survey data, and creating surveys.

API endpoint

Access to all the resources available via API is over HTTPS.

For Global Data Center (Default): By default, your data is stored in our global data centers. Therefore, if you're not specifically using our India data center to store/access your data, please use the following host api.webengage.com to access all resources available via API.

https://api.webengage.com/

For India Data Center: If you're using our India data center to store your data, please ensure that you use the following host: api.in.webengage.com.

https://api.in.webengage.com/

Please Note
In your contract with WebEngage, if you have not specifically requested for your data to be stored in our India data center, then your data will be stored in our Global data center.
-
If your WebEngage dashboard URL starts with dashboard.webengage.com, then it means you're using our Global data center.
-
If your WebEngage dashboard URL starts with dashboard.in.webengage.com, then it means you're using our India data center.

Response format

The data can be sent in either JSON or XML format. To select this, 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 format

All timestamps are returned in the format illustrated below.

yyyy-MM-ddTHH:mm:ssZ

Example: 2013-01-26T07:31+0000

Response container

Each API response will be wrapped in a main container called response. It will have three properties: status, data and message. status will be either success or error depending upon the server response. message will explain the reason of this corresponding status. data will contain the data for the requested resource.

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

User authentication

WebEngage API follows Bearer Authentication Scheme for API access.

You will find your API key on WebEngage dashboard. Log in to your WebEngage dashboard, navigate to Integrations > REST API to find it. Each account manager of your WebEngage account will have a different API key. Access restrictions for an API key is driven by the access privileges of that account manager. You have to pass this API key in header, as illustrated below.

curl -X POST <HOST>/v1/accounts/<YOUR_WEBENGAGE_LICENSE_CODE>/users \
    --header 'Authorization: Bearer <YOUR_API_KEY>' \
    --header 'Content-Type: application/json' \
    --data '{
    "userId": "johndoe",
    "firstName": "John",
    "lastName": "Doe"
    }'

Make sure you replace HOST with the host mentioned here, YOUR_WEBENGAGE_LICENSE_CODE with your WebEngage license code and YOUR_API_KEY with your WebEngage API key.

Errors

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

Errors by status code

Code
Description

400

Invalid resource / parameters

401

Invalid auth / access

404

Invalid URL

Next steps

Getting started


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.