Skip to content

DELETE = Delete

The DELETE method is used to delete a resource (and if applicable, all its child related resources)

In this example, we will delete a Site. This action will also delete all of its Locations and anything related to those Locations (Answers, Photos, etc)

Delete is Forever!

Be careful with this one. There is no "are you sure" or "confirm here" when making changes through the API.

This includes cascaded deletions (child resources like deleting Photos when a Location is deleted)

Delete the Site with ID 1701
curl -s -X DELETE \
    -H "Authorization: Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" \
    https://deploy.c1engineering.com/api/projects/sites/1701/
Delete the Site with ID 1701
Invoke-RestMethod `
    -Method 'Delete' `
    -Headers @{Authorization="Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"} `
    -Uri https://deploy.c1engineering.com/api/projects/sites/1701/
Delete the Site with ID 1701
import requests

response = requests.delete(
    'https://deploy.c1engineering.com/api/projects/sites/1701/',
    headers={
        'Authorization':
        'Token xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
    },
)