API Reference Documentation

API Referencev1.0

Users API

API endpoints for managing user accounts and authentication.

Base URL:https://api.example.com/v1
GET/users

Retrieve a paginated list of all users in the system.

Query Parameters

NameTypeDescription
pageintegerPage number for pagination (default: 1)
limitintegerNumber of results per page (default: 20, max: 100)
sortstringSort field (name, email, created_at)
orderstringSort order (asc, desc)

Response

NameTypeDescription
dataUser[]Array of user objects
meta.totalintegerTotal number of users
meta.pageintegerCurrent page number
meta.pagesintegerTotal number of pages

Example

Request
GET /users?page=1&limit=10
Response
{
  "data": [
    {
      "id": "usr_123",
      "name": "John Doe",
      "email": "[email protected]",
      "created_at": "2025-01-15T10:30:00Z"
    }
  ],
  "meta": {
    "total": 150,
    "page": 1,
    "pages": 15
  }
}
POST/users

Create a new user account.

Request Body

NameTypeDescription
namerequiredstringFull name of the user
emailrequiredstringUnique email address
passwordrequiredstringPassword (min 8 characters)
rolestringUser role (user, admin). Defaults to user

Response

NameTypeDescription
idstringUnique user identifier
namestringUser's full name
emailstringUser's email address
created_atstringISO 8601 timestamp

Example

Request
POST /users
Content-Type: application/json

{
  "name": "Jane Smith",
  "email": "[email protected]",
  "password": "securePassword123"
}
Response
{
  "id": "usr_456",
  "name": "Jane Smith",
  "email": "[email protected]",
  "created_at": "2025-01-20T14:22:00Z"
}
DELETE/users/:id

Permanently delete a user account. This action cannot be undone.

Query Parameters

NameTypeDescription
idrequiredstringThe unique identifier of the user to delete

Example

Request
DELETE /users/usr_123
Response
{
  "success": true,
  "message": "User deleted successfully"
}
About this block

API Reference DocumentationPRO

Technical reference with endpoint cards, HTTP method badges, and side-by-side request/response examples. Perfect for API documentation.

More Post blocks

View all Post
PRO

post20

Documentation Getting Started

PRO

post60

Research Paper Summary

PRO

post47

Resource Roundup

Get Pro access