Descendants

GET /accounts/:account/accounts{?messaging,q,legal,type}

An Account has a “parent” and zero or more “sub-accounts”, in a tree structure. This will return the given Account and all its descendant Accounts in a flat collection.

Examples

List Descendants

Request

GET /accounts/my_account/accounts
Example
$ curl -i -H Accept:"application/vnd.textus+jsonld" \
    -H Authorization:"Bearer {token}" \
    -X GET /accounts/my_account/accounts
    

Response

Status

200

Response Type

AccountCollection

Example Body

{
  "@type": "AccountCollection",
  "@context": "/contexts/AccountCollection.jsonld",
  "id": "/accounts/my_account/accounts",
  "members": [
    {
      "@type": "Account",
      "@context": "/contexts/Account.jsonld",
      "id": "/accounts/my_account",
      "name": "Example Account",
      "slug": "my_account",
      "logo": null,
      "phoneNumbers": [
        "(303) 555-1111"
      ],
      "effectiveRole": "admin",
      "type": "standard",
      "analytics": "/accounts/my_account/analytics",
      "inbox": "/my_account/inbox",
      "contacts": "/my_account/contacts",
      "campaigns": "/my_account/campaigns",
      "users": {
        "@type": "hydra:Collection",
        "@context": "/contexts/hydra:Collection.jsonld",
        "id": "/my_account/users",
        "totalItems": 2
      },
      "children": {
        "@type": "hydra:Collection",
        "@context": "/contexts/hydra:Collection.jsonld",
        "id": "/accounts/my_account/children",
        "totalItems": 1,
        "members": []
      }
    }
  ],
  "totalItems": 1,
  "view": {
    "@type": "hydra:PartialCollectionView",
    "@context": "/contexts/hydra:PartialCollectionView.jsonld",
    "id": "/accounts/my_account/accounts",
    "first": "/accounts/my_account/accounts",
    "next": null,
    "previous": null
  }
}

© 2024 TextUs