Skip to content

Collection routes: update, delete

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

Reference for Collection, one group of Collection routes.

Collection.update

Changes the given properties of a Collection. Verb page.

Text
PATCH /{namespace}/collections/{id}

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

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Collection.
typelist of NounThe Nouns this Thing is an instance of.
outsidejsonThe ids this Thing has in outside tools, one per Integration, so a re-run matches instead of duplicating.
queryjsonThe saved query that defines a dynamic Collection.

Returns

OutputTypeRequiredDescription
collectionCollectionrequiredThe Collection.

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/collections/collection_txTK8QorKn \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"query":{}}'
JSON
{
  "api": "https://api.sb/leaseline.app",
  "collection": {
    "$id": "https://api.sb/leaseline.app/collections/collection_txTK8QorKn",
    "$type": "Collection",
    "id": "Example id",
    "type": [
      "noun_v0akLUrXCN"
    ],
    "query": {}
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Collection.update",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}

Collection.delete

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

Text
DELETE /{namespace}/collections/{id}

Path: id. Emits Collection.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Collection.

Returns

OutputTypeRequiredDescription
collectionCollectionrequiredThe Collection.

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/collections/collection_txTK8QorKn \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
JSON
{
  "api": "https://api.sb/leaseline.app",
  "collection": {
    "$id": "https://api.sb/leaseline.app/collections/collection_txTK8QorKn",
    "$type": "Collection",
    "id": "Example id",
    "type": [
      "noun_v0akLUrXCN"
    ]
  },
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/act_br07HsG8MG",
    "operation": "Collection.delete",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/leaseline.app/actions/act_br07HsG8MG"
  }
}