Delete
A delete endpoint is a write that removes a record from one collection, found by its id. It is the simplest endpoint: a collection and a permission. It is the datahoster-endpoint-delete.json file in an endpoint folder; its presence makes that endpoint answer a DELETE that removes a record.
{
"datahoster-endpoint-delete-collection": "messages",
"datahoster-endpoint-delete-public": false,
"datahoster-endpoint-delete-users": ["you"]
}
you may delete a message by id.Contents
The file is one JSON object; its keys are fixed names starting with datahoster-endpoint-delete-. The example above, in a remove/ endpoint, lets you remove a message.
| Name | Type | Description |
|---|---|---|
datahoster-endpoint-delete-collection | text | The collection a record is removed from. Required. |
datahoster-endpoint-delete-public | boolean | Whether anyone may call it, with no token. Defaults to false. |
datahoster-endpoint-delete-users | array | The users who may call it, each proving a token. Defaults to []. |
HTTP request
DELETE the endpoint's path, at <domain>/<endpoint>, with the record's id as a query parameter. If the endpoint is not public, send the user's token as a bearer token. A request that is not allowed — no token where one is needed, a wrong token, or a user this endpoint does not list — gets the same 404 as a path with no endpoint.
DELETE https://api.example.com/remove?id=9f86d081884c7d659a2feaa0c55ad015
Authorization: Bearer k7Qw2f9xJ4mB6pR8tZ1nD3sV5hL0aYc
id.| Status | Meaning |
|---|---|
204 | The record was removed. The response has no body. |
400 | The id is missing or malformed. |
404 | No delete endpoint answers on this path, no record has that id, or the caller is not allowed it — a missing token, an invalid one, or a user the endpoint does not list. These are indistinguishable, so a probe cannot tell the endpoint is there. |