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

# Manage Partner Workspace invites

POST https://api.getpostman.com/invitations
Content-Type: application/json

Manages invitations and access to your team's [Partner Workspaces](https://learning.postman.com/docs/collaborating-in-postman/using-workspaces/partner-workspaces/manage/). You can use this endpoint to:

- Send Partner Workspace invitations to the given email addresses. Users who already exist in the partnership are added directly, while new users receive an invitation email.
- Remove partners from a workspace.
- Remove partners from a partnership and all of its workspaces.

**Note:**

- Partner Workspaces are available on the Postman **Team** and **Enterprise** [plans](https://www.postman.com/pricing/).
- This endpoint requires the following [roles](https://learning.postman.com/docs/administration/roles-and-permissions/), based on your plan:
  - **Team** — Requires the **Workspace Editor** role to invite or remove partners from workspaces. The **Admin** role is required for removing partners from all workspaces.
  - **Enterprise** — The **Partner Manager** role can perform all operations. The **Workspace Editor** role and **Admin** roles have the same permissions on this plan as they do on the Team plan. It's recommended to use the **Partner Manager** role if you're on an **Enterprise** plan.


Reference: https://learning.postman.com/api-docs/api-reference/workspaces/manage-partner-workspace-invites

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: Postman API
  version: 1.0.0
paths:
  /invitations:
    post:
      operationId: managePartnerWorkspaceInvites
      summary: Manage Partner Workspace invites
      description: >
        Manages invitations and access to your team's [Partner
        Workspaces](https://learning.postman.com/docs/collaborating-in-postman/using-workspaces/partner-workspaces/manage/).
        You can use this endpoint to:


        - Send Partner Workspace invitations to the given email addresses. Users
        who already exist in the partnership are added directly, while new users
        receive an invitation email.

        - Remove partners from a workspace.

        - Remove partners from a partnership and all of its workspaces.


        **Note:**


        - Partner Workspaces are available on the Postman **Team** and
        **Enterprise** [plans](https://www.postman.com/pricing/).

        - This endpoint requires the following
        [roles](https://learning.postman.com/docs/administration/roles-and-permissions/),
        based on your plan:
          - **Team** — Requires the **Workspace Editor** role to invite or remove partners from workspaces. The **Admin** role is required for removing partners from all workspaces.
          - **Enterprise** — The **Partner Manager** role can perform all operations. The **Workspace Editor** role and **Admin** roles have the same permissions on this plan as they do on the Team plan. It's recommended to use the **Partner Manager** role if you're on an **Enterprise** plan.
      tags:
        - workspaces
      parameters:
        - name: x-api-key
          in: header
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/Workspaces_managePartnerWorkspaceInvites_Response_200
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        '404':
          description: Not Found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: >-
                  #/components/schemas/ManagePartnerWorkspaceInvitesRequestInternalServerError
      requestBody:
        content:
          application/json:
            schema:
              $ref: >-
                #/components/schemas/Workspaces_managePartnerWorkspaceInvites_Request
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:
    ManagePartnerWorkspaceInvitesInvitePartnerAction:
      type: string
      enum:
        - invite_partner
      description: The `invite_partner` action.
      title: ManagePartnerWorkspaceInvitesInvitePartnerAction
    ManagePartnerWorkspaceInvitesInvitePartnerTargetEntity:
      type: string
      enum:
        - workspace
      description: The `workspace` value.
      title: ManagePartnerWorkspaceInvitesInvitePartnerTargetEntity
    ManagePartnerWorkspaceInvitesInvitePartnerRoleId:
      type: string
      enum:
        - '4'
        - '5'
        - '6'
        - '7'
      description: |
        The role ID to assign to invited partners:
        - `4` — Viewer
        - `5` — Editor
        - `6` — Viewer and Partner Lead
        - `7` — Editor and Partner Lead
      title: ManagePartnerWorkspaceInvitesInvitePartnerRoleId
    partnerEmailAddress:
      type: string
      format: email
      description: A partner's email address.
      title: partnerEmailAddress
    managePartnerWorkspaceInvitesTargetObjectEmails:
      type: object
      properties:
        emails:
          type: array
          items:
            $ref: '#/components/schemas/partnerEmailAddress'
          description: A list of the partners' email addresses.
      required:
        - emails
      description: The target on which to perform the action.
      title: managePartnerWorkspaceInvitesTargetObjectEmails
    managePartnerWorkspaceInvitesInvitePartner:
      type: object
      properties:
        action:
          $ref: >-
            #/components/schemas/ManagePartnerWorkspaceInvitesInvitePartnerAction
          description: The `invite_partner` action.
        targetEntity:
          $ref: >-
            #/components/schemas/ManagePartnerWorkspaceInvitesInvitePartnerTargetEntity
          description: The `workspace` value.
        targetEntityId:
          type: string
          description: The Partner Workspace's ID.
        roleId:
          $ref: >-
            #/components/schemas/ManagePartnerWorkspaceInvitesInvitePartnerRoleId
          description: |
            The role ID to assign to invited partners:
            - `4` — Viewer
            - `5` — Editor
            - `6` — Viewer and Partner Lead
            - `7` — Editor and Partner Lead
        target:
          $ref: '#/components/schemas/managePartnerWorkspaceInvitesTargetObjectEmails'
      required:
        - action
        - targetEntity
        - targetEntityId
        - roleId
        - target
      description: Invite partners to a Partner Workspace.
      title: managePartnerWorkspaceInvitesInvitePartner
    ManagePartnerWorkspaceInvitesRemovePartnerTargetEntity:
      type: string
      enum:
        - workspace
      description: The `workspace` value.
      title: ManagePartnerWorkspaceInvitesRemovePartnerTargetEntity
    ManagePartnerWorkspaceInvitesRemovePartnerAction:
      type: string
      enum:
        - remove_partner
      description: The `remove_partner` action.
      title: ManagePartnerWorkspaceInvitesRemovePartnerAction
    partnerUserId:
      type: string
      description: The partner's ID.
      title: partnerUserId
    ManagePartnerWorkspaceInvitesTargetObjectUserId0:
      type: object
      properties:
        userIds:
          type: array
          items:
            $ref: '#/components/schemas/partnerUserId'
          description: A list of partner user IDs to remove from the Partner Workspace.
      required:
        - userIds
      description: The target on which to perform the action.
      title: ManagePartnerWorkspaceInvitesTargetObjectUserId0
    ManagePartnerWorkspaceInvitesTargetObjectUserId1:
      type: object
      properties:
        userIds:
          type: array
          items:
            $ref: '#/components/schemas/partnerUserId'
          description: A list of partner publishers' team IDs.
      required:
        - userIds
      description: The target on which to perform the action.
      title: ManagePartnerWorkspaceInvitesTargetObjectUserId1
    managePartnerWorkspaceInvitesTargetObjectUserId:
      oneOf:
        - $ref: >-
            #/components/schemas/ManagePartnerWorkspaceInvitesTargetObjectUserId0
        - $ref: >-
            #/components/schemas/ManagePartnerWorkspaceInvitesTargetObjectUserId1
      title: managePartnerWorkspaceInvitesTargetObjectUserId
    managePartnerWorkspaceInvitesRemovePartner:
      type: object
      properties:
        targetEntity:
          $ref: >-
            #/components/schemas/ManagePartnerWorkspaceInvitesRemovePartnerTargetEntity
          description: The `workspace` value.
        targetEntityId:
          type: string
          description: The Partner Workspace ID from which to remove partners.
        action:
          $ref: >-
            #/components/schemas/ManagePartnerWorkspaceInvitesRemovePartnerAction
          description: The `remove_partner` action.
        target:
          $ref: '#/components/schemas/managePartnerWorkspaceInvitesTargetObjectUserId'
      required:
        - targetEntity
        - targetEntityId
        - action
        - target
      description: The request body for removing partners from a Partner Workspace.
      title: managePartnerWorkspaceInvitesRemovePartner
    ManagePartnerWorkspaceInvitesRemovePartnerTeamTargetEntity:
      type: string
      enum:
        - team
      description: The `team` value.
      title: ManagePartnerWorkspaceInvitesRemovePartnerTeamTargetEntity
    ManagePartnerWorkspaceInvitesRemovePartnerTeamAction:
      type: string
      enum:
        - remove_partner
      description: The `remove_partner` action.
      title: ManagePartnerWorkspaceInvitesRemovePartnerTeamAction
    managePartnerWorkspaceInvitesRemovePartnerTeam:
      type: object
      properties:
        targetEntity:
          $ref: >-
            #/components/schemas/ManagePartnerWorkspaceInvitesRemovePartnerTeamTargetEntity
          description: The `team` value.
        targetEntityId:
          type: string
          description: The team ID from which to remove partners.
        action:
          $ref: >-
            #/components/schemas/ManagePartnerWorkspaceInvitesRemovePartnerTeamAction
          description: The `remove_partner` action.
        target:
          $ref: '#/components/schemas/managePartnerWorkspaceInvitesTargetObjectUserId'
      required:
        - targetEntity
        - targetEntityId
        - action
        - target
      description: The request body for removing partners from partnership with a team.
      title: managePartnerWorkspaceInvitesRemovePartnerTeam
    Workspaces_managePartnerWorkspaceInvites_Request:
      oneOf:
        - $ref: '#/components/schemas/managePartnerWorkspaceInvitesInvitePartner'
        - $ref: '#/components/schemas/managePartnerWorkspaceInvitesRemovePartner'
        - $ref: '#/components/schemas/managePartnerWorkspaceInvitesRemovePartnerTeam'
      title: Workspaces_managePartnerWorkspaceInvites_Request
    ManagePartnerWorkspaceInvitesInvitePartnerResponseRoleDisplayName:
      type: string
      enum:
        - Viewer
        - Editor
        - Viewer and Partner Lead
        - Editor and Partner Lead
      description: The assigned role's display name.
      title: ManagePartnerWorkspaceInvitesInvitePartnerResponseRoleDisplayName
    ManagePartnerWorkspaceInvitesInvitePartnerResponseResultsItemsStatus:
      type: string
      enum:
        - EMAIL_SENT
        - ALREADY_INVITED
        - PARTNER_ADDED
        - FAILED
      description: >
        The invitation status:

        - `EMAIL_SENT` — An invitation email was sent.

        - `ALREADY_INVITED` — The user already has a pending invitation.

        - `PARTNER_ADDED` — The existing user was added to the workspace
        directly.

        - `FAILED` — The invitation failed.
      title: ManagePartnerWorkspaceInvitesInvitePartnerResponseResultsItemsStatus
    ManagePartnerWorkspaceInvitesInvitePartnerResponseResultsItems:
      type: object
      properties:
        email:
          type: string
          format: email
          description: The invited user's email address.
        status:
          $ref: >-
            #/components/schemas/ManagePartnerWorkspaceInvitesInvitePartnerResponseResultsItemsStatus
          description: >
            The invitation status:

            - `EMAIL_SENT` — An invitation email was sent.

            - `ALREADY_INVITED` — The user already has a pending invitation.

            - `PARTNER_ADDED` — The existing user was added to the workspace
            directly.

            - `FAILED` — The invitation failed.
        userId:
          type: string
          description: The user ID. This only returns for the `PARTNER_ADDED` status.
        message:
          type: string
          description: A response message.
        invitationLink:
          type: string
          format: uri
          description: >-
            An invitation link. This only returns for the `EMAIL_SENT` and
            `ALREADY_INVITED` statuses.
      title: ManagePartnerWorkspaceInvitesInvitePartnerResponseResultsItems
    managePartnerWorkspaceInvitesInvitePartnerResponse:
      type: object
      properties:
        targetEntity:
          type: string
          description: The target entity.
        targetEntityId:
          type: string
          description: The target entity's ID.
        roleId:
          type: string
          description: The role ID assigned to the users.
        action:
          type: string
          description: The action peformed.
        roleDisplayName:
          $ref: >-
            #/components/schemas/ManagePartnerWorkspaceInvitesInvitePartnerResponseRoleDisplayName
          description: The assigned role's display name.
        results:
          type: array
          items:
            $ref: >-
              #/components/schemas/ManagePartnerWorkspaceInvitesInvitePartnerResponseResultsItems
          description: A list of the action results for each email address.
      title: managePartnerWorkspaceInvitesInvitePartnerResponse
    ManagePartnerWorkspaceInvitesRemovePartnerResponseResultsItemsStatus:
      type: string
      enum:
        - REMOVED
        - FAILED
      description: |
        The removal status:
        - `REMOVED` — The partner was successfully removed.
        - `FAILED` — The partner's removal failed.
      title: ManagePartnerWorkspaceInvitesRemovePartnerResponseResultsItemsStatus
    ManagePartnerWorkspaceInvitesRemovePartnerResponseResultsItems:
      type: object
      properties:
        error:
          type: string
          description: >-
            If the endpoint returns the `FAILED` status, the error message
            detailing the error.
        message:
          type: string
          description: A response message.
        status:
          $ref: >-
            #/components/schemas/ManagePartnerWorkspaceInvitesRemovePartnerResponseResultsItemsStatus
          description: |
            The removal status:
            - `REMOVED` — The partner was successfully removed.
            - `FAILED` — The partner's removal failed.
        userId:
          type: string
          description: The user ID.
      title: ManagePartnerWorkspaceInvitesRemovePartnerResponseResultsItems
    managePartnerWorkspaceInvitesRemovePartnerResponse:
      type: object
      properties:
        targetEntity:
          type: string
          description: The target entity type.
        targetEntityId:
          type: string
          description: The target entity's ID.
        action:
          type: string
          description: The action performed.
        results:
          type: array
          items:
            $ref: >-
              #/components/schemas/ManagePartnerWorkspaceInvitesRemovePartnerResponseResultsItems
          description: A list of the action results.
      title: managePartnerWorkspaceInvitesRemovePartnerResponse
    Workspaces_managePartnerWorkspaceInvites_Response_200:
      oneOf:
        - $ref: >-
            #/components/schemas/managePartnerWorkspaceInvitesInvitePartnerResponse
        - $ref: >-
            #/components/schemas/managePartnerWorkspaceInvitesRemovePartnerResponse
      title: Workspaces_managePartnerWorkspaceInvites_Response_200
    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
    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
    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
    ManagePartnerWorkspaceInvitesRequestInternalServerError:
      oneOf:
        - $ref: '#/components/schemas/commonErrorTypeTitleDetail'
        - $ref: '#/components/schemas/commonErrorTypeTitleDetailStatus'
        - $ref: '#/components/schemas/commonErrorNameMessage'
      title: ManagePartnerWorkspaceInvitesRequestInternalServerError
  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

### Invite Partners to a Partner Workspace



**Request**

```json
undefined
```

**Response**

```json
{
  "action": "invite_partner",
  "results": [
    {
      "email": "alex.cruz@example.com",
      "message": "Partner added to workspace",
      "status": "PARTNER_ADDED",
      "userId": "56781234"
    },
    {
      "email": "mike.brown@xample.com",
      "invitationLink": "https://go.getpostman.com/invite-signup?invite_code=XXX",
      "message": "Pending invite exists",
      "status": "ALREADY_INVITED"
    },
    {
      "email": "sara.smith@example.com",
      "invitationLink": "https://go.getpostman.com/invite-signup?invite_code=XXX",
      "status": "EMAIL_SENT"
    }
  ],
  "roleDisplayName": "Viewer",
  "roleId": "4",
  "targetEntity": "workspace",
  "targetEntityId": "1f0df51a-8658-4ee8-a2a1-d2567dfa09a9"
}
```

**SDK Code**

```python Invite Partners to a Partner Workspace
import requests

url = "https://api.getpostman.com/invitations"

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

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

print(response.json())
```

```javascript Invite Partners to a Partner Workspace
const url = 'https://api.getpostman.com/invitations';
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 Invite Partners to a Partner Workspace
package main

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

func main() {

	url := "https://api.getpostman.com/invitations"

	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 Invite Partners to a Partner Workspace
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/invitations")

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 Invite Partners to a Partner Workspace
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.getpostman.com/invitations")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .asString();
```

```php Invite Partners to a Partner Workspace
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.getpostman.com/invitations', [
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Invite Partners to a Partner Workspace
using RestSharp;

var client = new RestClient("https://api.getpostman.com/invitations");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Invite Partners to a Partner Workspace
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/invitations")! 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()
```

### Partial Invite Success



**Request**

```json
undefined
```

**Response**

```json
{
  "action": "invite_partner",
  "results": [
    {
      "email": "alex.cruz@example.com",
      "message": "Partner added to workspace",
      "status": "PARTNER_ADDED",
      "userId": "56781234"
    },
    {
      "email": "mike.brown@xample.com",
      "invitationLink": "https://go.getpostman.com/invite-signup?invite_code=XXX",
      "message": "Pending invite exists",
      "status": "ALREADY_INVITED"
    },
    {
      "email": "sara.smith@example.com",
      "message": "Failed to process invitation",
      "status": "FAILED"
    }
  ],
  "roleDisplayName": "Viewer",
  "roleId": "4",
  "targetEntity": "workspace",
  "targetEntityId": "1f0df51a-8658-4ee8-a2a1-d2567dfa09a9"
}
```

**SDK Code**

```python Partial Invite Success
import requests

url = "https://api.getpostman.com/invitations"

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

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

print(response.json())
```

```javascript Partial Invite Success
const url = 'https://api.getpostman.com/invitations';
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 Partial Invite Success
package main

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

func main() {

	url := "https://api.getpostman.com/invitations"

	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 Partial Invite Success
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/invitations")

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 Partial Invite Success
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.getpostman.com/invitations")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .asString();
```

```php Partial Invite Success
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.getpostman.com/invitations', [
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Partial Invite Success
using RestSharp;

var client = new RestClient("https://api.getpostman.com/invitations");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Partial Invite Success
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/invitations")! 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()
```

### Partial Partners Removal Success



**Request**

```json
undefined
```

**Response**

```json
{
  "action": "remove_partner",
  "results": [
    {
      "status": "REMOVED",
      "userId": "56781234"
    },
    {
      "message": "Failed to remove partner from all workspaces",
      "status": "FAILED",
      "userId": "12348765"
    },
    {
      "error": "Partner information not found",
      "status": "FAILED",
      "userId": "34567812"
    }
  ],
  "targetEntity": "workspace",
  "targetEntityId": "1f0df51a-8658-4ee8-a2a1-d2567dfa09a9"
}
```

**SDK Code**

```python Partial Partners Removal Success
import requests

url = "https://api.getpostman.com/invitations"

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

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

print(response.json())
```

```javascript Partial Partners Removal Success
const url = 'https://api.getpostman.com/invitations';
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 Partial Partners Removal Success
package main

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

func main() {

	url := "https://api.getpostman.com/invitations"

	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 Partial Partners Removal Success
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/invitations")

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 Partial Partners Removal Success
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.getpostman.com/invitations")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .asString();
```

```php Partial Partners Removal Success
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.getpostman.com/invitations', [
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Partial Partners Removal Success
using RestSharp;

var client = new RestClient("https://api.getpostman.com/invitations");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Partial Partners Removal Success
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/invitations")! 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()
```

### Remove Partner from a Workspace



**Request**

```json
undefined
```

**Response**

```json
{
  "action": "remove_partner",
  "results": [
    {
      "status": "REMOVED",
      "userId": "56781234"
    }
  ],
  "targetEntity": "workspace",
  "targetEntityId": "1f0df51a-8658-4ee8-a2a1-d2567dfa09a9"
}
```

**SDK Code**

```python Remove Partner from a Workspace
import requests

url = "https://api.getpostman.com/invitations"

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

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

print(response.json())
```

```javascript Remove Partner from a Workspace
const url = 'https://api.getpostman.com/invitations';
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 Remove Partner from a Workspace
package main

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

func main() {

	url := "https://api.getpostman.com/invitations"

	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 Remove Partner from a Workspace
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/invitations")

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 Remove Partner from a Workspace
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.getpostman.com/invitations")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .asString();
```

```php Remove Partner from a Workspace
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.getpostman.com/invitations', [
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Remove Partner from a Workspace
using RestSharp;

var client = new RestClient("https://api.getpostman.com/invitations");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Remove Partner from a Workspace
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/invitations")! 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()
```

### Remove Partner From Partnership



**Request**

```json
{
  "action": "remove_partner",
  "target": {
    "userIds": [
      "56781234"
    ]
  },
  "targetEntity": "team",
  "targetEntityId": "123"
}
```

**Response**

```json
{
  "action": "remove_partner",
  "results": [
    {
      "status": "REMOVED",
      "userId": "56781234"
    }
  ],
  "targetEntity": "team",
  "targetEntityId": "123"
}
```

**SDK Code**

```python Remove Partner From Partnership
import requests

url = "https://api.getpostman.com/invitations"

payload = {
    "action": "remove_partner",
    "target": { "userIds": ["56781234"] },
    "targetEntity": "team",
    "targetEntityId": "123"
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Remove Partner From Partnership
const url = 'https://api.getpostman.com/invitations';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"action":"remove_partner","target":{"userIds":["56781234"]},"targetEntity":"team","targetEntityId":"123"}'
};

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

```go Remove Partner From Partnership
package main

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

func main() {

	url := "https://api.getpostman.com/invitations"

	payload := strings.NewReader("{\n  \"action\": \"remove_partner\",\n  \"target\": {\n    \"userIds\": [\n      \"56781234\"\n    ]\n  },\n  \"targetEntity\": \"team\",\n  \"targetEntityId\": \"123\"\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 Remove Partner From Partnership
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/invitations")

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  \"action\": \"remove_partner\",\n  \"target\": {\n    \"userIds\": [\n      \"56781234\"\n    ]\n  },\n  \"targetEntity\": \"team\",\n  \"targetEntityId\": \"123\"\n}"

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

```java Remove Partner From Partnership
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.getpostman.com/invitations")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"action\": \"remove_partner\",\n  \"target\": {\n    \"userIds\": [\n      \"56781234\"\n    ]\n  },\n  \"targetEntity\": \"team\",\n  \"targetEntityId\": \"123\"\n}")
  .asString();
```

```php Remove Partner From Partnership
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.getpostman.com/invitations', [
  'body' => '{
  "action": "remove_partner",
  "target": {
    "userIds": [
      "56781234"
    ]
  },
  "targetEntity": "team",
  "targetEntityId": "123"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Remove Partner From Partnership
using RestSharp;

var client = new RestClient("https://api.getpostman.com/invitations");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"action\": \"remove_partner\",\n  \"target\": {\n    \"userIds\": [\n      \"56781234\"\n    ]\n  },\n  \"targetEntity\": \"team\",\n  \"targetEntityId\": \"123\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Remove Partner From Partnership
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "action": "remove_partner",
  "target": ["userIds": ["56781234"]],
  "targetEntity": "team",
  "targetEntityId": "123"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/invitations")! 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()
```

### Invite Partners to Partner Workspace



**Request**

```json
{
  "action": "invite_partner",
  "roleId": "4",
  "target": {
    "emails": [
      "alex.cruz@example.com",
      "mike.brown@example.com",
      "sara.smith@example.com"
    ]
  },
  "targetEntity": "workspace",
  "targetEntityId": "1f0df51a-8658-4ee8-a2a1-d2567dfa09a9"
}
```

**Response**

```json
{
  "action": "invite_partner",
  "results": [
    {
      "email": "alex.cruz@example.com",
      "message": "Partner added to workspace",
      "status": "PARTNER_ADDED",
      "userId": "56781234"
    },
    {
      "email": "mike.brown@xample.com",
      "invitationLink": "https://go.getpostman.com/invite-signup?invite_code=XXX",
      "message": "Pending invite exists",
      "status": "ALREADY_INVITED"
    },
    {
      "email": "sara.smith@example.com",
      "invitationLink": "https://go.getpostman.com/invite-signup?invite_code=XXX",
      "status": "EMAIL_SENT"
    }
  ],
  "roleDisplayName": "Viewer",
  "roleId": "4",
  "targetEntity": "workspace",
  "targetEntityId": "1f0df51a-8658-4ee8-a2a1-d2567dfa09a9"
}
```

**SDK Code**

```python Invite Partners to Partner Workspace
import requests

url = "https://api.getpostman.com/invitations"

payload = {
    "action": "invite_partner",
    "roleId": "4",
    "target": { "emails": ["alex.cruz@example.com", "mike.brown@example.com", "sara.smith@example.com"] },
    "targetEntity": "workspace",
    "targetEntityId": "1f0df51a-8658-4ee8-a2a1-d2567dfa09a9"
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Invite Partners to Partner Workspace
const url = 'https://api.getpostman.com/invitations';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"action":"invite_partner","roleId":"4","target":{"emails":["alex.cruz@example.com","mike.brown@example.com","sara.smith@example.com"]},"targetEntity":"workspace","targetEntityId":"1f0df51a-8658-4ee8-a2a1-d2567dfa09a9"}'
};

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

```go Invite Partners to Partner Workspace
package main

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

func main() {

	url := "https://api.getpostman.com/invitations"

	payload := strings.NewReader("{\n  \"action\": \"invite_partner\",\n  \"roleId\": \"4\",\n  \"target\": {\n    \"emails\": [\n      \"alex.cruz@example.com\",\n      \"mike.brown@example.com\",\n      \"sara.smith@example.com\"\n    ]\n  },\n  \"targetEntity\": \"workspace\",\n  \"targetEntityId\": \"1f0df51a-8658-4ee8-a2a1-d2567dfa09a9\"\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 Invite Partners to Partner Workspace
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/invitations")

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  \"action\": \"invite_partner\",\n  \"roleId\": \"4\",\n  \"target\": {\n    \"emails\": [\n      \"alex.cruz@example.com\",\n      \"mike.brown@example.com\",\n      \"sara.smith@example.com\"\n    ]\n  },\n  \"targetEntity\": \"workspace\",\n  \"targetEntityId\": \"1f0df51a-8658-4ee8-a2a1-d2567dfa09a9\"\n}"

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

```java Invite Partners to Partner Workspace
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.getpostman.com/invitations")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"action\": \"invite_partner\",\n  \"roleId\": \"4\",\n  \"target\": {\n    \"emails\": [\n      \"alex.cruz@example.com\",\n      \"mike.brown@example.com\",\n      \"sara.smith@example.com\"\n    ]\n  },\n  \"targetEntity\": \"workspace\",\n  \"targetEntityId\": \"1f0df51a-8658-4ee8-a2a1-d2567dfa09a9\"\n}")
  .asString();
```

```php Invite Partners to Partner Workspace
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.getpostman.com/invitations', [
  'body' => '{
  "action": "invite_partner",
  "roleId": "4",
  "target": {
    "emails": [
      "alex.cruz@example.com",
      "mike.brown@example.com",
      "sara.smith@example.com"
    ]
  },
  "targetEntity": "workspace",
  "targetEntityId": "1f0df51a-8658-4ee8-a2a1-d2567dfa09a9"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Invite Partners to Partner Workspace
using RestSharp;

var client = new RestClient("https://api.getpostman.com/invitations");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"action\": \"invite_partner\",\n  \"roleId\": \"4\",\n  \"target\": {\n    \"emails\": [\n      \"alex.cruz@example.com\",\n      \"mike.brown@example.com\",\n      \"sara.smith@example.com\"\n    ]\n  },\n  \"targetEntity\": \"workspace\",\n  \"targetEntityId\": \"1f0df51a-8658-4ee8-a2a1-d2567dfa09a9\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Invite Partners to Partner Workspace
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "action": "invite_partner",
  "roleId": "4",
  "target": ["emails": ["alex.cruz@example.com", "mike.brown@example.com", "sara.smith@example.com"]],
  "targetEntity": "workspace",
  "targetEntityId": "1f0df51a-8658-4ee8-a2a1-d2567dfa09a9"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/invitations")! 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()
```

### Remove Partner from Workspace



**Request**

```json
{
  "action": "remove_partner",
  "target": {
    "userIds": [
      "56781234"
    ]
  },
  "targetEntity": "workspace",
  "targetEntityId": "1f0df51a-8658-4ee8-a2a1-d2567dfa09a9"
}
```

**Response**

```json
{
  "action": "invite_partner",
  "results": [
    {
      "email": "alex.cruz@example.com",
      "message": "Partner added to workspace",
      "status": "PARTNER_ADDED",
      "userId": "56781234"
    },
    {
      "email": "mike.brown@xample.com",
      "invitationLink": "https://go.getpostman.com/invite-signup?invite_code=XXX",
      "message": "Pending invite exists",
      "status": "ALREADY_INVITED"
    },
    {
      "email": "sara.smith@example.com",
      "invitationLink": "https://go.getpostman.com/invite-signup?invite_code=XXX",
      "status": "EMAIL_SENT"
    }
  ],
  "roleDisplayName": "Viewer",
  "roleId": "4",
  "targetEntity": "workspace",
  "targetEntityId": "1f0df51a-8658-4ee8-a2a1-d2567dfa09a9"
}
```

**SDK Code**

```python Remove Partner from Workspace
import requests

url = "https://api.getpostman.com/invitations"

payload = {
    "action": "remove_partner",
    "target": { "userIds": ["56781234"] },
    "targetEntity": "workspace",
    "targetEntityId": "1f0df51a-8658-4ee8-a2a1-d2567dfa09a9"
}
headers = {
    "x-api-key": "<apiKey>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Remove Partner from Workspace
const url = 'https://api.getpostman.com/invitations';
const options = {
  method: 'POST',
  headers: {'x-api-key': '<apiKey>', 'Content-Type': 'application/json'},
  body: '{"action":"remove_partner","target":{"userIds":["56781234"]},"targetEntity":"workspace","targetEntityId":"1f0df51a-8658-4ee8-a2a1-d2567dfa09a9"}'
};

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

```go Remove Partner from Workspace
package main

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

func main() {

	url := "https://api.getpostman.com/invitations"

	payload := strings.NewReader("{\n  \"action\": \"remove_partner\",\n  \"target\": {\n    \"userIds\": [\n      \"56781234\"\n    ]\n  },\n  \"targetEntity\": \"workspace\",\n  \"targetEntityId\": \"1f0df51a-8658-4ee8-a2a1-d2567dfa09a9\"\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 Remove Partner from Workspace
require 'uri'
require 'net/http'

url = URI("https://api.getpostman.com/invitations")

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  \"action\": \"remove_partner\",\n  \"target\": {\n    \"userIds\": [\n      \"56781234\"\n    ]\n  },\n  \"targetEntity\": \"workspace\",\n  \"targetEntityId\": \"1f0df51a-8658-4ee8-a2a1-d2567dfa09a9\"\n}"

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

```java Remove Partner from Workspace
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.getpostman.com/invitations")
  .header("x-api-key", "<apiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"action\": \"remove_partner\",\n  \"target\": {\n    \"userIds\": [\n      \"56781234\"\n    ]\n  },\n  \"targetEntity\": \"workspace\",\n  \"targetEntityId\": \"1f0df51a-8658-4ee8-a2a1-d2567dfa09a9\"\n}")
  .asString();
```

```php Remove Partner from Workspace
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.getpostman.com/invitations', [
  'body' => '{
  "action": "remove_partner",
  "target": {
    "userIds": [
      "56781234"
    ]
  },
  "targetEntity": "workspace",
  "targetEntityId": "1f0df51a-8658-4ee8-a2a1-d2567dfa09a9"
}',
  'headers' => [
    'Content-Type' => 'application/json',
    'x-api-key' => '<apiKey>',
  ],
]);

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

```csharp Remove Partner from Workspace
using RestSharp;

var client = new RestClient("https://api.getpostman.com/invitations");
var request = new RestRequest(Method.POST);
request.AddHeader("x-api-key", "<apiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"action\": \"remove_partner\",\n  \"target\": {\n    \"userIds\": [\n      \"56781234\"\n    ]\n  },\n  \"targetEntity\": \"workspace\",\n  \"targetEntityId\": \"1f0df51a-8658-4ee8-a2a1-d2567dfa09a9\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Remove Partner from Workspace
import Foundation

let headers = [
  "x-api-key": "<apiKey>",
  "Content-Type": "application/json"
]
let parameters = [
  "action": "remove_partner",
  "target": ["userIds": ["56781234"]],
  "targetEntity": "workspace",
  "targetEntityId": "1f0df51a-8658-4ee8-a2a1-d2567dfa09a9"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.getpostman.com/invitations")! 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()
```