Appearance
API Reference
This section contains the complete API reference documentation generated from the OpenAPI specification.
A sample API to demonstrate vitepress-openapi
Contact
Servers
https://api.example.com/v1Production server
https://staging-api.example.com/v1Staging server
Get all users
GET
/users
Retrieve a list of all users
Authorizations
bearerAuth
Enter your bearer token in the format: Bearer {token}
Type
HTTP (bearer)
Parameters
Query Parameters
page
Page number
Type
integer
Default
1limit
Number of items per page
Type
integer
Default
10Maximum
100Responses
Successful response
application/json
{
"data": [
{
"id": "string",
"name": "string",
"email": "string",
"role": "string",
"createdAt": "string",
"updatedAt": "string"
}
],
"pagination": {
"page": 0,
"limit": 0,
"total": 0,
"totalPages": 0
}
}
Create a user
POST
/users
Create a new user
Authorizations
bearerAuth
Enter your bearer token in the format: Bearer {token}
Type
HTTP (bearer)
Request Body
application/json
{
"name": "string",
"email": "string",
"role": "user"
}
Responses
User created successfully
application/json
{
"id": "string",
"name": "string",
"email": "string",
"role": "string",
"createdAt": "string",
"updatedAt": "string"
}
Get user by ID
GET
/users/{userId}
Retrieve a specific user by their ID
Authorizations
bearerAuth
Enter your bearer token in the format: Bearer {token}
Type
HTTP (bearer)
Parameters
Path Parameters
userId*
User ID
Type
Requiredstring
Responses
Successful response
application/json
{
"id": "string",
"name": "string",
"email": "string",
"role": "string",
"createdAt": "string",
"updatedAt": "string"
}
Update user
PUT
/users/{userId}
Update an existing user
Authorizations
bearerAuth
Enter your bearer token in the format: Bearer {token}
Type
HTTP (bearer)
Parameters
Path Parameters
userId*
User ID
Type
Requiredstring
Request Body
application/json
{
"name": "string",
"email": "string",
"role": "user"
}
Responses
User updated successfully
application/json
{
"id": "string",
"name": "string",
"email": "string",
"role": "string",
"createdAt": "string",
"updatedAt": "string"
}
Delete user
Get all posts
GET
/posts
Retrieve a list of all posts
Authorizations
bearerAuth
Enter your bearer token in the format: Bearer {token}
Type
HTTP (bearer)
Parameters
Query Parameters
page
Page number
Type
integer
Default
1limit
Number of items per page
Type
integer
Default
10Maximum
100Responses
Successful response
application/json
{
"data": [
{
"id": "string",
"title": "string",
"content": "string",
"authorId": "string",
"published": true,
"createdAt": "string",
"updatedAt": "string"
}
],
"pagination": {
"page": 0,
"limit": 0,
"total": 0,
"totalPages": 0
}
}
Create a post
POST
/posts
Create a new post
Authorizations
bearerAuth
Enter your bearer token in the format: Bearer {token}
Type
HTTP (bearer)
Request Body
application/json
{
"title": "string",
"content": "string",
"published": false
}
Responses
Post created successfully
application/json
{
"id": "string",
"title": "string",
"content": "string",
"authorId": "string",
"published": true,
"createdAt": "string",
"updatedAt": "string"
}