Skip to content

Setting routes: update, delete

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

Reference for Setting, one group of Setting routes.

Setting.update

Changes the given properties of a Setting. Verb page.

Text
PATCH /{namespace}/settings/{id}

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

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Setting.
keystringThe name of the choice.
valuejsonThe chosen value.
lockedbooleanTrue when no holder below may override it.

Returns

OutputTypeRequiredDescription
settingSettingrequiredThe Setting.

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/settings/setting_mfZPXxFQYD \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"value":{}}'
JSON
{
  "api": "https://api.sb/leaseline.app",
  "setting": {
    "$id": "https://api.sb/leaseline.app/settings/setting_mfZPXxFQYD",
    "$type": "Setting",
    "key": "Example key",
    "value": {}
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Setting.update",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}

Setting.delete

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

Text
DELETE /{namespace}/settings/{id}

Path: id. Emits Setting.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Setting.

Returns

OutputTypeRequiredDescription
settingSettingrequiredThe Setting.

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/settings/setting_mfZPXxFQYD \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
JSON
{
  "api": "https://api.sb/leaseline.app",
  "setting": {
    "$id": "https://api.sb/leaseline.app/settings/setting_mfZPXxFQYD",
    "$type": "Setting",
    "key": "Example key",
    "value": {}
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Setting.delete",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}