---
title: "Create directory"
method: POST
path: "/streaming/directories"
tags: ["Directories"]
---

# Create directory

`POST /streaming/directories`

Use this method to create a new directory entity.

## Request body

- DirectoryPost
  - `name` string, required — Title of the directory.
  - `parent_id` integer — ID of a parent directory. "null" if it's in the root.

## Response `200`

Successful

- DirectoryBase
  - `id` integer — ID of the directory
  - `name` string — Title of the directory
  - `parent_id` integer — ID of a parent directory. "null" if it's in the root.
  - `items_count` integer — Number of objects in this directory. Counting files and folders. The quantity is calculated only at one level (not recursively in all subfolders).
  - `created_at` string — Time of creation. Datetime in ISO 8601 format.
  - `updated_at` string — Time of last update of the directory entity. Datetime in ISO 8601 format.

## Other responses

- `422` — Possible error messages: **{ "errors": { "name": [ "can't be blank" ] } }** *Name* is a required parameter, so it must be specified

---

[API](https://skmtc.net/g-core/apis/gcore-openapi.md) · [All operations](https://skmtc.net/g-core/apis/gcore-openapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/g-core/gcore-openapi/revisions/09e652815095/schema)
