Logo
15_Days_of_Postman_-_for_testers_IvanKo API Documentation

Create a request

POST {{baseUrl}}/collections/{{collectionId}}/requests

Creates a request in a collection. For a complete list of properties, see the [Collection Format Request documentation]

Note:

It is recommended that you pass the name property in the request body. If you do not, the system uses a null value. As a result, this creates a request with a blank name.

 

Body PARAM

Key Datatype Required Description 
folder
string The folder ID in which to create the request. By default, the system will create the request at the collection level.



HEADERS

Key Datatype Required Description 




RESPONSES

status OK

{ "model_id": "c82dd02c-4870-4907-8fcb-593a876cf05b", "meta": { "model": "request", "action": "import" }, "data": { "collection": "12ece9e1-2abf-4edc-8e34-de66e74114d2", "method": "POST", "headers": [ { "key": "Host", "value": "postman-echo.com" }, { "key": "user-agent", "value": "curl/7.88.1" }, { "key": "accept", "value": "*/*" }, { "key": "content-type", "value": "application/json" }, { "key": "content-length", "value": "22" } ], "events": [ { "listen": "test", "script": { "id": "a8608e1a-ce4b-4129-8c89-930d26ae0f6a", "exec": [ "pm.test(\"Status code is 200\", function () {", " pm.response.to.have.status(200);", "});" ], "type": "text/javascript" } }, { "listen": "prerequest", "script": { "id": "5b4bb273-5878-4bd7-a296-94a256783a66", "exec": [ "" ], "type": "text/javascript" } } ], "dataMode": "raw", "url": "https://postman-echo.com/post", "name": "Example POST Request", "owner": "12345678", "folder": null, "responses_order": [], "id": "c82dd02c-4870-4907-8fcb-593a876cf05b", "lastUpdatedBy": "12345678", "headerData": [], "createdAt": "2023-09-07T13:35:33.691Z", "updatedAt": "2023-09-07T13:35:33.691Z", "rawModeData": null, "dataOptions": { "raw": { "language": "json" } }, "responses": [] }, "revision": 32456382272 }



Curl
curl -X POST 'https://api.getpostman.com/collections/collectionId/requests?folder=<string>' -d '{"name":"requestName"}'

ENDPOINTS