@favish/staffbase-utils 0.15.0 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (124) hide show
  1. package/README.md +1 -0
  2. package/dist/device.cjs.js +1 -1
  3. package/dist/device.cjs.js.map +1 -1
  4. package/dist/device.es.mjs +2 -2
  5. package/dist/device.es.mjs.map +1 -1
  6. package/dist/host.cjs.js +2 -0
  7. package/dist/host.cjs.js.map +1 -0
  8. package/dist/host.es.mjs +10 -0
  9. package/dist/host.es.mjs.map +1 -0
  10. package/dist/src/device/index.d.ts +2 -0
  11. package/dist/src/device/index.d.ts.map +1 -1
  12. package/dist/src/device/isMobilePlatform.d.ts +7 -0
  13. package/dist/src/device/isMobilePlatform.d.ts.map +1 -0
  14. package/dist/src/device/isNativeApp.d.ts +7 -0
  15. package/dist/src/device/isNativeApp.d.ts.map +1 -0
  16. package/dist/src/host/getStaffbaseCsrfToken.d.ts +11 -0
  17. package/dist/src/host/getStaffbaseCsrfToken.d.ts.map +1 -0
  18. package/dist/src/host/index.d.ts +2 -0
  19. package/dist/src/host/index.d.ts.map +1 -0
  20. package/dist/src/types/device/WindowWithStaffbaseRuntime.d.ts +12 -0
  21. package/dist/src/types/device/WindowWithStaffbaseRuntime.d.ts.map +1 -0
  22. package/dist/src/types/groups/CreateGroupBody.d.ts +12 -0
  23. package/dist/src/types/groups/CreateGroupBody.d.ts.map +1 -0
  24. package/dist/src/types/groups/Group.d.ts +47 -0
  25. package/dist/src/types/groups/Group.d.ts.map +1 -0
  26. package/dist/src/types/groups/GroupAccessors.d.ts +13 -0
  27. package/dist/src/types/groups/GroupAccessors.d.ts.map +1 -0
  28. package/dist/src/types/groups/GroupAdminsWithGroups.d.ts +18 -0
  29. package/dist/src/types/groups/GroupAdminsWithGroups.d.ts.map +1 -0
  30. package/dist/src/types/groups/GroupBranch.d.ts +23 -0
  31. package/dist/src/types/groups/GroupBranch.d.ts.map +1 -0
  32. package/dist/src/types/groups/GroupConfig.d.ts +16 -0
  33. package/dist/src/types/groups/GroupConfig.d.ts.map +1 -0
  34. package/dist/src/types/groups/GroupConfigLocalization.d.ts +13 -0
  35. package/dist/src/types/groups/GroupConfigLocalization.d.ts.map +1 -0
  36. package/dist/src/types/groups/GroupUser.d.ts +51 -0
  37. package/dist/src/types/groups/GroupUser.d.ts.map +1 -0
  38. package/dist/src/types/groups/GroupUsers.d.ts +21 -0
  39. package/dist/src/types/groups/GroupUsers.d.ts.map +1 -0
  40. package/dist/src/types/groups/UpdateGroupBody.d.ts +12 -0
  41. package/dist/src/types/groups/UpdateGroupBody.d.ts.map +1 -0
  42. package/dist/src/types/groups/generated/groupsApi.d.ts +739 -0
  43. package/dist/src/types/groups/generated/groupsApi.d.ts.map +1 -0
  44. package/dist/src/types/groups/index.d.ts +11 -0
  45. package/dist/src/types/groups/index.d.ts.map +1 -0
  46. package/dist/src/types/host/WindowWithStaffbaseAuth.d.ts +13 -0
  47. package/dist/src/types/host/WindowWithStaffbaseAuth.d.ts.map +1 -0
  48. package/dist/src/types/news/CreatePostBody.d.ts +11 -0
  49. package/dist/src/types/news/CreatePostBody.d.ts.map +1 -0
  50. package/dist/src/types/news/Post.d.ts +73 -0
  51. package/dist/src/types/news/Post.d.ts.map +1 -0
  52. package/dist/src/types/news/PostAcknowledgements.d.ts +14 -0
  53. package/dist/src/types/news/PostAcknowledgements.d.ts.map +1 -0
  54. package/dist/src/types/news/PostAuthor.d.ts +16 -0
  55. package/dist/src/types/news/PostAuthor.d.ts.map +1 -0
  56. package/dist/src/types/news/PostAuthorAvatar.d.ts +17 -0
  57. package/dist/src/types/news/PostAuthorAvatar.d.ts.map +1 -0
  58. package/dist/src/types/news/PostComments.d.ts +11 -0
  59. package/dist/src/types/news/PostComments.d.ts.map +1 -0
  60. package/dist/src/types/news/PostLayout.d.ts +12 -0
  61. package/dist/src/types/news/PostLayout.d.ts.map +1 -0
  62. package/dist/src/types/news/PostLikes.d.ts +12 -0
  63. package/dist/src/types/news/PostLikes.d.ts.map +1 -0
  64. package/dist/src/types/news/PostSource.d.ts +11 -0
  65. package/dist/src/types/news/PostSource.d.ts.map +1 -0
  66. package/dist/src/types/news/UpdatePostBody.d.ts +10 -0
  67. package/dist/src/types/news/UpdatePostBody.d.ts.map +1 -0
  68. package/dist/src/types/news/generated/newsApi.d.ts +1433 -0
  69. package/dist/src/types/news/generated/newsApi.d.ts.map +1 -0
  70. package/dist/src/types/news/index.d.ts +11 -0
  71. package/dist/src/types/news/index.d.ts.map +1 -0
  72. package/dist/src/types/pages/CreatePagePayload.d.ts +12 -0
  73. package/dist/src/types/pages/CreatePagePayload.d.ts.map +1 -0
  74. package/dist/src/types/pages/Page.d.ts +51 -0
  75. package/dist/src/types/pages/Page.d.ts.map +1 -0
  76. package/dist/src/types/pages/PageAccess.d.ts +20 -0
  77. package/dist/src/types/pages/PageAccess.d.ts.map +1 -0
  78. package/dist/src/types/pages/PageContent.d.ts +18 -0
  79. package/dist/src/types/pages/PageContent.d.ts.map +1 -0
  80. package/dist/src/types/pages/UpdatePagePayload.d.ts +11 -0
  81. package/dist/src/types/pages/UpdatePagePayload.d.ts.map +1 -0
  82. package/dist/src/types/pages/generated/pagesApi.d.ts +418 -0
  83. package/dist/src/types/pages/generated/pagesApi.d.ts.map +1 -0
  84. package/dist/src/types/pages/index.d.ts +6 -0
  85. package/dist/src/types/pages/index.d.ts.map +1 -0
  86. package/dist/src/types/user/CreateUserBody.d.ts +11 -0
  87. package/dist/src/types/user/CreateUserBody.d.ts.map +1 -0
  88. package/dist/src/types/user/UpdateUserBody.d.ts +11 -0
  89. package/dist/src/types/user/UpdateUserBody.d.ts.map +1 -0
  90. package/dist/src/types/user/User.d.ts +65 -0
  91. package/dist/src/types/user/User.d.ts.map +1 -0
  92. package/dist/src/types/user/UserAvatar.d.ts +19 -0
  93. package/dist/src/types/user/UserAvatar.d.ts.map +1 -0
  94. package/dist/src/types/user/UserAvatarVariant.d.ts +23 -0
  95. package/dist/src/types/user/UserAvatarVariant.d.ts.map +1 -0
  96. package/dist/src/types/user/UserConfig.d.ts +11 -0
  97. package/dist/src/types/user/UserConfig.d.ts.map +1 -0
  98. package/dist/src/types/user/UserCreation.d.ts +16 -0
  99. package/dist/src/types/user/UserCreation.d.ts.map +1 -0
  100. package/dist/src/types/user/UserEmail.d.ts +15 -0
  101. package/dist/src/types/user/UserEmail.d.ts.map +1 -0
  102. package/dist/src/types/user/UserName.d.ts +13 -0
  103. package/dist/src/types/user/UserName.d.ts.map +1 -0
  104. package/dist/src/types/user/UserProfile.d.ts +28 -0
  105. package/dist/src/types/user/UserProfile.d.ts.map +1 -0
  106. package/dist/src/types/user/UserRecoveryCode.d.ts +17 -0
  107. package/dist/src/types/user/UserRecoveryCode.d.ts.map +1 -0
  108. package/dist/src/types/user/UserRole.d.ts +12 -0
  109. package/dist/src/types/user/UserRole.d.ts.map +1 -0
  110. package/dist/src/types/user/UserSecret.d.ts +20 -0
  111. package/dist/src/types/user/UserSecret.d.ts.map +1 -0
  112. package/dist/src/types/user/generated/userApi.d.ts +1525 -0
  113. package/dist/src/types/user/generated/userApi.d.ts.map +1 -0
  114. package/dist/src/types/user/index.d.ts +14 -0
  115. package/dist/src/types/user/index.d.ts.map +1 -0
  116. package/dist/types/groups.cjs.js +1 -0
  117. package/dist/types/groups.es.mjs +0 -0
  118. package/dist/types/news.cjs.js +1 -0
  119. package/dist/types/news.es.mjs +0 -0
  120. package/dist/types/pages.cjs.js +1 -0
  121. package/dist/types/pages.es.mjs +0 -0
  122. package/dist/types/user.cjs.js +1 -0
  123. package/dist/types/user.es.mjs +0 -0
  124. package/package.json +31 -1
@@ -0,0 +1,1525 @@
1
+ /**
2
+ * This file was auto-generated by openapi-typescript.
3
+ * Do not make direct changes to the file.
4
+ */
5
+ export interface paths {
6
+ "/users": {
7
+ parameters: {
8
+ query?: never;
9
+ header?: never;
10
+ path?: never;
11
+ cookie?: never;
12
+ };
13
+ /**
14
+ * List users
15
+ * @description This endpoint returns all users on the platform with their available data.
16
+ *
17
+ * <div class="sb-box sb-box--note">
18
+ * For more advanced searches, use the <a href='https://developers.staffbase.com/api/api-user/#tag/Users/operation/searchUsersOfBranch' target='_blank' rel='noopener noreferrer'>search user endpoint</a>.
19
+ * </div>
20
+ */
21
+ get: operations["GetUsers"];
22
+ put?: never;
23
+ /**
24
+ * Invite new users
25
+ * @description This endpoint invites a new user to the platform.
26
+ */
27
+ post: operations["InviteUser"];
28
+ delete?: never;
29
+ options?: never;
30
+ head?: never;
31
+ patch?: never;
32
+ trace?: never;
33
+ };
34
+ "/users/search": {
35
+ parameters: {
36
+ query?: never;
37
+ header?: never;
38
+ path?: never;
39
+ cookie?: never;
40
+ };
41
+ /**
42
+ * Search users
43
+ * @description This endpoint searches users on the platform based on the parameters given.
44
+ */
45
+ get: operations["searchUsersOfBranch"];
46
+ put?: never;
47
+ post?: never;
48
+ delete?: never;
49
+ options?: never;
50
+ head?: never;
51
+ patch?: never;
52
+ trace?: never;
53
+ };
54
+ "/users/{userId}": {
55
+ parameters: {
56
+ query?: never;
57
+ header?: never;
58
+ path?: never;
59
+ cookie?: never;
60
+ };
61
+ /**
62
+ * Return a user
63
+ * @description This endpoint returns a single user based on the user's identifier.
64
+ */
65
+ get: operations["GetSpecificUser"];
66
+ /**
67
+ * Update a user
68
+ * @description This endpoint updates a user by an incremental update.
69
+ * <div class="sb-box sb-box--alert">
70
+ * This is a legacy endpoint and is planned to be <a href='https://developers.staffbase.com/concepts/api-versioning/' target='_blank' rel='noopener noreferrer'>deprecated</a> in the future. Use the <a href='https://developers.staffbase.com/api/api-user#tag/User/operation/updateUser' target='_blank' rel='noopener noreferrer'>PATCH method</a> instead.
71
+ * </div>
72
+ *
73
+ * See also further details on example use cases: <a href='https://developers.staffbase.com/use-cases/update-profilefields-via-userapi/' target='_blank' rel='noopener noreferrer'>Update user standard fields</a>,
74
+ * <a href='https://developers.staffbase.com/use-cases/update-avatar-via-userapi/' target='_blank' rel='noopener noreferrer'>Update user avatar</a> and
75
+ * <a href='https://developers.staffbase.com/use-cases/offboarding-users/#deactivate-user-accounts' target='_blank' rel='noopener noreferrer'>Deactivate a user</a>.
76
+ */
77
+ put: operations["UpdateUser"];
78
+ post?: never;
79
+ /**
80
+ * Delete a user
81
+ * @description This endpoint deletes a user from the platform. Deleted user accounts cannot be restored by administrators or Staffbase. To regain access, a new user account must be created. Constraint: The last remaining administrator on the platform cannot be deleted.
82
+ */
83
+ delete: operations["DeleteUser"];
84
+ options?: never;
85
+ head?: never;
86
+ /**
87
+ * Update a user
88
+ * @description This endpoint partially updates user properties. Provide only the properties you want to update. This method replaces the <a href='https://developers.staffbase.com/api/api-user#tag/User/operation/UpdateUser' target='_blank' rel='noopener noreferrer'>PUT method</a>.
89
+ * </div>
90
+ */
91
+ patch: operations["updateUser"];
92
+ trace?: never;
93
+ };
94
+ "/users/{userId}/groups": {
95
+ parameters: {
96
+ query?: never;
97
+ header?: never;
98
+ path?: never;
99
+ cookie?: never;
100
+ };
101
+ /**
102
+ * List groups of a user
103
+ * @description This endpoint returns a list of groups the requested user is a member of.
104
+ */
105
+ get: operations["GetGroupsOfUser"];
106
+ put?: never;
107
+ post?: never;
108
+ delete?: never;
109
+ options?: never;
110
+ head?: never;
111
+ patch?: never;
112
+ trace?: never;
113
+ };
114
+ "/users/{userId}/groups/search": {
115
+ parameters: {
116
+ query?: never;
117
+ header?: never;
118
+ path?: never;
119
+ cookie?: never;
120
+ };
121
+ /**
122
+ * Get a user's groups
123
+ * @description This endpoint returns the groups of a user sorted by their creation date and can search by group name. It can be called by admins and group admins.
124
+ */
125
+ get: operations["GetUserGroups"];
126
+ put?: never;
127
+ post?: never;
128
+ delete?: never;
129
+ options?: never;
130
+ head?: never;
131
+ patch?: never;
132
+ trace?: never;
133
+ };
134
+ "/users/{userId}/groups/visible": {
135
+ parameters: {
136
+ query?: never;
137
+ header?: never;
138
+ path?: never;
139
+ cookie?: never;
140
+ };
141
+ /**
142
+ * List visible groups a user
143
+ * @description This endpoint returns a list of groups the user is a member of. Groups are filtered by <a href="https://support.staffbase.com/hc/en-us/articles/360010803979-Types-of-User-Groups" target="_blank">type</a> and conditional groups are omitted.
144
+ */
145
+ get: operations["GetVisibleGroupsOfUser"];
146
+ put?: never;
147
+ post?: never;
148
+ delete?: never;
149
+ options?: never;
150
+ head?: never;
151
+ patch?: never;
152
+ trace?: never;
153
+ };
154
+ "/users/{userId}/recovery": {
155
+ parameters: {
156
+ query?: never;
157
+ header?: never;
158
+ path?: never;
159
+ cookie?: never;
160
+ };
161
+ get?: never;
162
+ put?: never;
163
+ /**
164
+ * Send recovery email
165
+ * @description This endpoint sends an email to the specified user to recover their account.
166
+ */
167
+ post: operations["UserRecovery"];
168
+ delete?: never;
169
+ options?: never;
170
+ head?: never;
171
+ patch?: never;
172
+ trace?: never;
173
+ };
174
+ "/users/{userId}/sessions": {
175
+ parameters: {
176
+ query?: never;
177
+ header?: never;
178
+ path?: never;
179
+ cookie?: never;
180
+ };
181
+ get?: never;
182
+ put?: never;
183
+ post?: never;
184
+ /**
185
+ * Log a user out
186
+ * @description This endpoint invalidates all active sessions that belong to the given user.
187
+ */
188
+ delete: operations["DeleteUserSessions"];
189
+ options?: never;
190
+ head?: never;
191
+ patch?: never;
192
+ trace?: never;
193
+ };
194
+ "/users/sync": {
195
+ parameters: {
196
+ query?: never;
197
+ header?: never;
198
+ path?: never;
199
+ cookie?: never;
200
+ };
201
+ /**
202
+ * List users by timestamp
203
+ * @description This endpoint returns users in order of their updated timestamp along with a cursor to continue after the latest returned users.
204
+ */
205
+ get: operations["Sync"];
206
+ put?: never;
207
+ post?: never;
208
+ delete?: never;
209
+ options?: never;
210
+ head?: never;
211
+ patch?: never;
212
+ trace?: never;
213
+ };
214
+ }
215
+ export type webhooks = Record<string, never>;
216
+ export interface components {
217
+ schemas: {
218
+ /**
219
+ * Schema to create a user
220
+ * @description Schema to create a user
221
+ */
222
+ CreateUser: {
223
+ /** @description The department of the user. Value will be also set to `profile.department`. */
224
+ department?: string;
225
+ /** @description The primary email of the user. When a new user has signed up and set the primary email themselves, that email can not be changed via API afterwards. Has to be unique per application. */
226
+ "emails/primary"?: string;
227
+ /** @description This id can be set as an external id to identify the user in your organisation. Therefore, this property needs to be unique, too. It is recommended to **not modify this id** once set - to avoid duplication of users. See also our Support article <a href="https://support.staffbase.com/hc/en-us/articles/360020766759-Identifiers-for-Your Users-in-the-Staffbase-Platform" target="_blank"> Identifiers for Your Users in the Staffbase Platform</a>. The externalID is only visible to the admin. */
228
+ externalID?: string;
229
+ /** @description The first name of the user. */
230
+ firstName?: string;
231
+ /** @description Optional message to be included in the invitation mail, when inviting a new user to the App. */
232
+ inviteMessage?: string;
233
+ /** @description The last name of the user. */
234
+ lastName?: string;
235
+ /** @description The location of the user. Value will be also set to `profile.location`. */
236
+ location?: string;
237
+ /** @description A set of groups where this user may not unsubscribe from. Needs user management rights to execute. See the <a href="https://support.staffbase.com/hc/en-us/sections/360003247419-Mandatory-Group-Management" target="_blank"> mandatory group management section</a> on our support portal. */
238
+ mandatoryGroupIDs?: string[];
239
+ /** @description The public email address of the user. Value will be also set to `profile.publicEmailAddress`. This email address will not be used to send information to the user. It is only shown in the user profile. */
240
+ publicEmailAddress?: string;
241
+ /** @description The phone number of the user. Value will be also set to `profile.phoneNumber`. */
242
+ phoneNumber?: string;
243
+ /** @description The position of the user. Value will be also set to `profile.position`. */
244
+ position?: string;
245
+ profile?: components["schemas"]["UserProfile"];
246
+ /** @description The recovery code of a user to reset the password. See the <a href="https://support.staffbase.com/hc/en-us/sections/360002122511-Account-Recovery" target="_blank">account recovery section</a> on our support portal. The recovery code does not follow the password policy defined for the App. Use `recoveryCodeExpires` to set an expiration date. */
247
+ recoveryCode?: string;
248
+ /** @description Expiration date of the recovery code. */
249
+ recoveryCodeExpires?: number;
250
+ /** @description The role of the user. See also <a href="/basic-concepts/role-type/#role-type" target="_blank"> User Role Type</a>. */
251
+ role?: {
252
+ type?: string;
253
+ };
254
+ /** @description The secret of the user. This parameter cannot be changed anymore when the user status has changed from pending to activated. If no secret property is provided, we will auto-generate a secret based on the password policy of your App. In case you create users without an identifier like email or userName, the <b>secret</b> for those users will be handled as an access code which has to be <b>unique</b>. See also our articles <a href="https://support.staffbase.com/hc/en-us/articles/360002609791-Onboarding-with-an-Access-Code" target="_blank">Onboarding with an Access Code</a> and <a href="https://support.staffbase.com/hc/en-us/articles/360010062120-Adding-Users-Manually-via-Access-Code" target="_blank">Adding Users Manually via Access Code</a>. */
255
+ secret?: string;
256
+ /**
257
+ * @description This property determines if an email invitation is sent out from the Staffbase platform to the primary email address of a pending user. Only set this property to `true` when the invitation email is intended. If the user is equipped with an email you can send an email invitation to the new user by setting the *sendMail* parameter to `true`. The user receives an email to sign up for the app. <div class="sb-box sb-box--tip"> When the <span class="mdx-code">sendMail</span> parameter is not included or specified in the request, by default it is set with the value <span class="mdx-code">true</span>. If you do not want the email invitation to be sent out, set the <span class="mdx-code">sendMail</span> parameter with the value <span class="mdx-code">false</span>. </div> See the <a href="/basic-concepts/user-model" target="_blank">user model</a> for more information on all available properties.
258
+ * @example false
259
+ */
260
+ sendMail?: boolean;
261
+ /** @description A set of tags for this user for easier access. When a user gets imported via CSV, for example, we can tag the user with some attributes. This is useful, for example, for managing <a href="https://support.staffbase.com/hc/en-us/articles/360010633120-Setting-Up-Tags-for-Conditional-Groups" target="_blank"> conditional groups</a>. Tags created from profile fields configured for Group Tagging cannot be altered directly via this attribute. The profile field value must be updated which will then also update the tag. */
262
+ tags?: string[];
263
+ /** @description The unique username a user logs in with. */
264
+ userName?: string;
265
+ };
266
+ UserAvatar: {
267
+ original?: {
268
+ /** @example https://{{sb-host}}.com/{{sb-system}}/image/upload/v1631172776/{{shortened}}/603b64e00c3fdb29134eb89b.png */
269
+ url?: string;
270
+ /** @example 225 */
271
+ width?: number;
272
+ /** @example 225 */
273
+ height?: number;
274
+ /** @example 4650 */
275
+ size?: number;
276
+ /** @example png */
277
+ format?: string;
278
+ /** @example image/png */
279
+ mimeType?: string;
280
+ /** @example 2021-09-09T07:32:56.000Z */
281
+ created?: string;
282
+ };
283
+ icon?: {
284
+ /** @example https://{{sb-host}}.com/{{sb-system}}/image/upload/v1631172776/{{shortened}}/603b64e00c3fdb29134eb89b.png */
285
+ url?: string;
286
+ /** @example null */
287
+ format?: string;
288
+ /** @example null */
289
+ mimeType?: string;
290
+ };
291
+ thumb?: {
292
+ /** @example https://{{sb-host}}.com/{{sb-system}}/image/upload/v1631172776/{{shortened}}/603b64e00c3fdb29134eb89b.png */
293
+ url?: string;
294
+ /** @example null */
295
+ format?: string;
296
+ /** @example null */
297
+ mimeType?: string;
298
+ };
299
+ };
300
+ /**
301
+ * A single user
302
+ * @description A single user
303
+ */
304
+ SingleUserWithAvatar: {
305
+ /** @example 2021-07-28T06:49:15.462Z */
306
+ activated?: string;
307
+ avatar?: components["schemas"]["UserAvatar"];
308
+ config?: {
309
+ /** @example en_US */
310
+ locale?: string;
311
+ };
312
+ /** @example 2021-07-22T09:14:39.146Z */
313
+ created?: string;
314
+ /** @example Development & Research */
315
+ department?: string;
316
+ /**
317
+ * @example [
318
+ * {
319
+ * "value": "john@doe.com",
320
+ * "primary": true,
321
+ * "providerID": "staffbase"
322
+ * }
323
+ * ]
324
+ */
325
+ emails?: Record<string, never>[];
326
+ /** @example jd123 */
327
+ externalID?: string;
328
+ /** @example John */
329
+ firstName?: string;
330
+ /**
331
+ * @example [
332
+ * "c69e7b20e6504345aa4b4938",
333
+ * "9e7b20e6504dfa90a4345aa3"
334
+ * ]
335
+ */
336
+ groupIDs?: unknown;
337
+ /** @example 20e6504df8a90a4345aa4b49 */
338
+ id?: string;
339
+ /** @example Doe */
340
+ lastName?: string;
341
+ /** @example Chemnitz */
342
+ location?: string;
343
+ /**
344
+ * @example [
345
+ * "c69e7b20e6504345aa4b4938"
346
+ * ]
347
+ */
348
+ mandatoryGroupIDs?: unknown;
349
+ /** @example +491234567890 */
350
+ phoneNumber?: string;
351
+ /** @example Developer */
352
+ position?: string;
353
+ profile?: {
354
+ avatar?: components["schemas"]["UserAvatar"];
355
+ /** @example Development & Research */
356
+ department?: string;
357
+ /** @example John */
358
+ firstName?: string;
359
+ /** @example Doe */
360
+ lastName?: string;
361
+ /** @example Chemnitz */
362
+ location?: string;
363
+ /** @example +491234567890 */
364
+ phoneNumber?: string;
365
+ /** @example Developer */
366
+ position?: string;
367
+ /** @example hi@example.com */
368
+ publicEmailAddress?: string;
369
+ };
370
+ /** @example hi@example.com */
371
+ publicEmailAddress?: string;
372
+ role?: {
373
+ /** @example admin */
374
+ type?: string;
375
+ };
376
+ /**
377
+ * @description This status of the user on the platform The status `contact` is only applicable if you have Staffbase Email.
378
+ * @example activated
379
+ * @enum {string}
380
+ */
381
+ status?: "pending" | "activated" | "deactivated" | "contact";
382
+ /** @example 2021-08-16T15:15:45.668 */
383
+ updated?: string;
384
+ };
385
+ /** @description Returns a list of groups. */
386
+ ReturnGroups: {
387
+ /** @example 1 */
388
+ total?: number;
389
+ /** @example 100 */
390
+ limit?: number;
391
+ /** @example 0 */
392
+ offset?: number;
393
+ data?: {
394
+ /** @example 5fad53cd85ebee1b0fde6f5d */
395
+ id?: unknown;
396
+ /** @example f8c6de49-2c08-40e4-8df8-a5aac98de43c */
397
+ externalID?: unknown;
398
+ /** @example My awesome group */
399
+ name?: unknown;
400
+ /** @example enumeration */
401
+ type?: unknown;
402
+ /** @example 20e6504df8a90a4345aa4b49 */
403
+ ownerID?: unknown;
404
+ users?: components["schemas"]["ReturnUsers"];
405
+ };
406
+ };
407
+ /** @description Returns a list of users matching the query and/or filter parameters. Each user in the response matches our user model. */
408
+ ReturnUsers: {
409
+ /** @example 1 */
410
+ total?: number;
411
+ /** @example 100 */
412
+ limit?: number;
413
+ /** @example 0 */
414
+ offset?: number;
415
+ data?: components["schemas"]["SingleUserWithAvatar"][];
416
+ };
417
+ UpdateUser: {
418
+ /** @description The department of the user. Value will be also set to `profile.department`. */
419
+ department?: string;
420
+ /** @description The primary email of the user. When a new user has signed up and set the primary email themselves, that email can not be changed via API afterwards. Has to be unique per branch. */
421
+ "emails/primary"?: string;
422
+ /** @description This id can be set as an external id to identify the user in your organisation. Therefore, this property needs to be unique, too. It is recommended to **not modify this id** once set - to avoid duplication of users. See also our Support article <a href="https://support.staffbase.com/hc/en-us/articles/360020766759-Identifiers-for-Your-Users-in-the-Staffbase-Platform" target="_blank"> Identifiers for Your Users in the Staffbase Platform</a>. The externalID is only visible to the admin. */
423
+ externalID?: string;
424
+ /** @description The first name of the user. */
425
+ firstName?: string;
426
+ /** @description Optional message to be included in the invitation mail, when inviting a new user to the App. */
427
+ inviteMessage?: string;
428
+ /** @description The last name of the user. */
429
+ lastName?: string;
430
+ /** @description The location of the user. Value will be also set to `profile.location`. */
431
+ location?: string;
432
+ /** @description A set of groups where this user may not unsubscribe from. Needs user management rights to execute. See the <a href="https://support.staffbase.com/hc/en-us/sections/360003247419-Mandatory-Group-Management" target="_blank"> mandatory group management section</a> on our support portal. */
433
+ mandatoryGroupIDs?: string[];
434
+ /** @description The public email address of the user. Value will be also set to `profile.publicEmailAddress`. This email address will not be used to send information to the user. It is only shown in the user profile. */
435
+ publicEmailAddress?: string;
436
+ /** @description The phone number of the user. Value will be also set to `profile.phoneNumber`. */
437
+ phoneNumber?: string;
438
+ /** @description The position of the user. Value will be also set to `profile.position`. */
439
+ position?: string;
440
+ profile?: components["schemas"]["UserProfile"];
441
+ /** @description The recovery code of a user to reset the password. See the <a href="https://support.staffbase.com/hc/en-us/sections/360002122511-Account-Recovery" target="_blank">account recovery section</a> on our support portal. The recovery code does not follow the password policy defined for the App. Use `recoveryCodeExpires` to set an expiration date. */
442
+ recoveryCode?: string;
443
+ /** @description Expiration date of the recovery code. */
444
+ recoveryCodeExpires?: number;
445
+ /** @description The role of the user. See also <a href="/basic-concepts/role-type/#role-type" target="_blank"> User Role Type</a>. */
446
+ role?: {
447
+ [key: string]: {
448
+ /** @description The role type defines the role a user could have in your organisation. */
449
+ type?: string;
450
+ };
451
+ };
452
+ /**
453
+ * @description This status of the user on the platform. The status `contact` is only applicable if you have Staffbase Email.
454
+ * @example activated
455
+ * @enum {string}
456
+ */
457
+ status?: "pending" | "activated" | "deactivated" | "deleted" | "contact";
458
+ /** @description This property determines if an email invitation is sent out from the Staffbase platform to the primary email address of a pending user. Only set this property to `true` when the invitation email is intended. */
459
+ sendMail?: boolean;
460
+ /** @description A set of tags for this user for easier access. When a user gets imported via CSV, for example, we can tag the user with some attributes. This is useful, for example, for managing <a href="https://support.staffbase.com/hc/en-us/articles/360010633120-Setting-Up-Tags-for-Conditional-Groups" target="_blank"> conditional groups</a>. Tags created from profile fields configured for Group Tagging cannot be altered directly via this attribute. The profile field value must be updated which will then also update the tag. */
461
+ tags?: string[];
462
+ /**
463
+ * @description The user name of the user. Has to be unique per branch.
464
+ * @example MyNewUsername1
465
+ */
466
+ userName?: string;
467
+ };
468
+ /** @description Fills a profile field for a user. See the <a href="https://developers.staffbase.com/basic-concepts/user-model/" target="_blank">user model</a>. */
469
+ UserProfile: {
470
+ /** @description The first name of the user. */
471
+ firstName?: string;
472
+ /** @description The last name of the user. */
473
+ lastName?: string;
474
+ /** @description The department of the user. */
475
+ department?: string;
476
+ /** @description The location of the user. */
477
+ location?: string;
478
+ /** @description The position or job title of the user. */
479
+ position?: string;
480
+ /** @description The phone number of the user. */
481
+ phoneNumber?: string;
482
+ /** @description The public email address of the user. Only shown in the user profile, not used for login or notifications. */
483
+ publicEmailAddress?: string;
484
+ avatar?: components["schemas"]["UserAvatar"];
485
+ } & {
486
+ [key: string]: unknown;
487
+ };
488
+ /** @description <a href="https://support.staffbase.com/hc/en-us/articles/25487559570834" target="_blank">System and custom profile fields</a> for a user. System fields are listed as named properties, and custom profile fields are supported as additional properties. */
489
+ UserDataProfile: {
490
+ /** @description The first name of the user. */
491
+ firstName?: string;
492
+ /** @description The last name of the user. */
493
+ lastName?: string;
494
+ /** @description The department of the user. */
495
+ department?: string;
496
+ /** @description The location of the user. */
497
+ location?: string;
498
+ /** @description The position or job title of the user. */
499
+ position?: string;
500
+ /** @description The phone number of the user. */
501
+ phoneNumber?: string;
502
+ /** @description The public email address of the user. Only shown in the user profile, not used for login or notifications. */
503
+ publicEmailAddress?: string;
504
+ avatar?: components["schemas"]["UserAvatar"];
505
+ } & {
506
+ [key: string]: unknown;
507
+ };
508
+ /**
509
+ * @description The status of the user on the platform. The status `contact` is only applicable if you have Staffbase Email.
510
+ * @enum {string}
511
+ */
512
+ UserStatus: "pending" | "activated" | "deactivated" | "deleted" | "contact";
513
+ /**
514
+ * Schema to create a user
515
+ * @description Schema to create a user
516
+ */
517
+ CreateUserInMarketingResponse: {
518
+ /** @example 5fb67f23dd7c407fbdd11517 */
519
+ branchID?: unknown;
520
+ /** @example WeBranchAdminRole */
521
+ branchRole?: unknown;
522
+ config?: {
523
+ /** @example en_US */
524
+ locale?: unknown;
525
+ notificationSettings?: {
526
+ chat?: {
527
+ /** @example true */
528
+ push?: string;
529
+ };
530
+ comments?: {
531
+ /** @example true */
532
+ push?: string;
533
+ };
534
+ mentions?: {
535
+ /** @example true */
536
+ push?: string;
537
+ };
538
+ posts?: {
539
+ /** @example true */
540
+ push?: string;
541
+ };
542
+ };
543
+ };
544
+ /** @example 2023-03-20T09:06:53.753Z */
545
+ created?: unknown;
546
+ /** @example Marketing */
547
+ department?: unknown;
548
+ /**
549
+ * @example [
550
+ * {
551
+ * "value": "marketing@example.com",
552
+ * "primary": true,
553
+ * "providerID": "staffbase"
554
+ * }
555
+ * ]
556
+ */
557
+ emails?: unknown;
558
+ /** @example user */
559
+ entityType?: unknown;
560
+ /** @example 209tz9hgbrevkmfkq03j */
561
+ externalID?: unknown;
562
+ /** @example Mike */
563
+ firstName?: unknown;
564
+ /** @example [] */
565
+ groupIDs?: unknown;
566
+ /** @example 6418222d81275f1a9f539a56 */
567
+ id?: unknown;
568
+ /** @example Welcome to our App! */
569
+ inviteMessage?: unknown;
570
+ /** @example Smith */
571
+ lastName?: unknown;
572
+ /** @example London */
573
+ location?: unknown;
574
+ /**
575
+ * @example [
576
+ * "5f69df13f537d14b8374a733",
577
+ * "60955d000c6cf823e3f6d75a"
578
+ * ]
579
+ */
580
+ mandatoryGroupIDs?: unknown;
581
+ /** @example +44 20 7946 0438 */
582
+ phoneNumber?: unknown;
583
+ /** @example Manager */
584
+ position?: unknown;
585
+ /** @example public@example.org */
586
+ publicEmailAddress?: unknown;
587
+ profile?: {
588
+ /** @example Mike */
589
+ firstName?: unknown;
590
+ /** @example Smith */
591
+ lastName?: unknown;
592
+ /** @example +44 20 7946 0438 */
593
+ phoneNumber?: unknown;
594
+ /** @example marketing@example.com */
595
+ publicEmailAddress?: unknown;
596
+ /** @example London */
597
+ location?: unknown;
598
+ /** @example Manager */
599
+ position?: unknown;
600
+ avatar?: components["schemas"]["UserAvatar"];
601
+ /** @example Marketing */
602
+ department?: unknown;
603
+ /** @example 1337 */
604
+ costcenter?: unknown;
605
+ };
606
+ recoveryCode?: {
607
+ /** @example 1620638653 */
608
+ expires?: unknown;
609
+ /** @example NewRecoveryCode1234 */
610
+ plain?: unknown;
611
+ };
612
+ role?: {
613
+ /** @example admin */
614
+ type?: unknown;
615
+ };
616
+ secret?: {
617
+ /** @example -1 */
618
+ expires?: unknown;
619
+ /** @example MyNewPassword1337! */
620
+ plain?: unknown;
621
+ };
622
+ /** @description User creation method */
623
+ creation?: {
624
+ /**
625
+ * @description Creation method
626
+ * @enum {string}
627
+ */
628
+ type?: "csv" | "direct" | "sso";
629
+ };
630
+ /**
631
+ * @description The status of the user on the platform. The status `contact` is only applicable if you have Staffbase Email.
632
+ * @example pending
633
+ * @enum {unknown}
634
+ */
635
+ status?: "pending" | "activated" | "deactivated" | "contact";
636
+ /**
637
+ * @example [
638
+ * "csv_import:newyork",
639
+ * "location:NYC"
640
+ * ]
641
+ */
642
+ tags?: unknown;
643
+ /** @example 2023-03-20T09:06:54.020Z */
644
+ updated?: unknown;
645
+ userName?: {
646
+ /** @example mynewusername1 */
647
+ value?: unknown;
648
+ /** @example staffbase */
649
+ providerID?: unknown;
650
+ };
651
+ };
652
+ UsersSearch: {
653
+ /** @description total number of members */
654
+ total?: number;
655
+ /** @description cursor to get the next data */
656
+ nextCursor?: string;
657
+ /** @description cursor to get the previous data */
658
+ prevCursor?: string;
659
+ /** @description list of members */
660
+ entries?: {
661
+ /** @description list of users */
662
+ data?: components["schemas"]["User"][];
663
+ };
664
+ };
665
+ /** @description Returns a list of manageable users. */
666
+ Users: {
667
+ /** @description cursor to get the next data */
668
+ nextCursor?: string;
669
+ /** @description cursor to get the previous data */
670
+ prevCursor?: string;
671
+ /** @description list of users */
672
+ entries?: components["schemas"]["User"][];
673
+ };
674
+ User: {
675
+ /** @description unique identifier of a user */
676
+ id: string;
677
+ config?: components["schemas"]["UserConfig"];
678
+ /**
679
+ * Format: date-time
680
+ * @description timestamp when the user was created
681
+ */
682
+ createdAt: string;
683
+ /**
684
+ * Format: date-time
685
+ * @description timestamp when the user was activated
686
+ */
687
+ activatedAt?: string;
688
+ /** @description external identifier for a user */
689
+ externalId?: string;
690
+ /** @description role for permission checks */
691
+ role?: string;
692
+ email?: components["schemas"]["Email"];
693
+ status: components["schemas"]["UserStatus"];
694
+ /** @description access code assigned to the user before activation */
695
+ secret?: string;
696
+ profile?: components["schemas"]["UserDataProfile"];
697
+ userName?: components["schemas"]["UserName"];
698
+ };
699
+ UserInvite: {
700
+ /** @description unique username of the user */
701
+ userName?: string;
702
+ /** @description primary mail for different functionalities like login */
703
+ email?: string;
704
+ /** @description identifier to match with interfacing systems */
705
+ externalId?: string;
706
+ /** @description permission role on the platform */
707
+ role: string;
708
+ /**
709
+ * @description The status of the user on the platform. Set to `contact` to create a contact account without login access. The option to set `contact` is available only if you have Staffbase Email.
710
+ * @enum {string}
711
+ */
712
+ status?: "pending" | "contact";
713
+ config: {
714
+ /** @description language setting for the specific user */
715
+ locale: string;
716
+ };
717
+ profile?: components["schemas"]["UserDataProfile"];
718
+ };
719
+ UserUpdate: {
720
+ /** @description primary mail for different functionalities like login */
721
+ email?: string;
722
+ /** @description permission role for the whole branch */
723
+ role?: string;
724
+ status?: components["schemas"]["UserStatus"];
725
+ /** @description external identifier for a user */
726
+ externalId?: string;
727
+ profile?: components["schemas"]["UserDataProfile"];
728
+ /** @description name of the user */
729
+ userName?: string;
730
+ recoveryCode?: components["schemas"]["Secret"];
731
+ /** @description value of the password or access code */
732
+ secret?: string;
733
+ /**
734
+ * @description This property determines if an email invitation is sent out from the Staffbase platform to the primary email address of a pending user. Only set this property to `true` when the invitation email is intended. If the user is equipped with an email you can send an email invitation to the new user by setting the *sendMail* parameter to `true`. The user receives an email to sign up for the app. <div class="sb-box sb-box--tip"> When the <span class="mdx-code">sendMail</span> parameter is not included or specified in the request, by default it is set with the value <span class="mdx-code">false</span>. If you want the email invitation to be sent out, set the <span class="mdx-code">sendMail</span> parameter with the value <span class="mdx-code">true</span>. </div> See the <a href="/basic-concepts/user-model" target="_blank">user model</a> for more information on all available properties.
735
+ * @example false
736
+ */
737
+ sendMail?: boolean;
738
+ };
739
+ Secret: {
740
+ /** @description value of the password or access code */
741
+ plain?: string;
742
+ /** @description time when the secret is not valid anymore or 'unlimited' when there is no expiration or 'expired' if the secret is already expired */
743
+ expires?: string;
744
+ };
745
+ UserConfig: {
746
+ /**
747
+ * @description Content language locale for the specific user. The locale has to be one of the <a href="/references/languages-and-locale-codes/" target="_blank">supported language locales</a>. The user can <a href="https://support.staffbase.com/hc/en-us/articles/206524359-Changing-the-Language" target="_blank">update their content language</a> any time in the App or Intranet settings.
748
+ * @example en_US
749
+ */
750
+ locale: string;
751
+ };
752
+ UserName: {
753
+ /** @description unique username of the user */
754
+ value?: string;
755
+ /**
756
+ * @description source of the username
757
+ * @enum {string}
758
+ */
759
+ source: "admin" | "user" | "system";
760
+ };
761
+ Email: {
762
+ /** @description primary mail of the user */
763
+ value?: string;
764
+ /**
765
+ * @description source of the email address
766
+ * @enum {string}
767
+ */
768
+ source: "admin" | "user" | "system";
769
+ };
770
+ /**
771
+ * A single user
772
+ * @description A single user
773
+ */
774
+ SingleUserWithAvatarSync: {
775
+ /** @example 2021-07-28T06:49:15.462Z */
776
+ activated?: string;
777
+ avatar?: components["schemas"]["UserAvatar"];
778
+ config?: {
779
+ /** @example en_US */
780
+ locale?: string;
781
+ };
782
+ /** @example 2021-07-22T09:14:39.146Z */
783
+ created?: string;
784
+ /** @example Development & Research */
785
+ department?: string;
786
+ /**
787
+ * @example [
788
+ * {
789
+ * "value": "john@doe.com",
790
+ * "primary": true,
791
+ * "providerID": "staffbase"
792
+ * }
793
+ * ]
794
+ */
795
+ emails?: Record<string, never>[];
796
+ /** @example jd123 */
797
+ externalID?: string;
798
+ /** @example John */
799
+ firstName?: string;
800
+ /**
801
+ * @example [
802
+ * "c69e7b20e6504345aa4b4938",
803
+ * "9e7b20e6504dfa90a4345aa3"
804
+ * ]
805
+ */
806
+ groupIDs?: unknown;
807
+ /** @example 20e6504df8a90a4345aa4b49 */
808
+ id?: string;
809
+ /** @example Doe */
810
+ lastName?: string;
811
+ /** @example Chemnitz */
812
+ location?: string;
813
+ /**
814
+ * @example [
815
+ * "c69e7b20e6504345aa4b4938"
816
+ * ]
817
+ */
818
+ mandatoryGroupIDs?: unknown;
819
+ /** @example +491234567890 */
820
+ phoneNumber?: string;
821
+ /** @example Developer */
822
+ position?: string;
823
+ profile?: {
824
+ avatar?: components["schemas"]["UserAvatar"];
825
+ /** @example Development & Research */
826
+ department?: string;
827
+ /** @example John */
828
+ firstName?: string;
829
+ /** @example Doe */
830
+ lastName?: string;
831
+ /** @example Chemnitz */
832
+ location?: string;
833
+ /** @example +491234567890 */
834
+ phoneNumber?: string;
835
+ /** @example Developer */
836
+ position?: string;
837
+ /** @example hi@example.com */
838
+ publicEmailAddress?: string;
839
+ };
840
+ /** @example hi@example.com */
841
+ publicEmailAddress?: string;
842
+ role?: {
843
+ /** @example admin */
844
+ type?: string;
845
+ };
846
+ /**
847
+ * @description This status of the user on the platform The status `contact` is only applicable if you have Staffbase Email.
848
+ * @example activated
849
+ * @enum {string}
850
+ */
851
+ status?: "pending" | "activated" | "deactivated" | "deleted" | "contact";
852
+ /** @example 2021-08-16T15:15:45.668 */
853
+ updated?: string;
854
+ };
855
+ /** @description The object that holds different types of accessor ids for a group, including user, group, and platform access. Its presence indicates that the group is open. If it is omitted, the group is internal. It is required only for open groups. */
856
+ GroupAccessorIds: {
857
+ /** @description List of user ids that has access to this group. */
858
+ userIds?: string[];
859
+ /** @description List of group ids that has access to this group. */
860
+ groupIds?: string[];
861
+ /** @description Shows whether all users on the platform have access to this group. */
862
+ branchAccess?: boolean;
863
+ };
864
+ /** @description The object that holds different localization values for a group. Refer to the <a href="https://developers.staffbase.com/references/languages-and-locale-codes" target="_blank" rel="noopener noreferrer">localization documentation</a> for the list of supported locales. */
865
+ Localization: {
866
+ [key: string]: {
867
+ /** @description Name of the group. */
868
+ name: string;
869
+ /** @description Description of the group. */
870
+ description?: string;
871
+ };
872
+ };
873
+ GroupConfig: {
874
+ localization: components["schemas"]["Localization"];
875
+ /** @description Show the group in the My Groups overview page. */
876
+ showInOverview: boolean;
877
+ /** @description URL to the group image. */
878
+ imageUrl?: string;
879
+ /** @description Icon of the group. */
880
+ icon?: string;
881
+ /** @description URL of a custom icon for the group. */
882
+ customIconUrl?: string;
883
+ /** @description URL to the group page. */
884
+ link?: string;
885
+ };
886
+ GroupCreator: {
887
+ /** @description Unique identifier of the creator. */
888
+ id?: string;
889
+ /**
890
+ * @description Type of the creator.
891
+ * @enum {string}
892
+ */
893
+ type: "integration" | "scim" | "token" | "user";
894
+ };
895
+ /** @description Defines conditions for including or excluding users from a group based on tags. */
896
+ Conditions: {
897
+ /** @description List of tags that users must match to be included or excluded. */
898
+ tags?: string[];
899
+ };
900
+ Group: {
901
+ /** @description Unique identifier of a group. */
902
+ id: string;
903
+ accessorIds?: components["schemas"]["GroupAccessorIds"];
904
+ adminIds?: components["schemas"]["GroupAccessorIds"];
905
+ /** @description External systems identifier of the group. */
906
+ externalId?: string;
907
+ config: components["schemas"]["GroupConfig"];
908
+ /**
909
+ * @description Type of the group. Learn more about <a href="https://support.staffbase.com/hc/en-us/articles/360010803979-Types-of-User-Groups" target="_blank" rel="noopener noreferrer"> types of user groups</a>.
910
+ * @enum {string}
911
+ */
912
+ type: "conditional" | "internal" | "open";
913
+ creator: components["schemas"]["GroupCreator"];
914
+ /**
915
+ * Format: date-time
916
+ * @description Timestamp of the last update.
917
+ */
918
+ updatedAt: string;
919
+ /** @description List of inclusion conditions. */
920
+ inclusions?: components["schemas"]["Conditions"][];
921
+ /** @description List of included userIds. */
922
+ inclusionUserIds?: string[];
923
+ /** @description List of exclusion conditions. */
924
+ exclusions?: components["schemas"]["Conditions"][];
925
+ /** @description List of excluded userIds. */
926
+ exclusionUserIds?: string[];
927
+ };
928
+ GroupsSearch: {
929
+ /** @description The total number of groups matching the search. */
930
+ total?: number;
931
+ /** @description Cursor to get the next data page. */
932
+ nextCursor?: string;
933
+ /** @description Cursor to get the previous data page. */
934
+ prevCursor?: string;
935
+ /** @description List of searched groups. */
936
+ entries?: {
937
+ /** @description List of groups. */
938
+ data?: components["schemas"]["Group"][];
939
+ };
940
+ };
941
+ };
942
+ responses: {
943
+ /** @description This occurs when a valid token is missing. */
944
+ NoToken: {
945
+ headers: {
946
+ [name: string]: unknown;
947
+ };
948
+ content: {
949
+ /**
950
+ * @example {
951
+ * "identifier": 40102,
952
+ * "statusCode": 401,
953
+ * "message": "This endpoint requires authentication.",
954
+ * "type": "NotLoggedInException"
955
+ * }
956
+ */
957
+ "application/json": unknown;
958
+ };
959
+ };
960
+ /** @description This occurs when the used token has not the required permissions to perform this action. */
961
+ NoPermission: {
962
+ headers: {
963
+ [name: string]: unknown;
964
+ };
965
+ content: {
966
+ /**
967
+ * @example {
968
+ * "identifier": 40308,
969
+ * "statusCode": 403,
970
+ * "message": "Access to branch [null] is restricted. You are trying to perform an operation that exceeds the access level.",
971
+ * "type": "AccessDeniedException"
972
+ * }
973
+ */
974
+ "application/json": unknown;
975
+ };
976
+ };
977
+ /** @description This occurs when the requested resource does not exist. */
978
+ NotFound: {
979
+ headers: {
980
+ [name: string]: unknown;
981
+ };
982
+ content: {
983
+ /**
984
+ * @example {
985
+ * "identifier": 40408,
986
+ * "statusCode": 404,
987
+ * "message": "User '5791e3ffd4c61f21c3df8b9' could not be found.",
988
+ * "type": "NotFoundException"
989
+ * }
990
+ */
991
+ "application/json": unknown;
992
+ };
993
+ };
994
+ /** @description Password recovery is not possible for this user. This happens when the user has no email address set or when the app configuration doesn't allow password recovery. */
995
+ NoRecovery: {
996
+ headers: {
997
+ [name: string]: unknown;
998
+ };
999
+ content?: never;
1000
+ };
1001
+ /** @description Your branch needs at least one admin. */
1002
+ NoAdmin: {
1003
+ headers: {
1004
+ [name: string]: unknown;
1005
+ };
1006
+ content?: never;
1007
+ };
1008
+ /** @description The user has been successfully updated. */
1009
+ UserUpdated: {
1010
+ headers: {
1011
+ [name: string]: unknown;
1012
+ };
1013
+ content: {
1014
+ /**
1015
+ * @example {
1016
+ * "config": {
1017
+ * "locale": "en_US"
1018
+ * },
1019
+ * "created": "2021-02-28T09:39:44.431Z",
1020
+ * "department": "Marketing",
1021
+ * "emails": [
1022
+ * {
1023
+ * "value": "mike.smith@example.com",
1024
+ * "primary": true
1025
+ * }
1026
+ * ],
1027
+ * "externalID": "209tz9hgbrevkmfkq03j",
1028
+ * "firstName": "Mike",
1029
+ * "groupIDs": [],
1030
+ * "id": "603b64e00c3fdb29134eb89b",
1031
+ * "lastName": "Smith",
1032
+ * "location": "London",
1033
+ * "mandatoryGroupIDs": [
1034
+ * "5f69df13f537d14b8374a733",
1035
+ * "60955d000c6cf823e3f6d75a"
1036
+ * ],
1037
+ * "phoneNumber": "+44 20 7946 0438",
1038
+ * "position": "Manager",
1039
+ * "profile": {
1040
+ * "firstName": "Mike",
1041
+ * "lastName": "Smith",
1042
+ * "phoneNumber": "+44 20 7946 0438",
1043
+ * "publicEmailAddress": "public@example.org",
1044
+ * "location": "London",
1045
+ * "position": "Manager",
1046
+ * "avatar": null,
1047
+ * "department": null,
1048
+ * "costcenter": "1337"
1049
+ * },
1050
+ * "publicEmailAddress": "public@example.org",
1051
+ * "role": {
1052
+ * "type": "admin"
1053
+ * },
1054
+ * "tags": [
1055
+ * "csv_import:newyork",
1056
+ * "profile:jobtype:accountant",
1057
+ * "location:NYC"
1058
+ * ],
1059
+ * "userName": {
1060
+ * "value": "john.doe",
1061
+ * "providerID": "staffbase"
1062
+ * },
1063
+ * "status": "deactivated",
1064
+ * "updated": "2021-03-02T09:39:44.441Z"
1065
+ * }
1066
+ */
1067
+ "application/json": unknown;
1068
+ };
1069
+ };
1070
+ };
1071
+ parameters: {
1072
+ /** @description The unique identifier automatically generated by the Staffbase platform or the externalID, if it is added for the user. */
1073
+ UserId: string;
1074
+ /** @description A string that is used for searching in any profile field available for users, such as firstname, lastname, or location. You can combine this with the filter parameter if needed. */
1075
+ Query: string;
1076
+ /** @description If set to `true`, the response will also include users that have been deleted. Only users that have been deleted in the last 30 days are included. This is useful for synchronizing users with an external system. */
1077
+ IncludeDeleted: boolean;
1078
+ /** @description Switch to include the user profile data in the response. */
1079
+ IncludeProfile: boolean;
1080
+ /** @description A string as encoded cursor information to the next data page. <strong> Note:</strong> This replaces the non-performant `offset` pagination and is only available in the latest endpoint versions, not in older versions. */
1081
+ Cursor: string;
1082
+ /** @description A string that is used for searching groups by name. */
1083
+ VisibleGroupsQuery: string;
1084
+ /** @description Content filter in **SCIM notation**. You can combine this with the query parameter if needed. For more details see our guide for the <a href="/references/user-api-filters/" target="_blank">filter parameter</a>. */
1085
+ Filter: string;
1086
+ /** @description The amount of items that should be returned. */
1087
+ Limit100: number;
1088
+ /** @description The amount of items that should be returned. */
1089
+ Limit1000: number;
1090
+ /** @description The amount of items that should be returned. */
1091
+ Limit: number;
1092
+ /** @description Define an offset for getting the items starting at this number. Currently, the maximum offset is 800,000. If you need to access more than 800,000 items, please use the user sync API instead. <strong>Note</strong>: In the latest versions of some endpoints, cursor-based pagination is available instead of offset pagination for improved performance. */
1093
+ Offset: number;
1094
+ /** @description Sort users by a specific field. */
1095
+ Sort: "created_ASC" | "created_DESC" | "lastName_ASC_firstName_ASC" | "updated_DESC" | "activated_DESC" | "relevance_DESC";
1096
+ /** @description Sort groups by a specific field. */
1097
+ UserGroupOrder: "created_DESC" | "name_ASC" | "updated_DESC";
1098
+ };
1099
+ requestBodies: never;
1100
+ headers: never;
1101
+ pathItems: never;
1102
+ }
1103
+ export type $defs = Record<string, never>;
1104
+ export interface operations {
1105
+ GetUsers: {
1106
+ parameters: {
1107
+ query?: {
1108
+ /** @description A string as encoded cursor information to the next data page. <strong> Note:</strong> This replaces the non-performant `offset` pagination and is only available in the latest endpoint versions, not in older versions. */
1109
+ cursor?: components["parameters"]["Cursor"];
1110
+ /** @description A string that is used for searching in any profile field available for users, such as firstname, lastname, or location. You can combine this with the filter parameter if needed. */
1111
+ query?: components["parameters"]["Query"];
1112
+ /** @description Content filter in **SCIM notation**. You can combine this with the query parameter if needed. For more details see our guide for the <a href="/references/user-api-filters/" target="_blank">filter parameter</a>. */
1113
+ filter?: components["parameters"]["Filter"];
1114
+ /** @description The amount of items that should be returned. */
1115
+ limit?: components["parameters"]["Limit1000"];
1116
+ /** @description Define an offset for getting the items starting at this number. Currently, the maximum offset is 800,000. If you need to access more than 800,000 items, please use the user sync API instead. <strong>Note</strong>: In the latest versions of some endpoints, cursor-based pagination is available instead of offset pagination for improved performance. */
1117
+ offset?: components["parameters"]["Offset"];
1118
+ /** @description Sort users by a specific field. */
1119
+ sort?: components["parameters"]["Sort"];
1120
+ };
1121
+ header?: never;
1122
+ path?: never;
1123
+ cookie?: never;
1124
+ };
1125
+ requestBody?: never;
1126
+ responses: {
1127
+ /** @description Get a list of users. */
1128
+ 200: {
1129
+ headers: {
1130
+ [name: string]: unknown;
1131
+ };
1132
+ content: {
1133
+ "application/vnd.staffbase.accessors.users.v2+json": components["schemas"]["Users"];
1134
+ "application/json": components["schemas"]["ReturnUsers"];
1135
+ };
1136
+ };
1137
+ 401: components["responses"]["NoToken"];
1138
+ 403: components["responses"]["NoPermission"];
1139
+ };
1140
+ };
1141
+ InviteUser: {
1142
+ parameters: {
1143
+ query?: never;
1144
+ header?: never;
1145
+ path?: never;
1146
+ cookie?: never;
1147
+ };
1148
+ requestBody?: {
1149
+ content: {
1150
+ "application/vnd.staffbase.accessors.user-invite.v2+json": components["schemas"]["UserInvite"];
1151
+ "application/json": components["schemas"]["CreateUser"];
1152
+ };
1153
+ };
1154
+ responses: {
1155
+ /** @description New user created */
1156
+ 201: {
1157
+ headers: {
1158
+ [name: string]: unknown;
1159
+ };
1160
+ content: {
1161
+ "application/vnd.staffbase.accessors.user.v3+json": components["schemas"]["User"];
1162
+ "application/json": components["schemas"]["CreateUserInMarketingResponse"];
1163
+ };
1164
+ };
1165
+ 401: components["responses"]["NoToken"];
1166
+ 403: components["responses"]["NoPermission"];
1167
+ };
1168
+ };
1169
+ searchUsersOfBranch: {
1170
+ parameters: {
1171
+ query?: {
1172
+ /** @description A string as encoded cursor information to the next data page. <strong> Note:</strong> This replaces the non-performant `offset` pagination and is only available in the latest endpoint versions, not in older versions. */
1173
+ cursor?: components["parameters"]["Cursor"];
1174
+ /** @description A string that is used for searching in any profile field available for users, such as firstname, lastname, or location. You can combine this with the filter parameter if needed. */
1175
+ query?: components["parameters"]["Query"];
1176
+ /** @description Content filter in **SCIM notation**. You can combine this with the query parameter if needed. For more details see our guide for the <a href="/references/user-api-filters/" target="_blank">filter parameter</a>. */
1177
+ filter?: components["parameters"]["Filter"];
1178
+ /** @description Sort users by a specific field. */
1179
+ sort?: components["parameters"]["Sort"];
1180
+ /** @description The amount of items that should be returned. */
1181
+ limit?: components["parameters"]["Limit"];
1182
+ /** @description Switch to include the user profile data in the response. */
1183
+ includeProfile?: components["parameters"]["IncludeProfile"];
1184
+ };
1185
+ header?: never;
1186
+ path?: never;
1187
+ cookie?: never;
1188
+ };
1189
+ requestBody?: never;
1190
+ responses: {
1191
+ /** @description Get a list of users that match the given search filters. */
1192
+ 200: {
1193
+ headers: {
1194
+ [name: string]: unknown;
1195
+ };
1196
+ content: {
1197
+ "application/vnd.staffbase.accessors.users-search.v1+json": components["schemas"]["UsersSearch"];
1198
+ };
1199
+ };
1200
+ 401: components["responses"]["NoToken"];
1201
+ 403: components["responses"]["NoPermission"];
1202
+ };
1203
+ };
1204
+ GetSpecificUser: {
1205
+ parameters: {
1206
+ query?: {
1207
+ /** @description Switch to include the user profile data in the response. */
1208
+ includeProfile?: components["parameters"]["IncludeProfile"];
1209
+ };
1210
+ header?: never;
1211
+ path: {
1212
+ /** @description The unique identifier automatically generated by the Staffbase platform or the externalID, if it is added for the user. */
1213
+ userId: components["parameters"]["UserId"];
1214
+ };
1215
+ cookie?: never;
1216
+ };
1217
+ requestBody?: never;
1218
+ responses: {
1219
+ /** @description Get a single user by the identifier. */
1220
+ 200: {
1221
+ headers: {
1222
+ [name: string]: unknown;
1223
+ };
1224
+ content: {
1225
+ "application/vnd.staffbase.accessors.user.v3+json": components["schemas"]["User"];
1226
+ "application/json": components["schemas"]["SingleUserWithAvatar"];
1227
+ };
1228
+ };
1229
+ 401: components["responses"]["NoToken"];
1230
+ 403: components["responses"]["NoPermission"];
1231
+ 404: components["responses"]["NotFound"];
1232
+ };
1233
+ };
1234
+ UpdateUser: {
1235
+ parameters: {
1236
+ query?: never;
1237
+ header?: never;
1238
+ path: {
1239
+ /** @description The unique identifier automatically generated by the Staffbase platform or the externalID, if it is added for the user. */
1240
+ userId: components["parameters"]["UserId"];
1241
+ };
1242
+ cookie?: never;
1243
+ };
1244
+ requestBody?: {
1245
+ content: {
1246
+ "application/json": components["schemas"]["UpdateUser"];
1247
+ };
1248
+ };
1249
+ responses: {
1250
+ 200: components["responses"]["UserUpdated"];
1251
+ 401: components["responses"]["NoToken"];
1252
+ 403: components["responses"]["NoPermission"];
1253
+ 404: components["responses"]["NotFound"];
1254
+ };
1255
+ };
1256
+ DeleteUser: {
1257
+ parameters: {
1258
+ query?: never;
1259
+ header?: never;
1260
+ path: {
1261
+ /** @description The unique identifier automatically generated by the Staffbase platform or the externalID, if it is added for the user. */
1262
+ userId: components["parameters"]["UserId"];
1263
+ };
1264
+ cookie?: never;
1265
+ };
1266
+ requestBody?: never;
1267
+ responses: {
1268
+ /** @description This is the legacy response. Switch to new version. The user has been successfully removed from the platform. The status code is returned without a payload. */
1269
+ 202: {
1270
+ headers: {
1271
+ [name: string]: unknown;
1272
+ };
1273
+ content: {
1274
+ "application/json": unknown;
1275
+ };
1276
+ };
1277
+ /** @description User deleted. */
1278
+ 204: {
1279
+ headers: {
1280
+ [name: string]: unknown;
1281
+ };
1282
+ content: {
1283
+ "application/vnd.staffbase.accessors.user-delete.v2+json": unknown;
1284
+ };
1285
+ };
1286
+ 401: components["responses"]["NoToken"];
1287
+ 403: components["responses"]["NoPermission"];
1288
+ 404: components["responses"]["NotFound"];
1289
+ 405: components["responses"]["NoAdmin"];
1290
+ };
1291
+ };
1292
+ updateUser: {
1293
+ parameters: {
1294
+ query?: never;
1295
+ header?: never;
1296
+ path: {
1297
+ /** @description The unique identifier automatically generated by the Staffbase platform or the externalID, if it is added for the user. */
1298
+ userId: components["parameters"]["UserId"];
1299
+ };
1300
+ cookie?: never;
1301
+ };
1302
+ requestBody?: {
1303
+ content: {
1304
+ "application/vnd.staffbase.accessors.user-update.v1+json": components["schemas"]["UserUpdate"];
1305
+ };
1306
+ };
1307
+ responses: {
1308
+ /** @description User updated */
1309
+ 200: {
1310
+ headers: {
1311
+ [name: string]: unknown;
1312
+ };
1313
+ content: {
1314
+ "application/vnd.staffbase.accessors.user.v3+json": components["schemas"]["User"];
1315
+ };
1316
+ };
1317
+ 401: components["responses"]["NoToken"];
1318
+ 404: components["responses"]["NotFound"];
1319
+ };
1320
+ };
1321
+ GetGroupsOfUser: {
1322
+ parameters: {
1323
+ query?: {
1324
+ /** @description The amount of items that should be returned. */
1325
+ limit?: components["parameters"]["Limit100"];
1326
+ /** @description Define an offset for getting the items starting at this number. Currently, the maximum offset is 800,000. If you need to access more than 800,000 items, please use the user sync API instead. <strong>Note</strong>: In the latest versions of some endpoints, cursor-based pagination is available instead of offset pagination for improved performance. */
1327
+ offset?: components["parameters"]["Offset"];
1328
+ /** @description Sort groups by a specific field. */
1329
+ sort?: components["parameters"]["UserGroupOrder"];
1330
+ };
1331
+ header?: never;
1332
+ path: {
1333
+ /** @description The unique identifier automatically generated by the Staffbase platform or the externalID, if it is added for the user. */
1334
+ userId: components["parameters"]["UserId"];
1335
+ };
1336
+ cookie?: never;
1337
+ };
1338
+ requestBody?: never;
1339
+ responses: {
1340
+ /** @description Returns a list of groups. */
1341
+ 200: {
1342
+ headers: {
1343
+ [name: string]: unknown;
1344
+ };
1345
+ content: {
1346
+ "application/json": components["schemas"]["ReturnGroups"];
1347
+ };
1348
+ };
1349
+ 401: components["responses"]["NoToken"];
1350
+ 403: components["responses"]["NoPermission"];
1351
+ 404: components["responses"]["NotFound"];
1352
+ };
1353
+ };
1354
+ GetUserGroups: {
1355
+ parameters: {
1356
+ query?: {
1357
+ /** @description A string as encoded cursor information to the next data page. <strong> Note:</strong> This replaces the non-performant `offset` pagination and is only available in the latest endpoint versions, not in older versions. */
1358
+ cursor?: components["parameters"]["Cursor"];
1359
+ /** @description A string that is used for searching in any profile field available for users, such as firstname, lastname, or location. You can combine this with the filter parameter if needed. */
1360
+ query?: components["parameters"]["Query"];
1361
+ /** @description The amount of items that should be returned. */
1362
+ limit?: components["parameters"]["Limit"];
1363
+ };
1364
+ header?: never;
1365
+ path: {
1366
+ /** @description The unique identifier automatically generated by the Staffbase platform or the externalID, if it is added for the user. */
1367
+ userId: components["parameters"]["UserId"];
1368
+ };
1369
+ cookie?: never;
1370
+ };
1371
+ requestBody?: never;
1372
+ responses: {
1373
+ /** @description Get the groups of a user. */
1374
+ 200: {
1375
+ headers: {
1376
+ [name: string]: unknown;
1377
+ };
1378
+ content: {
1379
+ "application/vnd.staffbase.accessors.user.groups-search.v1+json": components["schemas"]["GroupsSearch"];
1380
+ };
1381
+ };
1382
+ 401: components["responses"]["NoToken"];
1383
+ 404: components["responses"]["NotFound"];
1384
+ };
1385
+ };
1386
+ GetVisibleGroupsOfUser: {
1387
+ parameters: {
1388
+ query?: {
1389
+ /** @description A string that is used for searching groups by name. */
1390
+ query?: components["parameters"]["VisibleGroupsQuery"];
1391
+ /** @description The amount of items that should be returned. */
1392
+ limit?: components["parameters"]["Limit100"];
1393
+ /** @description Define an offset for getting the items starting at this number. Currently, the maximum offset is 800,000. If you need to access more than 800,000 items, please use the user sync API instead. <strong>Note</strong>: In the latest versions of some endpoints, cursor-based pagination is available instead of offset pagination for improved performance. */
1394
+ offset?: components["parameters"]["Offset"];
1395
+ /** @description Sort groups by a specific field. */
1396
+ sort?: components["parameters"]["UserGroupOrder"];
1397
+ };
1398
+ header?: never;
1399
+ path: {
1400
+ /** @description The unique identifier automatically generated by the Staffbase platform or the externalID, if it is added for the user. */
1401
+ userId: components["parameters"]["UserId"];
1402
+ };
1403
+ cookie?: never;
1404
+ };
1405
+ requestBody?: never;
1406
+ responses: {
1407
+ /** @description Returns a list of groups, that are visible to the user. */
1408
+ 200: {
1409
+ headers: {
1410
+ [name: string]: unknown;
1411
+ };
1412
+ content: {
1413
+ "application/json": components["schemas"]["ReturnGroups"];
1414
+ };
1415
+ };
1416
+ 401: components["responses"]["NoToken"];
1417
+ 403: components["responses"]["NoPermission"];
1418
+ 404: components["responses"]["NotFound"];
1419
+ };
1420
+ };
1421
+ UserRecovery: {
1422
+ parameters: {
1423
+ query?: never;
1424
+ header?: never;
1425
+ path: {
1426
+ /** @description The unique identifier automatically generated by the Staffbase platform or the externalID, if it is added for the user. */
1427
+ userId: components["parameters"]["UserId"];
1428
+ };
1429
+ cookie?: never;
1430
+ };
1431
+ requestBody?: never;
1432
+ responses: {
1433
+ /** @description The recovery mail was successfully sent to the user. */
1434
+ 202: {
1435
+ headers: {
1436
+ [name: string]: unknown;
1437
+ };
1438
+ content?: never;
1439
+ };
1440
+ 400: components["responses"]["NoRecovery"];
1441
+ 401: components["responses"]["NoToken"];
1442
+ 404: components["responses"]["NotFound"];
1443
+ };
1444
+ };
1445
+ DeleteUserSessions: {
1446
+ parameters: {
1447
+ query?: never;
1448
+ header?: never;
1449
+ path: {
1450
+ /** @description The unique identifier automatically generated by the Staffbase platform or the externalID, if it is added for the user. */
1451
+ userId: components["parameters"]["UserId"];
1452
+ };
1453
+ cookie?: never;
1454
+ };
1455
+ requestBody?: never;
1456
+ responses: {
1457
+ /** @description The user has been successfully logged out of all active sessions. The status code is returned without a payload. */
1458
+ 202: {
1459
+ headers: {
1460
+ [name: string]: unknown;
1461
+ };
1462
+ content?: never;
1463
+ };
1464
+ 401: components["responses"]["NoToken"];
1465
+ 403: components["responses"]["NoPermission"];
1466
+ 404: components["responses"]["NotFound"];
1467
+ };
1468
+ };
1469
+ Sync: {
1470
+ parameters: {
1471
+ query?: {
1472
+ /** @description A string as encoded cursor information to the next data page. <strong> Note:</strong> This replaces the non-performant `offset` pagination and is only available in the latest endpoint versions, not in older versions. */
1473
+ cursor?: components["parameters"]["Cursor"];
1474
+ /** @description If set to `true`, the response will also include users that have been deleted. Only users that have been deleted in the last 30 days are included. This is useful for synchronizing users with an external system. */
1475
+ includeDelete?: components["parameters"]["IncludeDeleted"];
1476
+ /** @description The amount of items that should be returned. */
1477
+ limit?: components["parameters"]["Limit1000"];
1478
+ };
1479
+ header?: never;
1480
+ path?: never;
1481
+ cookie?: never;
1482
+ };
1483
+ requestBody?: never;
1484
+ responses: {
1485
+ /** @description A list of user records with pagination links */
1486
+ 200: {
1487
+ headers: {
1488
+ [name: string]: unknown;
1489
+ };
1490
+ content: {
1491
+ "application/json": {
1492
+ data?: components["schemas"]["SingleUserWithAvatarSync"][];
1493
+ links?: {
1494
+ next?: {
1495
+ /** @example GET */
1496
+ method?: string;
1497
+ /**
1498
+ * Format: uri
1499
+ * @example https://example.staffbase.com/api/users/sync/
1500
+ */
1501
+ resource?: string;
1502
+ params?: {
1503
+ /** @example 3 */
1504
+ limit?: number;
1505
+ /** @example MTY2Mzg0ODAzNDA5Mw==__NjMyYzRlNjEzZTYzYTkxOTA4MGNlOTQx__dHJ1ZQ== */
1506
+ cursor?: string;
1507
+ /** @example false */
1508
+ includeDelete?: boolean;
1509
+ };
1510
+ /**
1511
+ * Format: uri
1512
+ * @example https://example.staffbase.com/api/users/sync?limit=3&cursor=MTY2Mzg0ODAzNDA5Mw%3D%3D__NjMyYzRlNjEzZTYzYTkxOTA4MGNlOTQx__dHJ1ZQ%3D%3D&includeDelete=false
1513
+ */
1514
+ href?: string;
1515
+ };
1516
+ };
1517
+ };
1518
+ };
1519
+ };
1520
+ 401: components["responses"]["NoToken"];
1521
+ 403: components["responses"]["NoPermission"];
1522
+ };
1523
+ };
1524
+ }
1525
+ //# sourceMappingURL=userApi.d.ts.map