Files
medusa-store/www/apps/api-reference/specs/admin/paths/admin_users.yaml
github-actions[bot] bbf79169a9 chore(docs): Updated API Reference (#6220)
Automated changes by [create-pull-request](https://github.com/peter-evans/create-pull-request) GitHub action

Co-authored-by: Oli Juhl <59018053+olivermrbl@users.noreply.github.com>
2024-01-25 17:58:17 +00:00

224 lines
6.1 KiB
YAML

get:
operationId: GetUsers
summary: List Users
description: >-
Retrieves a list of users. The users can be filtered by fields such as `q`
or `email`. The users can also be sorted or paginated.
x-authenticated: true
parameters:
- in: query
name: email
description: Filter by email.
schema:
type: string
- in: query
name: first_name
description: Filter by first name.
schema:
type: string
- in: query
name: last_name
description: Filter by last name.
schema:
type: string
- in: query
name: q
description: Term used to search users' first name, last name, and email.
schema:
type: string
- in: query
name: order
description: A user field to sort-order the retrieved users by.
schema:
type: string
- in: query
name: id
style: form
explode: false
description: Filter by user IDs.
schema:
oneOf:
- type: string
description: ID of the user.
- type: array
items:
type: string
description: ID of a user.
- in: query
name: created_at
description: Filter by a creation date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
- in: query
name: updated_at
description: Filter by an update date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
- in: query
name: deleted_at
description: Filter by a deletion date range.
schema:
type: object
properties:
lt:
type: string
description: filter by dates less than this date
format: date
gt:
type: string
description: filter by dates greater than this date
format: date
lte:
type: string
description: filter by dates less than or equal to this date
format: date
gte:
type: string
description: filter by dates greater than or equal to this date
format: date
- in: query
name: offset
description: The number of users to skip when retrieving the users.
schema:
type: integer
default: 0
- in: query
name: limit
description: Limit the number of users returned.
schema:
type: integer
default: 20
- in: query
name: fields
description: Comma-separated fields that should be included in the returned users.
schema:
type: string
x-codegen:
method: list
queryParams: AdminGetUsersParams
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_users/get.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/admin_users/get.tsx
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_users/get.sh
security:
- api_token: []
- cookie_auth: []
- jwt_token: []
tags:
- Users
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminUsersListRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml
post:
operationId: PostUsers
summary: Create a User
description: >-
Create an admin User. The user has the same privileges as all admin users,
and will be able to authenticate and perform admin functionalities right
after creation.
x-authenticated: true
requestBody:
content:
application/json:
schema:
$ref: ../components/schemas/AdminCreateUserRequest.yaml
x-codegen:
method: create
x-codeSamples:
- lang: JavaScript
label: JS Client
source:
$ref: ../code_samples/JavaScript/admin_users/post.js
- lang: tsx
label: Medusa React
source:
$ref: ../code_samples/tsx/admin_users/post.tsx
- lang: Shell
label: cURL
source:
$ref: ../code_samples/Shell/admin_users/post.sh
security:
- api_token: []
- cookie_auth: []
- jwt_token: []
tags:
- Users
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ../components/schemas/AdminUserRes.yaml
'400':
$ref: ../components/responses/400_error.yaml
'401':
$ref: ../components/responses/unauthorized.yaml
'404':
$ref: ../components/responses/not_found_error.yaml
'409':
$ref: ../components/responses/invalid_state_error.yaml
'422':
$ref: ../components/responses/invalid_request_error.yaml
'500':
$ref: ../components/responses/500_error.yaml