# Mock collection item update (delta update)

**URL:** <https://community.postman.com/t/mock-collection-item-update-delta-update/51157>\
**Category:** Help Hub\
**Tags:** collections, postman-api\
**Created:** [August 30, 2023, 11:04am UTC](https://community.postman.com/t/mock-collection-item-update-delta-update/51157 "2023-08-30T11:04:01Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![supply-technologist8](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@supply-technologist8](https://community.postman.com/u/supply-technologist8)\
**Post date:** [August 30, 2023, 11:04am UTC](https://community.postman.com/t/mock-collection-item-update-delta-update/51157/1 "2023-08-30T11:04:01Z")

</div>

Hi,

The api exposes the endpoint `/collections` but i cannot seem to find anything else with regards to an item within a collection i.e. `/collections/items/itemId`

What I am seeing is that each existing item has its own id which makes me believe there’s a way to refer to it and perform an edit?

What I would like to do is to update one item at the time not the entire collection.

My request examples are quite heavy and I hit a bad request error when my entire request exceeds 20~mb.

I have read that you do not allow more than 1mb in the body and also that also that compressing the request body is not yet supported by postman.

What I want to understand is if there’s a way to perform a delta update on a collection?

Thanks

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [August 30, 2023, 2:05pm UTC](https://community.postman.com/t/mock-collection-item-update-delta-update/51157/2 "2023-08-30T14:05:03Z")

</div>

Hey @supply-technologist8 👋

Welcome to the Postman Community! :postman:

This might be something that could help you out here:

[https://www.postman.com/postman/workspace/postman-public-workspace/collection/16473433-f2f0cb8f-609d-443f-913c-9831187c326e?action=share&source=copy-link&creator=14760314](https://www.postman.com/postman/workspace/postman-public-workspace/collection/16473433-f2f0cb8f-609d-443f-913c-9831187c326e?action=share&source=copy-link&creator=14760314)

> Any endpoint in this collection needs the header `Accept: application/vnd.postman.v2+json` (already set in the collection). This will soon be removed and it will be part of the normal postman api docs.

---

<div class="post-metadata">

**Author:** ![supply-technologist8](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@supply-technologist8](https://community.postman.com/u/supply-technologist8)\
**Post date:** [August 30, 2023, 2:32pm UTC](https://community.postman.com/t/mock-collection-item-update-delta-update/51157/3 "2023-08-30T14:32:12Z")

</div>

Hey @danny-dainton, I focused so hard on the Postman API collection I have totally missed this one!!

What is the correct way to use it? I am afraid that the collection will grow a bit over time and I wont be able to get it and then determine the item ids Id like to update.

1. GET [https://api.getpostman/collections/id](https://api.getpostman/collections/id)
2. PUT [https://api.getpostman/collections/responses/id](https://api.getpostman/collections/responses/id)

Could you link me to couple of examples please?

What are the requests and responses, the req/res within the item? The mock request and mock example response?

So far on a simple get by id on req or res I am only getting 404s, what am I missing?

Thank you

---

<div class="post-metadata">

**Author:** ![supply-technologist8](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@supply-technologist8](https://community.postman.com/u/supply-technologist8)\
**Post date:** [August 30, 2023, 3:26pm UTC](https://community.postman.com/t/mock-collection-item-update-delta-update/51157/4 "2023-08-30T15:26:33Z")

</div>

It’s me again, sorry I should learn to read, added the header you pointed out and I got some data back, thanks a million!

---

<div class="post-metadata">

**Author:** ![danny-dainton](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/danny-dainton/32/29401_2.png) [@danny-dainton](https://community.postman.com/u/danny-dainton)\
**Post date:** [August 30, 2023, 4:12pm UTC](https://community.postman.com/t/mock-collection-item-update-delta-update/51157/5 "2023-08-30T16:12:01Z")

</div>

Glad to see you have it working - The inclusion of the `header` is only temporarily required for those endpoints.

A blog post with examples and a more in depth look at the usages of those endpoints will be available soon.

---

<div class="post-metadata">

**Author:** ![supply-technologist8](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@supply-technologist8](https://community.postman.com/u/supply-technologist8)\
**Post date:** [August 30, 2023, 4:19pm UTC](https://community.postman.com/t/mock-collection-item-update-delta-update/51157/6 "2023-08-30T16:19:16Z")

</div>

Is it everything on the json request/response objects updatable? The examples only refer to few properties

For instance I am trying to update on the response

```auto
Url: {
  raw: “”,
  path: [
    “”,
    “”
  ]
}

```

And not having much luck with it this thus.

I need to update an entire item would that consist of two steps

1 update the request  
2 update the response

Also is the body of the response updatable?

Thank you, thank you, looking forward to the blog post.

---

<div class="post-metadata">

**Author:** ![supply-technologist8](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@supply-technologist8](https://community.postman.com/u/supply-technologist8)\
**Post date:** [August 31, 2023, 10:21am UTC](https://community.postman.com/t/mock-collection-item-update-delta-update/51157/7 "2023-08-31T10:21:44Z")

</div>

hey @danny-dainton I am trying to post a new request object to /collections/id/requests

Although I am having - method as post, the request created always appears as GET, am I wrong in using the Request object which is nested into Collection?

Where can I see more information on the expected request body for requests and responses endpoints?

Thank you

---

<div class="post-metadata">

**Author:** ![supply-technologist8](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@supply-technologist8](https://community.postman.com/u/supply-technologist8)\
**Post date:** [August 31, 2023, 12:03pm UTC](https://community.postman.com/t/mock-collection-item-update-delta-update/51157/8 "2023-08-31T12:03:42Z")

</div>

It’s me again it seems that the request one is easier than the response, I would really appreciate your help with the request body for /responses

Thanks

---

<div class="post-metadata">

**Author:** ![david-espi-hernandez](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/david-espi-hernandez/32/25537_2.png) [@david-espi-hernandez](https://community.postman.com/u/david-espi-hernandez)\
**Post date:** [August 31, 2023, 12:43pm UTC](https://community.postman.com/t/mock-collection-item-update-delta-update/51157/9 "2023-08-31T12:43:58Z")

</div>

Hi, Cris!

Can you please attach the request body you are using?  
In addition, if you can provide a bit of context on what are you trying to achieve that would be great:

- Why are you doing this (what is your problem), what do you want to achieve
- What is the process you are following  
… that would be great, so I could understand the problem better.

Thanks!

---

<div class="post-metadata">

**Author:** ![david-espi-hernandez](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/david-espi-hernandez/32/25537_2.png) [@david-espi-hernandez](https://community.postman.com/u/david-espi-hernandez)\
**Post date:** [August 31, 2023, 12:56pm UTC](https://community.postman.com/t/mock-collection-item-update-delta-update/51157/10 "2023-08-31T12:56:45Z")

</div>

By the way, if you pass the “method” field in the request body when doing a POST on the collections/{id}/requests endpoint, it sets the request method to the method passed in the field (POST, PUT…)  
We will add more examples to the documentation.

---

<div class="post-metadata">

**Author:** ![supply-technologist8](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@supply-technologist8](https://community.postman.com/u/supply-technologist8)\
**Post date:** [August 31, 2023, 2:43pm UTC](https://community.postman.com/t/mock-collection-item-update-delta-update/51157/11 "2023-08-31T14:43:50Z")

</div>

Hey @david-espi-hernandez I am playing a guessing game as I do not know what the request body model for both /requests and /responses should look like. I think I have wrongly assumed that it could use the ones listed here:

> **[Collection | Postman Collection Format](https://learning.postman.com/collection-format/reference/collection/)**
>
> Collection: documentation for Postman Collection Format, a portable format for organizing API requests and workflows.

> **[Request | Postman Collection Format](https://learning.postman.com/collection-format/reference/request/)**
>
> Request: documentation for Postman Collection Format, a portable format for organizing API requests and workflows.

> **[Response | Postman Collection Format](https://learning.postman.com/collection-format/reference/response/)**
>
> Response: documentation for Postman Collection Format, a portable format for organizing API requests and workflows.

I have build a Collection object and cut the response/request pieces and tried to use them in the  
/collections/id/requests  
/collections/id/responses?request=requestId

I did manage to figure out the request body for /requests which is ultimately a flat json with name ;url;method fields

however I struggle with the request body for /responses as I have found out that for instance response code isn’t a code field but an entire object called responseCode.

Hence I requested some help in order to understand and use correctly the request body for both endpoints. Let me know if anything is unclear.

---

<div class="post-metadata">

**Author:** ![supply-technologist8](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@supply-technologist8](https://community.postman.com/u/supply-technologist8)\
**Post date:** [August 31, 2023, 2:50pm UTC](https://community.postman.com/t/mock-collection-item-update-delta-update/51157/12 "2023-08-31T14:50:30Z")

</div>

Providing some more answers to:  
“Why are you doing this (what is your problem), what do you want to achieve”

I have a mock server to which I want to potentially add more items. By item I refer to an Item from the Collection object - [Collection | Postman Collection Format](https://learning.postman.com/collection-format/reference/collection/) - which consists of Request and Response objects. I am doing this programatically not manually hence I need to work with the API to achieve delta updates, rather than recreating the collection which is my current go to process.

So far I am recreating the whole collection (by sending PUT /collections/collectionId). When adding a new item (request with an example response pair) to the collection with my current process I receive a 400 error response because of the size of the request.  
Each item’s response has a somewhat heavy body content and when they are all added together and then attempt to recreate the collection - the entire request to PUT /collections/collectionId - starts exceeding the maximum allowed size for the body of the request (from documentation is 1MB, I managed to push around 10+ mb).

Hence I started looking for ways to update items individually, but the documentation and ways to achieve that are scarce.

---

<div class="post-metadata">

**Author:** ![supply-technologist8](https://avatars.discourse-cdn.com/v4/letter/s/53a042/32.png) [@supply-technologist8](https://community.postman.com/u/supply-technologist8)\
**Post date:** [August 31, 2023, 3:12pm UTC](https://community.postman.com/t/mock-collection-item-update-delta-update/51157/13 "2023-08-31T15:12:20Z")

</div>

I had also tried to gzip the PUT /collections/collectionId request so that it’s lighter but that did not work out as I expected, i.e. nothing changed on the postman end and I still received the same 400 response

---

<div class="post-metadata">

**Author:** ![david-espi-hernandez](https://sea2.discourse-cdn.com/getpostman/user_avatar/community.postman.com/david-espi-hernandez/32/25537_2.png) [@david-espi-hernandez](https://community.postman.com/u/david-espi-hernandez)\
**Post date:** [September 1, 2023, 10:37am UTC](https://community.postman.com/t/mock-collection-item-update-delta-update/51157/14 "2023-09-01T10:37:52Z")

</div>

Hi!  
I’ve created several examples that will help you with your problem:

- Create a request passing a body: [Postman](https://www.postman.com/postman/workspace/postman-public-workspace/example/16473433-ca7364c9-1f96-4f6e-bf02-4b0f516a2c81)
- Get a request with body: [Postman](https://www.postman.com/postman/workspace/postman-public-workspace/example/16473433-33c2e558-f57c-4b45-b24e-efc18dcb75b2)
- Get a response with body: [Postman](https://www.postman.com/postman/workspace/postman-public-workspace/example/16473433-60a79ae3-6350-4110-bf4c-bad4daa02c65)
- Create a response with body: [Postman](https://www.postman.com/postman/workspace/postman-public-workspace/example/16473433-262d85f9-69e9-4201-b7ab-6226417e1d43)

I believe you can use these examples to solve your problem.  
As Danny said, we will be working on the examples and the existing documentation, and we will also work on a blog post to help people with these endpoints.  
Please let me know if this works for you.

---

<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:** [September 4, 2023, 10:38am UTC](https://community.postman.com/t/mock-collection-item-update-delta-update/51157/15 "2023-09-04T10:38:39Z")

</div>

Closed on September 4, 2023, 10:38am UTC

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