Delete items
delete_itemsDelete items of one kind into the 30-day recycle bin.
When to use:
The person has confirmed what should go (show it with list_items or get_items first).
When NOT to use:
Taking a screen out of a group: use update_items removeScreenIds.
Stopping a takeover: use end_takeover.
What to know:
restore_items undoes a delete within 30 days. A deleted playlist or schedule stops on every screen playing it; a deleted screen's device returns to pairing; a deleted location hands its content to its parent.
Refused: the root, a location with child locations, items shared to another workspace. Each id reports ok or its error. Needs the kind's delete permission.
Parameters:
kind and ids: every id must be of that kind.
permanent: true erases for good instead (recycle-bin kinds only). The first call deletes nothing and returns wouldErase and a confirmCode.
confirmCode: only with permanent:true; send the code from the first call, after the person says yes, with the same kind and ids. It lasts 10 minutes and fits only those ids; without permanent it is an error.
Example: {kind:"playlists", ids:["pl_8f2c"]}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ids | Yes | Item ids. | |
| kind | Yes | Kind of the ids. | |
| permanent | No | Erase for good. | |
| confirmCode | No | Code from the first call. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| kind | No | The kind that was acted on. | |
| next | No | Preview call: what to do next. | |
| erased | No | How many items were erased for good (0 on the first, preview call). | |
| failed | No | How many failed; the rest still ran. | |
| results | No | One row per id or item, in the order given. | |
| permanent | No | true for a permanent delete. | |
| succeeded | No | How many ids or items succeeded. | |
| wouldErase | No | Preview call: the items that would be erased. | |
| confirmCode | No | Preview call: send this on the second call, after the person says yes. |