setCapacity
SetCapacity sets the most work a Service holds in flight, in the unit its intake counts.
curl -X POST https: //api.sb/ catalogmend.com/ services/ service_Eq1ssq4AOW/ open \
-H "Authorization: Bearer $SB_TOKEN"
API reference
Service.openIts NounsServicenpx startup-builder do Service.open --data '{"service": "service_Eq1ssq4AOW"}'
CLI reference
Service.openIts NounsService{
"name": "do",
"arguments": {
"code": "return await $.Service.open({ service: 'service_Eq1ssq4AOW' })"
}
}
MCP reference
Service.openIts NounsServiceimport { $ } from 'startup-builder'
const service = await $.Service.open({ service: 'service_Eq1ssq4AOW' })
SDK reference
Service.openIts NounsServicecurl -X POST https: //api.sb/ catalogmend.com/ services/ service_Eq1ssq4AOW/ open \
-H "Authorization: Bearer $SB_TOKEN"
API reference
Service.openIts NounsServicenpx startup-builder do Service.open --data '{"service": "service_Eq1ssq4AOW"}'
CLI reference
Service.openIts NounsService{
"name": "do",
"arguments": {
"code": "return await $.Service.open({ service: 'service_Eq1ssq4AOW' })"
}
}
MCP reference
Service.openIts NounsServiceimport { $ } from 'startup-builder'
const service = await $.Service.open({ service: 'service_Eq1ssq4AOW' })
SDK reference
Service.openIts NounsServiceInputs
| Input | Type | Required | Description |
|---|---|---|---|
service | Service | required | The Service. |
capacity | integer | required | The most work in flight, in the intake’s unit, such as listings. |
Outputs
| Output | Type | Required | Description |
|---|---|---|---|
service | Service | required | The Service with its new capacity. |
Effects
| Fact | Value |
|---|---|
| Action class | None: no approval rule names it, so it runs within its seat's Permissions and Limits |
| Stakes | The Startup's own records only |
| Door | Two-way: it runs at once |
| Modes | try previews it and stores nothing; send returns a pending Action; do (default) waits for the result |
| Idempotent | Only with a key: a repeat with the same Idempotency-Key and input returns the first Action, the same key with other input is refused with 409, and a repeat without a key runs again |
| Undo | Action.undo reverses it |
| Emits | Service.capacitySet |
| Performed by | The Delivery Manager |
- An Order past capacity is offered the next open slot instead of a start now.
Refuses when
| Check | Error | Fix | Then call |
|---|---|---|---|
| The key is valid, but its scopes do not allow this operation | forbidden | Use a key whose scopes cover the operation, or ask an owner of the namespace to grant them. | None. |
service is missing, or is not a service | invalid-input | Send service as a service, then call it again. | None. |
capacity is missing, or is not a integer | invalid-input | Send capacity as a integer, then call it again. | None. |
The Idempotency-Key was sent before with another operation or other input | idempotency-mismatch | Send a new key for new input; reuse a key only to retry the same request. | None. |
When it waits
| Gate | Default |
|---|---|
| Decision class | Low: two-way, no delay window |
| Delay window | None: it runs once review passes. |
| Limit | The call Limit of the Permission it runs under. |
| Over the Limit | It waits pending for an Approval, which a Human answers: the owner of record, or a Human they named to approve for the Founder seat. Approved, it runs; refused, it ends refused with limit-exceeded; unanswered by its deadline, it ends canceled. |
Example
You, to your agent
Set capacity the service “Catalog audit”.
curl -X POST https: //api.sb/ catalogmend.com/ services/ service_Eq1ssq4AOW/ setCapacity \
-H "Authorization: Bearer $SB_TOKEN" \
-H "Content-Type: application/ json" \
-d '{"capacity": 1}'
npx startup-builder do Service.setCapacity --data '{"service": "service_Eq1ssq4AOW", "capacity": 1}'
{
"name": "do",
"arguments": {
"code": "return await $.Service.setCapacity({ service: 'service_Eq1ssq4AOW', capacity: 1 })"
}
}
import { $ } from 'startup-builder'
const service = await $.Service.setCapacity({ service: 'service_Eq1ssq4AOW', capacity: 1 })
To retry, send the same Idempotency-Key: the retry returns the first Action and runs nothing twice. A new key runs the call again.