Your primary authentication credentials. You'll have two keys:
Key Type
Format
Environment
Test Key
pk_test_xxxxxxxxxxxxxxxx
embedded-api.testing.mapademics.com
Live Key
pk_live_xxxxxxxxxxxxxxxx
embedded-api.mapademics.com
End-Customer API Keys
End-customer keys identify which of your customers is making the API call. You provision these in the Embedded API Portal.
Key Type
Format
End-Customer Key
ck_xxxxxxxxxxxxxxxx
End-customer keys enable:
Per-customer usage tracking and billing
Per-customer rate limits
Customer-specific analytics
Authentication Requirements
Important: Testing and production have different authentication requirements.
Testing Environment
Calls to embedded-api.testing.mapademics.com require only your test key:
Header
Required
Value
X-API-Key
Yes
pk_test_xxx
X-End-Customer-API-Key
No
Not required
Production Environment
Calls to embedded-api.mapademics.com require both your live key and an end-customer key:
Header
Required
Value
X-API-Key
Yes
pk_live_xxx
X-End-Customer-API-Key
Yes
ck_xxx
Testing vs Production Summary
Aspect
Testing
Production
Base URL
embedded-api.testing.mapademics.com
embedded-api.mapademics.com
Primary Key
pk_test_xxx
pk_live_xxx
End-Customer Key
Not required
Required
Data
Sample/synthetic
Real
Rate Limits
Higher (for development)
Standard
Billing
Not billed
Billed per request
Start with testing. The testing environment doesn't require end-customer keys, making it easier to get started during development.
Managing End-Customer Keys
Creating End-Customer Keys
Log into the Embedded API Portal
Navigate to End-Customer Keys
Click Create New Key
Enter a name/identifier for the customer
Copy the generated ck_xxx key
Best Practices
Create one key per end-customer for accurate usage tracking
Store keys securely - treat them like passwords
Rotate keys periodically if you suspect compromise
Revoke unused keys to maintain security
Security Best Practices
Never Expose Keys in Client-Side Code
API keys should never appear in:
JavaScript running in browsers
Mobile app source code
Public repositories
Client-side configuration files
Wrong: Hardcoding keys in frontend code
Correct: Proxy requests through your backend
Use Environment Variables
Store API keys in environment variables, not in code:
Rotate Keys Periodically
We recommend rotating your API keys every 90 days:
Generate a new key in the Embedded API Portal
Update your application to use the new key
Verify the new key works correctly
Revoke the old key
API Versioning
The API uses path-based versioning. The current version is v1 and is included in all endpoint URLs:
We maintain backward compatibility within major versions. Breaking changes are announced at least 6 months in advance and released as a new major version (e.g., /v2).
Authentication Errors
Error Code
HTTP Status
Meaning
UNAUTHORIZED
401
Missing or invalid API key
FORBIDDEN
403
Valid key but missing end-customer key or insufficient permissions