Skip to content

delete accounts id

Harmun edited this page May 16, 2019 · 1 revision

delete /accounts/:id Admin/User Soft delete an account specified by id None { id, name, owner, deletedAt, lastUpdated, balance }

DELETE accounts/:id

Soft deletes an account specified by id. Their data is still kept in the database.

To restore a user, an admin can use the PUT user/:id endpoint.

Restrictions

  • Users can only manipulate data for accounts tied to their own ID, unless they have the admin user role.
  • Cannot restore an account.

Resource Information

Request formats JSON
Requires authentication? Yes

Example Request

curl -X DELETE \
  http://localhost:3000/accounts/6 \
  -H 'Authorization: Bearer 123testtoken123' \
  -H 'Host: localhost:3000'

Example Response

After you delete an account you'll get back the soft-deleted account's information like this:

{
    "id": 6,
    "name": "asgardAccount",
    "owner": 8,
    "deletedAt": "2019-05-16T10:36:00.000Z",
    "lastUpdated": "2019-05-16T09:40:03.000Z",
    "balance": 5000
}