Skip to main content

Multi-Account Support

The gateway supports multiple accounts per provider per tenant. This is essential for agencies managing multiple client accounts.

How it works

Tokens are stored with an account_id dimension:

tokens:{tenant}:{provider}:{account_id}

For example:

  • tokens:ascend:hubspot:default — Ascend dev portal
  • tokens:ascend:hubspot:kahuna_prod — Kahuna production portal
  • tokens:ascend:google_ads:default — MCC account (manager)

Specifying an account

Pass account_id in your API call:

{
"domain": "hubspot",
"action": "list",
"object_type": "contacts",
"account_id": "kahuna_prod"
}

Safety guard

If a tenant has multiple accounts for a provider and you don't specify account_id, the gateway returns an error:

{
"error": "Tenant ascend has multiple hubspot accounts. Pass account_id explicitly. Available: default, kahuna_prod.",
"code": "VALIDATION_ERROR"
}

This prevents accidentally querying the wrong account.

For Google Ads, the gateway automatically injects the login-customer-id header when routing through an MCC:

  • customer_id — the sub-account being queried
  • login_customer_id — the MCC that has access (set in tenant config)