---
title: "Create a file"
method: POST
path: "/v2/files"
tags: ["Files"]
---

# Create a file

`POST /v2/files`

## Request

- Base URL: `https://api.sigmacomputing.com`
- URL: `https://api.sigmacomputing.com/v2/files`
- Auth: HTTP bearer

Create an empty workspace, folder, workbook, or report in Sigma.

  ### Usage notes
  - Specify a **parentId** for a folder, workbook, or report to place it within another folder. Retrieve the ID to use as a **parentId** by calling the [/v2/files](https://help.sigmacomputing.com/reference/list-files) endpoint and reviewing the `id` field in the response for files with a `type` of `folder`.
  - Specify an **ownerId** for a folder, workbook, or report to create it on behalf of another user. Retrieve the **memberId** by calling the [/v2/members](https://help.sigmacomputing.com/reference/list-members) endpoint.

  ### Usage scenarios
  - **Project onboarding**: Start a new project by creating a workspace and folders to contain the workbooks for the project.

## Request body

- union
  - FilesCreateRequest0: Workspace to create
    - `type` 'workspace', required
    - `name` string, required
  - FilesCreateRequest1: Folder to create
    - `type` 'folder', required
    - `name` string, required
    - `description` string
    - `ownerId` string
    - `parentId` string
  - FilesCreateRequest2: Workbook to create
    - `type` 'workbook', required
    - `name` string, required
    - `description` string
    - `ownerId` string
    - `parentId` string
    - `source` V2FilesPostRequestBodyContentApplicationJsonSchemaOneOf2Source
      - `inodeId` string, required
      - `version` number, double, required
  - FilesCreateRequest3: Report to create
    - `type` 'report', required
    - `name` string, required
    - `description` string
    - `ownerId` string
    - `parentId` string

## Response `200`

The response body.

- FilesCreateResponse200
  - `id` string, required
  - `urlId` string, required
  - `name` string, required
  - `type` 'workspace' | 'folder' | 'workbook' | 'dataset' | 'data-model' | 'sql' | 'worksheet' | 'dashboard' | 'template' | 'table' | 'symlink' | 'report', required
  - `parentId` string, required
  - `parentUrlId` string, required
  - `permission` 'create' | 'annotate' | 'organize' | 'explore' | 'view' | 'edit' | 'apply', required
  - `path` string, required
  - `badge` string, nullable, required
  - `isArchived` boolean, required
  - `description` string
  - `ownerId` string, nullable
  - `parentSourceUrlId` string: For a document deployed to a tenant organization, the `urlId` of the source document in the parent organization. Only present when the document was deployed from a parent organization. The source document can be a workbook, template, data model, dataset, or report.
  - `createdBy` string, required: The identifier of the user who created this object.
  - `updatedBy` string, required: The identifier of the user or process that last updated this object.
  - `createdAt` string, date-time, required: When the object was created.
  - `updatedAt` string, date-time, required: When the object was last updated.

---

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