View, create, edit, regenerate and archive API keys used for authentication. This article covers the supported authentication methods: Basic Auth, OAuth 2.0, and AWS STS Auth.
This is an Early Access feature. To enable it for your account, please contact your MoEngage Customer Success Manager (CSM) or the Support team.
An API key is a unique identifier that authenticates and authorizes requests to MoEngage API resources. Use the API Key Dashboard to create keys, scope each key to the APIs it needs, and regenerate or archive keys as your integrations change.The multi-API key feature is currently supported for the following API groups:
Creation of new API keys for Push APIs is not currently supported. Push APIs work only with Basic Auth (Legacy) keys migrated to this dashboard.
To send data to MoEngage, you can use the Workspace ID and key for that particular API. Whenever a key is regenerated, the old key expires immediately and it takes some time for the new key to become functional, which may result in service interruptions. MoEngage provides multiple API keys to help you avoid this situation:
Generate a new key while the existing key is still available: With multi-key support, the existing key remains active until the new key becomes functional. This allows you to rotate keys for security purposes without causing downtime. For example, if your team needs time to integrate a new key, the old key continues to work during that period. After the new key is integrated, you can archive the old one.
Use different keys for different teams: You can create separate keys for different internal teams or external vendors, each scoped to the APIs they need. This provides granular access control and improves security across your organization.
To restrict which IP addresses can use your keys, see API Firewall.
MoEngage supports the following authentication types for API keys:
Basic Auth: The standard authentication method, which uses an API key and secret. Choose this method for server-to-server integrations that do not need token expiration.
OAuth 2.0: A token-based method that issues short-lived access tokens. You set the token expiry time, and MoEngage validates each access token automatically. For the full flow, including generating, using, and refreshing tokens, refer to OAuth 2.0 Overview.
AWS STS Auth: A token-based method for workloads that run on AWS. You allowlist the AWS Security Token Service (STS) assumed-role ARNs that can use the key, and each request proves its AWS identity with a signature from the role’s temporary credentials. MoEngage also issues a MOE-APPSECRET value for the key, which every request sends alongside that signature. Choose this method when your services already assume an IAM role and you want MoEngage to authorize those roles directly. See Add Role ARNs and AWS STS Auth.
You select the authentication type from the Authentication type list in the Create new key dialog. You cannot change the authentication type after you create the key. To move an integration to a different authentication type, create a new key and archive the old one.
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 (autogenerated previously when the workspace was created and migrated to this new dashboard) details and continue to use them. However, archiving, editing, and regenerating legacy keys is not supported.
MoEngage recommends creating and using new keys, as legacy keys will be deprecated in the future.
1
Open the API Keys Page
On the left navigation menu in the MoEngage dashboard, go to Settings > Account > API keys.
2
Start a New Key
Click + Create new key.
3
Open the Key Details Form
In the Create new key dialog, enter the key details.
4
Name the Key
Enter a name in the Key name box. The key name must not exceed 100 characters and must be unique across your workspace. Archived keys keep their names, so you cannot reuse the name of a key you archived earlier.
5
Choose an Authentication Type
From the Authentication type list, select the method you want to use, then set the options for that method:
Basic Auth
OAuth 2.0
AWS STS Auth
Under Select APIs for access, select the API groups you want to access using this key:
Data APIs
Segmentation APIs
Campaigns
Inform
Offerings
Decision Policy
Dashboard & Analyze
In the Expiry time (in minutes) box, enter the access token lifetime. The value must be between 5 and 60 minutes, and the default is 15 minutes.
The Expiry time (in minutes) box does not appear for Basic Auth keys. AWS STS Auth keys have a box with the same name, but it sets a different limit. See the AWS STS Auth tab.
Under Select APIs for access, select the API groups you want to access using this key:
Data APIs
Campaigns
Offerings
Decision Policy
Dashboard & Analyze
Segmentation APIs and Inform are not listed for OAuth 2.0 keys. To access these groups, create a Basic Auth key.
In the Expiry time (in minutes) box, enter how long MoEngage trusts a signature it has already verified. The value must be between 5 and 15 minutes, and the default is 15 minutes. This setting does not change how old a signature can be when MoEngage first verifies it, which the AWS freshness window governs.
In the ARN box, enter the AWS STS assumed-role ARN that can use this key. Click + Add value to add another ARN, up to 10 entries. For the accepted format and the validations the dashboard applies to each entry, see Add Role ARNs.
Under Select APIs for access, select the API groups you want to access using this key:
Data APIs
Channel Configuration
Personalize
Campaigns, Segmentation APIs, Inform, Offerings, Decision Policy, and Dashboard & Analyze are not available to AWS STS Auth keys. To access those groups, create a Basic Auth or OAuth 2.0 key.Not every scope inside a listed group is available to an AWS STS Auth key. See Scopes Available to AWS STS Auth for the scopes such a key can use.When you save the key, MoEngage generates a MOE-APPSECRET value for it. Your application sends that value as a header on every request, in addition to the AWS signature. See View Key Details to retrieve it.
6
Scope the API Access
Click next to a group to expand it and select individual APIs. Use Select all or De-select all to manage selections across all groups.
7
Save the New Key
Click Create key. The new key appears under Active API keys.
To use the key in requests, see Authentication. If you created an OAuth 2.0 key, see OAuth 2.0 Overview for generating an access token, calling the APIs, and refreshing the token. For per-endpoint request limits and payload caps, see Rate Limits.
This section applies only to keys that use the AWS STS Auth authentication type. MoEngage authorizes such a key against a list of assumed-role ARNs, and only a caller whose assumed-role ARN appears on the key can use it.
This section covers the dashboard configuration for an AWS STS Auth key. For the signing sequence that your application performs, the regional AWS STS hosts, and the headers that each API request carries, refer to AWS STS Auth.
No other scope accepts an AWS STS Auth key. To call Campaigns, Segmentation APIs, Inform, Offerings, Decision Policy, or Dashboard & Analyze, create a Basic Auth or OAuth 2.0 key.
You create and manage these roles in your own AWS account. MoEngage does not generate the ARN, so copy it from your AWS account and paste it into the key. For more information, see the AWS Security Token Service API Reference.
The session name is mandatory. An entry that stops at the role name, such as arn:aws:sts::123456789012:assumed-role/MoEngageIngestionRole, is rejected as Invalid format.
Each session of a role produces a different ARN, so a role that many workloads or team members share can exceed the limit of 10 entries. Place * at the end of the segment you want to broaden.
MoEngageIngestionRole-Dev, MoEngageIngestionRole-Prod, and every other role with that prefix.
Two rules apply to every wildcard entry:
An entry accepts one *, and only as the final character. arn:aws:sts::123456789012:assumed-role/My*Role and any entry with two wildcards are invalid.
The role name must contain at least one character before the wildcard, so arn:aws:sts::123456789012:assumed-role/* is invalid.
A wildcard grants the key’s full API access to every ARN it matches, so use one only when every matched role or session needs the same access. When you add a wildcard entry, the dashboard displays the banner Using * matches multiple ARNs. Ensure that this broader scope is intentional for security.
When a wildcard entry already covers a role, you cannot add a named session for the same role. The dashboard treats the named session as a duplicate. Remove one of the two entries to save the key.
The ARN does not match the expected format. For example, the account ID has fewer than 12 digits, the resource type is role instead of assumed-role, or the session name is missing.
Invalid format
The entry contains more than one *, places * anywhere other than the final character, or uses * as the entire role name.
Invalid format
You enter the same ARN twice, or you add a named session for a role that a wildcard entry already covers.
Duplicate ARN detected
The list already contains 10 ARNs.
The dashboard disables + Add value and states that you can add up to 10 values.
You can search for keys using the search bar. The count of active keys is displayed above the table.
Legacy keys are listed with the auth type Basic Auth (Legacy). You can view and continue to use these keys, but you cannot edit, regenerate, or archive them.
View the full details of the key. From the details panel, you can also access Edit key details and Regenerate key.
Regenerate key
Generate a new key. You can regenerate a key as often as you need. On an AWS STS Auth key, this issues a new MOE-APPSECRET value and leaves the key’s role ARNs and API access unchanged.
On the API Keys page, click for the key you want to view.
2
Open the Details Panel
Click View key details. The fields in the details panel depend on the authentication type of the key:
Basic Auth
OAuth 2.0
AWS STS Auth
Field
Description
Key name
The name assigned to the key.
API key
The masked key value with a view button and a copy button.
Authentication type
Basic Auth, or Basic Auth (Legacy) for a migrated legacy key.
Last updated on
The date and time the key was last modified.
Last updated by
The email address of the user who last modified the key.
Created on
The date and time the key was created.
Created by
The email address of the user who created the key.
API access
The APIs selected for this key, with checkmarks indicating the enabled options. Click next to a group to see the individual APIs it includes.
Field
Description
Key name
The name assigned to the key.
API key
The masked key value with a view button and a copy button.
Authentication type
OAuth 2.0.
Access token expiration
The token lifetime in minutes.
Last updated on
The date and time the key was last modified.
Last updated by
The email address of the user who last modified the key.
Created on
The date and time the key was created.
Created by
The email address of the user who created the key.
API access
The APIs selected for this key, with checkmarks indicating the enabled options. Click next to a group to see the individual APIs it includes.
Field
Description
Key name
The name assigned to the key.
API key
The masked key value with a view button and a copy button.
Authentication type
AWS STS Auth.
MOE-APPSECRET
The secret that MoEngage generated for this key, with a view button and a copy button. The value stays available after creation, so you can retrieve it here at any time.
Expiry time
How long, in minutes, MoEngage trusts a signature it has already verified.
ARNs
The assumed-role ARNs that can use this key. Click Show more to expand the full list, and hover over an entry to see the complete ARN.
Last updated on
The date and time the key was last modified.
Last updated by
The email address of the user who last modified the key.
Created on
The date and time the key was created.
Created by
The email address of the user who created the key.
API access
The APIs selected for this key, with checkmarks indicating the enabled options. Click next to a group to see the individual APIs it includes.
From the details panel, you can click Edit key details or Regenerate key to perform those actions.
On the API Keys page, click for the key you want to edit.
2
Open the Edit Dialog
Click Edit key details.
3
Update the Fields
In the Edit key details dialog, edit the available fields:
Basic Auth
OAuth 2.0
AWS STS Auth
Field
Editable
Key name
Yes
Authentication type
No
Select APIs for access
Yes
Field
Editable
Key name
Yes
Authentication type
No
Access token expiration
Yes
Select APIs for access
Yes
Field
Editable
Key name
Yes
Authentication type
No
Expiry time (in minutes)
Yes
ARN
Yes
Select APIs for access
Yes
The same validations apply as when you create the key. See Add Role ARNs.
4
Save Your Changes
Click Save. The Save button remains disabled until you make a change.If you change the API access or the ARN list, a confirmation dialog opens with the title Are you sure you want to update “<key name>” Key?. The dialog groups your changes into categories, such as ARN added and ARN removed, and shows only the categories you changed. Click Show more to expand a long list, and hover over an entry to see the complete ARN.
Review the summary, then click Save to apply the changes.
Removing an API group or an ARN revokes that access immediately. Notify everyone who uses this key before you save, because their integrations fail as soon as you confirm the change.
Audit Logs records every API key action, so you can identify who created, updated, regenerated, or archived a key and when. These entries appear under the API Keys entity, and each description names the key and its authentication type. For the full list of recorded events and their description formats, see Identity and Access Management.
Legacy keys are API keys created automatically when the workspace was created and migrated from the older API keys dashboard to this one. You cannot edit, regenerate, or archive them.
What is access token expiration in OAuth 2.0?
OAuth 2.0 access token expiration is a security feature that limits how long an access token can be used to call protected APIs before it becomes invalid.An access token acts as a temporary digital pass. Instead of sharing your password with every app or service, the authorization server gives you a short-lived token. When that token reaches its expiration time, the API rejects any further requests and returns an HTTP 401 Unauthorized error.
Why does access token expiration matter?
Better security: If an attacker steals a short-lived token, they have only a brief window to exploit it before it stops working.
Resource control: Expiration prevents unused or abandoned tokens from filling up the authorization server’s database.
Standard lifespan: You can set the access token expiration anywhere from 5 to 60 minutes.
How does MoEngage handle expired tokens?
MoEngage issues a companion refresh token alongside the access token. Your integration exchanges that refresh token for a fresh access token in the background, without sending the API key again. The refresh token expires after 24 hours without a refresh, and after 30 days at most, so refresh at least once a day to keep the token alive. For the refresh request and its error codes, refer to Refresh Access Token.
Where do I find my assumed-role ARN?
You find it in your own AWS account. Create or identify the role your workload assumes, then copy its assumed-role ARN. MoEngage does not create the role or generate the ARN. For the format MoEngage accepts, see ARN Format.
How many ARNs can one key have?
One key accepts up to 10 ARNs. After the list reaches 10 entries, the dashboard disables + Add value. To cover more sessions of the same role, use a wildcard session name instead of listing each session separately. See Match All Sessions of a Role.
Can I change the authentication type of an existing key?
No, you cannot change it. You can edit the key name, the expiry time, the ARN list, and the API access, but the authentication type stays as you set it at creation. To switch an integration to a different authentication type, create a new key and archive the old one.
Assistant
Responses are generated using AI and may contain mistakes.