# Remove a teammate

URL: /agents/remove-a-teammate · Id: `guide:remove-a-teammate`

> Say "my contractor left, turn off their access" and get their seat emptied, its open work routed on, and their sign-in ended, with their history kept.

Take a person out of their [Role](/business/nouns/role) and end their access. The seat's open [Tasks](/business/nouns/task) go to the Role it escalates to until someone fills it, and everything they did stays on the record.

Needs: [Give a teammate access](/agents/give-a-teammate-access)

**Before it runs**

- You leave the chat: Never: it all happens in the chat.

## What you get
- 1 empty seat, its open work routed to the Role above it until someone fills it (Role)
- 1 sign-in and access ended, with their history kept (Worker)

## Your agent does
**For agents**

- Guide: `guide:remove-a-teammate`, status `live`. Page: [/agents/remove-a-teammate.md](/agents/remove-a-teammate.md).
- Approval: none. Run it when the founder asks.
- Leaves the chat: never.
- Needs first: [Give a teammate access](/agents/give-a-teammate-access).
- Run: call the steps in order, each through the API, SDK, CLI or MCP tab below; a later step passes the `$id` an earlier one returns. Each value marked example is the sample business’s: pass the founder’s own.

| Step | Verb | Inputs (type, required, this guide’s value) | Returns |
| --- | --- | --- | --- |
| 1 | [`Role.vacate`](/business/nouns/role/vacate) (`verb:Role.vacate`) | `role` Role (an id), required: example `"engineering-lead"`; `reason` text: example `"Sam left the business."` | `role` Role |
| 2 | [`Worker.delete`](/business/nouns/worker/delete) (`verb:Worker.delete`) | `id` string, required: the `$id` of the first Worker `Worker.list` returns for `where: name = Sam` | `worker` Worker |

Returns: the last call answers with `worker` and its `action`, whose `status` is `done`, `pending` (waiting on an Approval or a Worker), `failed`, `canceled` or `refused`:

```json
{
  "api": "https://api.sb/leaseline.app",
  "worker": {
    "$id": "https://api.sb/leaseline.app/workers/worker_1",
    "$type": "Worker"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/action_1",
    "operation": "Worker.delete",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/action_1"
  }
}
```

Next: offer “Hand the seat back to its agent”, or “Invite someone else to the seat”.

Calls: `Role.vacate` → `Worker.delete`

Ask:

```text
Remove a teammate.
Sam left, turn off their access.
Take my contractor off the business.
```

API:

```bash
# 1. Role.vacate
curl -X POST https://api.sb/leaseline.app/roles/engineering-lead/vacate \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"reason":"Sam left the business."}'

# Look up the Worker: Worker.list
ID=$(curl "https://api.sb/leaseline.app/workers?where=name%20%3D%20Sam&limit=1" \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" | jq -r '.workers[0]["$id"] | split("/") | last')

# 2. Worker.delete
curl -X DELETE https://api.sb/leaseline.app/workers/$ID \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
```

SDK:

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

await $.Role.vacate({ role: 'engineering-lead', reason: 'Sam left the business.' })
const [id] = await $.Worker.list({ where: 'name = Sam', limit: 1 })
await $.Worker.delete({ id: id.$id })
```

CLI:

```bash
npx startup-builder do Role.vacate --json '{"role":"engineering-lead","reason":"Sam left the business."}'
ID=$(npx startup-builder do Worker.list --json '{"where":"name = Sam","limit":1}' | jq -r '.workers[0]["$id"] | split("/") | last')
npx startup-builder do Worker.delete --json '{"id":"'"$ID"'"}'
```

MCP:

```json
{
  "name": "do",
  "arguments": {
    "code": "await $.Role.vacate({ role: 'engineering-lead', reason: 'Sam left the business.' })\nconst [id] = await $.Worker.list({ where: 'name = Sam', limit: 1 })\nreturn await $.Worker.delete({ id: id.$id })"
  }
}
```

## Change it
- Hand the seat back to its agent.
- Invite someone else to the seat.

## Under the hood
- Systems: [Workforce](/systems/workforce)
- Nouns: [Role](/business/nouns/role), [Worker](/business/nouns/worker), [Access Level](/business/nouns/access-level)
- Events: [`Role.vacated`](/business/events/Role.vacated)

[`Role.vacate`](/business/nouns/role/vacate) empties the seat and keeps its contract, [Processes](/business/nouns/process) and [Mailbox](/business/nouns/mailbox) for the next [Worker](/business/nouns/worker). Deleting the Worker ends the [Access Level](/business/nouns/access-level) it held.