# Rename a group with Node.js continued ## Update a group name Say the group has evolved and needs a better name to describe it. Let's give your group of contacts a different name. 1. To update the name of the group, create an additional file in the project called `updateGroup.md`. Update a group name import fetch from 'node-fetch'; async function run() { const servicePlanId = 'YOUR_service_plan_id'; const groupId = 'YOUR_group_id'; const resp = await fetch( `https://us.sms.api.sinch.com/xms/v1/${servicePlanId}/groups/${groupId}`, { method: 'POST', headers: { 'Content-Type': 'application/json', Authorization: 'Bearer YOUR_API_token' }, body: JSON.stringify({name: 'YOUR_new_group_name'}) } ); const data = await resp.json(); console.log(data); } run(); 1. Paste the code in the "Update a group name" sample. 2. Fill in the `name` parameter with the new name of your group. Note: Notice that we are using a different endpoint to update the group. For more update options, see our various code samples in the [API reference](/docs/sms/api-reference/sms/groups/updategroup). ## Run the code 1. Run the following command in your terminal/command prompt to create a group: ```shell node updateGroup.mjs ``` ### Successful Response A successful response shows the new name of the group. ```javascript { "id": "XXXXX6621VHXXXXX9Z8PMXXXXX", "name": "Jazzercise 1", "size": 2, "created_at": "2022-08-24T14:15:22Z", "modified_at": "2022-08-24T14:15:22Z", } ``` You're an all-star classifier! [Go back](/docs/sms/tutorials/node/name-group/next_2) ## Next steps - Find other useful code samples in our [API reference](/docs/sms/api-reference). - Check out [another tutorial](/docs/sms/tutorials).