# Document all the payloads for the requests

**URL:** <https://community.postman.com/t/document-all-the-payloads-for-the-requests/51774>\
**Category:** Help Hub\
**Tags:** collections, authentication\
**Created:** [September 14, 2023, 1:09pm UTC](https://community.postman.com/t/document-all-the-payloads-for-the-requests/51774 "2023-09-14T13:09:37Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![technical-physicist1](https://avatars.discourse-cdn.com/v4/letter/t/49beb7/32.png) [@technical-physicist1](https://community.postman.com/u/technical-physicist1)\
**Post date:** [September 14, 2023, 1:09pm UTC](https://community.postman.com/t/document-all-the-payloads-for-the-requests/51774/1 "2023-09-14T13:09:37Z")

</div>

I WANT to ask  
I want in Postman that all the payloads we have can be documented, or can we have any directory path so that we have the records of our payloads?  
Does it seem possible to have  
Please let me know in Postman!  
thankful.

---

<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:** [September 14, 2023, 1:50pm UTC](https://community.postman.com/t/document-all-the-payloads-for-the-requests/51774/2 "2023-09-14T13:50:59Z")

</div>

Hey @technical-physicist1 👋

Welcome to the Postman Community! :postman:

You could add those payloads as `Examples` for a request in the Collection. By adding them here, they would be displayed on the auto-generated Collection documentation for you.

On the request, you can use the _View more actions_ menu and select `Add example`:

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

Add your alternative payload in the example:

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

Those can be selected in the Example dropdown and will be displayed on the documentation:

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

More information can be found on our Learning Center:

> **[Writing your docs | Postman Learning Center](https://learning.postman.com/docs/publishing-your-api/authoring-your-documentation/)**
>
> Writing your docs: documentation for Postman, the collaboration platform for API development. Create better APIs—faster.

---

<div class="post-metadata">

**Author:** ![technical-physicist1](https://avatars.discourse-cdn.com/v4/letter/t/49beb7/32.png) [@technical-physicist1](https://community.postman.com/u/technical-physicist1)\
**Post date:** [September 15, 2023, 7:53am UTC](https://community.postman.com/t/document-all-the-payloads-for-the-requests/51774/3 "2023-09-15T07:53:23Z")

</div>

![Capture](https://us1.discourse-cdn.com/getpostman/original/3X/7/6/76d3086ab81cef267ba7a9adf679ce3baf3553ed.png)

i do not have that add example option in this!

---

<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:** [September 15, 2023, 8:09am UTC](https://community.postman.com/t/document-all-the-payloads-for-the-requests/51774/4 "2023-09-15T08:09:51Z")

</div>

You’re opening the menu for the Collection or Folder, you need to do this on the Request.

---

<div class="post-metadata">

**Author:** ![technical-physicist1](https://avatars.discourse-cdn.com/v4/letter/t/49beb7/32.png) [@technical-physicist1](https://community.postman.com/u/technical-physicist1)\
**Post date:** [September 15, 2023, 11:06am UTC](https://community.postman.com/t/document-all-the-payloads-for-the-requests/51774/5 "2023-09-15T11:06:19Z")

</div>

I have around 500+ APIs  
I have to manually add that example to this, which will be a headache.  
Is there any method or library that can automatically save payloads in any file or folder?

---

<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:** [September 15, 2023, 2:26pm UTC](https://community.postman.com/t/document-all-the-payloads-for-the-requests/51774/6 "2023-09-15T14:26:49Z")

</div>

You could utilize the Postman API to programatically add examples to your requests using [this endpoint](https://www.postman.com/postman/workspace/postman-public-workspace/request/12959542-37c3f560-a1c6-4fae-bcc9-c2620ecebd34).

The request body would need to be in this format:

```auto
{
    "name": "Example - POST Request",
    "responseCode": {
        "code": 200,
        "name": "OK"
    },
    "language": "json",
    "rawDataType": null,
    "requestObject": "{\"data\":null,\"dataMode\":\"raw\",\"dataOptions\":{\"raw\":{\"language\":\"json\"}},\"headerData\":[],\"method\":\"POST\",\"queryParams\":[],\"url\":\"https://postman-echo.com/post\",\"headers\":\"\",\"rawModeData\":\"{\\n \\\"field\\\": \\\"Value\\\"\\n}\"}"
}

```

The `rawModeData` part of the `requestObject` would be where you would can add the payload example body.

As you have multiple requests, you would need create the logic to get all the ids (These can be extracted from the [GET Collection](https://www.postman.com/postman/workspace/postman-public-workspace/request/12959542-a6a282df-907e-438b-8fe6-e5efaa60b8bf) endpoint) and loop over them adding in the examples using the Postman API endpoint I referenced.

---

<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:** [October 30, 2023, 2:27pm UTC](https://community.postman.com/t/document-all-the-payloads-for-the-requests/51774/7 "2023-10-30T14:27:17Z")

</div>

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