Skip to content

Commit cd00ec2

Browse files
astevensnmelehan
authored andcommitted
Add /account/cancel endpoint (#306)
* Add /account/cancel endpoint This endpoint cancels an account. The only request body parameter is the `comments` field, which I've suggested is a place for the user to return the reason for the cancellation / any other feedback. * Fixed x-linode-cli-command * Added statement to clarify that cancel action Added a statement to ensure users are aware that this action will cause Linode to charge the credit card on file for the remaining balance. * Updated endpoint and comment param descriptions. Tried to make it more clear that Linode will not be able to proceed with the account cancellation if they are unable to charge a credit card. Made the `comment` param a bit more open ended while still encouraging feedback by changing `the reason` to `any reason`. * Changed exit survey link to dummy link This is to prevent a customer from sending bogus survey results.
1 parent fdb6a9f commit cd00ec2

File tree

1 file changed

+83
-0
lines changed

1 file changed

+83
-0
lines changed

openapi.yaml

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,89 @@ paths:
396396
linode-cli account update \
397397
--first_name John \
398398
--last_name Smith
399+
/account/cancel:
400+
x-linode-cli-command: account
401+
post:
402+
x-linode-grant: read_write
403+
tags:
404+
- Account
405+
summary: Cancel Account
406+
description: >
407+
Cancels an active Linode account. This action will cause
408+
Linode to attempt to charge the credit card on file for the remaining
409+
balance. An error will occur if Linode fails to charge the credit card
410+
on file. Restricted users will not be able to cancel an account.
411+
operationId: cancelAccount
412+
x-linode-cli-action: cancel
413+
security:
414+
- personalAccessToken: []
415+
- oauth:
416+
- account:read_write
417+
requestBody:
418+
description: >
419+
Supply a comment stating the reason that you are cancelling your account.
420+
required: true
421+
content:
422+
application/json:
423+
schema:
424+
properties:
425+
comments:
426+
type: string
427+
description: >
428+
Any reason for cancelling the account, and any other comments
429+
you might have about your Linode service.
430+
example: "I'm consolidating multiple accounts into one."
431+
responses:
432+
'200':
433+
description: Account cancelled
434+
content:
435+
application/json:
436+
schema:
437+
type: object
438+
properties:
439+
survey_link:
440+
type: string
441+
description: A link to Linode's exit survey.
442+
example: {'survey_link':
443+
'https://alinktothesurvey.com'}
444+
'409':
445+
description: Could not charge the credit card on file
446+
content:
447+
application/json:
448+
schema:
449+
type: object
450+
properties:
451+
errors:
452+
type: array
453+
items:
454+
type: object
455+
properties:
456+
reason:
457+
type: string
458+
description: >
459+
A string explaining that the account could not be cancelled
460+
because there is an outstanding balance on the account
461+
that must be paid first.
462+
example: >
463+
We were unable to charge your credit
464+
card for services rendered. We cannot cancel
465+
this account until the balance has been paid.
466+
default:
467+
$ref: '#/components/responses/ErrorResponse'
468+
x-code-samples:
469+
- lang: Shell
470+
source: >
471+
curl -H "Content-Type: application/json" \
472+
-H "Authorization: Bearer $TOKEN" \
473+
-X PUT -d '{
474+
"comments": "I'm consolidating my accounts."
475+
}
476+
}' \
477+
https://api.linode.com/v4/account/cancel
478+
- lang: CLI
479+
source: >
480+
linode-cli account cancel \
481+
--comments "I'm consolidating my accounts"
399482
/account/credit-card:
400483
x-linode-cli-command: account
401484
post:

0 commit comments

Comments
 (0)