Skip to Content
HelvetlyDocs
API referenceDocuments

Rename or move a document

Needs a token with the write:documents scope. Authentication

Try in Playground sends a real request to app.helvetly.com with a token you paste. It stays in this browser tab only (session storage) and goes to no one else.

PATCH
/api/v1/documents/{id}

Renames and/or moves a live document (name, folder_id; null folder_id is the top level). A name taken in the target folder follows on_conflict: fail answers 409 name_taken (details.suggestion), keep_both renames, replace trashes the other file. 409 trashed for a document in the Trash (restore it with bulk_documents first), 422 validation_failed for a bad name or a folder that no longer exists. Retrying the same body is safe.

Authorization

bearerAuth
headerAuthorizationBearer <token>

A personal API token, hvt_…, with scopes such as read:* or write:invoices

Path Parameters

id*string

The document's id.

Request Body

application/json
  1. body

Rename and/or move a live document. A trashed document answers 409 trashed.

name?string
Length1 <= length <= 255
folder_id?|

Move into this folder; null: top level.

on_conflict?string

A same-named live file in the target folder: fail (409 name_taken), keep_both ("Offer (2).pdf") or replace (the other file goes to the Trash; 409 retained if it is a business record).

Default"fail"
Value in"fail""keep_both""replace"

Response Body

OK

application/json
  1. response
data*

A document's metadata. The bytes come from download_document and get_document_content.

Example Request
curl -X PATCH 'https://app.helvetly.com/api/v1/documents/string' \  -H 'Content-Type: application/json' \  -d '{  "name": "Offer Acme 2026.pdf",  "folder_id": "fld_01JABCDEF",  "on_conflict": "keep_both"}'
Example Response
{  "data": {    "id": "string",    "name": "string",    "folder_id": "string",    "folder": {      "id": "string",      "name": "string"    },    "size": 0,    "content_type": "string",    "kind": "pdf",    "previewable": true,    "sha256": "string",    "links": [      {        "type": "string",        "id": "string",        "label": "string",        "retains": true      }    ],    "retained_until": "2019-08-24",    "uploaded_by": {      "id": "string",      "name": "string"    },    "created_at": "2019-08-24T14:15:22Z",    "updated_at": "2019-08-24T14:15:22Z",    "deleted_at": "2019-08-24T14:15:22Z",    "deleted_by": {      "id": "string",      "name": "string"    },    "purge_at": "2019-08-24T14:15:22Z"  }}