---
title: "Create View"
method: POST
path: "/folder/{folderId}/views"
tags: ["Folder"]
---

# Create View

`POST /folder/{folderId}/views`

## Request

- Base URL: `https://api.speakai.co/v1`
- URL: `https://api.speakai.co/v1/folder/{folderId}/views`
- Auth: API key in header `x-speakai-key` and API key in header `x-access-token`

Create a new view for a specific folder. Column types can be:

**FieldType values:**
- text
- url
- boolean
- date
- datetime
- number
- currency

**DefaultViewColumn values:**
- name
- duration
- tags
- sentiment
- datetime
- createdAt
- updatedAt

## Path parameters

- `folderId` string, required

## Request body

- object
  - `name` string, required: The name for the new view. Required.
  - `isDefault` boolean: Whether this view becomes the folder's default view. Setting it to true clears the default flag on your other active views in the folder. Optional. The schema declares a default of false, but the middleware discards the schema's converted value, so an omitted isDefault reaches the handler as undefined. The stored value still ends up false, because the FolderView model defaults isDefault to false.
  - `columns` object[], required: The columns the view shows, in the order you want them displayed. Required. Each entry must be an object matching columnSchema. No cap on the number of entries. An empty array passes validation, because the array has no.min.
    - `fieldId` string: The ID of the custom field this column shows. Leave it empty for a built-in column. Optional. Empty string and null are accepted.
    - `name` string: The heading shown for this column. Required.
    - `type` 'text' | 'url' | 'boolean' | 'date' | 'datetime' | 'number' | 'currency' | 'name' | 'duration' | 'tags' | 'sentiment' | 'size' | 'mediaType' | 'createdAt' | 'updatedAt': What kind of value the column holds. The accepted set is the FieldType values followed by the DefaultViewColumn values. Required. The value must be one of the listed values. The set is built from Object.values(FieldType) and Object.values(DefaultViewColumn), both declared in speak-shared and re-exported through and The raw.valid list contains "datetime" twice, because it appears in both enums; the accepted set is the 15 distinct values listed here.
    - `definition` string: An optional label describing what the column is derived from. Optional. Empty string and null are accepted.
    - `order` number: The position of the column in the view, counting from zero. The server replaces a value of 0 with the column's position in the array you sent, so a column with order 0 in third position is stored as 2. Required. Declared as Any number passes; there is no minimum and no integer-only rule. The handler stores col.order || index, which is why 0 is overwritten.

## Response `200`

Success. This spec records no example response body for this endpoint.

---

[API](https://skmtc.dev/speakai/apis/speak-ai-api.md) · [All operations](https://skmtc.dev/speakai/apis/speak-ai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/speakai/apis/speak-ai-api/revisions/52d777e6d46e?raw)
