Endpoints
Create, configure, and manage REST API endpoints for your application.
Auto-generated Endpoints
DYPAI automatically generates CRUD endpoints for every table in your database:
| Method | Endpoint | Description |
|---|---|---|
GET | /api/v1/{table} | List all records with pagination |
GET | /api/v1/{table}/:id | Get a single record by ID |
POST | /api/v1/{table} | Create a new record |
PUT | /api/v1/{table}/:id | Update an existing record |
DELETE | /api/v1/{table}/:id | Delete a record |
Creating Custom Endpoints
Open API Builder
Navigate to the API Builder section in your project dashboard.
Click New Endpoint
Click the "New Endpoint" button to start creating a custom endpoint.
Configure Endpoint
Set the endpoint path, HTTP method, and description.
Add Logic
Use the Flow Editor to define the endpoint's business logic.
Save and Deploy
Save your endpoint. It's immediately available at your API URL.
Endpoint Configuration
| Option | Description |
|---|---|
| Path | URL path (e.g., /users/profile) |
| Method | HTTP method (GET, POST, PUT, DELETE, PATCH) |
| Description | Documentation for the endpoint |
| Auth Required | Whether authentication is required |
| Rate Limit | Requests per minute limit |
Using Endpoints
Call your endpoints using any HTTP client:
// JavaScript/TypeScript
const response = await fetch('https://your-project.dypai.io/api/v1/users', {
method: 'GET',
headers: {
'Content-Type': 'application/json',
'X-API-KEY': 'your-api-key'
}
});
const users = await response.json();
console.log(users);Creating a Record
// POST request
const response = await fetch('https://your-project.dypai.io/api/v1/posts', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
'X-API-KEY': 'your-api-key',
'Authorization': 'Bearer user-jwt-token'
},
body: JSON.stringify({
title: 'My First Post',
content: 'Hello World!',
published: true
})
});
const newPost = await response.json();Filtering and Pagination
// GET with query parameters
const url = new URL('https://your-project.dypai.io/api/v1/posts');
url.searchParams.set('published', 'true');
url.searchParams.set('limit', '10');
url.searchParams.set('offset', '0');
url.searchParams.set('order', 'created_at.desc');
const response = await fetch(url, {
headers: { 'X-API-KEY': 'your-api-key' }
});
const { data, count } = await response.json();Use query parameters for filtering:
?column=eq.value, ?column=gt.5, ?column=like.*search*Query Parameters
| Parameter | Description | Example |
|---|---|---|
select | Select specific columns | ?select=id,title,author |
limit | Limit results | ?limit=10 |
offset | Skip results | ?offset=20 |
order | Sort results | ?order=created_at.desc |
column=eq.value | Filter by equality | ?status=eq.active |
column=neq.value | Not equal | ?status=neq.deleted |
column=gt.value | Greater than | ?price=gt.100 |
column=like.pattern | Pattern matching | ?title=like.*dypai* |
Testing Endpoints
DYPAI includes a built-in API tester:
- Select an endpoint from the API Builder
- Click "Test" to open the testing panel
- Configure headers and request body
- Click "Send" to execute the request
- View the response in real-time
The API tester automatically includes your API key for testing.
Organizing Endpoints
Group related endpoints for better organization:
- Create folders for different modules (users, posts, orders)
- Use consistent naming conventions
- Add descriptions to document purpose