Create filePath via nextcloud api

Hi, how can i create a complete file path using the nextcloud api?

My MKCOL request looks like this:

https://domain/remote.php/dav/files/user/first/second/path

But if nextcloud need to create the complete structure i get:

<?xml version="1.0" encoding="utf-8"?>

<d:error xmlns:d=“DAV:” xmlns:s=“sabre/dav”>
<s:exception>Sabre\DAV\Exception\Conflict</s:exception>
<s:message>Parent node does not exist</s:message>
</d:error>

If i just use:

https://domain/remote.php/dav/files/user/first/

it will work.

That’s correct MKCOL behavior. WebDAV (not Nextcloud) requires ancestors (parents) to exist.