Skip to content

Noun routes: update, delete

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

Reference for Noun, one group of Noun routes.

Noun.update

Changes the given properties of a Noun. Verb page.

Text
PATCH /{namespace}/nouns/{id}

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

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Noun.
namestringThe singular, capitalized name.
propertiesjsonIts properties, each with a name, a type, and whether it is required.
publishedInVersionThe first published Version that serves it; from then on, edits go through a Change and delete refuses.

Returns

OutputTypeRequiredDescription
nounNounrequiredThe Noun.

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

Noun.delete

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

Text
DELETE /{namespace}/nouns/{id}

Path: id. Emits Noun.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Noun.

Returns

OutputTypeRequiredDescription
nounNounrequiredThe Noun.

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