REST API
REST API guide for the 01 SOFTWARE platform
REST API
01 SOFTWARE provides a RESTful API for managing your data.
API Endpoints
Base URL
https://api.01.software/apiAuthentication
For more details on authentication, see the Authentication Guide.
Collection API
All collections provide standard CRUD endpoints.
List / Search
GET /api/{collection-slug}Query Parameters
| Parameter | Type | Description |
|---|---|---|
| limit | number | Items per page (default: 10) |
| page | number | Page number (default: 1) |
| sort | string | Sort field (-fieldName: descending) |
| where | object | Filter conditions (JSON) |
| depth | number | Relationship data inclusion depth (default: 0) |
| select | object | Select fields to return (e.g., select[title]=true) |
Example
# Get all products
curl "https://api.01.software/api/products" \
-H "Authorization: Bearer $TOKEN"
# Filtering and sorting
curl "https://api.01.software/api/products?\
limit=20&\
page=1&\
sort=-createdAt&\
where[status][equals]=published" \
-H "Authorization: Bearer $TOKEN"
# Include relationship data
curl "https://api.01.software/api/posts?depth=2" \
-H "Authorization: Bearer $TOKEN"Response
{
"docs": [
{
"id": "product_id",
"name": "Product Name",
"price": 10000,
"status": "published",
"createdAt": "2026-01-07T10:00:00Z",
"updatedAt": "2026-01-07T10:00:00Z"
}
],
"totalDocs": 100,
"limit": 20,
"totalPages": 5,
"page": 1,
"pagingCounter": 1,
"hasPrevPage": false,
"hasNextPage": true,
"prevPage": null,
"nextPage": 2
}Count
GET /api/{collection-slug}/countReturns the number of documents matching the where filter.
{
"totalDocs": 42
}Get by ID
GET /api/{collection-slug}/{id}Example
curl "https://api.01.software/api/products/product_id" \
-H "Authorization: Bearer $TOKEN"Response
{
"id": "product_id",
"name": "Product Name",
"price": 10000,
"status": "published",
"createdAt": "2026-01-07T10:00:00Z",
"updatedAt": "2026-01-07T10:00:00Z"
}Create
POST /api/{collection-slug}Example
curl -X POST "https://api.01.software/api/products" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "New Product",
"price": 15000,
"status": "draft",
"tenant": "tenant_id"
}'Response
{
"message": "Product created successfully",
"doc": {
"id": "new_product_id",
"name": "New Product",
"price": 15000,
"status": "draft",
"tenant": "tenant_id",
"createdAt": "2026-01-07T11:00:00Z",
"updatedAt": "2026-01-07T11:00:00Z"
}
}Update
PATCH /api/{collection-slug}/{id}Example
curl -X PATCH "https://api.01.software/api/products/product_id" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"price": 12000,
"status": "published"
}'Response
{
"message": "Product updated successfully",
"doc": {
"id": "product_id",
"name": "Product Name",
"price": 12000,
"status": "published",
"updatedAt": "2026-01-07T12:00:00Z"
}
}Delete
DELETE /api/{collection-slug}/{id}Example
curl -X DELETE "https://api.01.software/api/products/product_id" \
-H "Authorization: Bearer $TOKEN"Response
{
"id": "product_id",
"message": "Product deleted successfully"
}Filtering
For more details on filtering, see the Filtering Guide. It also covers the REST API URL format.
File Uploads
Media Upload
POST /api/media
Content-Type: multipart/form-dataExample
curl -X POST "https://api.01.software/api/media" \
-H "Authorization: Bearer $TOKEN" \
-F "file=@/path/to/image.jpg" \
-F "alt=Image description"Response
{
"message": "Media uploaded successfully",
"doc": {
"id": "media_id",
"filename": "image.jpg",
"mimeType": "image/jpeg",
"filesize": 102400,
"width": 1920,
"height": 1080,
"url": "https://cdn.01.software/media/image.jpg",
"createdAt": "2026-01-07T13:00:00Z"
}
}Authentication Endpoints
For more details on authentication endpoints (login, logout, token refresh, etc.), see the Authentication Guide.
Error Responses
Error Format
{
"errors": [
{
"message": "Error message",
"name": "ValidationError",
"data": {
"field": "Additional information"
}
}
]
}Common Error Codes
| Status Code | Description |
|---|---|
| 400 | Bad Request - Invalid request |
| 401 | Unauthorized - Authentication required |
| 403 | Forbidden - Insufficient permissions |
| 404 | Not Found - Resource not found |
| 429 | Too Many Requests - Rate limit exceeded |
| 500 | Internal Server Error - Server error |
SDK Integration
The REST API can be used more easily through the SDK.
import { createBrowserClient } from '@01.software/sdk'
const client = createBrowserClient({
clientKey: process.env.NEXT_PUBLIC_SOFTWARE_CLIENT_KEY
})
// Automatic REST API calls
const { data } = await client.from('products').find({
where: { status: { equals: 'published' } },
limit: 20,
sort: '-createdAt'
})Next Steps
- GraphQL API - Using the GraphQL API
- Authentication - Detailed API authentication guide
- Response Format - Response type reference
- Rate Limiting - Rate limit policies