---
title: "REST API Endpoints | Tajo"
description: "Documentation for the REST API endpoints"
url: https://tajo.io/docs/endpoints/rest-api/
markdown: https://tajo.io/docs/endpoints/rest-api.md
lang: en-US
author: "Set Noa"
author_url: https://tajo.io/set-noa/
---

# REST API Endpoints

[Set Noa](https://tajo.io/set-noa/)

Caution

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

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

```http
GET /users
```

Returns a list of all users. Supports pagination parameters.

**Query Parameters:**

| Parameter | Type | Description |
| --- | --- | --- |
| page | integer | Page number (default: 1) |
| limit | integer | Number of records per page (default: 50, max: 100) |
| sort | string | Field to sort by (e.g., “name”, “created\_at”) |

**Response:**

```json
{
  "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

```http
GET /users/{id}
```

Returns a single user by ID.

**Response:**

```json
{
  "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

```http
GET /products
```

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

**Query Parameters:**

| Parameter | Type | Description |
| --- | --- | --- |
| category | string | Filter by category |
| min\_price | number | Filter by minimum price |
| max\_price | number | Filter by maximum price |
| page | integer | Page number (default: 1) |
| limit | integer | Number of records per page (default: 50, max: 100) |

**Response:**

```json
{
  "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 Code | Description |
| --- | --- |
| 200 | OK - Request succeeded |
| 400 | Bad Request - Invalid parameters |
| 401 | Unauthorized - Authentication required |
| 403 | Forbidden - Insufficient permissions |
| 404 | Not Found - Resource doesn’t exist |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error - Server error occurred |

Error responses include a message explaining what went wrong:

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