> 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.

# Respond to an add request

PUT https://api.getpostman.com/network/private/network-entity/request/{requestId}
Content-Type: application/json

Responds to a user's request to add a workspace to your team's [Private API Network](https://learning.postman.com/docs/collaborating-in-postman/adding-private-network/). Only managers can approve or deny a request. Once approved, the workspace will appear in the team's Private API Network.

Reference: https://learning.postman.com/api-docs/api-reference/private-api-network/respond-private-network-add-request

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Postman API
  version: 1.0.0
paths:
  /network/private/network-entity/request/{requestId}:
    put:
      operationId: respondPrivateNetworkAddRequest
      summary: Respond to an add request
      description: >-
        Responds to a user's request to add a workspace to your team's [Private
        API
        Network](https://learning.postman.com/docs/collaborating-in-postman/adding-private-network/).
        Only managers can approve or deny a request. Once approved, the
        workspace will appear in the team's Private API Network.
      tags:
        - privateApiNetwork
      parameters:
        - name: requestId
          in: path
          description: The request's ID.
          required: true
          schema:
            $ref: '#/components/schemas/panRequestId'
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Private API
                  Network_respondPrivateNetworkAddRequest_Response_200
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/RespondPrivateNetworkAddRequestRequestBadRequestError
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/RespondPrivateNetworkAddRequestRequestUnauthorizedError
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/RespondPrivateNetworkAddRequestRequestForbiddenError
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/RespondPrivateNetworkAddRequestRequestInternalServerError
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/respondPanElementAddRequestBody'
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:
    panRequestId:
      type: integer
      title: panRequestId
    RespondPanElementAddRequestBodyStatus:
      type: string
      enum:
        - denied
        - approved
      description: The request's approval status.
      title: RespondPanElementAddRequestBodyStatus
    RespondPanElementAddRequestBodyResponse:
      type: object
      properties:
        message:
          type: string
          description: A message that details why the user's request was denied.
      description: If the request is denied, the response to the user's request.
      title: RespondPanElementAddRequestBodyResponse
    respondPanElementAddRequestBody:
      type: object
      properties:
        status:
          $ref: '#/components/schemas/RespondPanElementAddRequestBodyStatus'
          description: The request's approval status.
        response:
          $ref: '#/components/schemas/RespondPanElementAddRequestBodyResponse'
          description: If the request is denied, the response to the user's request.
      required:
        - status
      title: respondPanElementAddRequestBody
    RespondPanElementAddRequestApproveRequestItemsStatus:
      type: string
      enum:
        - approved
        - denied
      description: The request's status.
      title: RespondPanElementAddRequestApproveRequestItemsStatus
    RespondPanElementAddRequestApproveRequestItemsElementType:
      type: string
      enum:
        - workspace
      description: The `workspace` element type.
      title: RespondPanElementAddRequestApproveRequestItemsElementType
    RespondPanElementAddRequestApproveRequestItemsElement:
      type: object
      properties:
        id:
          type: string
          description: The element's ID.
        name:
          type: string
          description: The element's name.
        summary:
          type:
            - string
            - 'null'
          description: The element's short summary.
        description:
          type:
            - string
            - 'null'
          description: The element's description.
        type:
          $ref: >-
            #/components/schemas/RespondPanElementAddRequestApproveRequestItemsElementType
          description: The `workspace` element type.
        createdBy:
          type: integer
          description: The ID of the user who added the element to the Private API Network.
        createdAt:
          type: string
          format: date-time
          description: The date and time the element was added to the Private API Network.
      description: Information about the requested element.
      title: RespondPanElementAddRequestApproveRequestItemsElement
    RespondPanElementAddRequestApproveRequestItems:
      type: object
      properties:
        id:
          type: integer
          description: The request's ID.
        createdAt:
          type: string
          format: date-time
          description: The date and time at which the request was created.
        createdBy:
          type: integer
          description: The ID of the user who created the request.
        message:
          type: string
          description: The user's optional message included in the request.
        status:
          $ref: >-
            #/components/schemas/RespondPanElementAddRequestApproveRequestItemsStatus
          description: The request's status.
        element:
          $ref: >-
            #/components/schemas/RespondPanElementAddRequestApproveRequestItemsElement
          description: Information about the requested element.
      description: Information about the Private API Network request.
      title: RespondPanElementAddRequestApproveRequestItems
    respondPanElementAddRequestApprove:
      type: object
      properties:
        request:
          type: array
          items:
            $ref: >-
              #/components/schemas/RespondPanElementAddRequestApproveRequestItems
          description: A list of Private API Network requests.
      title: respondPanElementAddRequestApprove
    RespondPanElementAddRequestDenyRequestItemsStatus:
      type: string
      enum:
        - approved
        - denied
      description: The request's status.
      title: RespondPanElementAddRequestDenyRequestItemsStatus
    PanRequestElementType:
      type: string
      enum:
        - workspace
      description: The `workspace` element type.
      title: PanRequestElementType
    panRequestElement:
      type: object
      properties:
        id:
          type: string
          description: The element's ID.
        type:
          $ref: '#/components/schemas/PanRequestElementType'
          description: The `workspace` element type.
        name:
          type: string
          description: The element's name.
        summary:
          type:
            - string
            - 'null'
          description: The element's short summary.
        description:
          type:
            - string
            - 'null'
          description: The element's description.
      description: Information about the requested element.
      title: panRequestElement
    panRequestResponse:
      type: object
      properties:
        createdAt:
          type: string
          format: date-time
          description: The date and time at which request was denied.
        createdBy:
          type: integer
          description: The ID of the user who denied the request.
        message:
          type: string
          description: The request's response message.
      description: >-
        Information about the response to the element's request. This object
        only returns when the request is denied with a message.
      title: panRequestResponse
    RespondPanElementAddRequestDenyRequestItems:
      type: object
      properties:
        id:
          type: integer
          description: The request's ID.
        createdAt:
          type: string
          format: date-time
          description: The date and time at which the request was created.
        createdBy:
          type: integer
          description: The ID of the user who created the request.
        message:
          type: string
          description: The user's optional message included in the request.
        status:
          $ref: >-
            #/components/schemas/RespondPanElementAddRequestDenyRequestItemsStatus
          description: The request's status.
        element:
          $ref: '#/components/schemas/panRequestElement'
        response:
          $ref: '#/components/schemas/panRequestResponse'
      description: Information about the Private API Network request.
      title: RespondPanElementAddRequestDenyRequestItems
    respondPanElementAddRequestDeny:
      type: object
      properties:
        request:
          type: array
          items:
            $ref: '#/components/schemas/RespondPanElementAddRequestDenyRequestItems'
          description: A list of Private API Network requests.
      title: respondPanElementAddRequestDeny
    Private API Network_respondPrivateNetworkAddRequest_Response_200:
      oneOf:
        - $ref: '#/components/schemas/respondPanElementAddRequestApprove'
        - $ref: '#/components/schemas/respondPanElementAddRequestDeny'
      title: Private API Network_respondPrivateNetworkAddRequest_Response_200
    panError:
      type: object
      properties:
        name:
          type: string
          description: The error name.
        message:
          type: string
          description: The error message.
      title: panError
    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
    RespondPrivateNetworkAddRequestRequestBadRequestError:
      oneOf:
        - $ref: '#/components/schemas/panError'
        - $ref: '#/components/schemas/commonErrorNameMessage'
      title: RespondPrivateNetworkAddRequestRequestBadRequestError
    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
    RespondPrivateNetworkAddRequestRequestUnauthorizedError:
      oneOf:
        - $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        - $ref: '#/components/schemas/commonErrorNameMessage'
      title: RespondPrivateNetworkAddRequestRequestUnauthorizedError
    RespondPrivateNetworkAddRequestRequestForbiddenError:
      oneOf:
        - $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        - $ref: '#/components/schemas/commonErrorNameMessage'
      title: RespondPrivateNetworkAddRequestRequestForbiddenError
    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
    RespondPrivateNetworkAddRequestRequestInternalServerError:
      oneOf:
        - $ref: '#/components/schemas/commonErrorTypeTitleDetail'
        - $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        - $ref: '#/components/schemas/commonErrorNameMessage'
      title: RespondPrivateNetworkAddRequestRequestInternalServerError
  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

### Request Approved



**Request**

```json
{
  "status": "approved"
}
```

**Response**

```json
{
  "request": [
    {
      "createdAt": "2024-06-09T14:48:45.000Z",
      "createdBy": 87654321,
      "element": {
        "createdAt": "2024-06-19T04:48:40.000Z",
        "createdBy": 12345678,
        "description": null,
        "id": "1f0df51a-8658-4ee8-a2a1-d2567dfa09a9",
        "name": "Billing Team Workspace",
        "summary": "The Billing team's workspace.",
        "type": "workspace"
      },
      "id": 2,
      "message": "Please add this to the network",
      "status": "approved"
    }
  ]
}
```

**SDK Code**

```python Request Approved
import requests

url = "https://api.getpostman.com/network/private/network-entity/request/232"

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

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript Request Approved
const url = 'https://api.getpostman.com/network/private/network-entity/request/232';
const options = {
  method: 'PUT',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"status":"approved"}'
};

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

```go Request Approved
package main

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

func main() {

	url := "https://api.getpostman.com/network/private/network-entity/request/232"

	payload := strings.NewReader("{\n  \"status\": \"approved\"\n}")

	req, _ := http.NewRequest("PUT", 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 Request Approved
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/network/private/network-entity/request/232")

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

request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"status\": \"approved\"\n}"

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

```java Request Approved
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.getpostman.com/network/private/network-entity/request/232")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"status\": \"approved\"\n}")
  .asString();
```

```php Request Approved
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.getpostman.com/network/private/network-entity/request/232', [
  'body' => '{
  "status": "approved"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Request Approved
using RestSharp;

var client = new RestClient("https://api.getpostman.com/network/private/network-entity/request/232");
var request = new RestRequest(Method.PUT);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"status\": \"approved\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Request Approved
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = ["status": "approved"] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/network/private/network-entity/request/232")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```

### Request Denied



**Request**

```json
{
  "status": "denied",
  "response": {
    "message": "Please fix the API issues first."
  }
}
```

**Response**

```json
{
  "request": [
    {
      "createdAt": "2024-06-09T14:48:45.000Z",
      "createdBy": 87654321,
      "element": {
        "id": "1f0df51a-8658-4ee8-a2a1-d2567dfa09a9",
        "name": "Billing Team Workspace",
        "summary": "The Billing team's workspace.",
        "type": "workspace"
      },
      "id": 2,
      "message": "Please add this to the network",
      "response": {
        "createdAt": "2024-06-19T04:48:40.000Z",
        "createdBy": 12345678,
        "message": "Please fix the API issues first"
      },
      "status": "denied"
    }
  ]
}
```

**SDK Code**

```python Request Denied
import requests

url = "https://api.getpostman.com/network/private/network-entity/request/232"

payload = {
    "status": "denied",
    "response": { "message": "Please fix the API issues first." }
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.json())
```

```javascript Request Denied
const url = 'https://api.getpostman.com/network/private/network-entity/request/232';
const options = {
  method: 'PUT',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"status":"denied","response":{"message":"Please fix the API issues first."}}'
};

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

```go Request Denied
package main

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

func main() {

	url := "https://api.getpostman.com/network/private/network-entity/request/232"

	payload := strings.NewReader("{\n  \"status\": \"denied\",\n  \"response\": {\n    \"message\": \"Please fix the API issues first.\"\n  }\n}")

	req, _ := http.NewRequest("PUT", 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 Request Denied
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/network/private/network-entity/request/232")

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

request = Net::HTTP::Put.new(url)
request["x-api-key"] = '<apiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"status\": \"denied\",\n  \"response\": {\n    \"message\": \"Please fix the API issues first.\"\n  }\n}"

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

```java Request Denied
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://api.getpostman.com/network/private/network-entity/request/232")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"status\": \"denied\",\n  \"response\": {\n    \"message\": \"Please fix the API issues first.\"\n  }\n}")
  .asString();
```

```php Request Denied
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://api.getpostman.com/network/private/network-entity/request/232', [
  'body' => '{
  "status": "denied",
  "response": {
    "message": "Please fix the API issues first."
  }
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Request Denied
using RestSharp;

var client = new RestClient("https://api.getpostman.com/network/private/network-entity/request/232");
var request = new RestRequest(Method.PUT);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"status\": \"denied\",\n  \"response\": {\n    \"message\": \"Please fix the API issues first.\"\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Request Denied
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "status": "denied",
  "response": ["message": "Please fix the API issues first."]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/network/private/network-entity/request/232")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```