Data Types
Date Formats
The API supports two date formats:
| Format | Example | Description |
|---|---|---|
| Jalali (Solar) | 1403-01-15 |
Default format for Iranian users |
| Gregorian | 2024-04-03 |
Configurable in settings |
Error Response Format
All errors are returned in the following format:
{
"message": "Error message"
}
HTTP Status Codes:
| Code | Description |
|---|---|
| 200 | Success |
| 201 | Created |
| 204 | No Content (successful delete) |
| 400 | Bad Request |
| 401 | Unauthenticated |
| 403 | Forbidden |
| 404 | Not Found |
| 422 | Validation Error |
| 429 | Rate Limit Exceeded |
Pagination
All list endpoints use pagination:
Request Parameters:
| Parameter | Type | Default | Description |
|---|---|---|---|
page |
integer | 1 | Page number |
limit |
integer | 20 | Records per page |
Response Structure:
{
"records": [...],
"meta": {
"total": 150,
"total_pages": 8,
"current_page": 1,
"per_page": 20,
"from": 1,
"to": 20
}
}
Record Type in Responses
Most endpoints follow one of two patterns:
List: { "records": [ ... ], "meta": { ... } }
Single: { "record": { ... } } or { "data": { ... } }
Common Fields
Record Fields
| Field | Type | Description |
|---|---|---|
id |
integer | Unique identifier |
created_at |
string | Creation date |
updated_at |
string | Last update |
deleted |
0 or 1 | Deleted or not |
Search Fields
Most list endpoints support the following search parameters:
| Parameter | Type | Description |
|---|---|---|
search |
string | Search term |
status |
string | Filter by status |
sort |
string | Sorting |