> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://learning.postman.com/llms.txt. For full content including API reference and SDK examples, see https://learning.postman.com/llms-full.txt.

# Create a response

POST https://api.getpostman.com/collections/{collectionId}/responses
Content-Type: application/json

Creates a request response in a collection. For a complete list of request body properties, refer to the **Response** entry in the [Postman Collection Format documentation](https://schema.postman.com/collection/json/v2.1.0/draft-07/docs/index.html).

**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 response with a blank name.


Reference: https://learning.postman.com/api-docs/api-reference/collection-items/create-collection-response

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Postman API
  version: 1.0.0
paths:
  /collections/{collectionId}/responses:
    post:
      operationId: createCollectionResponse
      summary: Create a response
      description: >
        Creates a request response in a collection. For a complete list of
        request body properties, refer to the **Response** entry in the [Postman
        Collection Format
        documentation](https://schema.postman.com/collection/json/v2.1.0/draft-07/docs/index.html).


        **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
        response with a blank name.
      tags:
        - collectionItems
      parameters:
        - name: collectionId
          in: path
          description: The collection's ID.
          required: true
          schema:
            $ref: '#/components/schemas/collectionId'
        - name: request
          in: query
          description: The parent request's ID.
          required: true
          schema:
            $ref: '#/components/schemas/collectionRequestId'
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/createCollectionResponseResponse'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commonErrorNameMessageDetails'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commonErrorNameMessageDetails'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/CreateCollectionResponseRequestInternalServerError
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/createCollectionResponse'
servers:
  - url: https://api.getpostman.com
    description: https://api.getpostman.com
  - url: https://api.eu.postman.com
    description: https://api.eu.postman.com
components:
  schemas:
    collectionId:
      type: string
      title: collectionId
    collectionRequestId:
      type: string
      title: collectionRequestId
    request-method:
      type: string
      enum:
        - GET
        - PUT
        - POST
        - PATCH
        - DELETE
        - COPY
        - HEAD
        - OPTIONS
        - LINK
        - UNLINK
        - PURGE
        - LOCK
        - UNLOCK
        - PROPFIND
        - VIEW
      description: The request's HTTP method.
      title: request-method
    header-2:
      type: object
      properties:
        key:
          type: string
          description: The header's key, such as `Content-Type` or `X-Custom-Header`.
        value:
          type: string
          description: The header key's value.
        description:
          type:
            - string
            - 'null'
          description: The header's description.
      required:
        - key
        - value
      description: Information about the header.
      title: header-2
    header-list-2:
      type: array
      items:
        $ref: '#/components/schemas/header-2'
      description: A list of headers.
      title: header-list-2
    CreateCollectionResponseDataMode:
      type: string
      enum:
        - raw
        - urlencoded
        - formdata
        - binary
        - graphql
      description: The associated request body's data mode.
      title: CreateCollectionResponseDataMode
    RequestDataOptionsRaw:
      type: object
      properties:
        language:
          type: string
          description: The raw mode data's language type.
      description: Options for the `raw` data mode.
      title: RequestDataOptionsRaw
    RequestDataOptionsUrlencoded:
      type: object
      properties: {}
      description: Options for the `urlencoded` data mode.
      title: RequestDataOptionsUrlencoded
    RequestDataOptionsParams:
      type: object
      properties: {}
      description: Options for the `params` data mode.
      title: RequestDataOptionsParams
    RequestDataOptionsBinary:
      type: object
      properties: {}
      description: Options for the `binary` data mode.
      title: RequestDataOptionsBinary
    RequestDataOptionsGraphql:
      type: object
      properties: {}
      description: Options for the `graphql` data mode.
      title: RequestDataOptionsGraphql
    request-data-options:
      type: object
      properties:
        raw:
          $ref: '#/components/schemas/RequestDataOptionsRaw'
          description: Options for the `raw` data mode.
        urlencoded:
          $ref: '#/components/schemas/RequestDataOptionsUrlencoded'
          description: Options for the `urlencoded` data mode.
        params:
          $ref: '#/components/schemas/RequestDataOptionsParams'
          description: Options for the `params` data mode.
        binary:
          $ref: '#/components/schemas/RequestDataOptionsBinary'
          description: Options for the `binary` data mode.
        graphql:
          $ref: '#/components/schemas/RequestDataOptionsGraphql'
          description: Options for the `graphql` data mode.
      description: >-
        Additional configurations and options set for the request body's various
        data modes.
      title: request-data-options
    CreateCollectionResponseResponseCode:
      type: object
      properties:
        code:
          type: number
          format: double
          description: The response's HTTP response status code.
        name:
          type: string
          description: The name of the status code.
      description: The response's HTTP response code information.
      title: CreateCollectionResponseResponseCode
    createCollectionResponse:
      type: object
      properties:
        name:
          type: string
          description: >-
            The response's name. 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 response with a blank name.
        description:
          type:
            - string
            - 'null'
          description: The response's description.
        url:
          type:
            - string
            - 'null'
          description: The associated request's URL.
        method:
          $ref: '#/components/schemas/request-method'
        headers:
          $ref: '#/components/schemas/header-list-2'
        dataMode:
          $ref: '#/components/schemas/CreateCollectionResponseDataMode'
          description: The associated request body's data mode.
        rawModeData:
          type:
            - string
            - 'null'
          description: The associated request body's raw mode data.
        dataOptions:
          $ref: '#/components/schemas/request-data-options'
        responseCode:
          $ref: '#/components/schemas/CreateCollectionResponseResponseCode'
          description: The response's HTTP response code information.
        status:
          type:
            - string
            - 'null'
          description: The response's HTTP status text.
        time:
          type: string
          description: The time taken by the request to complete, in milliseconds.
        cookies:
          type:
            - string
            - 'null'
          description: The response's cookie data.
        mime:
          type:
            - string
            - 'null'
          description: The response's MIME type.
        text:
          type: string
          description: The raw text of the response body.
        language:
          type: string
          description: The response body's language type.
        rawDataType:
          type:
            - string
            - 'null'
          description: The response's raw data type.
        requestObject:
          type: string
          description: A JSON-stringified representation of the associated request.
      description: >
        Information about the response. For a complete list of properties, refer
        to the **Response** entry in the [Postman Collection Format
        documentation](https://schema.postman.com/collection/json/v2.1.0/draft-07/docs/index.html).


        **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
        response with a blank name.
      title: createCollectionResponse
    CreateCollectionResponseResponseData:
      type: object
      properties:
        id:
          type: string
          description: The response's ID.
        owner:
          type: string
          description: The user ID of the response's owner.
        request:
          type: string
          description: The request ID of the response's associated request.
        createdAt:
          type: string
          format: date-time
          description: The date and time at which the response was created.
        updatedAt:
          type: string
          format: date-time
          description: The date and time at which the response was last updated.
        lastUpdatedBy:
          type: string
          description: The user ID of the user who last updated the response.
      description: >-
        Information about the response. For a complete list of properties, refer
        to the **Response** entry in the [Postman Collection Format
        documentation](https://schema.postman.com/collection/json/v2.1.0/draft-07/docs/index.html).
      title: CreateCollectionResponseResponseData
    createCollectionResponseResponse:
      type: object
      properties:
        data:
          $ref: '#/components/schemas/CreateCollectionResponseResponseData'
          description: >-
            Information about the response. For a complete list of properties,
            refer to the **Response** entry in the [Postman Collection Format
            documentation](https://schema.postman.com/collection/json/v2.1.0/draft-07/docs/index.html).
        meta:
          type: object
          additionalProperties:
            description: Any type
          description: >-
            A Postman-specific response that contains information about the
            internal performed operation.
        model_id:
          type: string
          description: The response's ID.
        revision:
          type: number
          format: double
          description: >-
            An internal revision ID. Its value increments each time the resource
            changes. You can use this ID to track whether there were changes
            since the last time you fetched the resource.
      title: createCollectionResponseResponse
    CommonErrorNameMessageDetailsErrorDetails:
      oneOf:
        - type: object
          additionalProperties:
            description: Any type
        - type: array
          items:
            type: string
      description: Information about the error.
      title: CommonErrorNameMessageDetailsErrorDetails
    CommonErrorNameMessageDetailsError:
      type: object
      properties:
        name:
          type: string
          description: The error name.
        message:
          type: string
          description: The error message.
        details:
          $ref: '#/components/schemas/CommonErrorNameMessageDetailsErrorDetails'
          description: Information about the error.
      title: CommonErrorNameMessageDetailsError
    commonErrorNameMessageDetails:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/CommonErrorNameMessageDetailsError'
      title: commonErrorNameMessageDetails
    CommonErrorTypeTitleDetailDetail:
      oneOf:
        - type: string
        - type: object
          additionalProperties:
            description: Any type
      description: Information about the error.
      title: CommonErrorTypeTitleDetailDetail
    commonErrorTypeTitleDetail:
      type: object
      properties:
        type:
          type: string
          description: The type of error.
        title:
          type: string
          description: A short summary of the problem.
        detail:
          $ref: '#/components/schemas/CommonErrorTypeTitleDetailDetail'
          description: Information about the error.
      title: commonErrorTypeTitleDetail
    CommonErrorTypeTitleDetailStatusType:
      oneOf:
        - type: string
          format: uri-reference
        - type: string
      title: CommonErrorTypeTitleDetailStatusType
    commonErrorTypeTitleDetailStatus:
      type: object
      properties:
        type:
          $ref: '#/components/schemas/CommonErrorTypeTitleDetailStatusType'
        title:
          type: string
          description: A short summary of the problem.
        detail:
          type: string
          description: Information about the error.
        status:
          type: integer
          description: The error's HTTP status code.
      title: commonErrorTypeTitleDetailStatus
    CommonErrorNameMessageError:
      type: object
      properties:
        name:
          type: string
          description: The error name.
        message:
          type: string
          description: The error message.
      description: Information about the error.
      title: CommonErrorNameMessageError
    commonErrorNameMessage:
      type: object
      properties:
        error:
          $ref: '#/components/schemas/CommonErrorNameMessageError'
          description: Information about the error.
      title: commonErrorNameMessage
    CreateCollectionResponseRequestInternalServerError:
      oneOf:
        - $ref: '#/components/schemas/commonErrorTypeTitleDetail'
        - $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        - $ref: '#/components/schemas/commonErrorNameMessage'
      title: CreateCollectionResponseRequestInternalServerError
  securitySchemes:
    PostmanApiKey:
      type: apiKey
      in: header
      name: x-api-key
    scimApiKey:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        A valid [SCIM API
        key](https://learning.postman.com/docs/administration/scim-provisioning/scim-provisioning-overview/#generating-scim-api-key)
        for calls to SCIM endpoints.
    basicAuth:
      type: http
      scheme: basic

```

## Examples

### Collection Response Created



**Request**

```json
undefined
```

**Response**

```json
{
  "data": {
    "id": "43e1277f-6079-4feb-9316-c8ec24605092",
    "owner": "12345678",
    "request": "c82dd02c-4870-4907-8fcb-593a876cf05b",
    "createdAt": "2022-08-29T16:58:15.523Z",
    "updatedAt": "2022-08-29T16:58:15.523Z",
    "lastUpdatedBy": "12345678"
  },
  "meta": {
    "action": "create",
    "model": "response"
  },
  "model_id": "43e1277f-6079-4feb-9316-c8ec24605092",
  "revision": 26532286083
}
```

**SDK Code**

```python Collection Response Created
import requests

url = "https://api.getpostman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/responses"

querystring = {"request":"c82dd02c-4870-4907-8fcb-593a876cf05b"}

headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, headers=headers, params=querystring)

print(response.json())
```

```javascript Collection Response Created
const url = 'https://api.getpostman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/responses?request=c82dd02c-4870-4907-8fcb-593a876cf05b';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: undefined
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Collection Response Created
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.getpostman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/responses?request=c82dd02c-4870-4907-8fcb-593a876cf05b"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Collection Response Created
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/responses?request=c82dd02c-4870-4907-8fcb-593a876cf05b")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'

response = http.request(request)
puts response.read_body
```

```java Collection Response Created
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.getpostman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/responses?request=c82dd02c-4870-4907-8fcb-593a876cf05b")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .asString();
```

```php Collection Response Created
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.getpostman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/responses?request=c82dd02c-4870-4907-8fcb-593a876cf05b', [
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Collection Response Created
using RestSharp;

var client = new RestClient("https://api.getpostman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/responses?request=c82dd02c-4870-4907-8fcb-593a876cf05b");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Collection Response Created
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/responses?request=c82dd02c-4870-4907-8fcb-593a876cf05b")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```

### Create Response



**Request**

```json
{
  "name": "Example POST Response",
  "description": "This is an example POST response.",
  "url": "https://postman-echo.com/post",
  "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"
    }
  ],
  "dataMode": "raw",
  "rawModeData": "{\n    \"field\": \"Value\"\n}",
  "dataOptions": {
    "raw": {
      "language": "json"
    }
  }
}
```

**Response**

```json
{
  "data": {
    "id": "43e1277f-6079-4feb-9316-c8ec24605092",
    "owner": "12345678",
    "request": "c82dd02c-4870-4907-8fcb-593a876cf05b",
    "createdAt": "2022-08-29T16:58:15.523Z",
    "updatedAt": "2022-08-29T16:58:15.523Z",
    "lastUpdatedBy": "12345678"
  },
  "meta": {
    "action": "create",
    "model": "response"
  },
  "model_id": "43e1277f-6079-4feb-9316-c8ec24605092",
  "revision": 26532286083
}
```

**SDK Code**

```python Create Response
import requests

url = "https://api.getpostman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/responses"

querystring = {"request":"c82dd02c-4870-4907-8fcb-593a876cf05b"}

payload = {
    "name": "Example POST Response",
    "description": "This is an example POST response.",
    "url": "https://postman-echo.com/post",
    "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"
        }
    ],
    "dataMode": "raw",
    "rawModeData": "{
    \"field\": \"Value\"
}",
    "dataOptions": { "raw": { "language": "json" } }
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers, params=querystring)

print(response.json())
```

```javascript Create Response
const url = 'https://api.getpostman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/responses?request=c82dd02c-4870-4907-8fcb-593a876cf05b';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"name":"Example POST Response","description":"This is an example POST response.","url":"https://postman-echo.com/post","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"}],"dataMode":"raw","rawModeData":"{\n    \"field\": \"Value\"\n}","dataOptions":{"raw":{"language":"json"}}}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go Create Response
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.getpostman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/responses?request=c82dd02c-4870-4907-8fcb-593a876cf05b"

	payload := strings.NewReader("{\n  \"name\": \"Example POST Response\",\n  \"description\": \"This is an example POST response.\",\n  \"url\": \"https://postman-echo.com/post\",\n  \"method\": \"POST\",\n  \"headers\": [\n    {\n      \"key\": \"Host\",\n      \"value\": \"postman-echo.com\"\n    },\n    {\n      \"key\": \"user-agent\",\n      \"value\": \"curl/7.88.1\"\n    },\n    {\n      \"key\": \"accept\",\n      \"value\": \"*/*\"\n    },\n    {\n      \"key\": \"content-type\",\n      \"value\": \"application/json\"\n    },\n    {\n      \"key\": \"content-length\",\n      \"value\": \"22\"\n    }\n  ],\n  \"dataMode\": \"raw\",\n  \"rawModeData\": \"{\\n    \\\"field\\\": \\\"Value\\\"\\n}\",\n  \"dataOptions\": {\n    \"raw\": {\n      \"language\": \"json\"\n    }\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("x-api-key", "<apiKey>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby Create Response
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/responses?request=c82dd02c-4870-4907-8fcb-593a876cf05b")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"Example POST Response\",\n  \"description\": \"This is an example POST response.\",\n  \"url\": \"https://postman-echo.com/post\",\n  \"method\": \"POST\",\n  \"headers\": [\n    {\n      \"key\": \"Host\",\n      \"value\": \"postman-echo.com\"\n    },\n    {\n      \"key\": \"user-agent\",\n      \"value\": \"curl/7.88.1\"\n    },\n    {\n      \"key\": \"accept\",\n      \"value\": \"*/*\"\n    },\n    {\n      \"key\": \"content-type\",\n      \"value\": \"application/json\"\n    },\n    {\n      \"key\": \"content-length\",\n      \"value\": \"22\"\n    }\n  ],\n  \"dataMode\": \"raw\",\n  \"rawModeData\": \"{\\n    \\\"field\\\": \\\"Value\\\"\\n}\",\n  \"dataOptions\": {\n    \"raw\": {\n      \"language\": \"json\"\n    }\n  }\n}"

response = http.request(request)
puts response.read_body
```

```java Create Response
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.getpostman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/responses?request=c82dd02c-4870-4907-8fcb-593a876cf05b")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"Example POST Response\",\n  \"description\": \"This is an example POST response.\",\n  \"url\": \"https://postman-echo.com/post\",\n  \"method\": \"POST\",\n  \"headers\": [\n    {\n      \"key\": \"Host\",\n      \"value\": \"postman-echo.com\"\n    },\n    {\n      \"key\": \"user-agent\",\n      \"value\": \"curl/7.88.1\"\n    },\n    {\n      \"key\": \"accept\",\n      \"value\": \"*/*\"\n    },\n    {\n      \"key\": \"content-type\",\n      \"value\": \"application/json\"\n    },\n    {\n      \"key\": \"content-length\",\n      \"value\": \"22\"\n    }\n  ],\n  \"dataMode\": \"raw\",\n  \"rawModeData\": \"{\\n    \\\"field\\\": \\\"Value\\\"\\n}\",\n  \"dataOptions\": {\n    \"raw\": {\n      \"language\": \"json\"\n    }\n  }\n}")
  .asString();
```

```php Create Response
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.getpostman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/responses?request=c82dd02c-4870-4907-8fcb-593a876cf05b', [
  'body' => '{
  "name": "Example POST Response",
  "description": "This is an example POST response.",
  "url": "https://postman-echo.com/post",
  "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"
    }
  ],
  "dataMode": "raw",
  "rawModeData": "{\\n    \\"field\\": \\"Value\\"\\n}",
  "dataOptions": {
    "raw": {
      "language": "json"
    }
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

echo $response->getBody();
```

```csharp Create Response
using RestSharp;

var client = new RestClient("https://api.getpostman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/responses?request=c82dd02c-4870-4907-8fcb-593a876cf05b");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"Example POST Response\",\n  \"description\": \"This is an example POST response.\",\n  \"url\": \"https://postman-echo.com/post\",\n  \"method\": \"POST\",\n  \"headers\": [\n    {\n      \"key\": \"Host\",\n      \"value\": \"postman-echo.com\"\n    },\n    {\n      \"key\": \"user-agent\",\n      \"value\": \"curl/7.88.1\"\n    },\n    {\n      \"key\": \"accept\",\n      \"value\": \"*/*\"\n    },\n    {\n      \"key\": \"content-type\",\n      \"value\": \"application/json\"\n    },\n    {\n      \"key\": \"content-length\",\n      \"value\": \"22\"\n    }\n  ],\n  \"dataMode\": \"raw\",\n  \"rawModeData\": \"{\\n    \\\"field\\\": \\\"Value\\\"\\n}\",\n  \"dataOptions\": {\n    \"raw\": {\n      \"language\": \"json\"\n    }\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Create Response
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "Example POST Response",
  "description": "This is an example POST response.",
  "url": "https://postman-echo.com/post",
  "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"
    ]
  ],
  "dataMode": "raw",
  "rawModeData": "{
    \"field\": \"Value\"
}",
  "dataOptions": ["raw": ["language": "json"]]
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/collections/12ece9e1-2abf-4edc-8e34-de66e74114d2/responses?request=c82dd02c-4870-4907-8fcb-593a876cf05b")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```