# Change part of URL for all endpoints

**URL:** <https://community.postman.com/t/change-part-of-url-for-all-endpoints/61793>\
**Category:** Help Hub\
**Tags:** variables, collections\
**Created:** [June 4, 2024, 6:41am UTC](https://community.postman.com/t/change-part-of-url-for-all-endpoints/61793 "2024-06-04T06:41:44Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![tcolonel](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/tcolonel/32/28832_2.png) [@tcolonel](https://community.postman.com/u/tcolonel)\
**Post date:** [June 4, 2024, 6:41am UTC](https://community.postman.com/t/change-part-of-url-for-all-endpoints/61793/1 "2024-06-04T06:41:44Z")

</div>

Hello.

Is it possible to change part of URL of any endpoints? How I can do it?

For example I put site URL to var and now I need change it at all endpoints.

Thanks.

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [June 4, 2024, 9:18am UTC](https://community.postman.com/t/change-part-of-url-for-all-endpoints/61793/2 "2024-06-04T09:18:51Z")

</div>

This type of activity is covered in the Postman Learning Centre.

If you are new to Postman, then I would suggest a visit to the Learning Centre.

[Overview | Postman Learning Center](https://learning.postman.com/docs/introduction/overview/)

Including the Postman Training links under “Other Resources”.

![image](https://us1.discourse-cdn.com/getpostman/original/3X/3/b/3b763d56d66445f4c34eeb66c64631335559a741.png)

I would recommend the “Galaxy APIs 101” course first as it gets you used to the application features.

Then the “Galaxy Testing and Automation” course which teaches you how to assert the responses. It includes using variables.

---

<div class="post-metadata">

**Author:** ![tcolonel](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/tcolonel/32/28832_2.png) [@tcolonel](https://community.postman.com/u/tcolonel)\
**Post date:** [June 4, 2024, 9:38am UTC](https://community.postman.com/t/change-part-of-url-for-all-endpoints/61793/3 "2024-06-04T09:38:09Z")

</div>

I think either I phrased my question incorrectly or you misunderstood my question. I will try again.

I have a collection, in the collection there are endpoints. In each endpoint I have a URL like `https://site.com/api/<method>/?<params>`. I need to replace `https://site.com` with a variable in all endpoints. To avoid having to do this manually, I thought maybe there was a way. I looked at the API and found nothing except: `https://www.postman.com/postman/workspace/postman-public-workspace/folder/12959542-acbe573f-3abb-453c-a2b8-124213d069ab`, but there is no way to update collection elements, that’s why I created the ticket here.

Is it clearer now? Or does your answer just solve my problem?

Thanks.

---

<div class="post-metadata">

**Author:** ![michaelderekjones](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/michaelderekjones/32/14819_2.png) [@michaelderekjones](https://community.postman.com/u/michaelderekjones)\
**Post date:** [June 4, 2024, 9:52am UTC](https://community.postman.com/t/change-part-of-url-for-all-endpoints/61793/4 "2024-06-04T09:52:06Z")

</div>

If you want to update the details in a collection, you can use the Postman Collection API which will return a JSON representation of your collection.

[Get a collection | Postman Public Workspace | Postman API Network](https://www.postman.com/postman/workspace/postman-public-workspace/request/12959542-a6a282df-907e-438b-8fe6-e5efaa60b8bf?ctx=documentation)

That API has methods for patch requests.

[Update part of a collection | Postman Public Workspace | Postman API Network](https://www.postman.com/postman/workspace/postman-public-workspace/request/12959542-24607f03-453e-4936-b544-78d99e05cd19)

The following link may be of use as well.

[Structure of a collection | Postman Collection Format](https://learning.postman.com/collection-format/getting-started/structure-of-a-collection/)

---

<div class="post-metadata">

**Author:** ![tcolonel](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/tcolonel/32/28832_2.png) [@tcolonel](https://community.postman.com/u/tcolonel)\
**Post date:** [June 4, 2024, 10:16am UTC](https://community.postman.com/t/change-part-of-url-for-all-endpoints/61793/5 "2024-06-04T10:16:35Z")

</div>

@michaelderekjones

Thanks a lot for your help!

---

<div class="post-metadata">

**Author:** ![tcolonel](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/tcolonel/32/28832_2.png) [@tcolonel](https://community.postman.com/u/tcolonel)\
**Post date:** [June 7, 2024, 9:13am UTC](https://community.postman.com/t/change-part-of-url-for-all-endpoints/61793/7 "2024-06-07T09:13:51Z")

</div>

@satellite-cosmolog11

Thanks for your answer, but this is not at all what I need.

In general, my problem is solved as follows:

1. I get the entire collection using the API - [https://api.getpostman.com/collections/{{collectionId}](https://api.getpostman.com/collections/%7B%7BcollectionId%7D)}.
2. I replace the necessary part in all endpoints.
3. I send updated data using the API - [https://api.getpostman.com/collections/{{collectionId}](https://api.getpostman.com/collections/%7B%7BcollectionId%7D)}.

I get profit)

Thanks.

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/system/32/29796_2.png) [@system](https://community.postman.com/u/system)\
**Post date:** [July 7, 2024, 9:13am UTC](https://community.postman.com/t/change-part-of-url-for-all-endpoints/61793/8 "2024-07-07T09:13:53Z")

</div>

Closed on July 7, 2024, 9:13am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
