Disable or enable a sub-account
const url = 'https://api.siprtc.io/v1/Accounts/example/Tenants/example/Status';const options = { method: 'PATCH', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"is_disabled":true}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.siprtc.io/v1/Accounts/example/Tenants/example/Status \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "is_disabled": true }'Disables (is_disabled: true, status inactive) or re-enables (false, status active) a sub-account directly under the authenticated account. Any account type may call it, and the lookup is always among the authenticated account’s own sub-accounts, whatever {auth_id} says.
A disabled sub-account’s portal sign-in is disabled, and its API credentials stop authenticating, as do those of its own sub-accounts. The API gateway caches credentials, so this can take up to 10 minutes to apply to API calls. Send the sub-account’s Auth ID, not its email address.
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.
Request Bodyrequired
Section titled “ Request Bodyrequired ”The new state.
object
True disables the sub-account (status inactive), false enables it (status active). Required.
Example
trueResponses
Section titled “ Responses ”The sub-account’s new state.
object
The sub-account’s Auth ID as given in the path.
The new state.
Always “tenant status updated successfully”.
Always “success”.
Example
{ "auth_id": "AC000000000000000002", "is_disabled": true, "message": "tenant status updated successfully", "status": "success"}The body is not JSON, is_disabled is missing, or the change 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 authenticated 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"}The change could not be queued for the sign-in.
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"}