Docs

Get subaccounts list

/accounts/{accountSID}/messages

Overview

Make the GET request to /accounts to receive a list of all your accounts (including the master account).

Request example

The following curl example demonstrates getting a list of accounts.

curl –X GET ‘https://api.apico.net/v2/accounts’ \
-u {accountSID}:{authToken}

Response example

{
    "page": 0, 
    "limit": 20,
    "next": "https://api.apico.net/v2/accounts?limit=20&page=1",
    "prev": null,
           "total": 50,
    "accounts": [
    {
      "account_sid":"{accountSID}",
      "name": "MyAccount",
      "status": "active",
      "token": "{authToken}",
      "created": "Wed, 27 May 2015 01:11:11 +0000",
      "updated": "Wed, 27 May 2015 01:12:11 +0000",
      "type": "master"
    },
    {
      "account_sid":"{accountSID}",
      "name": "MyBlockedSubaccount",
      "status": "blocked",
      "token": "{authToken}",
      "created": "Mon, 18 Jan 2016 08:17:27 +0000",
      "updated": "Wed, 03 Feb 2016 10:05:13 +0000",
      "type": "slave"
    }, ...
  ]
}

Response parameters

Parameter

Description

page

The current page number.

Numbering starts with 0.

limit

A parameter describing how many records are returned at once.

The default and maximum value is 20.

next

URI to the next part of the list.

prev

URI to the previous part of the list.

total

The total number of entries in the returned list.

accounts

Account list.

accounts/account_sid

Account identifier.

accounts/name

Account name.

Alphanumeric string.

accounts/status

Account status.

Either active or blocked.

accounts/token

Authentication token (account password).

accounts/created

Account (subaccount) creation date.

accounts/updated

The last updated date.

accounts/type

Account type.

Either master (main account) or slave (subaccount).

Response filtering

To narrow the response results, specify filtering parameters in the GET request.

Request example (with filtering)

The following curl request demonstrates getting a list of active subaccounts.

curl –X GET ‘https://api.apico.net/v2/accounts?type=slave&status=active’ \
-u {accountSID}:{authToken}

Filtering parameters

Parameter

Description

page

The current page number.

Numbering starts with 0.

limit

A parameter describing how many records you want to return all at once.

The default and maximum value is 20.

account_sid

Account identifier.

name

Account name.

Alphanumeric string.

status

Account status.

Either active or blocked.

created

Account (subaccount) creation date.

updated

The last updated date.

type

Account type.

Either master (main account) or slave (subaccount).

next

URI to the next part of the list.

prev

URI to the previous part of the list.

total

The total number of entries in the returned list.

accounts

Account list.

accounts/account_sid

Account identifier.

accounts/name

Account name.

Alphanumeric string.

accounts/status

Account status.

Either active or blocked.

accounts/token

Authentication token.

accounts/created

Account (subaccount) creation date.

accounts/updated

The last updated date.

accounts/type

Account type.

Either master (main account) or slave (subaccount).