{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-docs/subprojects/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":["partial","admonition","code-snippet"]},"type":"markdown"},"seo":{"title":"Get started updating a subproject using Node.js","siteUrl":"https://developers.sinch.com","llmstxt":{"title":"Sinch Developer Documentation","description":"LLMs.txt containing a map of all the documentation files for Sinch.","sections":[{"title":"Numbers API","description":"The Numbers API enables you to search for, view, and activate numbers. It's considered a precursor to other APIs in the Sinch product family. The numbers API can be used in tandem with any of our APIs that perform messaging or calling.","includeFiles":["docs/numbers/**/*.md","docs/numbers/**/*.yaml"],"excludeFiles":["docs/numbers/index.md"]},{"title":"Conversation API","description":"Send and receive messages globally on many popular channels with ease and confidence when using Sinch's Conversation API. Conversation API is the preferred API for sending mobile messages on SMS and other social channels with Sinch. It is a simple API with unified error messages, consistent request payloads, and common webhook payloads that are channel-agnostic.","includeFiles":["docs/conversation/**/*.md","docs/conversation/**/*.yaml"],"excludeFiles":["docs/conversation/index.md"]},{"title":"Voice API","description":"The Voice API works as a big telephony switch. The Voice API handles incoming phone calls (also known as incoming call “legs”), sets up outgoing phone calls (or outgoing call “legs”), and bridges the two. The incoming call leg may come in over a data connection (from a smartphone or web application using the Sinch SDKs) or through a local phone number (from the PSTN network). Similarly, the outgoing call leg can be over data (to another smartphone or web application using the Sinch SDKs) or the PSTN network.","includeFiles":["docs/voice/**/*.md","docs/voice/**/*.yaml"],"excludeFiles":["docs/voice/index.md"]},{"title":"Verification API","description":"The Verification API is a platform for phone number verification. It consists of the API and different software development kits (the Sinch SDKs) that you integrate with your smartphone or web application and cloud based back-end services. Together they enable SMS, Flashcall, Phone Call and Data verification in your application.","includeFiles":["docs/verification/**/*.md","docs/verification/**/*.yaml"],"excludeFiles":["docs/verification/index.md"]},{"title":"Provisioning API","description":"Provisioning API allows you to programmatically set up your senders, accounts and templates on your favorite messaging platforms on the Conversation API. For now, you can create your first WhatsApp channel through Meta's Embedded sign up, you can configure your first SMS App and configure your webhooks. As development continues, we will be adding the most commonly used channels.","includeFiles":["docs/provisioning-api/**/*.md","docs/provisioning-api/**/*.json"],"excludeFiles":["docs/provisioning-api/index.md"]},{"title":"Elastic SIP Trunking API","description":"With Elastic SIP Trunking you can create and manage your SIP trunks and phone numbers programmatically.","includeFiles":["docs/est/**/*.md","docs/est/**/*.yaml"],"excludeFiles":["docs/est/index.md"]},{"title":"Fax API","description":"Send and receive HIPAA compliant faxes on our modern fax platform using our developer-friendly API.","includeFiles":["docs/fax/**/*.md","docs/fax/**/*.yaml"],"excludeFiles":["docs/fax/index.md"]},{"title":"In-app Voice and Video SDK","description":"The In-app Voice and Video SDK enables you to add voice and video calling capabilities directly into your mobile or web application using the Sinch SDKs.","includeFiles":["docs/in-app-calling/**/*.md"],"excludeFiles":["docs/in-app-calling/index.md"]},{"title":"Number Lookup API","description":"The Number Lookup API is designed to provide in-depth information about phone numbers, helping enterprises enhance their communication strategies and prevent fraud. By identifying the type of phone line (for example, mobile, landline, VoIP) and the associated carrier, the API allows businesses to optimize routing, reduce unnecessary costs, and improve customer engagement.","includeFiles":["docs/number-lookup-api-v2/**/*.md","docs/number-lookup-api-v2/**/*.yaml"],"excludeFiles":["docs/number-lookup-api-v2/index.md"]},{"title":"Functions","description":"Serverless compute for voice and messaging. Deploy your code and Sinch routes live calls and messages to it — no infrastructure to run.","includeFiles":["docs/functions/functions/**/*.md","docs/functions/concepts/**/*.md","docs/functions/reference/**/*.md"],"excludeFiles":["docs/functions/functions/index.md"]},{"title":"CLI","description":"One command line for every Sinch API and the full Functions lifecycle — scaffold, run locally, deploy, and manage.","includeFiles":["docs/functions/cli/**/*.md"],"excludeFiles":["docs/functions/cli/index.md"]}]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"get-started-updating-a-subproject-using-nodejs","__idx":0},"children":["Get started updating a subproject using Node.js"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":[{"$$mdtype":"Tag","name":"ConnectButton","attributes":{"title":"Sinch Agentic Tools","icon":"aiCode","option":[{"title":"Sinch Plugins","description":"Install Sinch Plugins","icon":"connection","link":"https://github.com/sinch/sinch-plugins#installation"},{"title":"Sinch Skills","description":"Install Sinch Skills","icon":"ai","link":"https://github.com/sinch/skills#installation"}]},"children":[]}," ",{"$$mdtype":"Tag","name":"ConnectButton","attributes":{"title":"Sinch SDKs","icon":"code","option":[{"title":"Sinch Node.js SDK","description":"Install Sinch Node.js SDK","icon":"node","link":"/docs/sdks/node#installation"},{"title":"Sinch Java SDK","description":"Install Sinch Java SDK","icon":"java","link":"/docs/sdks/java#installation"},{"title":"Sinch .NET SDK","description":"Install Sinch .NET SDK","icon":"dotnet","link":"/docs/sdks/dotnet#installation"},{"title":"Sinch Python SDK","description":"Install Sinch Python SDK","icon":"python","link":"/docs/sdks/python#installation"}]},"children":[]}," ",{"$$mdtype":"Tag","name":"ConnectButton","attributes":{"title":"Sinch CLI & Functions","icon":"window","option":[{"title":"Sinch CLI","description":"Install Sinch CLI","icon":"cli","link":"/docs/functions/cli/installation"},{"title":"Sinch Functions","description":"Quickstart Sinch Functions","icon":"code","link":"/docs/functions/functions/quickstart"}]},"children":[]}," ",{"$$mdtype":"Tag","name":"ConnectMCP","attributes":{"placement":"bottom","alignment":"start","options":["cursor","vscode","copy"]},"children":[]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Occassionally, you may need to update the details of a subproject using the Subproject API. This guide will walk you through how to update all details of your previously created subproject."]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"info","name":"Note"},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Before you can get started, you need the following already set up:"]},{"$$mdtype":"Tag","name":"ul","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["All Subproject API ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/subprojects/getting-started/"},"children":["configuration settings"]},"."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://nodejs.org/en/"},"children":["Node.js"]}," and a familiarity with how to create a new app."]}]}]},{"$$mdtype":"Tag","name":"Admonition","attributes":{"type":"success","name":"Steps:"},"children":[{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#set-up-your-node.js-application"},"children":["Set up"]}," your Node.js application."]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"#update-your-subproject"},"children":["Update"]}," your subproject."]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"set-up-your-nodejs-application","__idx":1},"children":["Set up your Node.js application"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Once you setup your free Sinch account, create a new node app with npm."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"shell","header":{"controls":{"copy":{}}},"source":"npm init\n","lang":"shell"},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Accept the defaults for the application."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Add the fetch package with npm to generate the necessary dependencies."]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"shell","header":{"controls":{"copy":{}}},"source":"npm install node-fetch\n","lang":"shell"},"children":[]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Create a new file named ",{"$$mdtype":"Tag","name":"code","attributes":{},"children":["index.mjs"]}," in the project and paste the provided code into the file."]}]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"file":"/code-snippets/node/subproject/updateSub.sample.js","language":"javascript","title":"index.mjs","header":{"title":"index.mjs","controls":{"copy":{}}},"lang":"javascript","source":"import fetch from 'node-fetch';\n\nconst subprojectId = 'YOUR_subprojectId'; // The subproject ID you want to update\nconst displayName = 'Updated Display Name'; // New display name for the subproject\nconst labels = {\n  'region': 'US-West',\n  'department': 'Engineering'\n};\n\nconst keyId = 'YOUR_Key_ID'; // Your Key ID from Sinch Build Dashboard\nconst keySecret = 'YOUR_Key_Secret'; // Your Key Secret from Sinch Build Dashboard\n\nconst updateData = {\n  displayName: displayName,\n  labels: labels\n};\n\nasync function updateSubproject() {\n  try {\n    const response = await fetch(\n      `https://subproject.api.sinch.com/v1/subprojects/${subprojectId}`,\n      {\n        method: 'PATCH',\n        headers: {\n          'Authorization': `Basic ${Buffer.from(`${keyId}:${keySecret}`).toString('base64')}`,\n          'Content-Type': 'application/json'\n        },\n        body: JSON.stringify(updateData)\n      }\n    );\n\n    if (!response.ok) {\n      throw new Error(`HTTP error! status: ${response.status}`);\n    }\n\n    const data = await response.json();\n    console.log('Subproject updated successfully:', data);\n    return data;\n  } catch (error) {\n    console.error('Error updating subproject:', error);\n    throw error;\n  }\n}\n\n// Execute the function\nupdateSubproject();\n"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"update-your-subproject","__idx":2},"children":["Update your subproject"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Now, we'll customize and run the code that will update your subproject."]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":3,"id":"fill-in-your-parameters","__idx":3},"children":["Fill in your parameters"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Assign your values to the following parameters:"]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Parameter"},"children":["Parameter"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"Your value"},"children":["Your value"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["YOUR_subprojectId"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The subproject ID that you would like to update."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["displayName"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["The display name of the subproject is replaced by providing a new one."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["labels"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Update any label key:value pairs. You can assign new values to current keys or add entirely new pairs."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["YOUR_Key_ID"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Your Key ID from ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://dashboard.sinch.com/settings/access-keys"},"children":["Sinch Build Dashboard"]}," under ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Settings"]},", then ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Access Keys"]},"."]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":[{"$$mdtype":"Tag","name":"code","attributes":{},"children":["YOUR_Key_Secret"]}]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Your Key Secret from ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"https://dashboard.sinch.com/settings/access-keys"},"children":["Sinch Build Dashboard"]}," under ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Settings"]},", then ",{"$$mdtype":"Tag","name":"strong","attributes":{},"children":["Access Keys"]},"."]}]}]}]}]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Save the file."]}]},{"$$mdtype":"Tag","name":"li","attributes":{},"children":[{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Execute the code and update your subproject."]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Run the following command:"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"shell","header":{"controls":{"copy":{}}},"source":"node index.mjs\n","lang":"shell"},"children":[]}]}]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"next-steps","__idx":4},"children":["Next steps"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["Check out our full ",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/docs/subprojects/api-reference"},"children":["API reference"]}," for more subproject options."]}]},"headings":[{"value":"Get started updating a subproject using Node.js","id":"get-started-updating-a-subproject-using-nodejs","depth":1},{"value":"Set up your Node.js application","id":"set-up-your-nodejs-application","depth":2},{"value":"Update your subproject","id":"update-your-subproject","depth":2},{"value":"Fill in your parameters","id":"fill-in-your-parameters","depth":3},{"value":"Next steps","id":"next-steps","depth":2}],"frontmatter":{"title":"Guide for updating a Sinch subproject with Node.js","description":"A guide for updating a subproject of a project using Node.js and the Subprojects API.","codeBlock":{"enabled":true,"request":{"path":"node/subproject/updateSub.sample.js","header":"Update a subproject","lang":"javascript"}},"seo":{"title":"Get started updating a subproject using Node.js"}},"lastModified":"2026-07-27T14:58:15.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/docs/subprojects/getting-started/node/updatesub","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}