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

# Create a file

POST https://api.sigmacomputing.com/v2/files
Content-Type: application/json

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.
    

Reference: https://help.sigmacomputing.com/reference/create-file

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: sigma-rest-api
  version: 1.0.0
paths:
  /v2/files:
    post:
      operationId: create
      summary: Create a file
      description: |-
        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.
            
      tags:
        - Files
      parameters:
        - name: Authorization
          in: header
          description: OAuth authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: The response body.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/files_create_Response_200'
      requestBody:
        description: The request body.
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/files_create_Request'
servers:
  - url: https://api.sigmacomputing.com
    description: Server for GCP (US) hosted organizations
  - url: https://api.sa.gcp.sigmacomputing.com
    description: Server for GCP (KSA) hosted organizations
  - url: https://aws-api.sigmacomputing.com
    description: Server for AWS US (West) hosted organizations
  - url: https://api.us-a.aws.sigmacomputing.com
    description: Server for AWS US (East) hosted organizations
  - url: https://api.ca.aws.sigmacomputing.com
    description: Server for AWS Canada hosted organizations
  - url: https://api.eu.aws.sigmacomputing.com
    description: Server for AWS Europe hosted organizations
  - url: https://api.au.aws.sigmacomputing.com
    description: Server for AWS Australia and APAC hosted organizations
  - url: https://api.uk.aws.sigmacomputing.com
    description: Server for AWS UK hosted organizations
  - url: https://api.us.azure.sigmacomputing.com
    description: Server for Azure US hosted organizations
  - url: https://api.eu.azure.sigmacomputing.com
    description: Server for Azure Europe hosted organizations
  - url: https://api.ca.azure.sigmacomputing.com
    description: Server for Azure Canada hosted organizations
  - url: https://api.uk.azure.sigmacomputing.com
    description: Server for Azure United Kingdom hosted organizations
  - url: https://api.au.azure.sigmacomputing.com
    description: Server for Azure Australia hosted organizations
components:
  schemas:
    V2FilesPostRequestBodyContentApplicationJsonSchemaOneOf0Type:
      type: string
      enum:
        - workspace
      title: V2FilesPostRequestBodyContentApplicationJsonSchemaOneOf0Type
    FilesCreateRequest0:
      type: object
      properties:
        type:
          $ref: >-
            #/components/schemas/V2FilesPostRequestBodyContentApplicationJsonSchemaOneOf0Type
        name:
          type: string
      required:
        - type
        - name
      description: Workspace to create
      title: FilesCreateRequest0
    V2FilesPostRequestBodyContentApplicationJsonSchemaOneOf1Type:
      type: string
      enum:
        - folder
      title: V2FilesPostRequestBodyContentApplicationJsonSchemaOneOf1Type
    FilesCreateRequest1:
      type: object
      properties:
        type:
          $ref: >-
            #/components/schemas/V2FilesPostRequestBodyContentApplicationJsonSchemaOneOf1Type
        name:
          type: string
        description:
          type: string
        ownerId:
          type: string
        parentId:
          type: string
      required:
        - type
        - name
      description: Folder to create
      title: FilesCreateRequest1
    V2FilesPostRequestBodyContentApplicationJsonSchemaOneOf2Type:
      type: string
      enum:
        - workbook
      title: V2FilesPostRequestBodyContentApplicationJsonSchemaOneOf2Type
    V2FilesPostRequestBodyContentApplicationJsonSchemaOneOf2Source:
      type: object
      properties:
        inodeId:
          type: string
        version:
          type: number
          format: double
      required:
        - inodeId
        - version
      title: V2FilesPostRequestBodyContentApplicationJsonSchemaOneOf2Source
    FilesCreateRequest2:
      type: object
      properties:
        type:
          $ref: >-
            #/components/schemas/V2FilesPostRequestBodyContentApplicationJsonSchemaOneOf2Type
        name:
          type: string
        description:
          type: string
        ownerId:
          type: string
        parentId:
          type: string
        source:
          $ref: >-
            #/components/schemas/V2FilesPostRequestBodyContentApplicationJsonSchemaOneOf2Source
      required:
        - type
        - name
      description: Workbook to create
      title: FilesCreateRequest2
    V2FilesPostRequestBodyContentApplicationJsonSchemaOneOf3Type:
      type: string
      enum:
        - report
      title: V2FilesPostRequestBodyContentApplicationJsonSchemaOneOf3Type
    FilesCreateRequest3:
      type: object
      properties:
        type:
          $ref: >-
            #/components/schemas/V2FilesPostRequestBodyContentApplicationJsonSchemaOneOf3Type
        name:
          type: string
        description:
          type: string
        ownerId:
          type: string
        parentId:
          type: string
      required:
        - type
        - name
      description: Report to create
      title: FilesCreateRequest3
    files_create_Request:
      oneOf:
        - $ref: '#/components/schemas/FilesCreateRequest0'
        - $ref: '#/components/schemas/FilesCreateRequest1'
        - $ref: '#/components/schemas/FilesCreateRequest2'
        - $ref: '#/components/schemas/FilesCreateRequest3'
      title: files_create_Request
    V2FilesPostResponsesContentApplicationJsonSchemaType:
      type: string
      enum:
        - workspace
        - folder
        - workbook
        - dataset
        - data-model
        - sql
        - worksheet
        - dashboard
        - template
        - table
        - symlink
        - report
      title: V2FilesPostResponsesContentApplicationJsonSchemaType
    V2FilesPostResponsesContentApplicationJsonSchemaPermission0:
      type: string
      enum:
        - create
      title: V2FilesPostResponsesContentApplicationJsonSchemaPermission0
    V2FilesPostResponsesContentApplicationJsonSchemaPermission1:
      type: string
      enum:
        - annotate
      title: V2FilesPostResponsesContentApplicationJsonSchemaPermission1
    V2FilesPostResponsesContentApplicationJsonSchemaPermission2:
      type: string
      enum:
        - organize
      title: V2FilesPostResponsesContentApplicationJsonSchemaPermission2
    V2FilesPostResponsesContentApplicationJsonSchemaPermission3:
      type: string
      enum:
        - explore
      title: V2FilesPostResponsesContentApplicationJsonSchemaPermission3
    V2FilesPostResponsesContentApplicationJsonSchemaPermission40:
      type: string
      enum:
        - view
      title: V2FilesPostResponsesContentApplicationJsonSchemaPermission40
    V2FilesPostResponsesContentApplicationJsonSchemaPermission41:
      type: string
      enum:
        - edit
      title: V2FilesPostResponsesContentApplicationJsonSchemaPermission41
    V2FilesPostResponsesContentApplicationJsonSchemaPermission42:
      type: string
      enum:
        - apply
      title: V2FilesPostResponsesContentApplicationJsonSchemaPermission42
    V2FilesPostResponsesContentApplicationJsonSchemaPermission4:
      oneOf:
        - $ref: >-
            #/components/schemas/V2FilesPostResponsesContentApplicationJsonSchemaPermission40
        - $ref: >-
            #/components/schemas/V2FilesPostResponsesContentApplicationJsonSchemaPermission41
        - $ref: >-
            #/components/schemas/V2FilesPostResponsesContentApplicationJsonSchemaPermission42
      title: V2FilesPostResponsesContentApplicationJsonSchemaPermission4
    V2FilesPostResponsesContentApplicationJsonSchemaPermission:
      oneOf:
        - $ref: >-
            #/components/schemas/V2FilesPostResponsesContentApplicationJsonSchemaPermission0
        - $ref: >-
            #/components/schemas/V2FilesPostResponsesContentApplicationJsonSchemaPermission1
        - $ref: >-
            #/components/schemas/V2FilesPostResponsesContentApplicationJsonSchemaPermission2
        - $ref: >-
            #/components/schemas/V2FilesPostResponsesContentApplicationJsonSchemaPermission3
        - $ref: >-
            #/components/schemas/V2FilesPostResponsesContentApplicationJsonSchemaPermission4
      title: V2FilesPostResponsesContentApplicationJsonSchemaPermission
    files_create_Response_200:
      type: object
      properties:
        id:
          type: string
        urlId:
          type: string
        name:
          type: string
        type:
          $ref: >-
            #/components/schemas/V2FilesPostResponsesContentApplicationJsonSchemaType
        parentId:
          type: string
        parentUrlId:
          type: string
        permission:
          $ref: >-
            #/components/schemas/V2FilesPostResponsesContentApplicationJsonSchemaPermission
        path:
          type: string
        badge:
          type:
            - string
            - 'null'
        isArchived:
          type: boolean
        description:
          type: string
        ownerId:
          type:
            - string
            - 'null'
        parentSourceUrlId:
          type: string
          description: >-
            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:
          type: string
          description: The identifier of the user who created this object.
        updatedBy:
          type: string
          description: The identifier of the user or process that last updated this object.
        createdAt:
          type: string
          format: date-time
          description: When the object was created.
        updatedAt:
          type: string
          format: date-time
          description: When the object was last updated.
      required:
        - id
        - urlId
        - name
        - type
        - parentId
        - parentUrlId
        - permission
        - path
        - badge
        - isArchived
        - createdBy
        - updatedBy
        - createdAt
        - updatedAt
      title: files_create_Response_200
  securitySchemes:
    OAuth:
      type: http
      scheme: bearer
      description: OAuth 2.0 authentication

```

## Examples



**Request**

```json
{
  "name": "string",
  "type": "workspace"
}
```

**Response**

```json
{
  "id": "00000000-0000-0000-0000-000000000000",
  "urlId": "57a96EMo3GVJG73179MV2l",
  "name": "Examples",
  "type": "folder",
  "parentId": "00000000-0000-0000-0000-000000000001",
  "parentUrlId": "57a96EMo3GVJG73179MV2G",
  "permission": "create",
  "path": "My Documents/Examples",
  "badge": "Endorsed",
  "isArchived": false,
  "createdBy": "<memberId>",
  "updatedBy": "<memberId>",
  "createdAt": "2022-11-22T22:33:47.323Z",
  "updatedAt": "2022-11-22T22:33:47.323Z",
  "description": "Examples description",
  "ownerId": "<memberId>"
}
```

**SDK Code**

```python Response Example
import requests

url = "https://api.sigmacomputing.com/v2/files"

payload = {
    "name": "string",
    "type": "workspace"
}
headers = {
    "Authorization": "<token>.",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.json())
```

```javascript Response Example
const url = 'https://api.sigmacomputing.com/v2/files';
const options = {
  method: 'POST',
  headers: {Authorization: '<token>.', 'Content-Type': 'application/json'},
  body: '{"name":"string","type":"workspace"}'
};

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

```go Response Example
package main

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

func main() {

	url := "https://api.sigmacomputing.com/v2/files"

	payload := strings.NewReader("{\n  \"name\": \"string\",\n  \"type\": \"workspace\"\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "<token>.")
	req.Header.Add("Content-Type", "application/json")

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

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

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

}
```

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

url = URI("https://api.sigmacomputing.com/v2/files")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = '<token>.'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"string\",\n  \"type\": \"workspace\"\n}"

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

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

HttpResponse<String> response = Unirest.post("https://api.sigmacomputing.com/v2/files")
  .header("Authorization", "<token>.")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"string\",\n  \"type\": \"workspace\"\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.sigmacomputing.com/v2/files', [
  'body' => '{
  "name": "string",
  "type": "workspace"
}',
  'headers' => [
    'Authorization' => '<token>.',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Response Example
using RestSharp;

var client = new RestClient("https://api.sigmacomputing.com/v2/files");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "<token>.");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"string\",\n  \"type\": \"workspace\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Response Example
import Foundation

let headers = [
  "Authorization": "<token>.",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "string",
  "type": "workspace"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.sigmacomputing.com/v2/files")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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