From 7df83f184501c1af5ac79f70b742473a6ee02050 Mon Sep 17 00:00:00 2001 From: Waldir Pimenta Date: Tue, 15 Jun 2021 17:31:38 +0100 Subject: [PATCH] Document functionality to delete accounts --- _accounts.md | 34 ++++++++++++++++++++++++++++++++++ _totp.md | 3 ++- 2 files changed, 36 insertions(+), 1 deletion(-) diff --git a/_accounts.md b/_accounts.md index 37eac4c..e72c543 100644 --- a/_accounts.md +++ b/_accounts.md @@ -111,3 +111,37 @@ Retrieves the details about a specific account. ### Response Returns a fully formed [Account Object](#account-object) representing the requested account. + +## Remove Account + +```bash +curl https://api.uphold.com/v0/me/accounts/18843b6d-5a43-480f-8e2b-73b27d726bf0 \ + -X DELETE + -H "Authorization: Bearer " +``` + +> The above command returns a response with no body, and HTTP status code `204` +([No Content](https://datatracker.ietf.org/doc/html/rfc7231#section-6.3.5)). + +Deletes a specific account. + +### Request + +`DELETE https://api.uphold.com/v0/me/accounts/:id` + + + + +### Response + +In case of success, returns a response with no body and an HTTP status code of `204` +([No Content](https://datatracker.ietf.org/doc/html/rfc7231#section-6.3.5)). + +If the account doesn't exist under the authorization-granting user, returns a 404 HTTP error. + +If the token lacks the `accounts:write` scope, returns a 404 HTTP error +with the JSON body `{ "error": "invalid_scope" }`. diff --git a/_totp.md b/_totp.md index bf7816b..7752a24 100644 --- a/_totp.md +++ b/_totp.md @@ -137,4 +137,5 @@ curl https://api.uphold.com/v0/me/authentication_methods/3f8f8264-2f5e-4b2b-8333 ### Response -Returns an HTTP status code of 204 and no JSON body, in case of success. +Returns an HTTP status code of `204` ([No Content](https://datatracker.ietf.org/doc/html/rfc7231#section-6.3.5)) +and no JSON body, in case of success.