Skip to content

Authentication

All eConsent API requests require authentication. The method you use depends on the type of integration.

For most API calls, including verification, retention, and opt-out, you authenticate by including your company_id and property_id in the request body.

{
"company_id": "comp-abc123",
"property_id": "prop-xyz789",
"certificate_id": "EC-session123-base64hash"
}

Your Company ID and Property ID are available in the eConsent dashboard at app.econsent.org under Settings and Properties, respectively.

For third-party integrations and webhook-based workflows (such as Meta Lead Ads), authentication uses a Bearer token in the Authorization header:

Terminal window
curl -X POST https://api.econsent.org/api/verify/match \
-H "Authorization: Bearer YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"certificate_id": "EC-session123-base64hash",
"consent": "I agree to receive calls"
}'

Bearer tokens are generated in the dashboard under Settings > Integrations. Each token is scoped to a specific company and can be revoked at any time.

When verifying certificates issued by another company, you must include the originator_company_id field in your request:

{
"certificate_id": "EC-session123-base64hash",
"company_id": "your-company-id",
"property_id": "your-property-id",
"consent": "I agree to marketing emails",
"originator_company_id": "originating-company-id"
}

For this to work, the originating company must:

  1. Enable the third_party_verification_enabled flag on their account.
  2. Add your company to their authorized_third_parties list.

If either condition is not met, the API returns a 403 Unauthorized response.

  1. Log in to app.econsent.org.
  2. Navigate to Settings.
  3. Your Company ID is displayed on the settings page.
  1. Navigate to Properties in your dashboard.
  2. Select the property you want to use.
  3. The Property ID is displayed on the property detail page.
  1. Navigate to Settings > Integrations in your dashboard.
  2. Enable the integration you need (Debt Lookup, Email Validation, Phone Validation, or Meta Lead Ads).
  3. Copy the generated API token.

All authentication failures return standard HTTP error codes:

Status codeMeaning
400Bad request: missing or malformed required fields
401Unauthorized: invalid credentials or token
403Forbidden: certificate opted out, or third-party access not authorized
404Not found: certificate or property does not exist
429Rate limited: too many requests
  • Server-side only. Never call the eConsent API from client-side JavaScript. Your Company ID and Property ID should remain on your backend.
  • Environment variables. Store credentials in environment variables or a secrets manager, not in source code.
  • Rotate tokens. Periodically rotate Bearer tokens, especially if team members with access leave your organization.
  • Restrict third-party access. Only add verified partners to your authorized_third_parties list and review it regularly.
  • Monitor the audit log. Use the dashboard’s audit log to track API access patterns and detect anomalies.
const COMPANY_ID = process.env.ECONSENT_COMPANY_ID;
const PROPERTY_ID = process.env.ECONSENT_PROPERTY_ID;
async function verifyConsent(certificateId, consentText) {
const response = await fetch('https://api.econsent.org/api/verify/match', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
company_id: COMPANY_ID,
property_id: PROPERTY_ID,
certificate_id: certificateId,
consent: consentText,
}),
});
return response.json();
}