---
title: "REST API: Get Space Directories"
type: "wiki"
space: "Axero Documentation"
author: "Anonymous User"
created: 2015-05-05T09:05:50Z
updated: 2026-09-28T01:16:39Z
tags: ["API"]
url: "https://my.axerosolutions.com/spaces/5/axero-documentation/wiki/view/4877/rest-api-get-space-directories"
---

# REST API: Get Space Directories

[Open API Guide](https://my.axerosolutions.com/spaces/5/axero-documentation/api-guide?id=4877)
GET/api/spaces/\{SpaceID\}/file/directories/\{ParentDirectoryID\}

Get the directories in a space under a parent directory.

## Request

### Request Header
| Header | Required | Value | Description |
| :--- | :--- | :--- | :--- |
| `Authorization` | YES | `Bearer YOUR_TOKEN` | Bearer token for the authenticated user. [Learn how to create Bearer tokens](https://my.axerosolutions.com/spaces/5/axero-documentation/wiki/view/108973/creating-bearer-tokens). |
### Required Parameters
| Parameter | Type | Required | Location | Description |
| :--- | :--- | :--- | :--- | :--- |
| `ParentDirectoryID` | Integer | YES | Path | ID of the parent directory whose child directories are returned; 0 for the space's top level. For a directory synced from an external drive the space is read as 0. |
| `SpaceID` | Integer | YES | Path | ID of the space whose directories are to be returned |
## Example

### Request Header

```
Authorization: Bearer YOUR_TOKEN
```

### Request URL

`https://your-site.com/api/spaces/235/file/directories/336`

### Success Response

```
{
  "IsError": false,
  "ResponseMessage": "",
  "ResponseData": [
    {
      "DirectoryID": 3813,
      "DirectoryName": "Project Files",
      "ParentID": 3590,
      "UserID": 630,
      "SpaceID": 313,
      "MediaServerID": 0,
      "IsDeleted": false,
      "IsRenamable": true,
      "IsDeletable": true,
      "IsSubDirectoryCreatable": true,
      "CanCreateFile": true,
      "IsSync": false,
      "IsActivityStreamDirectory": false,
      "IsDownloadable": true,
      "ExternalDirectoryType": 0,
      "ExternalURL": "",
      "CreatedByUserType": -1,
      "UpdatedByUserType": -1,
      "DateCreated": "2026-09-13T01:50:47.877",
      "ExternalDirectoryID": "",
      "IsExternalContent": false,
      "IsBeingAddedViaExternalSource": false,
      "FileDirectoryURL": "/spaces/313/marketing/files?directoryID=3813",
      "TenantID": 0
    }
  ]
}
```

### Error Response

```
{
  "Message": "The request is invalid."
}
```

## Error Handling

| Status Code | Likely Cause | Next Action |
| :--- | :--- | :--- |
| 400 Bad Request | SpaceID or ParentDirectoryID in the path is not an integer. | Send numeric IDs in both path positions. |
| 401 Unauthorized | Missing or invalid Bearer token. | Check token validity. [Learn how to create Bearer tokens →](https://my.axerosolutions.com/spaces/5/axero-documentation/wiki/view/108973/creating-bearer-tokens) |
| 403 Forbidden | The caller is not a member of the space. A member sees the list with any directories they cannot read left out; a non-member is refused outright. | Add the caller to the space, or call it as a site administrator. |
| 404 Not Found | ParentDirectoryID is greater than 0 and no directory has that ID; the response has no body. | Verify the ParentDirectoryID. |
| 500 Server Error | Internal failure. | Retry later. |

## Rate Limits

While Axero does not enforce hard rate limits by default, we recommend the following best practices to ensure optimal performance:

- **Sustained Request Rate:** Do not exceed 5 API calls per second
- **Sequential Processing:** Wait for each request to complete before sending the next in automated workflows
- **Concurrent Connections:** If parallel processing is required, limit to 3 or fewer simultaneous requests
- **Response Timeout:** Ensure API responses complete within 15 seconds during testing

Axero may implement temporary rate restrictions if excessive API usage affects overall site performance. For high-volume integrations, contact Axero to discuss your requirements.
