Delete an Object

To remove an object permanently from a container, send a DELETE request to the object.

  1. To send REST API calls to Object Storage Classic, you need a valid authentication token. If you obtained a token less than 30 minutes ago, then you can use that token. Otherwise, get a new token as described in Get an Authentication Token.
  2. Send a DELETE request to the object. Specify the authentication token in the x-auth-token header.

    Syntax

    curl -X DELETE \
      {accountRestEndpointURL}/{containerName}/{objectName} \
      -H 'x-auth-token: {authToken}'

    Sample Command

    curl -X DELETE \
      https://myaccount.ocm.rack01.example.com/v1/Storage-myaccount/mycontainer/myobject \
      -H 'x-auth-token: AUTH_tk10d7cf10041726fa2e64652d975bbab0'
  3. In the response, look for 204 No Content.
    HTTP/1.1 204 No Content
    Server: nginx/1.10.2
    Date: Thu, 02 Aug 2018 23:05:55 GMT
    Content-Type: text/plain;charset=UTF-8
    Connection: close
    X-Timestamp: 1533169820576
    X-Last-Modified-Timestamp: 1533251155.84714
    X-Trans-Id: tx803bcd4e5535450b93f79-005b638e53g