# Sandbox API refuses DELETE method

**URL:** <https://forums.suse.com/t/sandbox-api-refuses-delete-method/5439>\
**Category:** Rancher 1.x\
**Created:** [February 7, 2017, 1:24pm UTC](https://forums.suse.com/t/sandbox-api-refuses-delete-method/5439 "2017-02-07T13:24:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lalyos](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/lalyos/32/3581_2.png) [@lalyos](https://forums.suse.com/u/lalyos)\
**Post date:** [February 7, 2017, 1:24pm UTC](https://forums.suse.com/t/sandbox-api-refuses-delete-method/5439/1 "2017-02-07T13:24:54Z")

</div>

I’m trying to use the sandbox. First I 've added a couple of AWS hosts, and than later at cleanup, i tried to use the API:

```auto
curl -u "${CATTLE_ACCESS_KEY}:${CATTLE_SECRET_KEY}" \
  -X DELETE \
  -H 'Accept: application/json' \
    'https://try.rancher.com/v2-beta/projects/1a12345/hosts/1h123'

{
  "id": "e6d36e9e-0ff8-42f7-a58b-06e56dc56c18",
  "type": "error",
  "links": {},
  "actions": {},
  "status": 405,
  "code": "Method not allowed",
  "message": "Method not allowed",
  "detail": null,
  "baseType": "error"
}

```

---

<div class="post-metadata">

**Author:** ![vincent](https://sea2.discourse-cdn.com/flex022/user_avatar/forums.suse.com/vincent/32/7156_2.png) [@vincent](https://forums.suse.com/u/vincent)\
**Post date:** [February 7, 2017, 3:45pm UTC](https://forums.suse.com/t/sandbox-api-refuses-delete-method/5439/2 "2017-02-07T15:45:13Z")

</div>

Hosts have to be in `inactive` state (via the `deactivate` action) before they can be deleted.
