---
title: "Create a case directory"
method: POST
path: "/api/directories"
tags: ["Test Cases"]
---

# Create a case directory

`POST /api/directories`

## Request

- Base URL: `https://aximo.autify.com`
- URL: `https://aximo.autify.com/api/directories`
- Auth: API key in header `x-api-key`
- TypeScript: <https://skmtc.dev/autify/apis/aximo-api/docs/api/directories/post.ts> (a function with typed inputs; its response is checked against the schema)

Create a folder for test cases. `parentPath` nests it, and any missing parent
folders are created too. The name and each parent segment are trimmed, must
not be empty or contain `/` or control characters, and are at most 255
characters; the full path is at most 1000 characters. Names are case-sensitive.

Creating a path that already exists is not an error: the existing folder is
returned with `created: false` and status `200`, so a script can safely run
again. A new folder returns `created: true` and status `201`.

## Request body

- object
  - `projectId` string, uuid, required: ID of the workspace to create the folder in.
  - `name` string, required: Folder name. Must not contain `/` or control characters.
  - `parentPath` string: Parent folder path, such as `/Regression` or `Regression/Login`. Omit it (or pass `/`) to create the folder at the workspace root.

## Response `200`

The folder already existed and is returned unchanged.

- CreateDirectoryResult
  - `success` boolean, required
  - `directoryId` string, uuid, required: Use as `directoryId` on `POST /api/cases`.
  - `path` string, required: The folder's normalized full path.
  - `created` boolean, required: `false` when the folder already existed.

## Other responses

- `201`: Folder created.
- `400`: Invalid request body or folder name. Fields this endpoint does not define carry `details.unknownFields` and `details.hint`.
- `401`: Missing or invalid API key.
- `403`: API key is not scoped to an organization, the user is banned, or the user is no longer a member of the organization.
- `404`: Project not found.
- `429`: Rate limit exceeded — e.g. the daily session limit was reached for the organization, or too many API requests were sent in a short window (retry after the number of seconds in the `Retry-After` header).
- `500`: Unexpected server error.

---

[API](https://skmtc.dev/autify/apis/aximo-api.md) - [All operations](https://skmtc.dev/autify/apis/aximo-api/llms.txt) - [OpenAPI document](https://skmtc.dev/autify/apis/aximo-api/revisions/590722011284?raw)
