Rename a node
const url = 'https://work.optidata.cloud/api/drives/1/nodes/300754/rename';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"name":"NDA signed.pdf"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://work.optidata.cloud/api/drives/1/nodes/300754/rename \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "name": "NDA signed.pdf" }'Changes the name of a file or folder. Requires edit on the node.
Leading and trailing whitespace is trimmed; names that collide with a
sibling, or that contain characters the storage layer forbids, are
rejected with 422.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”Numeric id of the drive. Read it from GET /drives/config.json.
Numeric id of the node (file or folder).
Request Bodyrequired
Section titled “Request Bodyrequired”object
New name of the node.
Examples
{ "name": "NDA signed.pdf"}Responses
Section titled “ Responses ”The renamed node.
object
Examplegenerated
{}Missing, malformed or expired authentication key.
Authentication failures use an error key rather than message.
object
Examples
No bearer token sent
{ "error": "JWT passport exception: Missing bearer token in request"}The caller lacks the permission level the operation requires.
Generic error envelope used by policy, binding and framework failures.
object
Human-readable description of the failure.
Examples
{ "message": "This action is unauthorized."}The resource does not exist, or does not belong to the given drive.
Generic error envelope used by policy, binding and framework failures.
object
Human-readable description of the failure.
Examples
{ "message": "No query results for model [App\\Models\\Node] 99999999"}The request body or query string failed validation.
object
The first validation message.
Validation messages keyed by field name.
object
Examples
{ "message": "The name field is required.", "errors": { "name": [ "The name field is required." ] }}Rate limit exceeded. Retry after the window resets.
Generic error envelope used by policy, binding and framework failures.
object
Human-readable description of the failure.
Examples
{ "message": "Too Many Attempts."}