v1

latestOpenAPI 3.0.12026-07-17311136.1 KB
contents

Save or upload file.

Saves the file in the location specified by name and path. PUT is very similar to POST, but the requester specifies the name, whereas with POST, the server picks the name.

put/api/contents/{path}

Path parameters

pathstring required

file path

Request body

namestring

The new filename if changed

pathstring

New path for file or directory

typestring

Path dtype ('notebook', 'file', 'directory')

formatstring

File format ('json', 'text', 'base64')

contentstring

The actual body of the document excluding directory type

Response

File saved

namestring required

Name of file or directory, equivalent to the last part of the path

pathstring required

Full path for file or directory

type'directory' | 'file' | 'notebook' required

Type of content

writableboolean required

indicates whether the requester has permission to edit the file

createdstring dateTime required

Creation timestamp

last_modifiedstring dateTime required

Last modified timestamp

sizeinteger

The size of the file or notebook in bytes. If no size is provided, defaults to null.

mimetypestring required

The mimetype of a file. If content is not null, and type is 'file', this will contain the mimetype of the file, otherwise this will be null.

formatstring required

Format of content (one of null, 'text', 'base64', 'json')

hashstring

[optional] The hexdigest hash string of content, if requested (otherwise null). It cannot be null if hash_algorithm is defined.

hash_algorithmstring

[optional] The algorithm used to produce the hash, if requested (otherwise null). It cannot be null if hash is defined.