Guides
How to test your integration against a sandboxed environment
The sandbox provides an isolated copy of your data where you can safely test API integrations without affecting production.
smca_test_*) automatically route to the sandboxsmca_live_*) continue to hit your real dataconst res = await fetch(
'https://api.smartmca.com/api/v1/settings/api-access/sandbox/activate',
{
method: 'POST',
headers: {
'Authorization': `Bearer ${SESSION_TOKEN}`,
'Content-Type': 'application/json',
},
body: '{}',
}
);
const { sandboxOrgId, testApiKey } = await res.json();
console.log(`Sandbox org: ${sandboxOrgId}`);
console.log(`Test key: ${testApiKey.rawKey}`); // Save this β shown only once!
Once activated, use your test API key exactly like a live key. All endpoints work the same way β the key prefix determines routing:
// This hits the SANDBOX
const TEST_KEY = 'smca_test_abc123...';
const deals = await fetch('https://api.smartmca.com/api/public/v1/deals', {
headers: { 'Authorization': `Bearer ${TEST_KEY}` },
});
// This hits PRODUCTION
const LIVE_KEY = 'smca_live_xyz789...';
const realDeals = await fetch('https://api.smartmca.com/api/public/v1/deals', {
headers: { 'Authorization': `Bearer ${LIVE_KEY}` },
});
When activated, the sandbox is seeded with:
You can create additional test API keys with different entity scopes:
Note: The βTestβ environment option is only available when the sandbox is active.
Reset wipes all sandbox data and re-seeds with fresh sample records. API keys are preserved.
curl -X POST https://api.smartmca.com/api/v1/settings/api-access/sandbox/reset \
-H "Authorization: Bearer ${SESSION_TOKEN}" \
-H "Content-Type: application/json" \
-d '{}'
curl https://api.smartmca.com/api/v1/settings/api-access/sandbox/status \
-H "Authorization: Bearer ${SESSION_TOKEN}"
Response:
{
"active": true,
"sandboxOrgId": "org_sandbox_abc123",
"createdAt": "2026-03-04T10:00:00Z",
"keyCount": 2
}
Deactivation revokes all test API keys and stops billing. Sandbox data is retained for 30 days.
curl -X POST https://api.smartmca.com/api/v1/settings/api-access/sandbox/deactivate \
-H "Authorization: Bearer ${SESSION_TOKEN}" \
-H "Content-Type: application/json" \
-d '{}'
After deactivation, any requests with test keys return:
{
"code": "SANDBOX_NOT_ACTIVE",
"message": "Sandbox environment is not active. Activate it in Settings β API Access."
}
| Aspect | Sandbox (smca_test_*) | Production (smca_live_*) |
|---|---|---|
| Data | Sample/test data | Real data |
| Billing | Sandbox add-on fee | Normal subscription |
| Webhooks | Delivered normally | Delivered normally |
| Rate limits | Same as production | Same |
| API behavior | Identical | Identical |