# Create

Launch stage: GA

`POST /api/2.0/dbfs/create`

Opens a stream to write to a file and returns a handle to this stream.
 There is a 10 minute idle timeout on this handle. If a file or directory already exists on the given path
 and __overwrite__ is set to false, this call will throw an exception with ``RESOURCE_ALREADY_EXISTS``.

 A typical workflow for file upload would be:

 1. Issue a ``create`` call and get a handle.
 2. Issue one or more ``add-block`` calls with the handle you have.
 3. Issue a ``close`` call with the handle you have.

API scopes: files

## Request body

- `path` (string, optional)
  The path of the new file. The path should be the absolute DBFS path.
  Example: `/mnt/foo`
- `overwrite` (boolean, optional)
  The flag that specifies whether to overwrite existing file/files.
  Default: `false`

## Returns

- `handle` (int64, optional)
  Handle which should subsequently be passed into the AddBlock and Close calls when writing to a file through a stream.

## Response

```json
{
  "handle": 0
}
```

