Skip to content

Role routes: update, delete

The Role Verbs update, delete as api.sb routes, with inputs, result, refusals and an example.

Reference for Role, one group of Role routes.

Role.update

Changes the given properties of a Role. Verb page.

Text
PATCH /{namespace}/roles/{id}

Path: id. Body, as JSON: the other inputs. Emits Role.updated.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Role.
namestringThe title of the seat.
responsibilitiestextThe work the seat owns.
approvalsjsonWhat waits for the founder: rules by action class (spend, sign, publish, price, send), each optionally above an amount in USD.

Returns

OutputTypeRequiredDescription
roleRolerequiredThe Role.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

Terminal
curl -X PATCH https://api.sb/leaseline.app/roles/role_oloMFMUeCH \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Leaseline"}'
JSON
{
  "api": "https://api.sb/leaseline.app",
  "role": {
    "$id": "https://api.sb/leaseline.app/roles/role_oloMFMUeCH",
    "$type": "Role",
    "name": "Leaseline",
    "status": "filled"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Role.update",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}

Role.delete

Deletes a Role: a soft delete that keeps its history, undone by Thing.restore. Verb page.

Text
DELETE /{namespace}/roles/{id}

Path: id. Emits Role.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Role.

Returns

OutputTypeRequiredDescription
roleRolerequiredThe Role.

Refuses when

CheckErrorFixThen call
The key is valid, but its scopes do not allow this operation.forbiddenUse a key whose scopes cover the operation, or ask an owner of the namespace to grant them.None.

Example

Terminal
curl -X DELETE https://api.sb/leaseline.app/roles/role_oloMFMUeCH \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
JSON
{
  "api": "https://api.sb/leaseline.app",
  "role": {
    "$id": "https://api.sb/leaseline.app/roles/role_oloMFMUeCH",
    "$type": "Role",
    "name": "Success Manager",
    "status": "filled"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Role.delete",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}