Skip to content

Update a sub-account

PUT
/v1/Accounts/{auth_id}/Tenants/{tenant_auth_id}
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.

auth_id
required
string

Your Auth ID (the authenticated account).

tenant_auth_id
required
string

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

Fields to change.

Media type application/json
object
address

Postal address.

string

Example

1 Example Street, Springfield
email

Email address. A new address must not be used by any other live account (409).

string

Example

ada@example.com
first

First name.

string

Example

Ada
is_clidisabled

True disables caller ID (CLI) for the sub-account.

boolean

Example

false
is_deleted

True deletes the sub-account at once, as deleteTenant does, and ignores the other fields.

boolean

Example

false
is_disabled

True disables the sub-account, false enables it. Prefer updateTenantStatus.

boolean

Example

false
last

Last name.

string

Example

Lovelace
password

New sign-in password. When set, the sub-account’s portal password is reset; the other fields are still saved.

string

Example

choose-a-strong-password
phone1

Phone number.

string

Example

+15555550100
role

Realm roles to add to the sub-account’s sign-in (id and name each). Roles it already has are kept.

Array<object>
object
id

The realm role’s id (UUID).

string

Example

0b9c2c1e-7d3f-4c55-9a8e-5f2d4b6a7c81
name

The realm role’s name.

string

Example

member
time_zone

IANA time zone (422 when unknown).

string

Example

Europe/London
type

Account 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).

string

Example

member

Tenant updated successfully, or deleted successfully when is_deleted was true.

Media type application/json
object
message

What was done.

string
status

Always “success”.

string

Example

{
"message": "tenant updated successfully",
"status": "success"
}

The body is not JSON, required details would be empty, or the change could not be saved.

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

The caller may not set this account type.

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"
}

No such sub-account under the authenticated account.

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"
}

The email is already used by another account.

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"
}

Unknown time zone.

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"
}

The change could not be queued for the sign-in, or an account lookup failed.

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"
}