# A space for every customer

Their domains, their connected inboxes, and every thread that went through them — filed under the customer they belong to, and never visible across.

[Get started](/signup)
[Documentation](https://docs.aiinbx.com/guides/spaces)

One wildcard domain, one API key and one webhook endpoint on your side. A space per customer on theirs, holding whatever they send and receive on.

The wall

## One of your customers emails another

The case that quietly breaks an inbox keyed on the message alone: one side gets the copy, the other gets nothing.

Your customer Harbourly's tom@harbourly.com emails jana@rheinbau.de at your customer Rheinbau. The one message is filed twice: in Harbourly's space as email.sent on a thread of its own, and in Rheinbau's space as email.received on a thread of its own. Tom sees what he sent, Jana sees what arrived, and neither thread ever looks across.

The split

## Theirs to set, yours to hold

A customer can have their own sending hours, their own caps and their own opt-out list. What they never get is a key — you front the API for them, and one credential of yours reaches every space.

In a customer's space (1,248 of them):

-   Domains and subdomains: Yours handed out, or one they own

-   Connected inboxes: The Gmail or Outlook account they work in

-   Every thread and email: Whatever went through those addresses

-   Pacing rules: Their own hours and caps, set from your product

-   Suppression lists: Somebody who left them has not left you

At your workspace (One of it):

-   API keys: One credential, every space — never handed out

-   Webhook endpoints: One URL, every space's events, each stamped

-   The wildcard domain: Verified once; every subdomain under it is free

-   Account-wide rules: Your ceiling holds over whatever a customer sets

-   Members and billing: Your team, one invoice, however many customers

In the console

## Every customer, and what their mail is doing

The console's spaces page lists one space per customer, with the id your own system knows them by (cus\_…), their domains, how many mailboxes and threads they have and their last activity, searchable by name or by that id.

Pick one and the whole console narrows to it — threads, domains, metrics, pacing. A support ticket is answered inside the customer it is about, with nobody else’s mail on the screen.

In your code

## One key, however many customers

Hold the spc\_… against your customer record, or find it later by the external\_id you set. Every object and every event carries it.

Step 1, spaces.create: once, when a customer signs up.

```
const space = await aiinbx.spaces.create({
  name: customer.name,
  external_id: customer.id, // your own id, unique here
})

// A subdomain of your wildcard — no DNS, verified already
await aiinbx.domains.create({
  name: `${customer.slug}.northwind.io`,
  space_id: space.id,
})
```

Step 2, emails.send: the same call you already write.

```
const email = await aiinbx.emails.send({
  from: "assistant@harbourly.northwind.io",
  to: lead.email,
  subject: "Following up",
  text: draft,
})

email.space_id // "spc_7k2m" — the from address said so
```

Step 3, email.received: one endpoint, every customer's mail.

```
if (event.type === "email.received") {
  const customer = await customerBySpace(event.space_id)

  await queueReply(customer, event.data.thread_id)
}
```

## Give your product an inbox. The hard parts are already handled.

[Get started](/signup)
