docs: update api-reference project for v2 (#7307)
* remove everything v1 and make v2 default * move main v2 rewrites to book * move rewrites to book + other fixes
This commit is contained in:
@@ -2,160 +2,22 @@ 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.
|
||||
Retrieve a list of users. The users can be filtered by fields such as `id`.
|
||||
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
|
||||
parameters: []
|
||||
security:
|
||||
- api_token: []
|
||||
- cookie_auth: []
|
||||
- jwt_token: []
|
||||
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':
|
||||
@@ -168,47 +30,28 @@ get:
|
||||
$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
|
||||
schema: {}
|
||||
post:
|
||||
operationId: PostUsers
|
||||
summary: Create User
|
||||
description: Create a user.
|
||||
x-authenticated: true
|
||||
parameters: []
|
||||
security:
|
||||
- api_token: []
|
||||
- cookie_auth: []
|
||||
- jwt_token: []
|
||||
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':
|
||||
@@ -221,3 +64,7 @@ post:
|
||||
$ref: ../components/responses/invalid_request_error.yaml
|
||||
'500':
|
||||
$ref: ../components/responses/500_error.yaml
|
||||
requestBody:
|
||||
content:
|
||||
application/json:
|
||||
schema: {}
|
||||
|
||||
Reference in New Issue
Block a user