|
| 1 | +# .UserAndWorkspaceManagementApi |
| 2 | + |
| 3 | +All URIs are relative to *https://api.pandadoc.com* |
| 4 | + |
| 5 | +Method | HTTP request | Description |
| 6 | +------------- | ------------- | ------------- |
| 7 | +[**addMember**](UserAndWorkspaceManagementApi.md#addMember) | **POST** /public/v1/workspaces/{workspace_id}/members | Add member |
| 8 | +[**createUser**](UserAndWorkspaceManagementApi.md#createUser) | **POST** /public/v1/users | Create User |
| 9 | +[**createWorkspace**](UserAndWorkspaceManagementApi.md#createWorkspace) | **POST** /public/v1/workspaces | Create Workspace |
| 10 | + |
| 11 | + |
| 12 | +# **addMember** |
| 13 | +> AddMemberResponse addMember(addMemberRequest) |
| 14 | +
|
| 15 | + |
| 16 | +### Example |
| 17 | + |
| 18 | + |
| 19 | +```typescript |
| 20 | +import * as pd_api from 'pandadoc-node-client'; |
| 21 | + |
| 22 | +// replace it with your API key |
| 23 | +const API_KEY = "YOUR_API_KEY"; |
| 24 | +const configuration = pd_api.createConfiguration( |
| 25 | + { authMethods: {apiKey: `API-Key ${API_KEY}`} } |
| 26 | +); |
| 27 | +const apiInstance = new pd_api.UserAndWorkspaceManagementApi(configuration); |
| 28 | + |
| 29 | +const body:pd_api.UserAndWorkspaceManagementApiAddMemberRequest = { |
| 30 | + // string |
| 31 | + workspaceId: "BhVzRcxH9Z2LgfPPGXFUBa", |
| 32 | + // AddMemberRequest |
| 33 | + addMemberRequest: { |
| 34 | + userId: "2eWSKSvVqmuVCnuUK3iWwD", |
| 35 | + role: "Admin", |
| 36 | + }, |
| 37 | + // boolean | Send a confirmation email to the user that was added to workspace(s). (optional) |
| 38 | + notifyUser: true, |
| 39 | + // boolean | Send a confirmation email to all workspace admins indicating that the user has been added to the workspace. (optional) |
| 40 | + notifyWsAdmins: true, |
| 41 | +}; |
| 42 | + |
| 43 | +apiInstance.addMember(body).then((data) => { |
| 44 | + console.log('API called successfully. Returned data: %o', data); |
| 45 | +}).catch((error) => console.error(error)); |
| 46 | +``` |
| 47 | + |
| 48 | + |
| 49 | +### Parameters |
| 50 | + |
| 51 | +Name | Type | Description | Notes |
| 52 | +------------- | ------------- | ------------- | ------------- |
| 53 | + **addMemberRequest** | **AddMemberRequest**| | |
| 54 | + **workspaceId** | [**string**] | | defaults to undefined |
| 55 | + **notifyUser** | [**boolean**] | Send a confirmation email to the user that was added to workspace(s). | (optional) defaults to undefined |
| 56 | + **notifyWsAdmins** | [**boolean**] | Send a confirmation email to all workspace admins indicating that the user has been added to the workspace. | (optional) defaults to undefined |
| 57 | + |
| 58 | + |
| 59 | +### Return type |
| 60 | + |
| 61 | +**AddMemberResponse** |
| 62 | + |
| 63 | +### Authorization |
| 64 | + |
| 65 | +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) |
| 66 | + |
| 67 | +### HTTP request headers |
| 68 | + |
| 69 | + - **Content-Type**: application/json |
| 70 | + - **Accept**: application/json |
| 71 | + |
| 72 | + |
| 73 | +### HTTP response details |
| 74 | +| Status code | Description | Response headers | |
| 75 | +|-------------|-------------|------------------| |
| 76 | +**201** | OK | - | |
| 77 | +**400** | Bad Request | - | |
| 78 | +**401** | Authentication error | - | |
| 79 | +**403** | Permission error | - | |
| 80 | +**404** | Not found | - | |
| 81 | +**429** | Too Many Requests | - | |
| 82 | + |
| 83 | +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
| 84 | + |
| 85 | +# **createUser** |
| 86 | +> CreateUserResponse createUser(createUserRequest) |
| 87 | +
|
| 88 | + |
| 89 | +### Example |
| 90 | + |
| 91 | + |
| 92 | +```typescript |
| 93 | +import * as pd_api from 'pandadoc-node-client'; |
| 94 | + |
| 95 | +// replace it with your API key |
| 96 | +const API_KEY = "YOUR_API_KEY"; |
| 97 | +const configuration = pd_api.createConfiguration( |
| 98 | + { authMethods: {apiKey: `API-Key ${API_KEY}`} } |
| 99 | +); |
| 100 | +const apiInstance = new pd_api.UserAndWorkspaceManagementApi(configuration); |
| 101 | + |
| 102 | +const body:pd_api.UserAndWorkspaceManagementApiCreateUserRequest = { |
| 103 | + // CreateUserRequest |
| 104 | + createUserRequest: { |
| 105 | + user: { |
| 106 | + |
| 107 | + firstName: "John", |
| 108 | + lastName: "Doe", |
| 109 | + phoneNumber: "+14842634627", |
| 110 | + }, |
| 111 | + workspaces: [ |
| 112 | + { |
| 113 | + workspaceId: "2eWSKSvVqmuVCnuUK3iWwD", |
| 114 | + role: "Admin", |
| 115 | + }, |
| 116 | + ], |
| 117 | + license: "Full", |
| 118 | + }, |
| 119 | + // boolean | Send a confirmation email to the user that was added to workspace(s). (optional) |
| 120 | + notifyUser: true, |
| 121 | + // boolean | Send a confirmation email to all workspace admins indicating that the user has been added to the workspace. (optional) |
| 122 | + notifyWsAdmins: true, |
| 123 | +}; |
| 124 | + |
| 125 | +apiInstance.createUser(body).then((data) => { |
| 126 | + console.log('API called successfully. Returned data: %o', data); |
| 127 | +}).catch((error) => console.error(error)); |
| 128 | +``` |
| 129 | + |
| 130 | + |
| 131 | +### Parameters |
| 132 | + |
| 133 | +Name | Type | Description | Notes |
| 134 | +------------- | ------------- | ------------- | ------------- |
| 135 | + **createUserRequest** | **CreateUserRequest**| | |
| 136 | + **notifyUser** | [**boolean**] | Send a confirmation email to the user that was added to workspace(s). | (optional) defaults to undefined |
| 137 | + **notifyWsAdmins** | [**boolean**] | Send a confirmation email to all workspace admins indicating that the user has been added to the workspace. | (optional) defaults to undefined |
| 138 | + |
| 139 | + |
| 140 | +### Return type |
| 141 | + |
| 142 | +**CreateUserResponse** |
| 143 | + |
| 144 | +### Authorization |
| 145 | + |
| 146 | +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) |
| 147 | + |
| 148 | +### HTTP request headers |
| 149 | + |
| 150 | + - **Content-Type**: application/json |
| 151 | + - **Accept**: application/json |
| 152 | + |
| 153 | + |
| 154 | +### HTTP response details |
| 155 | +| Status code | Description | Response headers | |
| 156 | +|-------------|-------------|------------------| |
| 157 | +**201** | OK | - | |
| 158 | +**400** | Bad Request | - | |
| 159 | +**401** | Authentication error | - | |
| 160 | +**403** | Permission error | - | |
| 161 | +**404** | Not found | - | |
| 162 | +**429** | Too Many Requests | - | |
| 163 | + |
| 164 | +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
| 165 | + |
| 166 | +# **createWorkspace** |
| 167 | +> CreateWorkspaceResponse createWorkspace(createWorkspaceRequest) |
| 168 | +
|
| 169 | + |
| 170 | +### Example |
| 171 | + |
| 172 | + |
| 173 | +```typescript |
| 174 | +import * as pd_api from 'pandadoc-node-client'; |
| 175 | + |
| 176 | +// replace it with your API key |
| 177 | +const API_KEY = "YOUR_API_KEY"; |
| 178 | +const configuration = pd_api.createConfiguration( |
| 179 | + { authMethods: {apiKey: `API-Key ${API_KEY}`} } |
| 180 | +); |
| 181 | +const apiInstance = new pd_api.UserAndWorkspaceManagementApi(configuration); |
| 182 | + |
| 183 | +const body:pd_api.UserAndWorkspaceManagementApiCreateWorkspaceRequest = { |
| 184 | + // CreateWorkspaceRequest |
| 185 | + createWorkspaceRequest: { |
| 186 | + name: "A new workspace", |
| 187 | + }, |
| 188 | +}; |
| 189 | + |
| 190 | +apiInstance.createWorkspace(body).then((data) => { |
| 191 | + console.log('API called successfully. Returned data: %o', data); |
| 192 | +}).catch((error) => console.error(error)); |
| 193 | +``` |
| 194 | + |
| 195 | + |
| 196 | +### Parameters |
| 197 | + |
| 198 | +Name | Type | Description | Notes |
| 199 | +------------- | ------------- | ------------- | ------------- |
| 200 | + **createWorkspaceRequest** | **CreateWorkspaceRequest**| | |
| 201 | + |
| 202 | + |
| 203 | +### Return type |
| 204 | + |
| 205 | +**CreateWorkspaceResponse** |
| 206 | + |
| 207 | +### Authorization |
| 208 | + |
| 209 | +[apiKey](../README.md#apiKey), [oauth2](../README.md#oauth2) |
| 210 | + |
| 211 | +### HTTP request headers |
| 212 | + |
| 213 | + - **Content-Type**: application/json |
| 214 | + - **Accept**: application/json |
| 215 | + |
| 216 | + |
| 217 | +### HTTP response details |
| 218 | +| Status code | Description | Response headers | |
| 219 | +|-------------|-------------|------------------| |
| 220 | +**201** | OK | - | |
| 221 | +**401** | Authentication error | - | |
| 222 | +**403** | Permission error | - | |
| 223 | +**404** | Not found | - | |
| 224 | +**429** | Too Many Requests | - | |
| 225 | + |
| 226 | +[[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) |
| 227 | + |
0 commit comments