1 /**
2 * @oas [get] /admin/users
3 * operationId: GetUsers
4 * summary: List Users
5 * description: Retrieve a list of users. The users can be filtered by fields such as `id`. The users can also be sorted or paginated.
6 * x-authenticated: true
7 * parameters:
8 * - name: fields
9 * in: query
10 * description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default
11 * fields. without prefix it will replace the entire default fields.
12 * required: false
13 * schema:
14 * type: string
15 * title: fields
16 * description: Comma-separated fields that should be included in the returned data. if a field is prefixed with `+` it will be added to the default fields, using `-` will remove it from the default
17 * fields. without prefix it will replace the entire default fields.
18 * externalDocs:
19 * url: "#select-fields-and-relations"
20 * - name: offset
21 * in: query
22 * description: The number of items to skip when retrieving a list.
23 * required: false
24 * schema:
25 * type: number
26 * title: offset
27 * description: The number of items to skip when retrieving a list.
28 * externalDocs:
29 * url: "#pagination"
30 * - name: limit
31 * in: query
32 * description: Limit the number of items returned in the list.
33 * required: false
34 * schema:
35 * type: number
36 * title: limit
37 * description: Limit the number of items returned in the list.
38 * externalDocs:
39 * url: "#pagination"
40 * - name: order
41 * in: query
42 * description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`.
43 * required: false
44 * schema:
45 * type: string
46 * title: order
47 * description: The field to sort the data by. By default, the sort order is ascending. To change the order to descending, prefix the field name with `-`.
48 * - name: q
49 * in: query
50 * description: The search term to filter the user's searchable properties.
51 * required: false
52 * schema:
53 * type: string
54 * title: q
55 * description: The search term to filter the user's searchable properties.
56 * - name: id
57 * in: query
58 * required: false
59 * schema:
60 * oneOf:
61 * - type: string
62 * title: id
63 * description: Filter by a user's ID.
64 * - type: array
65 * description: Filter by user IDs.
66 * items:
67 * type: string
68 * title: id
69 * description: A user's ID.
70 * - name: email
71 * in: query
72 * description: Filter by an email.
73 * required: false
74 * schema:
75 * type: string
76 * title: email
77 * description: Filter by an email.
78 * format: email
79 * - name: first_name
80 * in: query
81 * description: Filter by a first name.
82 * required: false
83 * schema:
84 * type: string
85 * title: first_name
86 * description: Filter by a first name.
87 * - name: last_name
88 * in: query
89 * description: Filter by a last name.
90 * required: false
91 * schema:
92 * type: string
93 * title: last_name
94 * description: Filter by a last name.
95 * - name: created_at
96 * in: query
97 * description: Filter by a user's creation date.
98 * required: false
99 * schema:
100 * type: object
101 * description: Filter by a user's creation date.
102 * properties:
103 * $and:
104 * type: array
105 * description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
106 * items:
107 * type: object
108 * title: $and
109 * $or:
110 * type: array
111 * description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
112 * items:
113 * type: object
114 * title: $or
115 * $eq:
116 * oneOf:
117 * - type: string
118 * title: $eq
119 * description: Filter by an exact match.
120 * - type: array
121 * description: Filter by an exact match.
122 * items:
123 * type: string
124 * title: $eq
125 * description: Filter by an exact match.
126 * $ne:
127 * type: string
128 * title: $ne
129 * description: Filter by values not equal to this parameter.
130 * $in:
131 * type: array
132 * description: Filter by values in this array.
133 * items:
134 * type: string
135 * title: $in
136 * description: Filter by values in this array.
137 * $nin:
138 * type: array
139 * description: Filter by values not in this array.
140 * items:
141 * type: string
142 * title: $nin
143 * description: Filter by values not in this array.
144 * $not:
145 * oneOf:
146 * - type: string
147 * title: $not
148 * description: Filter by values not matching the conditions in this parameter.
149 * - type: object
150 * description: Filter by values not matching the conditions in this parameter.
151 * - type: array
152 * description: Filter by values not matching the conditions in this parameter.
153 * items:
154 * type: string
155 * title: $not
156 * description: Filter by values not matching the conditions in this parameter.
157 * $gt:
158 * type: string
159 * title: $gt
160 * description: Filter by values greater than this parameter. Useful for numbers and dates only.
161 * $gte:
162 * type: string
163 * title: $gte
164 * description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only.
165 * $lt:
166 * type: string
167 * title: $lt
168 * description: Filter by values less than this parameter. Useful for numbers and dates only.
169 * $lte:
170 * type: string
171 * title: $lte
172 * description: Filter by values less than or equal to this parameter. Useful for numbers and dates only.
173 * $like:
174 * type: string
175 * title: $like
176 * description: Apply a `like` filter. Useful for strings only.
177 * $re:
178 * type: string
179 * title: $re
180 * description: Apply a regex filter. Useful for strings only.
181 * $ilike:
182 * type: string
183 * title: $ilike
184 * description: Apply a case-insensitive `like` filter. Useful for strings only.
185 * $fulltext:
186 * type: string
187 * title: $fulltext
188 * description: Filter to apply on full-text properties.
189 * $overlap:
190 * type: array
191 * description: Filter arrays that have overlapping values with this parameter.
192 * items:
193 * type: string
194 * title: $overlap
195 * description: Filter arrays that have overlapping values with this parameter.
196 * $contains:
197 * type: array
198 * description: Filter arrays that contain some of the values of this parameter.
199 * items:
200 * type: string
201 * title: $contains
202 * description: Filter arrays that contain some of the values of this parameter.
203 * $contained:
204 * type: array
205 * description: Filter arrays that contain all values of this parameter.
206 * items:
207 * type: string
208 * title: $contained
209 * description: Filter arrays that contain all values of this parameter.
210 * $exists:
211 * type: boolean
212 * title: $exists
213 * description: Filter by whether a value for this parameter exists (not `null`).
214 * title: created_at
215 * - name: updated_at
216 * in: query
217 * description: Filter by a user's update date.
218 * required: false
219 * schema:
220 * type: object
221 * description: Filter by a user's update date.
222 * properties:
223 * $and:
224 * type: array
225 * description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
226 * items:
227 * type: object
228 * title: $and
229 * $or:
230 * type: array
231 * description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
232 * items:
233 * type: object
234 * title: $or
235 * $eq:
236 * oneOf:
237 * - type: string
238 * title: $eq
239 * description: Filter by an exact match.
240 * - type: array
241 * description: Filter by an exact match.
242 * items:
243 * type: string
244 * title: $eq
245 * description: Filter by an exact match.
246 * $ne:
247 * type: string
248 * title: $ne
249 * description: Filter by values not equal to this parameter.
250 * $in:
251 * type: array
252 * description: Filter by values in this array.
253 * items:
254 * type: string
255 * title: $in
256 * description: Filter by values in this array.
257 * $nin:
258 * type: array
259 * description: Filter by values not in this array.
260 * items:
261 * type: string
262 * title: $nin
263 * description: Filter by values not in this array.
264 * $not:
265 * oneOf:
266 * - type: string
267 * title: $not
268 * description: Filter by values not matching the conditions in this parameter.
269 * - type: object
270 * description: Filter by values not matching the conditions in this parameter.
271 * - type: array
272 * description: Filter by values not matching the conditions in this parameter.
273 * items:
274 * type: string
275 * title: $not
276 * description: Filter by values not matching the conditions in this parameter.
277 * $gt:
278 * type: string
279 * title: $gt
280 * description: Filter by values greater than this parameter. Useful for numbers and dates only.
281 * $gte:
282 * type: string
283 * title: $gte
284 * description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only.
285 * $lt:
286 * type: string
287 * title: $lt
288 * description: Filter by values less than this parameter. Useful for numbers and dates only.
289 * $lte:
290 * type: string
291 * title: $lte
292 * description: Filter by values less than or equal to this parameter. Useful for numbers and dates only.
293 * $like:
294 * type: string
295 * title: $like
296 * description: Apply a `like` filter. Useful for strings only.
297 * $re:
298 * type: string
299 * title: $re
300 * description: Apply a regex filter. Useful for strings only.
301 * $ilike:
302 * type: string
303 * title: $ilike
304 * description: Apply a case-insensitive `like` filter. Useful for strings only.
305 * $fulltext:
306 * type: string
307 * title: $fulltext
308 * description: Filter to apply on full-text properties.
309 * $overlap:
310 * type: array
311 * description: Filter arrays that have overlapping values with this parameter.
312 * items:
313 * type: string
314 * title: $overlap
315 * description: Filter arrays that have overlapping values with this parameter.
316 * $contains:
317 * type: array
318 * description: Filter arrays that contain some of the values of this parameter.
319 * items:
320 * type: string
321 * title: $contains
322 * description: Filter arrays that contain some of the values of this parameter.
323 * $contained:
324 * type: array
325 * description: Filter arrays that contain all values of this parameter.
326 * items:
327 * type: string
328 * title: $contained
329 * description: Filter arrays that contain all values of this parameter.
330 * $exists:
331 * type: boolean
332 * title: $exists
333 * description: Filter by whether a value for this parameter exists (not `null`).
334 * title: updated_at
335 * - name: deleted_at
336 * in: query
337 * description: Filter by a user's deletion date.
338 * required: false
339 * schema:
340 * type: object
341 * description: Filter by a user's deletion date.
342 * properties:
343 * $and:
344 * type: array
345 * description: Join query parameters with an AND condition. Each object's content is the same type as the expected query parameters.
346 * items:
347 * type: object
348 * title: $and
349 * $or:
350 * type: array
351 * description: Join query parameters with an OR condition. Each object's content is the same type as the expected query parameters.
352 * items:
353 * type: object
354 * title: $or
355 * $eq:
356 * oneOf:
357 * - type: string
358 * title: $eq
359 * description: Filter by an exact match.
360 * - type: array
361 * description: Filter by an exact match.
362 * items:
363 * type: string
364 * title: $eq
365 * description: Filter by an exact match.
366 * $ne:
367 * type: string
368 * title: $ne
369 * description: Filter by values not equal to this parameter.
370 * $in:
371 * type: array
372 * description: Filter by values in this array.
373 * items:
374 * type: string
375 * title: $in
376 * description: Filter by values in this array.
377 * $nin:
378 * type: array
379 * description: Filter by values not in this array.
380 * items:
381 * type: string
382 * title: $nin
383 * description: Filter by values not in this array.
384 * $not:
385 * oneOf:
386 * - type: string
387 * title: $not
388 * description: Filter by values not matching the conditions in this parameter.
389 * - type: object
390 * description: Filter by values not matching the conditions in this parameter.
391 * - type: array
392 * description: Filter by values not matching the conditions in this parameter.
393 * items:
394 * type: string
395 * title: $not
396 * description: Filter by values not matching the conditions in this parameter.
397 * $gt:
398 * type: string
399 * title: $gt
400 * description: Filter by values greater than this parameter. Useful for numbers and dates only.
401 * $gte:
402 * type: string
403 * title: $gte
404 * description: Filter by values greater than or equal to this parameter. Useful for numbers and dates only.
405 * $lt:
406 * type: string
407 * title: $lt
408 * description: Filter by values less than this parameter. Useful for numbers and dates only.
409 * $lte:
410 * type: string
411 * title: $lte
412 * description: Filter by values less than or equal to this parameter. Useful for numbers and dates only.
413 * $like:
414 * type: string
415 * title: $like
416 * description: Apply a `like` filter. Useful for strings only.
417 * $re:
418 * type: string
419 * title: $re
420 * description: Apply a regex filter. Useful for strings only.
421 * $ilike:
422 * type: string
423 * title: $ilike
424 * description: Apply a case-insensitive `like` filter. Useful for strings only.
425 * $fulltext:
426 * type: string
427 * title: $fulltext
428 * description: Filter to apply on full-text properties.
429 * $overlap:
430 * type: array
431 * description: Filter arrays that have overlapping values with this parameter.
432 * items:
433 * type: string
434 * title: $overlap
435 * description: Filter arrays that have overlapping values with this parameter.
436 * $contains:
437 * type: array
438 * description: Filter arrays that contain some of the values of this parameter.
439 * items:
440 * type: string
441 * title: $contains
442 * description: Filter arrays that contain some of the values of this parameter.
443 * $contained:
444 * type: array
445 * description: Filter arrays that contain all values of this parameter.
446 * items:
447 * type: string
448 * title: $contained
449 * description: Filter arrays that contain all values of this parameter.
450 * $exists:
451 * type: boolean
452 * title: $exists
453 * description: Filter by whether a value for this parameter exists (not `null`).
454 * title: deleted_at
455 * - name: with_deleted
456 * in: query
457 * description: Whether to include deleted records in the result.
458 * required: false
459 * schema:
460 * type: boolean
461 * title: with_deleted
462 * description: Whether to include deleted records in the result.
463 * x-codeSamples:
464 * - lang: JavaScript
465 * label: JS SDK
466 * source: |-
467 * import Medusa from "@medusajs/js-sdk"
468 *
469 * export const sdk = new Medusa({
470 * baseUrl: import.meta.env.VITE_BACKEND_URL || "/",
471 * debug: import.meta.env.DEV,
472 * auth: {
473 * type: "session",
474 * },
475 * })
476 *
477 * sdk.admin.user.list()
478 * .then(({ users, count, limit, offset }) => {
479 * console.log(users)
480 * })
481 * - lang: Shell
482 * label: cURL
483 * source: curl '{backend_url}/admin/users'
484 * tags:
485 * - Users
486 * responses:
487 * "200":
488 * description: OK
489 * content:
490 * application/json:
491 * schema:
492 * $ref: "#/components/schemas/AdminUserListResponse"
493 * "400":
494 * $ref: "#/components/responses/400_error"
495 * "401":
496 * $ref: "#/components/responses/unauthorized"
497 * "404":
498 * $ref: "#/components/responses/not_found_error"
499 * "409":
500 * $ref: "#/components/responses/invalid_state_error"
501 * "422":
502 * $ref: "#/components/responses/invalid_request_error"
503 * "500":
504 * $ref: "#/components/responses/500_error"
505 * security:
506 * - cookie_auth: []
507 * - jwt_token: []
508 *
509 */
510