# requestSetup

URL: /business/nouns/tenant/request-setup · Id: `verb:Tenant.requestSetup` · Call: `await $.Tenant.requestSetup({ … })` (SDK) or the `do` tool at `https://api.sb/mcp`. Inputs says what to pass, Outputs what returns, When it waits who approves.

> RequestSetup sends a Customer’s admin a link to connect their own sign-in, directory or verified domain to the Tenant.

RequestSetup sends a [Customer](/business/nouns/customer)’s admin a link to connect their own sign-in, directory or verified domain to the [Tenant](/business/nouns/tenant).

## Inputs
| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `tenant` | [Tenant](/business/nouns/tenant) | Yes | The Tenant to set up. |
| `admin` | [Person](/business/nouns/person) | Yes | The Customer’s admin who receives the link. |
| `intent` | `string` | Yes | What the link sets up. |

## Outputs
| Output | Type | Required | Description |
| --- | --- | --- | --- |
| `link` | `url` | Yes | The single-use setup link, valid for 7 days. |
| `tenant` | [Tenant](/business/nouns/tenant) | Yes | The Tenant being set up. |

## Effects
- Emits [`Tenant.setupRequested`](/business/events/Tenant.setupRequested).
- Performed by the [Security Engineer](/agents/engineering/security-engineer).
- Two-way: it runs at once, in the `try`, `send` and `do` modes.
- Sends the link to the admin; it sets up only what it names.

## Refuses when
| Check | Error | Fix | Then call |
| --- | --- | --- | --- |
| The key is valid, but its scopes do not allow this operation. | [`forbidden`](/code/api/errors/forbidden) | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | [Tenant.requestSetup](/business/nouns/tenant/request-setup) |

## When it waits
| Gate | Default |
| --- | --- |
| Decision class | Low: two-way, nothing at stake |
| [Delay window](/systems/trust-and-governance/controls/one-way-windows) | None: it runs once review passes. |
| Limit | The call [Limit](/business/nouns/limit) of the [Permission](/business/nouns/permission) it runs under. |
| Over the Limit | It waits `pending` for an [Approval](/business/nouns/approval) from the [Founder](/agents/founding/founder). Approved, it runs; refused, it ends `refused` with [`limit-exceeded`](/code/api/errors/limit-exceeded); unanswered by its deadline, it ends `canceled`. |

## Example

**Ask**

```text
Request setup the latest tenant with a person.
```

**API**

```bash
curl -X POST https://api.sb/tutorloop.com/tenants/tenant_1/requestSetup \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"admin":"person_1","intent":"sso"}'
```

```json
{
  "api": "https://api.sb/tutorloop.com",
  "link": "https://tutorloop.com",
  "tenant": {
    "$id": "https://api.sb/tutorloop.com/tenants/tenant_1",
    "$type": "Tenant",
    "placement": "path",
    "apiVersion": "v2"
  },
  "action": {
    "$id": "https://api.sb/tutorloop.com/actions/action_1",
    "operation": "Tenant.requestSetup",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/tutorloop.com/actions/action_1"
  }
}
```

**SDK**

```ts
import { $ } from 'startup-builder'

const { link, tenant } = await $.Tenant.requestSetup({ tenant: 'tenant_1', admin: 'person_1', intent: 'sso' })
```

**CLI**

```bash
npx startup-builder do Tenant.requestSetup --json '{"tenant":"tenant_1","admin":"person_1","intent":"sso"}'
```

**MCP**

```json
{
  "name": "do",
  "arguments": {
    "code": "return await $.Tenant.requestSetup({ tenant: 'tenant_1', admin: 'person_1', intent: 'sso' })"
  }
}
```

Next: [`SSOConnection.activate`](/business/nouns/sso-connection/activate) (in `guide:set-up-sso-for-a-customer`).

Guides that call it: [Set up SSO for a customer](/products/app/set-up-sso-for-a-customer).