Create a new directory at the specified Viking URI.
Python SDK
from openviking import OpenViking
client = OpenViking()
# Create a new directory
client.mkdir("viking://resources/new-project/")
HTTP API
curl -X POST http://localhost:1933/api/v1/fs/mkdir \
-H "Content-Type: application/json" \
-H "X-API-Key: your-key" \
-d '{
"uri": "viking://resources/new-project/"
}'
POST /api/v1/fs/mkdir
{
"uri": "viking://resources/new-project/"
}
Parameters
Viking URI for the new directory (must end with /)
Response
Operation status (ok on success)
Result object containing the created directory URI
Viking URI of the created directory
Execution time in seconds
{
"status": "ok",
"result": {
"uri": "viking://resources/new-project/"
},
"time": 0.1
}
CLI
openviking mkdir viking://resources/new-project/
Notes
- The URI should end with a trailing slash (
/) to indicate it’s a directory
- Parent directories are created automatically if they don’t exist
- If the directory already exists, the operation succeeds without error