---
title: "Create a node in the filesystem tree"
method: POST
path: "/api/v2/namespaces/{namespace}/files/{path}"
tags: ["files"]
---

# Create a node in the filesystem tree

`POST /api/v2/namespaces/{namespace}/files/{path}`

## Path parameters

- `namespace` string, required
- `path` string, required — path of the parent node (with slashes)

## Request body

- object
  - `name` string — name of the node(file or directory name)
  - `type` 'directory' | 'file' | 'workflow' | 'service' | 'endpoint' | 'consumer' — type of the node
  - `mimeType` string — (only with type != directory) mime type of the file content
  - `data` string — (only with type != directory) base64 encoded string of the file content

## Response `200`

filesystem tree node created successfully

- object
  - `data` FileNodeWithoutData — filesystem node data
    - `path` string — path of the node
    - `type` 'directory' | 'file' | 'workflow' | 'service' | 'endpoint' | 'consumer' — type of the node
    - `mimeType` string — (only with type != directory) mime type of the file content
    - `size` number — (only with type != directory) file size in bytes
    - `createdAt` string — timestamp of node creation date
    - `updatedAt` string — timestamp of node last updating date

---

[API](https://skmtc.net/direktiv/apis/direktiv-apiv2-reference.md) · [All operations](https://skmtc.net/direktiv/apis/direktiv-apiv2-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/direktiv/direktiv-apiv2-reference/revisions/ad935afb0f54/schema)
