---
title: "Validate directory existence"
method: POST
path: "/validate-directory"
tags: ["Files"]
---

# Validate directory existence

`POST /validate-directory`

Check if a directory exists and whether it can be created

## Request body

- ValidateDirectoryRequest
  - `path` string, required — Directory path to validate

## Response `200`

Directory validation result

- ValidateDirectoryResponse
  - `exists` boolean, required — Whether the directory exists
  - `isDirectory` boolean — Whether the path is a directory (only set if exists is true)
  - `canCreate` boolean — Whether the directory can be created (only set if exists is false)
  - `expandedPath` string, required — The expanded path with ~ resolved
  - `error` string — Error message if path validation failed

## Other responses

- `500` — Internal server error

## Changes

- **2025-10-22** `6efa8b3bf121` — 1 info
  - endpoint added
- **2025-08-05** `f3a20bfa8bea` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/humanlayer/apis/humanlayer-daemon-rest-api/changes/validate-directory/post.md)

---

[API](https://skmtc.dev/humanlayer/apis/humanlayer-daemon-rest-api.md) · [All operations](https://skmtc.dev/humanlayer/apis/humanlayer-daemon-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/humanlayer/humanlayer-daemon-rest-api/revisions/02da8cb8aa12/schema)
