Skip to main content

Pathfinder v1.4 is here! Now supporting multiple documentation tabs with their own sidebars. Learn more

REST API Endpoints

Caution

Demo Page - This is a demo page to showcase the multi-tab documentation feature. This content is for illustration purposes only.

REST API Endpoints

Our REST API provides endpoints for accessing and manipulating data. All endpoints return data in JSON format.

Base URL

All API requests should be made to the following base URL:

https://api.example.com/v1

Users Endpoints

Get All Users

GET /users

Returns a list of all users. Supports pagination parameters.

Query Parameters:

ParameterTypeDescription
pageintegerPage number (default: 1)
limitintegerNumber of records per page (default: 50, max: 100)
sortstringField to sort by (e.g., “name”, “created_at”)

Response:

{
"data": [
{
"id": "user_123",
"name": "John Doe",
"email": "john@example.com",
"created_at": "2023-01-15T08:30:00Z"
},
// More users...
],
"meta": {
"total": 250,
"page": 1,
"limit": 50
}
}

Get User by ID

GET /users/{id}

Returns a single user by ID.

Response:

{
"data": {
"id": "user_123",
"name": "John Doe",
"email": "john@example.com",
"created_at": "2023-01-15T08:30:00Z",
"profile": {
"bio": "Software developer",
"location": "New York",
"avatar_url": "https://example.com/avatars/john.jpg"
}
}
}

Products Endpoints

Get All Products

GET /products

Returns a list of all products. Supports filtering and pagination.

Query Parameters:

ParameterTypeDescription
categorystringFilter by category
min_pricenumberFilter by minimum price
max_pricenumberFilter by maximum price
pageintegerPage number (default: 1)
limitintegerNumber of records per page (default: 50, max: 100)

Response:

{
"data": [
{
"id": "prod_123",
"name": "Example Product",
"description": "This is an example product",
"price": 49.99,
"category": "electronics"
},
// More products...
],
"meta": {
"total": 350,
"page": 1,
"limit": 50
}
}

Error Handling

All endpoints follow standard HTTP status codes and include detailed error messages when appropriate:

Status CodeDescription
200OK - Request succeeded
400Bad Request - Invalid parameters
401Unauthorized - Authentication required
403Forbidden - Insufficient permissions
404Not Found - Resource doesn’t exist
429Too Many Requests - Rate limit exceeded
500Internal Server Error - Server error occurred

Error responses include a message explaining what went wrong:

{
"error": {
"code": "invalid_parameter",
"message": "The parameter 'email' is not a valid email address",
"request_id": "req_abc123"
}
}