Skip to content

Dataset routes: update, delete

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

Reference for Dataset, one group of Dataset routes.

Dataset.update

Changes the given properties of a Dataset. Verb page.

Text
PATCH /{namespace}/datasets/{id}

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

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Dataset.
namestringThe name of the Product.
promisetextWhat the Customer can rely on.
recordsintegerHow many Things it holds.
refreshedAtdatetimeWhen its Sources were last read.

Returns

OutputTypeRequiredDescription
datasetDatasetrequiredThe Dataset.

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/ratebook.dev/datasets/dataset_UDQXk0KsJB \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"records":1}'
JSON
{
  "api": "https://api.sb/ratebook.dev",
  "dataset": {
    "$id": "https://api.sb/ratebook.dev/datasets/dataset_UDQXk0KsJB",
    "$type": "Dataset",
    "name": "Ratebook",
    "promise": "A rate for any US address in under 100 milliseconds.",
    "status": "draft",
    "records": 1
  },
  "action": {
    "$id": "https://api.sb/ratebook.dev/actions/act_M5LgINdysq",
    "operation": "Dataset.update",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/ratebook.dev/actions/act_M5LgINdysq"
  }
}

Dataset.delete

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

Text
DELETE /{namespace}/datasets/{id}

Path: id. Emits Dataset.deleted.

Inputs

InputTypeRequiredDescription
idstringrequiredThe id of the Dataset.

Returns

OutputTypeRequiredDescription
datasetDatasetrequiredThe Dataset.

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/ratebook.dev/datasets/dataset_UDQXk0KsJB \
  -H "Authorization: Bearer $STARTUP_BUILDER_API_KEY"
JSON
{
  "api": "https://api.sb/ratebook.dev",
  "dataset": {
    "$id": "https://api.sb/ratebook.dev/datasets/dataset_UDQXk0KsJB",
    "$type": "Dataset",
    "name": "Ratebook",
    "promise": "A rate for any US address in under 100 milliseconds.",
    "status": "draft"
  },
  "action": {
    "$id": "https://api.sb/ratebook.dev/actions/act_M5LgINdysq",
    "operation": "Dataset.delete",
    "status": "done"
  },
  "links": {
    "self": "https://api.sb/ratebook.dev/actions/act_M5LgINdysq"
  }
}