Skip to content

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.

For developers

Take a person out of their Role and end their access. The seat's open Tasks go to the Role it escalates to until someone fills it, and everything they did stays on the record.

For developers

Needs Give a teammate access

What you get

  • 1empty seat, its open work routed to the Role above it until someone fills itRole
  • 1sign-in and access ended, with their history keptWorker

Your agent does

Role.vacate → Worker.delete
You, to your agent

Remove a teammate.

Sam left, turn off their access.

Take my contractor off the business.

# 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"
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 })
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"'"}'
{
  "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
Nouns
Role, Worker, Access Level
Events
Role.vacated

Role.vacate empties the seat and keeps its contract, Processes and Mailbox for the next Worker. Deleting the Worker ends the Access Level it held.