Bin
Deleted items stay in the bin for the organisation's retention period and can be restored.
| Method | Path | Summary |
|---|---|---|
| POST | /api/v2/trash | Move items to the bin |
| GET | /api/v2/trash | List the bin |
| POST | /api/v2/trash/:id/restore | Restore an item from the bin |
| DELETE | /api/v2/trash/:id | Delete an item for good |
| DELETE | /api/v2/trash | Empty the bin |
#Move items to the bin
POST
/api/v2/trash- Address
https://<your-org>.brambleit.cloud/drive/api/v2/trash- Requires
- Signed-in session,
X-API-Key, or a Bramble app access token (Authorization: Bearer).
Licence: Drive.
Request body JSON
| Name | Type | Description |
|---|---|---|
ids | array of any | The items. |
Response 200
| Field | Type | Description |
|---|---|---|
ok | boolean |
Example response
JSON
{
"ok": true
}Example request
Bash
curl -X POST 'https://<your-org>.brambleit.cloud/drive/api/v2/trash' \
-H "X-API-Key: $BRAMBLE_KEY" \
-H "Content-Type: application/json" \
-d '{"ids":[]}'JavaScript
const res = await fetch('https://<your-org>.brambleit.cloud/drive/api/v2/trash', {
method: 'POST',
headers: { 'X-API-Key': process.env.BRAMBLE_KEY, 'Content-Type': 'application/json' },
body: JSON.stringify({"ids":[]}),
});
const data = await res.json();Python
import os, requests
r = requests.post(
"https://<your-org>.brambleit.cloud/drive/api/v2/trash",
headers={"X-API-Key": os.environ["BRAMBLE_KEY"]},
json={"ids":[]},
)
r.raise_for_status()
data = r.json()PowerShell
$headers = @{ 'X-API-Key' = $env:BRAMBLE_KEY }
$body = '{"ids":[]}'
Invoke-RestMethod -Method POST -Uri 'https://<your-org>.brambleit.cloud/drive/api/v2/trash' -Headers $headers -ContentType 'application/json' -Body $body#List the bin
GET
/api/v2/trash- Address
https://<your-org>.brambleit.cloud/drive/api/v2/trash- Requires
- Signed-in session,
X-API-Key, or a Bramble app access token (Authorization: Bearer).
Licence: Drive.
Query parameters
| Name | Type | Description |
|---|---|---|
site | integer |
Response 200
Example request
Bash
curl -X GET 'https://<your-org>.brambleit.cloud/drive/api/v2/trash' \
-H "X-API-Key: $BRAMBLE_KEY"JavaScript
const res = await fetch('https://<your-org>.brambleit.cloud/drive/api/v2/trash', {
method: 'GET',
headers: { 'X-API-Key': process.env.BRAMBLE_KEY },
});
const data = await res.json();Python
import os, requests
r = requests.get(
"https://<your-org>.brambleit.cloud/drive/api/v2/trash",
headers={"X-API-Key": os.environ["BRAMBLE_KEY"]},
)
r.raise_for_status()
data = r.json()PowerShell
$headers = @{ 'X-API-Key' = $env:BRAMBLE_KEY }
Invoke-RestMethod -Method GET -Uri 'https://<your-org>.brambleit.cloud/drive/api/v2/trash' -Headers $headers#Restore an item from the bin
POST
/api/v2/trash/:id/restore- Address
https://<your-org>.brambleit.cloud/drive/api/v2/trash/:id/restore- Requires
- Signed-in session,
X-API-Key, or a Bramble app access token (Authorization: Bearer).
Licence: Drive.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | number |
Response 200
Example request
Bash
curl -X POST 'https://<your-org>.brambleit.cloud/drive/api/v2/trash/12.5/restore' \
-H "X-API-Key: $BRAMBLE_KEY"JavaScript
const res = await fetch('https://<your-org>.brambleit.cloud/drive/api/v2/trash/12.5/restore', {
method: 'POST',
headers: { 'X-API-Key': process.env.BRAMBLE_KEY },
});
const data = await res.json();Python
import os, requests
r = requests.post(
"https://<your-org>.brambleit.cloud/drive/api/v2/trash/12.5/restore",
headers={"X-API-Key": os.environ["BRAMBLE_KEY"]},
)
r.raise_for_status()
data = r.json()PowerShell
$headers = @{ 'X-API-Key' = $env:BRAMBLE_KEY }
Invoke-RestMethod -Method POST -Uri 'https://<your-org>.brambleit.cloud/drive/api/v2/trash/12.5/restore' -Headers $headers#Delete an item for good
DELETE
/api/v2/trash/:id- Address
https://<your-org>.brambleit.cloud/drive/api/v2/trash/:id- Requires
- Signed-in session,
X-API-Key, or a Bramble app access token (Authorization: Bearer).
Licence: Drive.
Path parameters
| Name | Type | Description |
|---|---|---|
idrequired | number |
Response 200
| Field | Type | Description |
|---|---|---|
ok | boolean |
Example response
JSON
{
"ok": true
}Example request
Bash
curl -X DELETE 'https://<your-org>.brambleit.cloud/drive/api/v2/trash/12.5' \
-H "X-API-Key: $BRAMBLE_KEY"JavaScript
const res = await fetch('https://<your-org>.brambleit.cloud/drive/api/v2/trash/12.5', {
method: 'DELETE',
headers: { 'X-API-Key': process.env.BRAMBLE_KEY },
});
const data = await res.json();Python
import os, requests
r = requests.delete(
"https://<your-org>.brambleit.cloud/drive/api/v2/trash/12.5",
headers={"X-API-Key": os.environ["BRAMBLE_KEY"]},
)
r.raise_for_status()
data = r.json()PowerShell
$headers = @{ 'X-API-Key' = $env:BRAMBLE_KEY }
Invoke-RestMethod -Method DELETE -Uri 'https://<your-org>.brambleit.cloud/drive/api/v2/trash/12.5' -Headers $headers#Empty the bin
DELETE
/api/v2/trash- Address
https://<your-org>.brambleit.cloud/drive/api/v2/trash- Requires
- Signed-in session,
X-API-Key, or a Bramble app access token (Authorization: Bearer).
Licence: Drive.
Query parameters
| Name | Type | Description |
|---|---|---|
site | integer |
Response 200
| Field | Type | Description |
|---|---|---|
deleted | any |
Example response
JSON
{
"deleted": null
}Example request
Bash
curl -X DELETE 'https://<your-org>.brambleit.cloud/drive/api/v2/trash' \
-H "X-API-Key: $BRAMBLE_KEY"JavaScript
const res = await fetch('https://<your-org>.brambleit.cloud/drive/api/v2/trash', {
method: 'DELETE',
headers: { 'X-API-Key': process.env.BRAMBLE_KEY },
});
const data = await res.json();Python
import os, requests
r = requests.delete(
"https://<your-org>.brambleit.cloud/drive/api/v2/trash",
headers={"X-API-Key": os.environ["BRAMBLE_KEY"]},
)
r.raise_for_status()
data = r.json()PowerShell
$headers = @{ 'X-API-Key' = $env:BRAMBLE_KEY }
Invoke-RestMethod -Method DELETE -Uri 'https://<your-org>.brambleit.cloud/drive/api/v2/trash' -Headers $headersWas this page helpful?
Thanks for your feedback.