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

# Get Folder Contents

GET https://api.coperniq.io/v1/folders/{folder_id}/contents

List a folder's direct children: subfolders, files, and forms filed directly in it (not further nested).

Each item carries a `type` field (`folder`, `file`, or `form`) telling you what it is. For `type: "folder"` items, call this same endpoint again with that folder's id to walk further in. Forms are ordinary files under the hood (`isForm: true` on the underlying file) that inherit their folder/phase placement, so they appear here rather than in a separate forms listing.

Note: on this endpoint (and the phase-contents endpoint), the file's MIME/category label is named `fileType` instead of `type`, to avoid colliding with the folder/file/form discriminator. This does not affect `GET /projects/{project_id}/files`, where `type` keeps its original meaning.

Reference: https://docs.coperniq.io/api-reference/folders/get-folder-contents

## Authentication

- `x-api-key` header (required) — API Key authentication via header

## Request

### Path parameters

- `folder_id` (integer, required) — Folder identifier

### Query parameters

- `include_archived` (boolean, optional, default: false) — Whether to include archived (inactive) records in the response. By default only active records are returned.

## Response

### 200

Successful response

- `list of FolderContentsItem`

## Errors

### 400 Bad Request Error

Invalid request

- `message` (string, optional)
- `code` (enum, optional)
  - Allowed values: `INTERNAL_SERVER_ERROR`
- `field` (string, optional) — Field that caused the validation error (if applicable)

### 404 Not Found Error

Resource not found

- `message` (string, optional)
- `code` (enum, optional)
  - Allowed values: `INTERNAL_SERVER_ERROR`

### 500 Internal Server Error

Internal server error

- `message` (string, optional)
- `code` (enum, optional)
  - Allowed values: `INTERNAL_SERVER_ERROR`

## Types

### FolderContentsItem

One row from a folder's or phase's `/contents` endpoint — a subfolder, file, or form. Discriminated by `type`.

- `type`: `folder` (folder)
  - `createdAt` (string, required) — Creation timestamp
  - `id` (integer, required) — Folder identifier
  - `isActive` (boolean, required) — Whether the folder is active (false if archived)
  - `name` (string, required) — Folder name
  - `projectId` (integer, required) — Project (or opportunity/account, under the hood) this folder belongs to
  - `updatedAt` (string, required) — Last update timestamp
  - `companyId` (integer, optional) — Owning company identifier
  - `createdBy` (integer, optional, nullable) — User who created the folder
  - `parentId` (integer, optional, nullable) — Parent folder id, if this folder is nested under another folder. Mutually exclusive with `phaseInstanceId`. Folders nest at most 2 levels deep.
  - `phaseInstanceId` (integer, optional, nullable) — Phase instance id, if this folder sits at the root of a phase. Mutually exclusive with `parentId`.
- `type`: `file` (file)
  - `createdAt` (string, required) — Creation timestamp
  - `downloadUrl` (string, required) — URL to download the file
  - `fileType` (string, required) — The file's MIME/category label (named `type` on GET /projects/\{project\_id}/files — renamed here to avoid colliding with this endpoint's folder/file/form discriminator).
  - `id` (integer, required) — File identifier
  - `name` (string, required) — File name
  - `updatedAt` (string, required) — Last update timestamp
  - `companyId` (integer, optional) — Owning company identifier
  - `createdByUser` (FolderContentsItemDiscriminatorMappingFormCreatedByUser, optional)
  - `formId` (integer, optional, nullable) — Linked Form entity id, present when `type` is `form`
  - `isArchived` (boolean, optional) — Whether the file is archived
  - `metaData` (FolderContentsItemDiscriminatorMappingFormMetaData, optional) — File metadata (size, MIME type, etc.) — see the `File` schema for the full shape
  - `source` (string, optional) — File source (e.g., INTERNAL)
- `type`: `form` (form)
  - `createdAt` (string, required) — Creation timestamp
  - `downloadUrl` (string, required) — URL to download the file
  - `fileType` (string, required) — The file's MIME/category label (named `type` on GET /projects/\{project\_id}/files — renamed here to avoid colliding with this endpoint's folder/file/form discriminator).
  - `id` (integer, required) — File identifier
  - `name` (string, required) — File name
  - `updatedAt` (string, required) — Last update timestamp
  - `companyId` (integer, optional) — Owning company identifier
  - `createdByUser` (FolderContentsItemDiscriminatorMappingFormCreatedByUser, optional)
  - `formId` (integer, optional, nullable) — Linked Form entity id, present when `type` is `form`
  - `isArchived` (boolean, optional) — Whether the file is archived
  - `metaData` (FolderContentsItemDiscriminatorMappingFormMetaData, optional) — File metadata (size, MIME type, etc.) — see the `File` schema for the full shape
  - `source` (string, optional) — File source (e.g., INTERNAL)

### FolderContentsItemDiscriminatorMappingFormCreatedByUser

- `id` (integer, optional)
- `firstName` (string, optional)
- `lastName` (string, optional)

### FolderContentsItemDiscriminatorMappingFormMetaData

File metadata (size, MIME type, etc.) — see the `File` schema for the full shape

## Examples

**Response**

```json
[
  {
    "type": "folder",
    "createdAt": "2024-01-15T09:30:00Z",
    "id": 1,
    "isActive": true,
    "name": "string",
    "projectId": 1,
    "updatedAt": "2024-01-15T09:30:00Z",
    "companyId": 1,
    "createdBy": 1,
    "parentId": 1,
    "phaseInstanceId": 1
  }
]
```

**SDK Code**

```python
import requests

url = "https://api.coperniq.io/v1/folders/1/contents"

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

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

print(response.json())
```

```javascript
const url = 'https://api.coperniq.io/v1/folders/1/contents';
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
package main

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

func main() {

	url := "https://api.coperniq.io/v1/folders/1/contents"

	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
require 'uri'
require 'net/http'

url = URI("https://api.coperniq.io/v1/folders/1/contents")

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
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.coperniq.io/v1/folders/1/contents")
  .header("x-api-key", "<apiKey>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.coperniq.io/v1/folders/1/contents', [
  'headers' => [
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.coperniq.io/v1/folders/1/contents");
var request = new RestRequest(Method.GET);
request.AddHeader("x-api-key", "<apiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.coperniq.io/v1/folders/1/contents")! 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()
```