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

# List files

GET https://content-gateway-example.com/v1/files

Retrieve files in a specific node, providing features like querying, filtering, and detailed navigational information including parent folder details and direct download URLs.


Reference: https://help.moveworks.com/api-reference/content-gateway/content-gateway/list-files

## Request

### Query parameters

- `$filter` (string, optional) — Filter content items by a condition.
- `$select` (string, optional) — Select which properties to include in the response for the content items.
- `$orderby` (string, optional) — Order content items by specific fields.
- `$top` (integer, optional) — Specify the number of content results to return.
- `$skip` (integer, optional) — Skip the first n content results.

## Response

### 200

Successfully retrieved list of content items with enhanced information.

- `@odata.context` (string, optional) — URL to the metadata of the response.
- `value` (list of object, optional)
  - `id` (string, required) — Unique id for each file
  - `name` (string, required) — User friendly name for the file
  - `last_modified_datetime` (datetime, required) — Used to efficiently ingest content only updated since last ingestion
  - `external_url` (string, required) — External URL to redirect users
  - `status` (enum, optional)
    - Allowed values: `active`, `deleted`
  - `custom_attributes` (map from string to string, optional) — A map of string to string for representing custom attributes.
  - `last_modified_by` (string, optional)
  - `created_datetime` (datetime, optional)
  - `created_by` (string, optional)
  - `metadata_url` (string, optional) — Used to retrieve metadata about individual files
  - `content` (object, optional)
    - `mime_type` (string, required) — Used to specify type of content. See our supported MIME types here: https://docs.moveworks.com/api-reference/content-gateway/supported-mime-types.
    - `download_path` (string, optional) — URL for the download request. For file streams: use `/{id}/download`. Not required for HTML content.
    - `size` (long, optional)
    - `sha1_hash` (string, optional)
  - `parent_info` (object, optional)
    - `id` (string, required)
    - `name` (string, required)
    - `path` (string, optional)
  - `children_url` (string, optional)
- `@odata.nextLink` (string, optional) — URL to fetch the next set of results.

## Errors

### 400 Bad Request Error

Bad Request - The request could not be understood due to malformed syntax.

- `error` (object, required)
  - `code` (string, required) — Standard error code (e.g., UNAUTHORIZED, INVALID_ARGUMENT, NOT_FOUND).
  - `message` (string, required) — Human-readable explanation of the error.

### 401 Unauthorized Error

Unauthorized - Authentication is required and has failed or has not yet been provided.

- `error` (object, required)
  - `code` (string, required) — Standard error code (e.g., UNAUTHORIZED, INVALID_ARGUMENT, NOT_FOUND).
  - `message` (string, required) — Human-readable explanation of the error.

### 403 Forbidden Error

Forbidden - Server understood the request but refuses to authorize it.

- `error` (object, required)
  - `code` (string, required) — Standard error code (e.g., UNAUTHORIZED, INVALID_ARGUMENT, NOT_FOUND).
  - `message` (string, required) — Human-readable explanation of the error.

### 404 Not Found Error

Not Found - The requested resource could not be found.

- `error` (object, required)
  - `code` (string, required) — Standard error code (e.g., UNAUTHORIZED, INVALID_ARGUMENT, NOT_FOUND).
  - `message` (string, required) — Human-readable explanation of the error.

### 429 Too Many Requests Error

Too Many Requests - Rate limit exceeded.

- `error` (object, required)
  - `code` (string, required) — Standard error code (e.g., UNAUTHORIZED, INVALID_ARGUMENT, NOT_FOUND).
  - `message` (string, required) — Human-readable explanation of the error.

## Examples

**Response**

```json
{
  "@odata.context": "https://content-gateway-example.com/v1/$metadata#Content",
  "value": [
    {
      "id": "12345",
      "name": "Document or Folder Name",
      "last_modified_datetime": "2023-04-17T12:34:56Z",
      "external_url": "https://intranet.example.com/files/AnnualReport2024.pdf",
      "status": "active",
      "custom_attributes": {},
      "last_modified_by": "john_doe@abc.com",
      "created_datetime": "2023-01-01T00:00:00Z",
      "created_by": "jane_doe@abc.com",
      "metadata_url": "https://intranet.example.com/content/files/<file_id>",
      "content": {
        "mime_type": "application/pdf",
        "download_path": "/12345/download",
        "size": 102400,
        "sha1_hash": "2fd4e1c67a2d28fced849ee1bb76e7391b93eb12"
      },
      "parent_info": {
        "id": "parent123",
        "name": "Parent Node Name",
        "path": "/reports/2023"
      },
      "children_url": "https://content-gateway-example.com/v1/content/files?$filter=(folder eq 12345)"
    }
  ],
  "@odata.nextLink": "https://content-gateway-example.com/v1/content?$filter=(category in (retail, sales) and file_type in (pdf, docx))&$top=10&$skip=10&$orderby=createdDateTime desc"
}
```

**SDK Code**

```python
import requests

url = "https://content-gateway-example.com/v1/files"

response = requests.get(url)

print(response.json())
```

```javascript
const url = 'https://content-gateway-example.com/v1/files';
const options = {method: 'GET'};

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

```go
package main

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

func main() {

	url := "https://content-gateway-example.com/v1/files"

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

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

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

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

}
```

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

url = URI("https://content-gateway-example.com/v1/files")

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

request = Net::HTTP::Get.new(url)

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

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

HttpResponse<String> response = Unirest.get("https://content-gateway-example.com/v1/files")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://content-gateway-example.com/v1/files');

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

```csharp
using RestSharp;

var client = new RestClient("https://content-gateway-example.com/v1/files");
var request = new RestRequest(Method.GET);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "https://content-gateway-example.com/v1/files")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"

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()
```