Skip to content

Getting Your API Key

MomentScience provides a suite of APIs for offer delivery, offer management, and performance reporting. This guide explains how to get your API key,...

Overview

MomentScience provides a suite of APIs for offer delivery, offer management, and performance reporting. This guide explains how to get your API key, understand scope permissions, explore available endpoints, manage existing keys, and troubleshoot common issues.

In this guide, you will learn how to:

  • Generate an API key from your account
  • Assign scopes to control access
  • Explore supported API endpoints
  • Modify, regenerate, or delete existing keys

Generate your API key

To use MomentScience APIs, you’ll need an API key tied to your account.

  1. Go to the MomentScience dashboard and sign in.
  2. Navigate to your Profile Settings.
  3. Click Generate API Key.
  4. Enter a descriptive name (e.g., “Test Key” or “Production Key”).
  5. Select the appropriate scopes based on the APIs you’ll use.
  6. Click Generate to create the key.

After creation, securely copy the key and add it to your environment configuration.

If you need further assistance, you can refer to the quick playable demo for a visual guide on how to generate your API Key.

API Scopes

Scopes define the permissions granted to an API key. You can assign multiple scopes to the same key, depending on the needs of your integration. Select only the scopes required for your use case.

Scope Description
Ads/Offers Grants access to the MomentPerks, Perkswall, and Offer Catalog APIs. Use this scope to retrieve and display available offers.
Reports Provides access to the Reporting API, enabling retrieval of detailed analytics, including impressions, clicks, revenue, click-through rates (CTR), and other performance data.
Configurations Allows programmatic updates to account-level configurations such as themes, branding, and general settings.
Offers Management Enables the creation, editing, and status control of offers. You can update both endemic and third-party offers, including setting them to “Paused” or “Active,” or editing creative elements like headlines and descriptions.
Accounts Grants permission to create and update sub-accounts within your organization.
PerksWallet Authorizes access to the PerksWallet feature ( save for later). This scope allows the API key to authenticate and manage saved offers, including deletion.

Managing API keys

Once an API key is created, you can update its name and scopes, regenerate it to invalidate the current value, or delete it if it’s no longer needed.

Modify an existing API key

  1. Go to Profile Settings
  2. Click the Action menu next to the API key you want to modify.
  3. Select Modify API Access.
  4. Edit the key’s name or adjust its scopes.
  5. Click Update to save changes.

Regenerate an API key

Regenerating a key disables the old one and generates a new value immediately.

  1. From the Action menu, select Regenerate API Key.
  2. A new key will be shown. The previous key will no longer be valid.
  3. Copy and store the new key securely.

Delete an API key

To permanently delete an API key:

  1. Click the Action menu next to the key you want to remove.
  2. Select Delete API Key.
  3. Click Confirm to finalize the deletion.

Current Endpoints

The following endpoints are available based on the scopes assigned to your API key:

API Purpose Endpoint Required Scope
Moments API Serve offers during key moments in the user journey (e.g. after checkout or reward unlock). POST/native/v4/offers.json Ads/Offers
Perkswall API Retrieve all Perkswall-enabled offers for building a branded offer gallery. POST/native/v4/perkswall.json Ads/Offers
Offer Catalog API Get a real-time JSON feed of all active offers, including creatives and tracking metadata. GET/native/v3/catalog.json Ads/Offers
Reporting API Access detailed performance data including impressions, revenue, clicks, and eCPM. GET/native/activity.json Reports

Security Best Practices

Storage Guidelines:

// ❌ Never expose API keys in client-side code
const apiKey = 'pk_live_abcd1234...';  // Visible to users

// ✅ Use environment variables for server-side code
const apiKey = process.env.MOMENTSCIENCE_API_KEY;

// ✅ Use secure storage for mobile apps
const apiKey = await SecureStore.getItemAsync('ms_api_key');

Key Rotation:

  • Rotate API keys regularly (recommended: every 90 days)
  • Implement graceful key transitions in production
  • Monitor key usage for anomalies

Having trouble with API keys or integration? reach out to us at help@momentscience.com. We’re here to support you.

Type to search…

↑↓ navigate↵ selectEsc close