-
Notifications
You must be signed in to change notification settings - Fork 7
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 } |
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.
- Users can only manipulate data for accounts tied to their own ID, unless they have the admin user role.
- Cannot restore an account.
Request formats | JSON |
Requires authentication? | Yes |
curl -X DELETE \
http://localhost:3000/accounts/6 \
-H 'Authorization: Bearer 123testtoken123' \
-H 'Host: localhost:3000'
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
}