---
title: "Preview Storage Structure"
method: POST
path: "/data_credentials/{credential_id}/probe/tree"
tags: ["Credentials"]
---

# Preview Storage Structure

`POST /data_credentials/{credential_id}/probe/tree`

## Request

- Base URL: `https://dataops.nexla.io/nexla-api`
- URL: `https://dataops.nexla.io/nexla-api/data_credentials/{credential_id}/probe/tree`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/nexla/apis/nexla-rest-api/docs/data_credentials/:credential_id/probe/tree/post.ts> (a function with typed inputs; its response is checked against the schema)

Use this endpoint to preview the structure/hierarchy of storage to which this credential grants access. For example, you can use this endpoint to see the folder and file structure of a file storage system or the table-column structure of a database.
This can be used to inspect the directory hierarchy of file content storage or the database schema of a database/warehouse storage system. Note that this endpoint is only valid for credentials for storage systems wherein a storage structure needs to be reviewed.

## Path parameters

- `credential_id` integer, required

## Query parameters

- `async` boolean
- `request_id` integer

## Request body

- union
  - object
    - `depth` integer, required: Specify the hierarchy depth that should be scanned and returned in the response. If no other payload properties are provided, the depth is relative to the storage root. If this request contains instructions about the slice of storage to be previewed (using the path/database/table properties), the depth will be applied relative to that storage slice. We recommend using a depth = 1 to ensure that only small, relevant slices of the storage system are scanned.
    - `path` string: Folder or subfolder path for which you wish to retrieve the content structure. The path string should be structured from the root of the location to the credential. For example, `demo-out.nexla.com/users/test` will return the folder tree for the contents of the `test` subfolder. This is relevant for file-type connectors.
  - object
    - `depth` integer, required: Specify the hierarchy depth that should be scanned and returned in the response. If no other payload properties are provided, the depth is relative to the storage root. If this request contains instructions about the slice of storage to be previewed (using the path/database/table properties), the depth will be applied relative to that storage slice. We recommend using a depth = 1 to ensure that only small, relevant slices of storage are scanned.
    - `database` string: Name of the database from which you wish to fetch table names or collections. Relevant for Database and NoSql document-type connectors.
    - `table` string: Name of the table of which you wish to fetch the column structure. Relevant for database-type connectors.

## Response `200`

OK

- union
  - ProbeTreeCommon
    - `status` 'ok': Response status code from the third-party storage system to which this credential connects. `Ok` indicates that the request resulted in a valid response from the storage system.
    - `message` 'Ok': Message string indicating response validity from the underlying storage system. `Ok` indicates that the request resulted in a valid response from the storage system. Errors are returned as relevant message strings indicating the failure reasons.
    - `connection_type` string: __Connector Type__: Connector codename.
  - AsyncResponse: This object represents the response of an asynchronous operation. The response can be a dictionary or an array of dictionaries. The format of the response depends on the operation that was executed.
    - `request_id` integer: The unique ID of the request that was executed. This ID can be used to track the status of the request.
    - `status` 'pending' | 'running' | 'completed' | 'failed' | 'cancelled'
    - `request_started_at` string, date-time: The date and time when the request was started.
    - `progress` integer: The progress of the request (value from 0 to 100). This value is a percentage of the total progress of the request. Applicable only to certain types of async operations.
    - `result` object: The result of the async operation. Format depends on the task type.
    - `request_stopped_at` string, date-time: The date and time when the request was stopped. This field is only present if the request has been stopped (due to cancellation or error).
    - `request_completed_at` string, date-time: The date and time when the request was completed. This field is only present if the request has been completed successfully.

## Other responses

- `401`: Unauthorized
- `404`: Not Found

---

[API](https://skmtc.dev/nexla/apis/nexla-rest-api.md) - [All operations](https://skmtc.dev/nexla/apis/nexla-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/nexla/apis/nexla-rest-api/revisions/ef02be92fe7b?raw)
