<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>nodejs rest api on Document Processing REST APIs | GroupDocs Cloud</title>
    <link>https://blog-qa.groupdocs.cloud/tag/nodejs-rest-api/</link>
    <description>Recent content in nodejs rest api on Document Processing REST APIs | GroupDocs Cloud</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Wed, 21 Oct 2026 13:18:44 +0000</lastBuildDate><atom:link href="https://blog-qa.groupdocs.cloud/tag/nodejs-rest-api/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Remove Annotation Objects from PDF with REST in Node.JS</title>
      <link>https://blog-qa.groupdocs.cloud/annotation/remove-annotation-objects-from-pdf-with-rest-in-nodejs/</link>
      <pubDate>Wed, 21 Oct 2026 13:18:44 +0000</pubDate>
      
      <guid>https://blog-qa.groupdocs.cloud/annotation/remove-annotation-objects-from-pdf-with-rest-in-nodejs/</guid>
      <description>Learn how to remove Annotation objects from PDF with REST in Node.JS using GroupDocs.Annotation Cloud SDK. Step-by-step guide with code, cURL and practices.</description>
      <content:encoded><![CDATA[<p>Removing unwanted notes, highlights, or ink marks from PDFs is a frequent requirement when preparing clean documents for distribution. <a href="https://products.groupdocs.cloud/annotation/nodejs/">GroupDocs.Annotation Cloud SDK for Node.js</a> provides a powerful REST‑based library that lets you manage <a href="https://docs.fileformat.com/pdf">PDF</a> annotations programmatically. This guide shows you how to remove Annotation objects from PDF with REST in Node.JS, step by step. You will see a complete code example, equivalent cURL commands, configuration tips, and best‑practice recommendations to integrate annotation removal into your services.</p>
<h2 id="full-working-example-to-remove-annotation-objects-from-pdf-with-rest-in-nodejs">Full Working Example to Remove Annotation Objects from PDF with REST in Node.JS</h2>
<p>This example demonstrates how to upload a PDF, delete all its annotations, and download the cleaned file using the GroupDocs.Annotation SDK.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">fs</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">require</span>(<span style="color:#e6db74">&#39;fs&#39;</span>);
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">path</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">require</span>(<span style="color:#e6db74">&#39;path&#39;</span>);
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">require</span>(<span style="color:#e6db74">&#34;@groupdocs/annotation-cloud&#34;</span>);
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// ==== Authentication =========================================================
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">clientId</span> <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;YOUR_CLIENT_ID&#34;</span>;
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">clientSecret</span> <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;YOUR_CLIENT_SECRET&#34;</span>;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">config</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">Configuration</span>(<span style="color:#a6e22e">clientId</span>, <span style="color:#a6e22e">clientSecret</span>);
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">annotationsApi</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">AnnotationsApi</span>(<span style="color:#a6e22e">config</span>);
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">storageApi</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">StorageApi</span>(<span style="color:#a6e22e">config</span>);
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// ==== Local &amp; Remote file definitions =======================================
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">localInputPath</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">path</span>.<span style="color:#a6e22e">resolve</span>(<span style="color:#a6e22e">__dirname</span>, <span style="color:#e6db74">&#34;input.pdf&#34;</span>);
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">localOutputPath</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">path</span>.<span style="color:#a6e22e">resolve</span>(<span style="color:#a6e22e">__dirname</span>, <span style="color:#e6db74">&#34;output.pdf&#34;</span>);
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">remoteFilePath</span> <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;input.pdf&#34;</span>;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// ==== Main workflow ==========================================================
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>(<span style="color:#66d9ef">async</span> () =&gt; {
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">// 1. Upload PDF to GroupDocs Cloud storage
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">fileBytes</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">fs</span>.<span style="color:#a6e22e">readFileSync</span>(<span style="color:#a6e22e">localInputPath</span>);
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">uploadRequest</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">UploadFileRequest</span>({
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">path</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">remoteFilePath</span>,
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">file</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">fileBytes</span>
</span></span><span style="display:flex;"><span>    });
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">await</span> <span style="color:#a6e22e">storageApi</span>.<span style="color:#a6e22e">uploadFile</span>(<span style="color:#a6e22e">uploadRequest</span>);
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">// 2. Build FileInfo object for the uploaded PDF
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">fileInfo</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">FileInfo</span>({
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">filePath</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">remoteFilePath</span>
</span></span><span style="display:flex;"><span>    });
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">// 3. Retrieve all existing annotations
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">getAnnotationsRequest</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">GetAnnotationsRequest</span>({
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">fileInfo</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">fileInfo</span>
</span></span><span style="display:flex;"><span>    });
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">annotationsResult</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">await</span> <span style="color:#a6e22e">annotationsApi</span>.<span style="color:#a6e22e">getAnnotations</span>(<span style="color:#a6e22e">getAnnotationsRequest</span>);
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">annotationIds</span> <span style="color:#f92672">=</span> (<span style="color:#a6e22e">annotationsResult</span>.<span style="color:#a6e22e">annotations</span> <span style="color:#f92672">||</span> []).<span style="color:#a6e22e">map</span>(<span style="color:#a6e22e">a</span> =&gt; <span style="color:#a6e22e">a</span>.<span style="color:#a6e22e">id</span>);
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">// 4. Delete all annotations (if any)
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    <span style="color:#66d9ef">if</span> (<span style="color:#a6e22e">annotationIds</span>.<span style="color:#a6e22e">length</span> <span style="color:#f92672">&gt;</span> <span style="color:#ae81ff">0</span>) {
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">deleteRequest</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">DeleteAnnotationsRequest</span>({
</span></span><span style="display:flex;"><span>            <span style="color:#a6e22e">fileInfo</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">fileInfo</span>,
</span></span><span style="display:flex;"><span>            <span style="color:#a6e22e">annotationIds</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">annotationIds</span>
</span></span><span style="display:flex;"><span>        });
</span></span><span style="display:flex;"><span>        <span style="color:#66d9ef">await</span> <span style="color:#a6e22e">annotationsApi</span>.<span style="color:#a6e22e">deleteAnnotations</span>(<span style="color:#a6e22e">deleteRequest</span>);
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">// 5. Download the cleaned PDF back to local storage
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">downloadRequest</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">DownloadFileRequest</span>({
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">path</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">remoteFilePath</span>
</span></span><span style="display:flex;"><span>    });
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">fileStream</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">await</span> <span style="color:#a6e22e">storageApi</span>.<span style="color:#a6e22e">downloadFile</span>(<span style="color:#a6e22e">downloadRequest</span>);
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">fs</span>.<span style="color:#a6e22e">writeFileSync</span>(<span style="color:#a6e22e">localOutputPath</span>, <span style="color:#a6e22e">fileStream</span>);
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">console</span>.<span style="color:#a6e22e">log</span>(<span style="color:#e6db74">`All annotations removed. Clean file saved to </span><span style="color:#e6db74">${</span><span style="color:#a6e22e">localOutputPath</span><span style="color:#e6db74">}</span><span style="color:#e6db74">`</span>);
</span></span><span style="display:flex;"><span>})();
</span></span></code></pre></div><blockquote>
<p><strong>Note:</strong> This code example demonstrates the core functionality. Before using it in your project, make sure to update any file paths and configuration values to match your actual environment, verify that all required dependencies are properly installed, and test thoroughly in your development environment. If you encounter any issues, please refer to the <a href="https://docs.groupdocs.cloud/annotation/">official documentation</a> or reach out to the <a href="https://forum.groupdocs.cloud/c/annotation/10">support team</a> for assistance.</p>
</blockquote>
<h2 id="delete-pdf-annotations-via-rest-api-using-curl">Delete PDF Annotations via REST API Using cURL</h2>
<p>Below are the cURL commands that perform the same annotation removal workflow through the GroupDocs.Annotation Cloud REST endpoints.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#75715e"># 1. Obtain an access token</span>
</span></span><span style="display:flex;"><span>curl -X POST <span style="color:#e6db74">&#34;https://api.groupdocs.cloud/v2.0/auth/token&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -H <span style="color:#e6db74">&#34;Content-Type: application/json&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -d <span style="color:#e6db74">&#34;{\&#34;client_id\&#34;:\&#34;YOUR_CLIENT_ID\&#34;,\&#34;client_secret\&#34;:\&#34;YOUR_CLIENT_SECRET\&#34;}&#34;</span>
</span></span></code></pre></div><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#75715e"># 2. Upload the source PDF</span>
</span></span><span style="display:flex;"><span>curl -X PUT <span style="color:#e6db74">&#34;https://api.groupdocs.cloud/v2.0/storage/file/input.pdf&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -H <span style="color:#e6db74">&#34;Authorization: Bearer YOUR_ACCESS_TOKEN&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -H <span style="color:#e6db74">&#34;Content-Type: application/pdf&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     --data-binary <span style="color:#e6db74">&#34;@input.pdf&#34;</span>
</span></span></code></pre></div><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#75715e"># 3. Retrieve annotation IDs</span>
</span></span><span style="display:flex;"><span>curl -X GET <span style="color:#e6db74">&#34;https://api.groupdocs.cloud/v2.0/annotation/annotations?filePath=input.pdf&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -H <span style="color:#e6db74">&#34;Authorization: Bearer YOUR_ACCESS_TOKEN&#34;</span>
</span></span></code></pre></div><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#75715e"># 4. Delete all retrieved annotations</span>
</span></span><span style="display:flex;"><span>curl -X DELETE <span style="color:#e6db74">&#34;https://api.groupdocs.cloud/v2.0/annotation/annotations?filePath=input.pdf&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -H <span style="color:#e6db74">&#34;Authorization: Bearer YOUR_ACCESS_TOKEN&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -H <span style="color:#e6db74">&#34;Content-Type: application/json&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -d <span style="color:#e6db74">&#34;{\&#34;annotationIds\&#34;:[\&#34;id1\&#34;,\&#34;id2\&#34;]}&#34;</span>
</span></span></code></pre></div><div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span><span style="color:#75715e"># 5. Download the cleaned PDF</span>
</span></span><span style="display:flex;"><span>curl -X GET <span style="color:#e6db74">&#34;https://api.groupdocs.cloud/v2.0/storage/file/input.pdf&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -H <span style="color:#e6db74">&#34;Authorization: Bearer YOUR_ACCESS_TOKEN&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -o output.pdf
</span></span></code></pre></div><p>For a complete list of endpoints and parameters, see the <a href="https://reference.groupdocs.cloud/annotation/">official API documentation</a>.</p>
<h2 id="how-remove-annotation-objects-from-pdf-with-rest-in-nodejs-works">How Remove Annotation Objects from PDF with REST in Node.JS Works</h2>
<ol>
<li><strong>Authentication Setup</strong> - The <code>Configuration</code> class is instantiated with your <code>clientId</code> and <code>clientSecret</code>, creating an authenticated context for all subsequent API calls.
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">config</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">Configuration</span>(<span style="color:#a6e22e">clientId</span>, <span style="color:#a6e22e">clientSecret</span>);
</span></span></code></pre></div></li>
<li><strong>File Upload</strong> - <code>UploadFileRequest</code> sends the local PDF bytes to GroupDocs Cloud storage. The <code>storageApi.uploadFile</code> method handles the transfer.
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">uploadRequest</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">UploadFileRequest</span>({
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">path</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">remoteFilePath</span>,
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">file</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">fileBytes</span>
</span></span><span style="display:flex;"><span>});
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">await</span> <span style="color:#a6e22e">storageApi</span>.<span style="color:#a6e22e">uploadFile</span>(<span style="color:#a6e22e">uploadRequest</span>);
</span></span></code></pre></div></li>
<li><strong>Retrieve Annotations</strong> - <code>GetAnnotationsRequest</code> builds a request object with a <code>FileInfo</code> reference. The <code>annotationsApi.getAnnotations</code> call returns a collection of annotation objects, from which IDs are extracted.
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">getAnnotationsRequest</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">GetAnnotationsRequest</span>({
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">fileInfo</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">fileInfo</span>
</span></span><span style="display:flex;"><span>});
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">annotationsResult</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">await</span> <span style="color:#a6e22e">annotationsApi</span>.<span style="color:#a6e22e">getAnnotations</span>(<span style="color:#a6e22e">getAnnotationsRequest</span>);
</span></span></code></pre></div></li>
<li><strong>Delete Annotations</strong> - If any IDs exist, <code>DeleteAnnotationsRequest</code> is populated and passed to <code>annotationsApi.deleteAnnotations</code>, which permanently removes the annotations from the stored PDF.
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">deleteRequest</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">DeleteAnnotationsRequest</span>({
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">fileInfo</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">fileInfo</span>,
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">annotationIds</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">annotationIds</span>
</span></span><span style="display:flex;"><span>});
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">await</span> <span style="color:#a6e22e">annotationsApi</span>.<span style="color:#a6e22e">deleteAnnotations</span>(<span style="color:#a6e22e">deleteRequest</span>);
</span></span></code></pre></div></li>
<li><strong>Download Clean PDF</strong> - Finally, <code>DownloadFileRequest</code> fetches the updated file, and <code>fs.writeFileSync</code> writes it to the local filesystem.
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">downloadRequest</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">DownloadFileRequest</span>({
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">path</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">remoteFilePath</span>
</span></span><span style="display:flex;"><span>});
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">fileStream</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">await</span> <span style="color:#a6e22e">storageApi</span>.<span style="color:#a6e22e">downloadFile</span>(<span style="color:#a6e22e">downloadRequest</span>);
</span></span><span style="display:flex;"><span><span style="color:#a6e22e">fs</span>.<span style="color:#a6e22e">writeFileSync</span>(<span style="color:#a6e22e">localOutputPath</span>, <span style="color:#a6e22e">fileStream</span>);
</span></span></code></pre></div></li>
</ol>
<p>For detailed class and method definitions, refer to the <a href="https://reference.groupdocs.cloud/annotation/">API reference</a>.</p>
<h2 id="installing-and-configuring-groupdocsannotation-cloud-sdk-for-nodejs">Installing and Configuring GroupDocs.Annotation Cloud SDK for Node.js</h2>
<p>The SDK is distributed as an npm package. Install it with the command below and then require it in your project.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>npm install groupdocs-annotation-cloud
</span></span></code></pre></div><p>You can also download the latest package directly from the <a href="https://github.com/groupdocs-annotation-cloud/groupdocs-annotation-cloud-node">GitHub releases page</a> or the official <a href="https://releases.groupdocs.cloud/annotation/nodejs/">download URL</a>.</p>
<p>After installation, import the library and create a configuration object as shown in the code example:</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">require</span>(<span style="color:#e6db74">&#34;@groupdocs/annotation-cloud&#34;</span>);
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">config</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsAnnotationCloud</span>.<span style="color:#a6e22e">Configuration</span>(<span style="color:#e6db74">&#34;YOUR_CLIENT_ID&#34;</span>, <span style="color:#e6db74">&#34;YOUR_CLIENT_SECRET&#34;</span>);
</span></span></code></pre></div><p>Make sure your runtime environment meets the Node.js version requirements and that you have a valid GroupDocs account to obtain the client credentials.</p>
<h2 id="annotation-removal-options-and-settings">Annotation Removal Options and Settings</h2>
<p>The SDK exposes several parameters you can tune:</p>
<ul>
<li><strong>clientId / clientSecret</strong> - Credentials for OAuth authentication. Set them in the <code>Configuration</code> constructor.</li>
<li><strong>fileInfo.filePath</strong> - The path of the PDF in GroupDocs Cloud storage. Adjust this if you store files in a different folder.</li>
<li><strong>annotationIds</strong> - An array of IDs returned by <code>GetAnnotations</code>. Supplying a subset allows selective deletion.</li>
</ul>
<p>Additional settings such as request timeouts and proxy configuration are available in the SDK documentation; see the <a href="https://docs.groupdocs.cloud/annotation/">official documentation</a> for the full list.</p>
<h2 id="best-practices-for-removing-pdf-annotations-via-rest">Best Practices for Removing PDF Annotations via REST</h2>
<ul>
<li><strong>Validate Annotation IDs</strong> - Always check that the IDs you intend to delete exist; attempting to delete non‑existent IDs can cause a 404 error.</li>
<li><strong>Use HTTPS</strong> - All API calls must be made over HTTPS to protect your credentials and document data.</li>
<li><strong>Handle Large Files with Chunked Uploads</strong> - For PDFs larger than 100 MB, prefer the multipart upload endpoint to avoid timeouts.</li>
<li><strong>Log API Responses</strong> - Store request IDs and responses for audit trails and easier troubleshooting.</li>
<li><strong>Reuse Access Tokens</strong> - Cache the OAuth token until it expires to reduce authentication overhead.</li>
</ul>
<h2 id="common-questions">Common Questions</h2>
<ul>
<li>
<p><strong>How do I authenticate with GroupDocs.Annotation Cloud API?</strong><br>
Obtain a client ID and secret from your GroupDocs account, then request an access token via the OAuth endpoint. See the <a href="https://docs.groupdocs.cloud/annotation/">official documentation</a> for details.</p>
</li>
<li>
<p><strong>Can I delete specific annotations instead of all?</strong><br>
Yes, provide the IDs of the annotations you want to remove in the DeleteAnnotationsRequest. The SDK returns the list of annotation IDs after a GetAnnotations call.</p>
</li>
<li>
<p><strong>How can I remove Annotation objects from PDF with REST in Node.JS?</strong><br>
Use the GroupDocs.Annotation Cloud SDK for Node.js to call the DeleteAnnotations endpoint after retrieving annotation IDs. The full workflow is demonstrated in the code example and cURL section of this guide.</p>
</li>
<li>
<p><strong>What licensing is required for production use?</strong><br>
A paid license is needed for production. You can acquire a temporary license from the <a href="https://purchase.groupdocs.cloud/temporary-license/">temporary license page</a> while evaluating.</p>
</li>
</ul>
<h2 id="further-reading">Further Reading</h2>
<ul>
<li><a href="https://blog.groupdocs.cloud/annotation/extract-or-remove-annotations-from-pdf-using-rest-api-in-node-js/">Extract or Remove Annotations from PDF using REST API in Node.js</a></li>
<li><a href="https://blog.groupdocs.cloud/annotation/strikethrough-text-in-a-pdf-using-nodejs/">Strikethrough Text in a PDF with Node.js and REST API</a></li>
<li><a href="https://blog.groupdocs.cloud/annotation/remove-annotations-from-pdf-using-rest-api-in-python/">Remove Annotations from PDF using REST API in Python</a></li>
</ul>
]]></content:encoded>
    </item>
    
    <item>
      <title>Edit Excel Sheet via REST in Node.JS</title>
      <link>https://blog-qa.groupdocs.cloud/editor/edit-excel-sheet-via-rest-in-nodejs/</link>
      <pubDate>Fri, 02 Oct 2026 14:32:02 +0000</pubDate>
      
      <guid>https://blog-qa.groupdocs.cloud/editor/edit-excel-sheet-via-rest-in-nodejs/</guid>
      <description>Learn how to edit Excel file in Node.js via REST using GroupDocs.Editor Cloud SDK. Guide covers setup, code example, cURL calls, and performance tips.</description>
      <content:encoded><![CDATA[<p>Automating spreadsheet updates is a common need when building data‑driven web services or reporting pipelines. The <a href="https://products.groupdocs.cloud/editor/nodejs/">GroupDocs.Editor Cloud SDK for Node.js</a> lets you edit Excel file in Node.js via REST with just a few lines of code. In this tutorial you will see how to configure the SDK, load an <a href="https://docs.fileformat.com/spreadsheet/xlsx/">XLSX</a> workbook, modify a <a href="https://docs.fileformat.com/spreadsheet/cell/">cell</a>, save the changes, and achieve the same result using raw cURL calls. We also discuss key features, configuration options, and performance considerations to help you integrate Excel editing efficiently.</p>
<h2 id="edit-excel-file-in-nodejs-via-rest---5-step-guide">Edit Excel File in Node.js via REST - 5 Step Guide</h2>
<ol>
<li><strong>Install the SDK and configure credentials</strong>: Set your <code>CLIENT_ID</code> and <code>CLIENT_SECRET</code> so the library can authenticate with GroupDocs Cloud.</li>
</ol>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">CLIENT_ID</span> <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;YOUR_CLIENT_ID&#34;</span>;
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">CLIENT_SECRET</span> <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;YOUR_CLIENT_SECRET&#34;</span>;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">config</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">Configuration</span>(<span style="color:#a6e22e">CLIENT_ID</span>, <span style="color:#a6e22e">CLIENT_SECRET</span>);
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">editApi</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">EditApi</span>(<span style="color:#a6e22e">config</span>);
</span></span></code></pre></div><ol start="2">
<li><strong>Load the Excel workbook for editing</strong>: Use <code>EditDocumentRequest</code> to open the file stored in your cloud storage.</li>
</ol>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">editRequest</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">EditDocumentRequest</span>({
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">fileInfo</span><span style="color:#f92672">:</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">FileInfo</span>({ <span style="color:#a6e22e">filePath</span><span style="color:#f92672">:</span> <span style="color:#e6db74">&#34;input.xlsx&#34;</span> })
</span></span><span style="display:flex;"><span>});
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">editResult</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">await</span> <span style="color:#a6e22e">editApi</span>.<span style="color:#a6e22e">editDocument</span>(<span style="color:#a6e22e">editRequest</span>);
</span></span></code></pre></div><ol start="3">
<li><strong>Retrieve the first worksheet and locate the target cell</strong>: The SDK returns a <code>document</code> object that contains worksheets and cells.</li>
</ol>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">worksheet</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">editResult</span>.document.<span style="color:#a6e22e">worksheets</span>[<span style="color:#ae81ff">0</span>];
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">let</span> <span style="color:#a6e22e">targetCell</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">worksheet</span>.<span style="color:#a6e22e">cells</span>.<span style="color:#a6e22e">find</span>(<span style="color:#a6e22e">c</span> =&gt; <span style="color:#a6e22e">c</span>.<span style="color:#a6e22e">rowIndex</span> <span style="color:#f92672">===</span> <span style="color:#ae81ff">0</span> <span style="color:#f92672">&amp;&amp;</span> <span style="color:#a6e22e">c</span>.<span style="color:#a6e22e">columnIndex</span> <span style="color:#f92672">===</span> <span style="color:#ae81ff">0</span>);
</span></span></code></pre></div><ol start="4">
<li><strong>Update or create the cell value</strong>: Change the content of cell <strong>A1</strong> (or add it if it does not exist).</li>
</ol>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">if</span> (<span style="color:#f92672">!</span><span style="color:#a6e22e">targetCell</span>) {
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">targetCell</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">Cell</span>({
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">rowIndex</span><span style="color:#f92672">:</span> <span style="color:#ae81ff">0</span>,
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">columnIndex</span><span style="color:#f92672">:</span> <span style="color:#ae81ff">0</span>,
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">value</span><span style="color:#f92672">:</span> <span style="color:#e6db74">&#34;Edited via GroupDocs Editor Cloud&#34;</span>
</span></span><span style="display:flex;"><span>    });
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">worksheet</span>.<span style="color:#a6e22e">cells</span>.<span style="color:#a6e22e">push</span>(<span style="color:#a6e22e">targetCell</span>);
</span></span><span style="display:flex;"><span>} <span style="color:#66d9ef">else</span> {
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">targetCell</span>.<span style="color:#a6e22e">value</span> <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;Edited via GroupDocs Editor Cloud&#34;</span>;
</span></span><span style="display:flex;"><span>}
</span></span></code></pre></div><ol start="5">
<li><strong>Save the edited workbook back to storage</strong>: Provide an <code>outputPath</code> and call <code>saveDocument</code>.</li>
</ol>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">saveOptions</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">SaveOptions</span>({ <span style="color:#a6e22e">outputPath</span><span style="color:#f92672">:</span> <span style="color:#e6db74">&#34;output.xlsx&#34;</span> });
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">saveRequest</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">SaveDocumentRequest</span>({
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">documentId</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">editResult</span>.<span style="color:#a6e22e">documentId</span>,
</span></span><span style="display:flex;"><span>    document<span style="color:#f92672">:</span> <span style="color:#a6e22e">editResult</span>.document,
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">saveOptions</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">saveOptions</span>
</span></span><span style="display:flex;"><span>});
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">await</span> <span style="color:#a6e22e">editApi</span>.<span style="color:#a6e22e">saveDocument</span>(<span style="color:#a6e22e">saveRequest</span>);
</span></span></code></pre></div><p>For a full list of classes and methods, see the <a href="https://reference.groupdocs.cloud/editor/">API reference</a>.</p>
<h2 id="edit-excel-file-in-nodejs-via-rest---complete-code-example">Edit Excel File in Node.js via REST - Complete Code Example</h2>
<p>The following example demonstrates how to edit Excel file in Node.js via REST using GroupDocs.Editor Cloud SDK.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">require</span>(<span style="color:#e6db74">&#34;@groupdocs/editor-cloud&#34;</span>);
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// Replace with your actual GroupDocs Cloud credentials
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">CLIENT_ID</span> <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;YOUR_CLIENT_ID&#34;</span>;
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">CLIENT_SECRET</span> <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;YOUR_CLIENT_SECRET&#34;</span>;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// Paths for the source Excel file and the edited result
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">INPUT_FILE_PATH</span> <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;input.xlsx&#34;</span>;
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">OUTPUT_FILE_PATH</span> <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;output.xlsx&#34;</span>;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#66d9ef">async</span> <span style="color:#66d9ef">function</span> <span style="color:#a6e22e">editExcel</span>() {
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">// Configure the SDK
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">config</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">Configuration</span>(<span style="color:#a6e22e">CLIENT_ID</span>, <span style="color:#a6e22e">CLIENT_SECRET</span>);
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">editApi</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">EditApi</span>(<span style="color:#a6e22e">config</span>);
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">// 1. Load the Excel workbook for editing
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">editRequest</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">EditDocumentRequest</span>({
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">fileInfo</span><span style="color:#f92672">:</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">FileInfo</span>({
</span></span><span style="display:flex;"><span>            <span style="color:#a6e22e">filePath</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">INPUT_FILE_PATH</span>
</span></span><span style="display:flex;"><span>        })
</span></span><span style="display:flex;"><span>    });
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">editResult</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">await</span> <span style="color:#a6e22e">editApi</span>.<span style="color:#a6e22e">editDocument</span>(<span style="color:#a6e22e">editRequest</span>);
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">documentId</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">editResult</span>.<span style="color:#a6e22e">documentId</span>;
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">const</span> document <span style="color:#f92672">=</span> <span style="color:#a6e22e">editResult</span>.document;
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">// 2. Retrieve the first worksheet
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">worksheet</span> <span style="color:#f92672">=</span> document.<span style="color:#a6e22e">worksheets</span>[<span style="color:#ae81ff">0</span>];
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">// 3. Update cell A1 (rowIndex = 0, columnIndex = 0) with a new value
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    <span style="color:#66d9ef">let</span> <span style="color:#a6e22e">targetCell</span> <span style="color:#f92672">=</span> <span style="color:#a6e22e">worksheet</span>.<span style="color:#a6e22e">cells</span>.<span style="color:#a6e22e">find</span>(<span style="color:#a6e22e">c</span> =&gt; <span style="color:#a6e22e">c</span>.<span style="color:#a6e22e">rowIndex</span> <span style="color:#f92672">===</span> <span style="color:#ae81ff">0</span> <span style="color:#f92672">&amp;&amp;</span> <span style="color:#a6e22e">c</span>.<span style="color:#a6e22e">columnIndex</span> <span style="color:#f92672">===</span> <span style="color:#ae81ff">0</span>);
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">if</span> (<span style="color:#f92672">!</span><span style="color:#a6e22e">targetCell</span>) {
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">targetCell</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">Cell</span>({
</span></span><span style="display:flex;"><span>            <span style="color:#a6e22e">rowIndex</span><span style="color:#f92672">:</span> <span style="color:#ae81ff">0</span>,
</span></span><span style="display:flex;"><span>            <span style="color:#a6e22e">columnIndex</span><span style="color:#f92672">:</span> <span style="color:#ae81ff">0</span>,
</span></span><span style="display:flex;"><span>            <span style="color:#a6e22e">value</span><span style="color:#f92672">:</span> <span style="color:#e6db74">&#34;Edited via GroupDocs Editor Cloud&#34;</span>
</span></span><span style="display:flex;"><span>        });
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">worksheet</span>.<span style="color:#a6e22e">cells</span>.<span style="color:#a6e22e">push</span>(<span style="color:#a6e22e">targetCell</span>);
</span></span><span style="display:flex;"><span>    } <span style="color:#66d9ef">else</span> {
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">targetCell</span>.<span style="color:#a6e22e">value</span> <span style="color:#f92672">=</span> <span style="color:#e6db74">&#34;Edited via GroupDocs Editor Cloud&#34;</span>;
</span></span><span style="display:flex;"><span>    }
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">// 4. Save the edited workbook back to storage
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">saveOptions</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">SaveOptions</span>({
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">outputPath</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">OUTPUT_FILE_PATH</span>
</span></span><span style="display:flex;"><span>    });
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">saveRequest</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">SaveDocumentRequest</span>({
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">documentId</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">documentId</span>,
</span></span><span style="display:flex;"><span>        document<span style="color:#f92672">:</span> document,
</span></span><span style="display:flex;"><span>        <span style="color:#a6e22e">saveOptions</span><span style="color:#f92672">:</span> <span style="color:#a6e22e">saveOptions</span>
</span></span><span style="display:flex;"><span>    });
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span>    <span style="color:#66d9ef">const</span> <span style="color:#a6e22e">saveResult</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">await</span> <span style="color:#a6e22e">editApi</span>.<span style="color:#a6e22e">saveDocument</span>(<span style="color:#a6e22e">saveRequest</span>);
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">console</span>.<span style="color:#a6e22e">log</span>(<span style="color:#e6db74">`Edited file saved to: </span><span style="color:#e6db74">${</span><span style="color:#a6e22e">saveResult</span>.<span style="color:#a6e22e">path</span><span style="color:#e6db74">}</span><span style="color:#e6db74">`</span>);
</span></span><span style="display:flex;"><span>}
</span></span><span style="display:flex;"><span>
</span></span><span style="display:flex;"><span><span style="color:#75715e">// Execute the edit operation
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span><span style="color:#a6e22e">editExcel</span>().<span style="color:#66d9ef">catch</span>(<span style="color:#a6e22e">error</span> =&gt; {
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">console</span>.<span style="color:#a6e22e">error</span>(<span style="color:#e6db74">&#34;Error during Excel editing:&#34;</span>, <span style="color:#a6e22e">error</span>);
</span></span><span style="display:flex;"><span>});
</span></span></code></pre></div><blockquote>
<p><strong>Note:</strong> This code example demonstrates the core functionality. Before using it in your project, make sure to update any file paths and configuration values to match your actual environment, verify that all required dependencies are properly installed, and test thoroughly in your development environment. If you encounter any issues, please refer to the <a href="https://docs.groupdocs.cloud/editor/">official documentation</a> or reach out to the <a href="https://forum.groupdocs.cloud/c/editor/20">support team</a> for assistance.</p>
</blockquote>
<h2 id="update-xlsx-sheet-using-rest-api-in-nodejs-via-curl">Update XLSX Sheet Using REST API in Node.js via cURL</h2>
<p>Below is a quick walkthrough of the same operation using raw HTTP calls. Replace the placeholder values with your actual credentials and file names.</p>
<ol>
<li>
<p><strong>Obtain an access token</strong></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>curl -X POST <span style="color:#e6db74">&#34;https://api.groupdocs.cloud/v2.0/connect/token&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -H <span style="color:#e6db74">&#34;Content-Type: application/x-www-form-urlencoded&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -d <span style="color:#e6db74">&#34;client_id=YOUR_CLIENT_ID&amp;client_secret=YOUR_CLIENT_SECRET&amp;grant_type=client_credentials&#34;</span>
</span></span></code></pre></div><p>The response contains <code>access_token</code>.</p>
</li>
<li>
<p><strong>Upload the source XLSX file</strong></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>curl -X POST <span style="color:#e6db74">&#34;https://api.groupdocs.cloud/v2.0/storage/file/input.xlsx&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -H <span style="color:#e6db74">&#34;Authorization: Bearer YOUR_ACCESS_TOKEN&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -F <span style="color:#e6db74">&#34;file=@input.xlsx&#34;</span>
</span></span></code></pre></div></li>
<li>
<p><strong>Edit the workbook (modify cell A1)</strong></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>curl -X POST <span style="color:#e6db74">&#34;https://api.groupdocs.cloud/v2.0/editor/edit&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -H <span style="color:#e6db74">&#34;Authorization: Bearer YOUR_ACCESS_TOKEN&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -H <span style="color:#e6db74">&#34;Content-Type: application/json&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -d <span style="color:#e6db74">&#39;{
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">           &#34;fileInfo&#34;: { &#34;filePath&#34;: &#34;input.xlsx&#34; },
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">           &#34;options&#34;: {
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">               &#34;cells&#34;: [
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">                   { &#34;rowIndex&#34;: 0, &#34;columnIndex&#34;: 0, &#34;value&#34;: &#34;Edited via GroupDocs Editor Cloud&#34; }
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">               ]
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">           }
</span></span></span><span style="display:flex;"><span><span style="color:#e6db74">         }&#39;</span>
</span></span></code></pre></div></li>
<li>
<p><strong>Download the edited file</strong></p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>curl -X GET <span style="color:#e6db74">&#34;https://api.groupdocs.cloud/v2.0/storage/file/output.xlsx&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -H <span style="color:#e6db74">&#34;Authorization: Bearer YOUR_ACCESS_TOKEN&#34;</span> <span style="color:#ae81ff">\
</span></span></span><span style="display:flex;"><span><span style="color:#ae81ff"></span>     -o output.xlsx
</span></span></code></pre></div></li>
</ol>
<p>For more details on request payloads, see the <a href="https://reference.groupdocs.cloud/editor/">official API documentation</a>.</p>
<h2 id="prerequisites-and-setup-for-groupdocseditor-cloud-sdk-for-nodejs">Prerequisites and Setup for GroupDocs.Editor Cloud SDK for Node.js</h2>
<p>To start using the SDK, you need Node.js 14 or later and a GroupDocs Cloud account.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-bash" data-lang="bash"><span style="display:flex;"><span>npm install groupdocs-editor-cloud
</span></span></code></pre></div><p>You can also download the latest package from the <a href="https://releases.groupdocs.cloud/editor/nodejs/">release page</a>. After installation, create a <code>client_id</code> and <code>client_secret</code> in your GroupDocs Cloud dashboard and keep them safe.</p>
<h2 id="what-makes-groupdocseditor-cloud-sdk-for-nodejs-ideal-for-modifying-excel-worksheets">What Makes GroupDocs.Editor Cloud SDK for Node.js Ideal for Modifying Excel Worksheets</h2>
<ul>
<li><strong>Full XLSX support</strong> - Load, edit, and save workbooks while preserving formulas, styles, and data validation.</li>
<li><strong>Cell‑level editing</strong> - Access individual cells, rows, or columns programmatically, which is perfect for updating reports or dashboards.</li>
<li><strong>Cloud storage integration</strong> - Work directly with files stored in GroupDocs Cloud without downloading them locally.</li>
<li><strong>Secure REST communication</strong> - All operations happen over HTTPS, and the SDK handles token management for you.</li>
</ul>
<p>For a deeper dive, refer to the <a href="https://docs.groupdocs.cloud/editor/">documentation</a>.</p>
<h2 id="fine-tuning-excel-editing-options-in-groupdocseditor-cloud">Fine-Tuning Excel Editing Options in GroupDocs.Editor Cloud</h2>
<p>The SDK exposes several options that let you control how the edited workbook is saved.</p>
<div class="highlight"><pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;"><code class="language-javascript" data-lang="javascript"><span style="display:flex;"><span><span style="color:#66d9ef">const</span> <span style="color:#a6e22e">saveOptions</span> <span style="color:#f92672">=</span> <span style="color:#66d9ef">new</span> <span style="color:#a6e22e">GroupDocsEditorCloud</span>.<span style="color:#a6e22e">SaveOptions</span>({
</span></span><span style="display:flex;"><span>    <span style="color:#a6e22e">outputPath</span><span style="color:#f92672">:</span> <span style="color:#e6db74">&#34;output.xlsx&#34;</span>,
</span></span><span style="display:flex;"><span>    <span style="color:#75715e">// You can also set compression level, password protection, etc.
</span></span></span><span style="display:flex;"><span><span style="color:#75715e"></span>});
</span></span></code></pre></div><ul>
<li><strong><code>outputPath</code></strong> - Destination path in cloud storage.</li>
<li><strong><code>compressionLevel</code></strong> - Reduce file size for large workbooks (available in the API reference).</li>
<li><strong><code>password</code></strong> - Protect the resulting file with a password if required.</li>
</ul>
<p>Adjust these settings to match your project&rsquo;s security and performance needs.</p>
<h2 id="performance-considerations-for-editing-xlsx-workbooks-via-rest">Performance Considerations for Editing XLSX Workbooks via REST</h2>
<ol>
<li><strong>Reuse the configuration object</strong> - Creating a new <code>Configuration</code> for every request adds overhead. Keep a single instance for the lifetime of your application.</li>
<li><strong>Batch cell updates</strong> - If you need to modify many cells, collect them in an array and send a single edit request instead of multiple calls.</li>
<li><strong>Limit worksheet size</strong> - Very large worksheets increase memory consumption. Consider splitting data across multiple sheets when possible.</li>
<li><strong>Avoid unnecessary saves</strong> - Only call <code>saveDocument</code> after all required changes are applied to reduce I/O operations.</li>
</ol>
<h2 id="conclusion">Conclusion</h2>
<p>Editing an Excel file in Node.js via REST becomes straightforward with the <a href="https://products.groupdocs.cloud/editor/nodejs/">GroupDocs.Editor Cloud SDK for Node.js</a>. You can programmatically load a workbook, modify cells, and save the result using just a few API calls or simple cURL commands. The SDK&rsquo;s cloud‑based architecture eliminates the need for local Office installations and scales with your application&rsquo;s workload. For production deployments, purchase a license that fits your usage pattern, and you can also obtain a temporary license for testing from the <a href="https://purchase.groupdocs.cloud/temporary-license/">temporary license page</a>. Start integrating Excel editing today and streamline your data‑processing pipelines.</p>
<h2 id="faqs">FAQs</h2>
<p><strong>How do I edit an Excel file in Node.js via REST without writing custom HTTP code?</strong><br>
Use the GroupDocs.Editor Cloud SDK for Node.js, which abstracts the REST calls and lets you edit Excel file in Node.js via REST with simple method invocations.</p>
<p><strong>Can I update an XLSX sheet using REST api Node.js for large files?</strong><br>
Yes. The SDK streams data and supports batch updates, making it suitable for large workbooks. Adjust <code>compressionLevel</code> and batch cell changes to improve performance.</p>
<p><strong>What is the best way to modify Excel worksheet programmatically Node.js?</strong><br>
Work with the <code>worksheet</code> and <code>cell</code> objects returned by <code>editDocument</code>. This gives you full control over rows, columns, and cell values without leaving the Node.js environment.</p>
<p><strong>Where can I find pricing and licensing information?</strong><br>
All licensing details, including pricing tiers and a temporary license for evaluation, are available on the <a href="https://purchase.groupdocs.cloud/temporary-license/">temporary license page</a>.</p>
<h2 id="read-more">Read More</h2>
<ul>
<li><a href="https://blog.groupdocs.cloud/editor/edit-excel-sheet-via-rest-in-java/">Edit Excel Sheet via REST in Java</a></li>
<li><a href="https://blog.groupdocs.cloud/editor/edit-excel-sheet-using-rest-api-in-python/">Edit Excel Sheet using REST API in Python</a></li>
<li><a href="https://blog.groupdocs.cloud/editor/best-practices-for-csv-editor-development-in-java/">Best Practices for CSV Editor Development in Java</a></li>
</ul>
]]></content:encoded>
    </item>
    
  </channel>
</rss>
