Skip to content

List sub-accounts

Request

Returns the sub-accounts sitting directly beneath the one you are signed in to. Neither the account you are calling as nor anything above it is included, and accounts in a different part of the hierarchy are never returned.

Each row carries object.parent_id and object.path - a slash-separated chain of account ids from the top of the tree down - so the hierarchy can be rebuilt from the listing without further calls.

Results are limited to the sub-accounts you are allowed to see, so two callers in the same account can get different rows.

Security
default
Query
show_descendantboolean

Return the whole subtree rather than only the accounts one level down. Available when the account allows it.

subaccount_selectionboolean

Narrow the results to the sub-accounts offered in the account-switching menu. Available when the account allows it.

per_pageinteger

The number of results to return per page. The higher the number the longer the request may take. It is highly recommended to use this to avoid timeouts as your data grows. Used in conjunction with the page parameter to paginate results.

pageinteger

The page of results to return. Used in conjunction with the per_page parameter to paginate results. If not specified, defaults to 1. The response's next_page_url will be null if there are no more pages.

filterArray of objects

A filter to apply to the results. Declared as an array of objects, where each object contains an attr (attribute code), operator and value key. Examples:

?filter[0]['attr']=name&filter[0][operator]=like&filter[0][value]=luke

?filter[0]['attr']=id&filter[0][operator]=>&filter[0][value]=265

See the filters documentation for more details on how to use this.

sort_bystring

The field to sort the results by. No ordering is applied unless you specify one, so row order is not guaranteed. Always send it when paging through a list, otherwise records can repeat or be missed between pages. Example: id

sort_orderstring

The direction to sort the results by. Can be 'asc' or 'desc', default is 'asc'.

Enum:"asc""desc"
_localestring

The locale to use for the response. This primarily affects the results of the nice field, which contain human-readable labels and terms, as well as locale-specific date formats.,

extrasArray of strings

A list of extras to include in the response. These are objects or arrays that are not part of the model's primary attributes, such as stats and counts. For fast responses, avoid requesting them if you don't need them.

Items Enum:"stats""domains""limits""certificate"
withArray of strings

A list of relations to include in the response. May be single records or collections. It is often more efficient to retrieve this way, to avoid follow-up API calls.

Items Enum:"users""brandings""account_terms_and_conditions_acceptance"
Headers
Rosterfy-Platformstring
curl -i -X GET \
  'https://developer.rosterfy.com/_mock/api-docs/openapi/api/v2/account?show_descendant=true&subaccount_selection=true&per_page=5&page=1&filter=%7Bfilter%7D&sort_by=%7Bsort_by%7D&sort_order=%7Bsort_order%7D&_locale=en-US&extras=stats&with=users' \
  -H 'Authorization: Bearer <YOUR_TOKEN_HERE>' \
  -H 'Rosterfy-Platform: admin'

Responses

Successful response

Bodyapplication/json
Array [
current_pageinteger
dataArray of objects
first_page_urlstring
frominteger
next_page_urlstring
pathstring
per_pageinteger
prev_page_urlstring or null
tointeger
]
Response
[ { "current_page": 1, "data": [], "first_page_url": "https://example.rosterfy.com/api/v2/account?per_page=5&_locale=en-US&page=1", "from": 1, "next_page_url": "https://example.rosterfy.com/api/v2/account?per_page=5&_locale=en-US&page=2", "path": "https://example.rosterfy.com/api/v2/account", "per_page": 5, "prev_page_url": null, "to": 5 } ]