# Export

Launch stage: GA

`GET /api/2.0/workspace/export`

Exports an object or the contents of an entire directory.
 
 If `path` does not exist, this call returns an error `RESOURCE_DOES_NOT_EXIST`.
 
 If the exported data would exceed size limit, this call returns `MAX_NOTEBOOK_SIZE_EXCEEDED`.
 Currently, this API does not support exporting a library.

API scopes: workspace

## Query parameters

- `path` (string, optional)
  The absolute path of the object or directory. Exporting a directory is only supported for the `DBC`, `SOURCE`, and `AUTO` format.
- `format` (string, optional)
  This specifies the format of the exported file. By default, this is `SOURCE`.
  
    The value is case sensitive.
  
    - `SOURCE`: The notebook is exported as source code. Directory exports will not include non-notebook entries.
    - `HTML`: The notebook is exported as an HTML file.
    - `JUPYTER`: The notebook is exported as a Jupyter/IPython Notebook file.
    - `DBC`: The notebook is exported in <Databricks> archive format. Directory exports will not include non-notebook entries.
    - `R_MARKDOWN`: The notebook is exported to R Markdown format.
    - `AUTO`: The object or directory is exported depending on the objects type. Directory exports will include notebooks and workspace files.
  Possible values: `SOURCE`, `HTML`, `JUPYTER`, `DBC`, `R_MARKDOWN`, `AUTO`, `RAW`
  Default: `SOURCE`
- `direct_download` (boolean, optional)
  Flag to enable direct download. If it is `true`, the response is the exported file itself.
   Otherwise, by default, the response contains content in the form of a base64 encoded string.
  Default: `false`

## Returns

- `content` (string, optional)
  The base64-encoded content.
   If the limit (10MB) is exceeded, exception with error code **MAX_NOTEBOOK_SIZE_EXCEEDED** is thrown.
- `file_type` (string, optional)
  The file type of the exported file.

## Response

```json
{
  "content": "string",
  "file_type": "string"
}
```

