Update a sub-account
const url = 'https://api.siprtc.io/v1/Accounts/example/Tenants/example';const options = { method: 'PUT', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"address":"1 Example Street, Springfield","email":"ada@example.com","first":"Ada","is_clidisabled":false,"is_deleted":false,"is_disabled":false,"last":"Lovelace","password":"choose-a-strong-password","phone1":"+15555550100","role":[{"id":"0b9c2c1e-7d3f-4c55-9a8e-5f2d4b6a7c81","name":"member"}],"time_zone":"Europe/London","type":"member"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PUT \ --url https://api.siprtc.io/v1/Accounts/example/Tenants/example \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "address": "1 Example Street, Springfield", "email": "ada@example.com", "first": "Ada", "is_clidisabled": false, "is_deleted": false, "is_disabled": false, "last": "Lovelace", "password": "choose-a-strong-password", "phone1": "+15555550100", "role": [ { "id": "0b9c2c1e-7d3f-4c55-9a8e-5f2d4b6a7c81", "name": "member" } ], "time_zone": "Europe/London", "type": "member" }'Updates a sub-account directly under the authenticated account. Any account type may call it. The body is applied over the stored sub-account, so fields you leave out keep their values; the sub-account’s Auth ID and parent cannot be changed.
Name, email and enabled-state changes are also sent to the sub-account’s portal sign-in, and role adds realm roles to it. A non-empty password resets the sign-in password instead; in that request the other fields are saved on the account but not sent to the sign-in. is_deleted: true deletes the sub-account at once, exactly as deleteTenant does, and answers deleted successfully.
{tenant_auth_id} may also be the sub-account’s email address. The lookup is always among the authenticated account’s own sub-accounts, whatever {auth_id} says. Errors: 400 for a body that is not JSON, an update that leaves first, email or phone1 empty without giving role, or a failed save; 403 for a change to a platform-level type by a caller that may not create one; 404 for an account that is not a direct sub-account; 409 for an email used by another account; 422 for an unknown time_zone.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Your Auth ID (the authenticated account).
Auth ID (or email address) of the sub-account.
Request Bodyrequired
Section titled “ Request Bodyrequired ”Fields to change.
object
Postal address.
Example
1 Example Street, SpringfieldEmail address. A new address must not be used by any other live account (409).
Example
ada@example.comFirst name.
Example
AdaTrue disables caller ID (CLI) for the sub-account.
Example
falseTrue deletes the sub-account at once, as deleteTenant does, and ignores the other fields.
Example
falseTrue disables the sub-account, false enables it. Prefer updateTenantStatus.
Example
falseLast name.
Example
LovelaceNew sign-in password. When set, the sub-account’s portal password is reset; the other fields are still saved.
Example
choose-a-strong-passwordPhone number.
Example
+15555550100Realm roles to add to the sub-account’s sign-in (id and name each). Roles it already has are kept.
object
The realm role’s id (UUID).
Example
0b9c2c1e-7d3f-4c55-9a8e-5f2d4b6a7c81The realm role’s name.
Example
memberIANA time zone (422 when unknown).
Example
Europe/LondonAccount type. Changing it to a platform-level type (tenant, vendor, superuser, ent, enterprise, reseller, dev, val) needs a vendor, superuser, ent or reseller caller (403).
Example
memberResponses
Section titled “ Responses ”Tenant updated successfully, or deleted successfully when is_deleted was true.
object
What was done.
Always “success”.
Example
{ "message": "tenant updated successfully", "status": "success"}The body is not JSON, required details would be empty, 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
exampleThe caller may not set this account type.
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"}No 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 email is already used by another 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"}Unknown time zone.
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, or an account lookup failed.
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"}