Skip to content

Keyword routes: update, delete

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

Reference for Keyword, one group of Keyword routes.

Keyword.update

Changes the given properties of a Keyword. Verb page.

Text
PATCH /{namespace}/keywords/{id}

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

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Keyword.
phrasestringThe words searched or asked.
formstringOne of search or question.

Returns

OutputTypeRequiredDescription
keywordKeywordrequiredThe Keyword.

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/keywords/keyword_cEoeFM4Drs \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"form":"search"}'
JSON
{
  "api": "https://api.sb/leaseline.app",
  "keyword": {
    "$id": "https://api.sb/leaseline.app/keywords/keyword_cEoeFM4Drs",
    "$type": "Keyword",
    "phrase": "Example phrase",
    "form": "search"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Keyword.update",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}

Keyword.delete

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

Text
DELETE /{namespace}/keywords/{id}

Path: id. Emits Keyword.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Keyword.

Returns

OutputTypeRequiredDescription
keywordKeywordrequiredThe Keyword.

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/keywords/keyword_cEoeFM4Drs \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
JSON
{
  "api": "https://api.sb/leaseline.app",
  "keyword": {
    "$id": "https://api.sb/leaseline.app/keywords/keyword_cEoeFM4Drs",
    "$type": "Keyword",
    "phrase": "Example phrase"
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Keyword.delete",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}