# List lists directory entries by path ascending.


[API catalog](/reference/api/) · [Docker Sandboxes overview](/reference/api/sandboxes/latest/) · [Product manual](https://docs.docker.com/ai/sandboxes-api/) · [OpenAPI specification](/reference/api/sandboxes/api.yaml)

API version: v1


> This API is experimental. Features, interfaces,
> and behavior may change.




`GET /v1/files`

List lists directory entries by path ascending.

## Connection and access

[API connection and authentication guidance](/reference/api/sandboxes/latest/#authentication)


Server: `{endpoint}`

`endpoint`: The sandbox API base URL from Sandbox.core.endpoint.uri; preserve its path prefix when appending /v1 routes. HTTP endpoints require a scoped endpoint bearer; direct Unix sockets use socket access control.

Effective security: alternatives are OR; schemes within an alternative are AND. An empty array declares no HTTP authentication requirement.

```json
[
  {
    "sandboxBearer": []
  }
]
```

## Example request

Replace placeholders and provide the required credentials or request body.

```console
curl \
  --request GET \
  --header "Authorization: Bearer ${TOKEN}" \
  --header 'Accept: application/json' \
  'https://sandbox.invalid/v1/files?path=%3CPATH%3E'
```



## Parameters

### path

Location: query. Required: yes.

path is the directory path.

```json
{
  "description": "path is the directory path.",
  "in": "query",
  "name": "path",
  "pointer": "/paths/~1v1~1files/get/parameters/0",
  "required": true,
  "schema": {
    "minLength": 1,
    "title": "path",
    "type": "string"
  }
}
```

### pageSize

Location: query. Required: no.

page_size is an optional page size.

Omitted or zero uses the backend default. Unless the operation states otherwise, page-size limits and handling of larger requests are backend-specific; use the backend support guide. Continue with nextPageToken until it is empty.

```json
{
  "description": "page_size is an optional page size.\n\nOmitted or zero uses the backend default. Unless the operation states otherwise, page-size limits and handling of larger requests are backend-specific; use the backend support guide. Continue with nextPageToken until it is empty.",
  "in": "query",
  "name": "pageSize",
  "pointer": "/paths/~1v1~1files/get/parameters/1",
  "required": false,
  "schema": {
    "title": "page_size",
    "type": "integer"
  }
}
```

### pageToken

Location: query. Required: no.

page_token is an optional continuation token.

```json
{
  "description": "page_token is an optional continuation token.",
  "in": "query",
  "name": "pageToken",
  "pointer": "/paths/~1v1~1files/get/parameters/2",
  "required": false,
  "schema": {
    "title": "page_token",
    "type": "string"
  }
}
```

### orderBy

Location: query. Required: no.

order_by is a single order field with optional direction; the portable field is
path.

```json
{
  "description": "order_by is a single order field with optional direction; the portable field is\npath.",
  "in": "query",
  "name": "orderBy",
  "pointer": "/paths/~1v1~1files/get/parameters/3",
  "required": false,
  "schema": {
    "title": "order_by",
    "type": "string"
  }
}
```

## Request and responses

### Response 200 application/json

Success


Schema:

```json
{
  "$ref": "#/components/schemas/FilesListResponse"
}
```










### Response default application/json

The structured Error body identifies the failure with a stable code and optional typed details.


Schema:

```json
{
  "$ref": "#/components/schemas/Error"
}
```









Schema example:
```json
{
  "code": "notFound",
  "details": [],
  "message": "sandbox not found"
}
```


## Complete operation contract

```json
{
  "description": "List lists directory entries by path ascending.",
  "operationId": "list",
  "parameters": [
    {
      "description": "path is the directory path.",
      "in": "query",
      "name": "path",
      "required": true,
      "schema": {
        "minLength": 1,
        "title": "path",
        "type": "string"
      }
    },
    {
      "description": "page_size is an optional page size.\n\nOmitted or zero uses the backend default. Unless the operation states otherwise, page-size limits and handling of larger requests are backend-specific; use the backend support guide. Continue with nextPageToken until it is empty.",
      "in": "query",
      "name": "pageSize",
      "required": false,
      "schema": {
        "title": "page_size",
        "type": "integer"
      }
    },
    {
      "description": "page_token is an optional continuation token.",
      "in": "query",
      "name": "pageToken",
      "required": false,
      "schema": {
        "title": "page_token",
        "type": "string"
      }
    },
    {
      "description": "order_by is a single order field with optional direction; the portable field is\npath.",
      "in": "query",
      "name": "orderBy",
      "required": false,
      "schema": {
        "title": "order_by",
        "type": "string"
      }
    }
  ],
  "responses": {
    "200": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/FilesListResponse"
          }
        }
      },
      "description": "Success"
    },
    "default": {
      "content": {
        "application/json": {
          "schema": {
            "$ref": "#/components/schemas/Error"
          }
        }
      },
      "description": "The structured Error body identifies the failure with a stable code and optional typed details."
    }
  },
  "security": [
    {
      "sandboxBearer": []
    }
  ],
  "servers": [
    {
      "url": "{endpoint}",
      "variables": {
        "endpoint": {
          "default": "https://sandbox.invalid",
          "description": "The sandbox API base URL from Sandbox.core.endpoint.uri; preserve its path prefix when appending /v1 routes. HTTP endpoints require a scoped endpoint bearer; direct Unix sockets use socket access control."
        }
      }
    }
  ],
  "summary": "List lists directory entries by path ascending.",
  "tags": [
    "Files"
  ],
  "x-sbx-authenticated-only": false,
  "x-sbx-conditional-permissions": [],
  "x-sbx-plane": "data",
  "x-sbx-required-permissions": [
    "sandboxesFilesRead"
  ],
  "x-sbx-serving-surface": "sandboxEndpoint"
}
```

## Referenced schemas

- [#/components/schemas/Error](/reference/api/sandboxes/latest/schemas/Error/)

- [#/components/schemas/FilesListResponse](/reference/api/sandboxes/latest/schemas/FilesListResponse/)




