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

# Create a directory

`POST /v1/directories`

## Request

- Base URL: `https://api.capacity.com` (the document declares no server; this is the origin it was published from)
- URL: `https://api.capacity.com/v1/directories`
- Auth: one of:
  - API key in header `x-capacity-id`
  - HTTP bearer

Create a directory.

## Request body

- DirectoryPostSchema
  - `name` string, required: The name of the directory

## Response `201`

The newly created directory

- object
  - `body` object: Json body data in the request
  - `parameters` object: Query parameters in the request
  - `result` DirectoryGetSchema
    - `id` string: ID of the directory
    - `name` string: Name of the directory

## Other responses

- `400`: The request contains malformed data or violates data integrity
- `422`: The request was well-formed but was unable to be followed due to semantic errors. This is usually due to the request data failing to pass validations.

---

[API](https://skmtc.dev/capacity/apis/capacity-api-docs.md) - [All operations](https://skmtc.dev/capacity/apis/capacity-api-docs/llms.txt) - [OpenAPI document](https://skmtc.dev/capacity/apis/capacity-api-docs/revisions/74c85bb61004?raw)
