All B2BEnrich API endpoints are authenticated using an API key.
API key authentication
The OpenAPI spec defines a single auth scheme:
- Type: API key
- Location: HTTP header
- Header name:
X-Api-Key
The spec also sets this scheme as global security, which means every operation requires X-Api-Key unless explicitly overridden.
Base URLs
The API advertises these server URLs:
- Production:
https://a.b2benrich.com - Local development:
http://localhost:8084
Send the API key
Include your key on every request:
Code
If you prefer, export it once:
Code
Validate your key
The following endpoints are useful for verifying your API key and organization context:
Get organization id
Returns the organization_id associated with the provided API key.
Code
Get credit balance
Returns the current credit balance for the API key's organization.
Code
Example authenticated request
Most API operations are JSON POST requests and require you to include your organization_id in the body.
Example: create a contact
Code
Error responses
If your request body doesn’t match the schema, the API returns 422 Validation Error.
If your API key is missing or invalid, you should expect an authentication error response (for example 401 Unauthorized), depending on the gateway configuration.