Skip to content

Schedule or cancel a sub-account deletion

POST
/v1/Accounts/{auth_id}/Tenants/Delete
curl --request POST \
--url https://api.siprtc.io/v1/Accounts/example/Tenants/Delete \
--header 'Authorization: Basic <credentials>' \
--header 'Content-Type: application/json' \
--data '{ "is_deleted": true, "tenant_id": "AC000000000000000002" }'

With is_deleted: true, schedules the deletion of a sub-account directly under the authenticated account: a deletion job is queued to run 15 minutes later. With is_deleted: false, cancels the scheduled deletion. Any account type may call it, and the lookup is always among the authenticated account’s own sub-accounts, whatever {auth_id} says. tenant_id may be the sub-account’s Auth ID or email address.

Errors: 400 for a body that is not JSON or a missing tenant_id or is_deleted. Every other failure answers 404, including when the job scheduler refuses the request or cannot be reached; read message for the reason.

auth_id
required
string

Your Auth ID (the authenticated account).

The sub-account, and whether to schedule or cancel its deletion.

Media type application/json
object
is_deleted
required

True schedules the deletion, false cancels a scheduled one.

boolean

Example

true
tenant_id
required

Auth ID (or email address) of the sub-account.

string

Example

AC000000000000000002

The job was scheduled or cancelled.

Media type application/json
object
is_deleted

The is_deleted value sent.

boolean
message

“tenant delete job scheduled” or “tenant delete job unscheduled”.

string
status

Always “success”.

string
tenant_id

The sub-account named in the request.

string

Example

{
"is_deleted": true,
"message": "tenant delete job scheduled",
"status": "success",
"tenant_id": "AC000000000000000002"
}

The body is not JSON, or tenant_id or is_deleted is missing.

Media type application/json
object
error

The underlying error text. Only some 400 responses of the tenant list carry it.

string
message

What went wrong, in English.

string
status

Always “failed”.

string

Example

{
"error": "sql: connection is already closed",
"message": "Account Details not found",
"status": "failed"
}

Authentication failed: wrong or missing credentials, a disabled account, or an {auth_id} that is neither you nor your direct sub-account.

Media type application/json
string

Example generated

example

No such sub-account, it has no email address, or the job could not be scheduled or cancelled.

Media type application/json
object
error

The underlying error text. Only some 400 responses of the tenant list carry it.

string
message

What went wrong, in English.

string
status

Always “failed”.

string

Example

{
"error": "sql: connection is already closed",
"message": "Account Details not found",
"status": "failed"
}