Delete a sub-account
const url = 'https://api.siprtc.io/v1/Accounts/example/Tenants/example';const options = {method: 'DELETE', headers: {Authorization: 'Basic <credentials>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request DELETE \ --url https://api.siprtc.io/v1/Accounts/example/Tenants/example \ --header 'Authorization: Basic <credentials>'Deletes a sub-account directly under {auth_id} at once: the account is marked deleted (status deleted) and drops out of lists and lookups, and its portal sign-in, and its contact-centre workspace or worker, are removed asynchronously. There is no undo and no grace period; scheduleTenantDeletion deletes after a delay instead.
Unlike the other Tenants operations, this one acts on the account in the path, which must be a vendor, ent, reseller or superuser account (400 otherwise); use your own Auth ID. To be sure the sub-account’s API credentials stop working, disable it with updateTenantStatus first. Send the sub-account’s Auth ID, not its email address. No request body is read.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Your Auth ID (the authenticated account).
Auth ID of the sub-account.
Responses
Section titled “ Responses ”Deleted successfully
object
What was done.
Always “success”.
Example
{ "message": "tenant updated successfully", "status": "success"}The path account is not a vendor, ent, reseller or superuser account, or the deletion could not be saved.
object
The underlying error text. Only some 400 responses of the tenant list carry it.
What went wrong, in English.
Always “failed”.
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.
Example generated
exampleNo such sub-account under the path account.
object
The underlying error text. Only some 400 responses of the tenant list carry it.
What went wrong, in English.
Always “failed”.
Example
{ "error": "sql: connection is already closed", "message": "Account Details not found", "status": "failed"}