---
title: "Add Directory"
method: POST
path: "/projects/{projectId}/directories"
tags: ["Source Files"]
---

# Add Directory

`POST /projects/{projectId}/directories`

## Request

- Base URL: `https://api.crowdin.com/api/v2`
- URL: `https://api.crowdin.com/api/v2/projects/{projectId}/directories`
- Auth: none declared
- TypeScript: <https://skmtc.dev/crowdin/apis/crowdin-enterprise-api-v2/docs/projects/:projectId/directories/post.ts> (a function with typed inputs; its response is checked against the schema)

**Required scopes:** `project.source.file` (Read and Write).

## Path parameters

- `projectId` integer, required

## Request body

- DirectoryCreateForm
  - `name` string, required: Directory name __Note:__ Can't contain `\ / : * ? " < > |` symbols
  - `branchId` integer: Branch identifier. Get via [List Branches](#operation/api.projects.branches.getMany) __Note:__ Can't be used with `directoryId` in same request
  - `directoryId` integer: Parent Directory Identifier. Get via [List Directories](#operation/api.projects.directories.getMany) __Note:__ Can't be used with `branchId` in same request
  - `title` string: Use to provide more details for translators. Title is available in UI only
  - `exportPattern` string: Directory export pattern. Defines directory name and path in resulting translations bundle __Note:__ Can't contain `: * ? " < > |` symbols
  - `priority` 'low' | 'normal' | 'high': Defines priority level for each branch

## Response `201`

Directory was successfully created

- DirectoryResource: Base schema of resource container. Container is a wrapper object that contains payload in required `data` property and provides space for adding any other metadata.
  - `data` Directory, required: Class DirectoryResponseModel
    - `id` integer
    - `projectId` integer
    - `branchId` integer, nullable
    - `directoryId` integer, nullable: Parent directory id
    - `name` string
    - `title` string: Title for translators
    - `exportPattern` string
    - `path` string
    - `priority` string
    - `createdAt` string, date-time, nullable
    - `updatedAt` string, date-time, nullable

## Other responses

- `400`: Invalid Request Parameters
- `401`: Unauthorized
- `403`: Forbidden
- `404`: Project, branch, or parent directory with specified id was not found
- `405`: Method Not Allowed
- `503`: Service Unavailable

---

[API](https://skmtc.dev/crowdin/apis/crowdin-enterprise-api-v2.md) - [All operations](https://skmtc.dev/crowdin/apis/crowdin-enterprise-api-v2/llms.txt) - [OpenAPI document](https://skmtc.dev/crowdin/apis/crowdin-enterprise-api-v2/revisions/dc68744c5384?raw)
