Skip to content

Add a role to the team

Create a Role for work no seat on the chart covers, and seat an agent in it in two calls.

For developers

Create a Role for work no seat on the chart covers, and seat an Agent in it. Your agent first checks that no seat already answers to the name: a bookkeeper is the Finance Lead.

For developers

What you get

  • 1new seat with its job, duties and limits written downRole
  • 1agent in the seat, with its own name in your businessAgent
  • 1tools: only what its duties needPermission
  • 1questions come to you until a team lead takes themRole

Your agent does

Role.create → Role.staff
You, to your agent

Add a maintenance coordinator to the team.

I need someone to book repair vendors.

Create a new role for leasing.

# 1. Role.create
ROLE=$(curl -X POST https://api.sb/leaseline.app/roles \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Maintenance Coordinator","responsibilities":"Books a vendor for every repair request within one business day. Tells the resident the visit time."}' | jq -r '.role["$id"] | split("/") | last')

# 2. Role.staff
curl -X POST https://api.sb/leaseline.app/roles/$ROLE/staff \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"worker":"agent_maintenance_coordinator"}'
import { $ } from 'startup-builder'

const role = await $.Role.create({ name: 'Maintenance Coordinator', responsibilities: 'Books a vendor for every repair request within one business day. Tells the resident the visit time.' })
await $.Role.staff({ role: role.$id, worker: 'agent_maintenance_coordinator' })
ROLE=$(npx startup-builder do Role.create --json '{"name":"Maintenance Coordinator","responsibilities":"Books a vendor for every repair request within one business day. Tells the resident the visit time."}' | jq -r '.role["$id"] | split("/") | last')
npx startup-builder do Role.staff --json '{"role":"'"$ROLE"'","worker":"agent_maintenance_coordinator"}'
{
  "name": "do",
  "arguments": {
    "code": "const role = await $.Role.create({ name: 'Maintenance Coordinator', responsibilities: 'Books a vendor for every repair request within one business day. Tells the resident the visit time.' })\nreturn await $.Role.staff({ role: role.$id, worker: 'agent_maintenance_coordinator' })"
  }
}

Change it

  • Put it on the Operations Team.
  • Let it book repairs up to $300 without asking.
  • Have it escalate to the Operations Lead, not me.

Under the hood

Systems
Workforce, Work queue
Nouns
Role, Agent, Permission, Team
Events
Role.staffed

Write the contract before the seat opens: why it exists, the duties, the Metric that judges it and its Limits. Role contracts lists every part. A seat with no result Metric gives its Role Review nothing to read.