Skip to content

Verb routes: update, delete

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

Reference for Verb, one group of Verb routes.

Verb.update

Changes the given properties of a Verb. Verb page.

Text
PATCH /{namespace}/verbs/{id}

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

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Verb.
namestringThe camelCase action form.
eventstringThe event the Verb emits.
publishedInVersionThe first published Version that serves it; from then on, edits go through a Change and delete refuses.

Returns

OutputTypeRequiredDescription
verbVerbrequiredThe Verb.

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/verbs/verb_hlkWBvrAyZ \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"name":"Leaseline"}'
JSON
{
  "api": "https://api.sb/leaseline.app",
  "verb": {
    "$id": "https://api.sb/leaseline.app/verbs/verb_hlkWBvrAyZ",
    "$type": "Verb",
    "name": "Leaseline",
    "event": "Example event",
    "status": "draft"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Verb.update",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}

Verb.delete

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

Text
DELETE /{namespace}/verbs/{id}

Path: id. Emits Verb.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Verb.

Returns

OutputTypeRequiredDescription
verbVerbrequiredThe Verb.

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/verbs/verb_hlkWBvrAyZ \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
JSON
{
  "api": "https://api.sb/leaseline.app",
  "verb": {
    "$id": "https://api.sb/leaseline.app/verbs/verb_hlkWBvrAyZ",
    "$type": "Verb",
    "name": "Leaseline",
    "event": "Example event",
    "status": "draft"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Verb.delete",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}