JavaScript
const options = { method: 'DELETE', headers: {'x-api-key': '<x-api-key>', 'x-organization-id': '<x-organization-id>'} }; fetch('https://api.dcycle.io/v1/facilities/{facility_id}', options) .then(res => res.json()) .then(res => console.log(res)) .catch(err => console.error(err));
Remove a facility from your organization
enabled=false
DELETE_FACILITY
550e8400-e29b-41d4-a716-446655440000
curl -X DELETE "https://api.dcycle.io/v1/facilities/550e8400-e29b-41d4-a716-446655440000" \ -H "x-api-key: ${DCYCLE_API_KEY}" \ -H "x-organization-id: ${DCYCLE_ORG_ID}"
HTTP/1.1 204 No Content
{ "detail": "Facility doesn't belong to organization" }
{ "code": "NOT_FOUND", "detail": "Facility with id=UUID('...') not found" }
# Archive instead of delete response = requests.put( f"https://api.dcycle.io/v1/facilities/{facility_id}", headers=headers, json={"status": "archived"} )