--- title: "Email API sub-accounts for platforms" description: "One sub-account per customer, each with its own domains, API keys and suppressions. One invoice, with usage and cost per customer through the API." url: https://ahasend.com/sub-accounts markdown_url: https://ahasend.com/sub-accounts.md lang: en type: page_builder published: 2026-11-23 updated: 2026-11-26 --- # Email API sub-accounts for platforms Email API sub-accounts give each of your customers their own AhaSend account, with its own domains, API keys and sending. You see usage and cost for each customer through the API, and you pay one invoice. - [Start for Free](https://dash.ahasend.com/user/register) - [View the sub-accounts docs](https://ahasend.com/docs/scale/sub-accounts) ## What a sub-account includes A sub-account is a full AhaSend account under your parent account. Other providers call them subaccounts or subusers. Sub-accounts are for SaaS platforms, agencies, resellers, cloud and hosting providers and managed service providers that send email for their customers. Do you only send your own email? Then one account with several domains is the simpler fit. ### Own domains and sending Each customer gets their own sending domains and their own sending activity. ### Own API keys A sub-account's API key works on every regular API v2 endpoint: domains, messages, webhooks, routes and more. ### Own webhooks and routes Each customer has their own webhooks for email events and their own routes for inbound email. ### Own members and suppressions Each customer has their own team members and their own suppression list. ## Usage and cost per customer One API call gives you this billing period's message volume and allocated cost for your parent account and for each active sub-account. Use it to bill each customer for what they send. - **Message volume per customer**: See how many emails each sub-account sent in the current billing period, next to your parent account. - **Allocated cost per customer**: Each sub-account's cost is its share of your invoice, split by message volume. It is not what the customer would pay on a plan of its own. - **Deliveries and bounces per customer**: Each sub-account's own statistics show its delivered emails and its bounces. - **One invoice**: Every sub-account's emails count on your plan. You pay one invoice, with no charge per sub-account. - **Removed sub-accounts in one total**: Usage from sub-accounts you removed this period stays on your invoice and shows as one total. - **Read it with a scoped key**: A parent API key with the sub-accounts:usage scope can read usage and cost. See the usage endpoint in the docs. ([Learn more](https://ahasend.com/docs/api-reference/sub-accounts/get-sub-accounts-usage)) ## Set up a customer in two API calls Create the sub-account, then its first API key. The secret key is shown only once. ### TypeScript / JavaScript Install dependencies: ```bash npm install @ahasend/sdk ``` #### TypeScript SDK ```typescript import { AhaSendClient } from "@ahasend/sdk"; // A parent API key with sub-accounts:write and sub-account-api-keys:write const parent = new AhaSendClient({ apiKey: process.env.AHASEND_API_KEY!, accountId: process.env.AHASEND_ACCOUNT_ID!, }); // 1. Create the sub-account const child = await parent.subAccounts.create( { name: "Acme Subsidiary", website: "acme.example.com" }, { idempotencyKey: "subacct-20240101-acme" }, ); // 2. Create its first API key (the secret is shown only once) const key = await parent.subAccounts.apiKeys.create( child.id, { label: "Bootstrap key", scopes: ["domains:read", "domains:write", "messages:send:all"], }, { idempotencyKey: "child-bootstrap-key-20240101-acme" }, ); // 3. Use the new key with the sub-account's ID on the regular API v2 endpoints const customer = new AhaSendClient({ apiKey: key.secret_key, accountId: child.id, }); ``` Need help getting started? [Check out our documentation](https://ahasend.com/docs) or [contact our support team](https://ahasend.com/contact) ### Go Install dependencies: ```bash go get github.com/AhaSend/ahasend-go ``` #### Go SDK ```go package main import ( "context" "log" "os" "github.com/AhaSend/ahasend-go/api" "github.com/AhaSend/ahasend-go/models/requests" "github.com/google/uuid" ) func main() { // A parent API key with sub-accounts:write and sub-account-api-keys:write parent := api.NewAPIClient(api.WithAPIKey(os.Getenv("AHASEND_API_KEY"))) accountID := uuid.MustParse(os.Getenv("AHASEND_ACCOUNT_ID")) ctx := context.Background() // 1. Create the sub-account child, _, err := parent.SubAccountsAPI.CreateSubAccount(ctx, accountID, requests.CreateSubAccountRequest{ Name: "Acme Subsidiary", Website: "acme.example.com", }, api.WithIdempotencyKey("subacct-20240101-acme"), ) if err != nil { log.Fatal(err) } // 2. Create its first API key (the secret is shown only once) key, _, err := parent.SubAccountsAPI.CreateSubAccountAPIKey(ctx, accountID, child.ID, requests.CreateAPIKeyRequest{ Label: "Bootstrap key", Scopes: []string{"domains:read", "domains:write", "messages:send:all"}, }, api.WithIdempotencyKey("child-bootstrap-key-20240101-acme"), ) if err != nil { log.Fatal(err) } // 3. Use the new key with child.ID on the regular API v2 endpoints customer := api.NewAPIClient(api.WithAPIKey(*key.SecretKey)) _ = customer } ``` Need help getting started? [Check out our documentation](https://ahasend.com/docs) or [contact our support team](https://ahasend.com/contact) ### cURL #### cURL ```bash PARENT_ACCOUNT_ID="your-parent-account-id" PARENT_SECRET="aha-sk-parent-64-character-key" SUB_ACCOUNTS_URL="https://api.ahasend.com/v2/accounts/${PARENT_ACCOUNT_ID}/sub-accounts" # 1. Create the sub-account and capture its ID SUB_ACCOUNT_ID="$(curl -sS -X POST "${SUB_ACCOUNTS_URL}" \ -H "Authorization: Bearer ${PARENT_SECRET}" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: subacct-20240101-acme" \ -d '{"name":"Acme Subsidiary","website":"acme.example.com"}' | jq -r '.id')" # 2. Create its first API key and capture the secret (shown only once) SUB_ACCOUNT_SECRET="$(curl -sS -X POST "${SUB_ACCOUNTS_URL}/${SUB_ACCOUNT_ID}/api-keys" \ -H "Authorization: Bearer ${PARENT_SECRET}" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: child-bootstrap-key-20240101-acme" \ -d '{"label":"Bootstrap key","scopes":["domains:read","domains:write","messages:send:all"]}' \ | jq -r '.secret_key')" # 3. Use SUB_ACCOUNT_SECRET with SUB_ACCOUNT_ID on the regular API v2 endpoints ``` Need help getting started? [Check out our documentation](https://ahasend.com/docs) or [contact our support team](https://ahasend.com/contact) _Central control_ ## Run every customer from your parent account Manage each sub-account in the dashboard, through the API, with the CLI or with the TypeScript and Go SDKs. ### Create, update and remove Create a sub-account for each new customer, update it as they grow, and remove it when they leave. [Learn more](https://ahasend.com/docs/api-reference/sub-accounts/create-sub-account) ### Pause and resume Pause sending for one customer and resume it when you are ready. [Learn more](https://ahasend.com/docs/api-reference/sub-accounts/suspend-sub-account) ### Monthly sending cap Set an optional monthly sending cap on each sub-account. A cap of 0 means no cap. [Learn more](https://ahasend.com/docs/api-reference/sub-accounts/update-sub-account) ### Scoped parent keys Give each parent API key only the sub-account scopes it needs, such as sub-accounts:usage to read usage and cost. [Learn more](https://ahasend.com/docs/api-reference/scopes) ### Dashboard and CLI Manage sub-accounts under Settings, Sub-accounts in the dashboard, or with the AhaSend CLI. [Learn more](https://ahasend.com/docs/cli/commands/subaccounts) ### TypeScript and Go SDKs Manage sub-accounts and read their usage from your own code with the TypeScript and Go SDKs. [Learn more](https://ahasend.com/docs/guides/nodejs-sdk) ## Plans and billing Sub-accounts come with Pro and Max. Support switches them on for your account. - Pro: up to 9 sub-accounts, from $10 (€9 / £8) a month - Max: no limit on sub-accounts, from $80 (€72 / £65) a month - No charge per sub-account [View pricing](https://ahasend.com/pricing) ### Billed to your parent account One bill for all the customers you send for. - One invoice for all your customers - Every sub-account's emails count on your plan - Message volume per sub-account for the billing period - Allocated cost per sub-account, to bill each customer back - Usage of removed sub-accounts kept as one total - An optional monthly sending cap on each sub-account - Usage and cost through the API, with a scoped key ## Your customers' email stays in Europe Message data is stored in the EU, in Germany and Finland, and AhaSend is ISO 27001 certified. If you process data for your own customers, our DPA makes AhaSend your sub-processor. - ISO 27001 certified - GDPR compliant - Hosted in Europe - CSA Certified Sender - [Security](https://ahasend.com/security) - [Read the DPA](https://ahasend.com/dpa) ## Questions about sub-accounts ### Which providers offer sub-accounts with per-tenant usage and cost data? AhaSend does. One API call returns the message volume and the allocated cost of each sub-account for the current billing period. Each sub-account's own statistics also show its delivered emails and its bounces. So you get a cost for each customer, and you can bill them back. ### Is the allocated cost what my customer would pay on their own? No. Allocated cost is the sub-account's share of your invoice, split by message volume. It is not what the customer would pay on a plan of its own. Usage from sub-accounts you removed this period shows as one total. ### Which plans include sub-accounts? Pro includes up to 9 sub-accounts, and Max has no limit. There is no charge per sub-account: the emails of all your sub-accounts count on your plan. See the plans on the [pricing page](https://ahasend.com/pricing). ### How do I switch on sub-accounts? Sub-accounts are available on every Pro and Max account. Email [support@ahasend.com](mailto:support@ahasend.com) or [sales@ahasend.com](mailto:sales@ahasend.com), and AhaSend switches them on for your account. You then find them under Settings, Sub-accounts in the dashboard. Read the story of the launch in [Introducing Sub Accounts](https://ahasend.com/blog/introducing-sub-accounts-early-access). ### Can I pause one customer without stopping the others? Yes. Pause a sub-account from your parent account, and resume it when you are ready. ### Does the DPA cover platforms that process data for their own customers? Yes. If you are a processor for your own customers, such as a software platform, agency, hosting provider or managed service provider, AhaSend acts as your sub-processor. Read the [data processing agreement](https://ahasend.com/dpa). ### Do you offer white-label DNS and dedicated IPs for platforms? Yes. Our page for [platform partners](https://ahasend.com/partners) covers white-label DNS, dedicated IPs and partner pricing. Still have questions? [Check our documentation](https://ahasend.com/docs) · [Contact support](https://ahasend.com/contact) ## Give every customer their own sub-account Start for free, then move to Pro or Max and ask support to switch on sub-accounts. - [Start for Free](https://dash.ahasend.com/user/register) - [Talk to an expert](https://ahasend.com/talk) _Sub-accounts come with Pro and Max_