> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.useroot.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.useroot.com/_mcp/server.

# List subaccounts

GET https://api.useroot.com/api/subaccounts

Retrieve a paginated list of all subaccounts for your root entity, with current balances and virtual banking details.

**Query Parameters**

| Field | Type | Required | Description |
|-------|------|----------|-------------|
| `cursor` | String | No | Cursor for pagination. Use the `next_cursor` from the previous response to get the next page |
| `limit` | Integer | No | Number of items to return per page. Maximum is 100 (default: 50) |
| `order` | String | No | Sort order by created_at: 'asc' for oldest first, 'desc' for newest first (default: 'desc') |
| `name` | String | No | Filter subaccounts by name (case-insensitive partial match) |

**Response Body**

| Field | Type | Description |
|-------|------|-------------|
| `data` | Array | Array of subaccount objects |
| `has_more` | Boolean | Whether there are more results available |
| `total_count` | Integer | Total number of subaccounts |
| `next_cursor` | String | Cursor for the next page (null if no more results) |
| `previous_cursor` | String | Cursor for the previous page |

**Pagination**

This endpoint supports cursor-based pagination. Results are ordered by creation date (newest first by default).

Reference: https://docs.useroot.com/api-reference/subaccounts-api/list-subaccounts

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: '[Code Generated] Root - Instant Account to Account Money Movement'
  version: 1.0.0
paths:
  /api/subaccounts:
    get:
      operationId: list-subaccounts
      summary: List subaccounts
      description: >-
        Retrieve a paginated list of all subaccounts for your root entity, with
        current balances and virtual banking details.


        **Query Parameters**


        | Field | Type | Required | Description |

        |-------|------|----------|-------------|

        | `cursor` | String | No | Cursor for pagination. Use the `next_cursor`
        from the previous response to get the next page |

        | `limit` | Integer | No | Number of items to return per page. Maximum
        is 100 (default: 50) |

        | `order` | String | No | Sort order by created_at: 'asc' for oldest
        first, 'desc' for newest first (default: 'desc') |

        | `name` | String | No | Filter subaccounts by name (case-insensitive
        partial match) |


        **Response Body**


        | Field | Type | Description |

        |-------|------|-------------|

        | `data` | Array | Array of subaccount objects |

        | `has_more` | Boolean | Whether there are more results available |

        | `total_count` | Integer | Total number of subaccounts |

        | `next_cursor` | String | Cursor for the next page (null if no more
        results) |

        | `previous_cursor` | String | Cursor for the previous page |


        **Pagination**


        This endpoint supports cursor-based pagination. Results are ordered by
        creation date (newest first by default).
      tags:
        - subaccountsApi
      parameters:
        - name: cursor
          in: query
          description: >-
            Cursor for pagination. Use the next_cursor from the previous
            response to get the next page.
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: limit
          in: query
          description: Number of items to return per page. Maximum is 500.
          required: false
          schema:
            type:
              - integer
              - 'null'
            default: 50
        - name: order
          in: query
          description: >-
            Sort order by created_at: 'asc' for oldest first, 'desc' for newest
            first (default: 'desc')
          required: false
          schema:
            oneOf:
              - $ref: '#/components/schemas/SortOrder'
              - type: 'null'
            default: desc
        - name: name
          in: query
          description: Filter subaccounts by name (case-insensitive partial match)
          required: false
          schema:
            type:
              - string
              - 'null'
        - name: x-api-key
          in: header
          description: >-
            RootPay API key sent in the x-api-key header. Keys are
            environment-scoped: live_* for production, test_* for sandbox.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: List of subaccounts retrieved successfully
          content:
            application/json:
              schema:
                description: Any type
servers:
  - url: https://api.useroot.com
    description: Production
components:
  schemas:
    SortOrder:
      type: string
      enum:
        - desc
        - asc
      description: Sort order for pagination endpoints.
      title: SortOrder
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: x-api-key
      description: >-
        RootPay API key sent in the x-api-key header. Keys are
        environment-scoped: live_* for production, test_* for sandbox.

```

## Examples

### Complete list



**Response**

```json
{
  "data": [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "name": "Nike Store Operations",
      "account_number": "1234567890",
      "routing_number": "111000025",
      "routing_numbers": {
        "ach": "111000025",
        "wire": "111000025"
      },
      "currency_code": "USD",
      "total_incoming_cents": 100000,
      "total_outgoing_cents": 45000,
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-15T10:30:00Z"
    },
    {
      "id": "b2c3d4e5-f678-90ab-cdef-123456789012",
      "name": "Adidas Store Operations",
      "account_number": "9999999999",
      "routing_number": "111000025",
      "routing_numbers": {
        "ach": "111000025",
        "wire": "111000025"
      },
      "currency_code": "USD",
      "total_incoming_cents": 75000,
      "total_outgoing_cents": 60000,
      "created_at": "2024-01-16T11:00:00Z",
      "updated_at": "2024-01-16T11:00:00Z"
    }
  ],
  "has_more": false,
  "total_count": 2
}
```

**SDK Code**

```python Complete list
import requests

url = "https://api.useroot.com/api/subaccounts"

headers = {"x-api-key": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Complete list
const url = 'https://api.useroot.com/api/subaccounts';
const options = {method: 'GET', headers: {'x-api-key': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Complete list
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.useroot.com/api/subaccounts"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-api-key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Complete list
require 'uri'
require 'net/http'

url = URI("https://api.useroot.com/api/subaccounts")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java Complete list
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.useroot.com/api/subaccounts")
  .header("x-api-key", "<apiKey>")
  .asString();
```

```php Complete list
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.useroot.com/api/subaccounts', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Complete list
using RestSharp;

var client = new RestClient("https://api.useroot.com/api/subaccounts");
var request = new RestRequest(Method.GET);
request.AddHeader("x-api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Complete list
import Foundation

let headers = ["x-api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.useroot.com/api/subaccounts")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Paginated results



**Response**

```json
{
  "data": [
    {
      "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "name": "Nike Store Operations",
      "account_number": "1234567890",
      "routing_number": "111000025",
      "routing_numbers": {
        "ach": "111000025",
        "wire": "111000025"
      },
      "currency_code": "USD",
      "total_incoming_cents": 100000,
      "total_outgoing_cents": 45000,
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-15T10:30:00Z"
    }
  ],
  "has_more": true,
  "total_count": 5,
  "next_cursor": "MTczNDY5OTAwMDAwMDpiMmMzZDRlNS1mNjc4LTkwYWItY2RlZi0xMjM0NTY3ODkwMTI="
}
```

**SDK Code**

```python Paginated results
import requests

url = "https://api.useroot.com/api/subaccounts"

headers = {"x-api-key": "<apiKey>"}

response = requests.get(url, headers=headers)

print(response.json())
```

```javascript Paginated results
const url = 'https://api.useroot.com/api/subaccounts';
const options = {method: 'GET', headers: {'x-api-key': '<apiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Paginated results
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.useroot.com/api/subaccounts"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("x-api-key", "<apiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Paginated results
require 'uri'
require 'net/http'

url = URI("https://api.useroot.com/api/subaccounts")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<apiKey>'

response = http.request(request)
puts response.read_body
```

```java Paginated results
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.useroot.com/api/subaccounts")
  .header("x-api-key", "<apiKey>")
  .asString();
```

```php Paginated results
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.useroot.com/api/subaccounts', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Paginated results
using RestSharp;

var client = new RestClient("https://api.useroot.com/api/subaccounts");
var request = new RestRequest(Method.GET);
request.AddHeader("x-api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift Paginated results
import Foundation

let headers = ["x-api-key": "<apiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.useroot.com/api/subaccounts")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```