Sub-Accounts

The following fields relate to the Sub-Accounts endpoint.

FieldLimitsRequired?Writeable?
id
NoNo

The ID of the sub-account (used for removing a sub-account)

user_id
YesYes

The ID of the user who should be assigned a sub-account

user_can_see_broker_hotnesses
NoYes

Enables the sub-account to use the broker's hotnesses

is_lead_sources_enabled
NoYes

Enables the sub-account to use the broker's lead sources

is_contact_activity_settings_enabled
NoYes

Enables the sub-account to use the broker's contact activity alerts

is_lead_status_enabled
NoYes

Enables the sub-account to use the broker's lead statuses

is_contact_types_enabled
NoYes

Enables the sub-account to use the broker's contact types

is_custom_fields_enabled
NoYes

Enables the sub-account to use the broker's custom fields

is_contact_ownership_enabled
NoYes

Enables the sub-account to use the broker's contacts

user_can_create_own_hotnesses
NoYes

Enables the sub-account to create their own hotnesses

is_lead_sources_new_enabled
NoYes

Enables the sub-account to create their own lead sources

is_contact_activity_settings_new_enabled
NoYes

Enables the sub-account to create their own contact activity alerts

is_lead_status_new_enabled
NoYes

Enables the sub-account to create their own lead statuses

is_custom_fields_new_enabled
NoYes

Enables the sub-account to create their own custom fields

is_contact_ownership_new_enabled
NoYes

Enables the sub-account to create their own contacts

is_contact_types_new_enabled
NoYes

Enables the sub-account to create their own contact types

user
NoNo

The user details of the sub-account

access_token
NoNo

An access token an admin can use for authorization


Sub-Accounts can only be added, retrieved, or removed if the querying user is a broker.

Submit one Sub-Account

To submit one sub-account:

POST https://api-v2.liondesk.com//sub-accounts headers: { Authorization: "Bearer [access token]", Content-Type: "application/json" }

The request object should have this form:{ "user_id": 10, "user_can_see_broker_hotnesses": true, "is_lead_sources_enabled": true, "is_contact_activity_settings_enabled": true, "is_lead_status_enabled": true, "is_contact_types_enabled": true, "is_custom_fields_enabled": true, "is_contact_ownership_enabled": true, "user_can_create_own_hotnesses": true, "is_lead_sources_new_enabled": true, "is_contact_activity_settings_new_enabled": true, "is_lead_status_new_enabled": true, "is_custom_fields_new_enabled": true, "is_contact_ownership_new_enabled": true, "is_contact_types_new_enabled": true }

Get One Sub-Account

To get one sub-account:

GET https://api-v2.liondesk.com//sub-accounts/1 headers: { Authorization: "Bearer [access token]", Content-Type: "application/json" }

The response object will have this form:{ "id": 2, "user_id": 10, "user_can_see_broker_hotnesses": true, "is_lead_sources_enabled": true, "is_contact_activity_settings_enabled": true, "is_lead_status_enabled": true, "is_contact_types_enabled": true, "is_custom_fields_enabled": true, "is_contact_ownership_enabled": true, "user_can_create_own_hotnesses": true, "is_lead_sources_new_enabled": true, "is_contact_activity_settings_new_enabled": true, "is_lead_status_new_enabled": true, "is_custom_fields_new_enabled": true, "is_contact_ownership_new_enabled": true, "is_contact_types_new_enabled": true, "user": { "id": 10, "first_name": "Bill", "last_name": "Gates", "email": "bill@microsoft.com", "username": "gates" }, "access_token": "b2374c372054e43c8da7c5ed681d8de880ee9762" }

Find All Sub-Accounts

You find/search sub-accounts by issuing a GET request to the base endpoint:

GET https://api-v2.liondesk.com//sub-accounts headers: { Authorization: "Bearer [access token]", Content-Type: "application/json" }

The response will contain an array of sub-account objects, like so:

{ "total": 2, "limit": 10, "skip": 0, "data": [ { "id": 2, "user_id": 10, "user_can_see_broker_hotnesses": true, "is_lead_sources_enabled": true, "is_contact_activity_settings_enabled": true, "is_lead_status_enabled": true, "is_contact_types_enabled": true, "is_custom_fields_enabled": true, "is_contact_ownership_enabled": true, "user_can_create_own_hotnesses": true, "is_lead_sources_new_enabled": true, "is_contact_activity_settings_new_enabled": true, "is_lead_status_new_enabled": true, "is_custom_fields_new_enabled": true, "is_contact_ownership_new_enabled": true, "is_contact_types_new_enabled": true, "user": { "id": 10, "first_name": "Bill", "last_name": "Gates", "email": "bill@microsoft.com", "username": "gates" }, "access_token": "b2374c372054e43c8da7c5ed681d8de880ee9762" }, { "id": 5, "user_id": 20, "user_can_see_broker_hotnesses": false, "is_lead_sources_enabled": false, "is_contact_activity_settings_enabled": false, "is_lead_status_enabled": false, "is_contact_types_enabled": false, "is_custom_fields_enabled": false, "is_contact_ownership_enabled": false, "user_can_create_own_hotnesses": false, "is_lead_sources_new_enabled": false, "is_contact_activity_settings_new_enabled": false, "is_lead_status_new_enabled": false, "is_custom_fields_new_enabled": false, "is_contact_ownership_new_enabled": false, "is_contact_types_new_enabled": false, "user": { "id": 20, "first_name": "Steve", "last_name": "Jobs", "email": "steve@apple.com", "username": "jobs" }, "access_token": "b2374c372054e43c8da7c5ed681d8de880ee9762" } ] }

Filtering Sub-Accounts

The following filtering operators may be mixed and matched as desired.

Equality

You may query sub-account fields directly by specifying equality parameters in the request URI:GET /sub-accounts?user_can_see_broker_hotnesses=true&is_custom_fields_enabled=false

You may wish to exclude results having some value with $ne:GET /sub-accounts?is_contact_ownership_enabled[$ne]=true

Limiting and Pagination

$limit will return only the number of results you specify: GET /sub-accounts?$limit=2

$skip will skip the specified number of results, useful for paginating:GET /sub-accounts?is_contact_ownership_enabled=true&$limit=2&$skip=2

Sorting

$sort will order results based on the field given.

Use 1 for ascending order, and -1 for descending order:GET /sub-accounts?$limit=10&$sort[user_id]=-1

Inclusion / Exclusion

Find all records where the property values are ($in) some set:GET /sub-accounts?user_can_create_own_hotnesses[$in]=true&is_custom_fields_new_enabled[$in]=falseIf the column matches any of the given values, the resource shall be returned.

Similarly, you may exclude certain values with ($nin):GET /sub-accounts?user_can_create_own_hotnesses[$nin]=true&is_custom_fields_new_enabled[$nin]=false

Remove

Sub-Accounts can be removed with a delete request.

DELETE https://api-v2.liondesk.com//sub-accounts/460 headers: { Authorization: "Bearer [access token]", Content-Type: "application/json" }