API Overview
The PropertyBase API provides programmatic access to your workspace data.
Base URL​
All API requests are made to:
https://api.propertybase.ai/v1
Authentication​
The API uses API keys for authentication. Include your key in the Authorization header:
curl -X GET https://api.propertybase.ai/v1/properties \
-H "Authorization: Bearer YOUR_API_KEY"
See Authentication for details on obtaining and managing API keys.
Request Format​
Headers​
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer token or API key |
Content-Type | Yes* | application/json for POST/PUT |
Accept | No | application/json (default) |
X-Workspace-ID | No | Override workspace (multi-tenant) |
Request Body​
For POST and PUT requests, send JSON:
{
"name": "John Smith",
"email": "john@example.com",
"phone": "+1234567890"
}
Response Format​
Success Response​
{
"success": true,
"data": {
"id": "lead_123",
"name": "John Smith",
"email": "john@example.com",
"created_at": "2024-01-15T10:30:00Z"
}
}
List Response​
{
"success": true,
"data": [
{ "id": "lead_123", "name": "John Smith" },
{ "id": "lead_124", "name": "Jane Doe" }
],
"meta": {
"page": 1,
"per_page": 20,
"total": 150,
"total_pages": 8
},
"links": {
"self": "/v1/leads?page=1",
"first": "/v1/leads?page=1",
"next": "/v1/leads?page=2",
"last": "/v1/leads?page=8"
}
}
Error Response​
{
"success": false,
"error": {
"code": "VALIDATION_ERROR",
"message": "Validation failed",
"details": [
{
"field": "email",
"message": "Invalid email format"
}
]
}
}
HTTP Status Codes​
| Code | Meaning |
|---|---|
200 | Success |
201 | Created |
204 | No Content (successful delete) |
400 | Bad Request |
401 | Unauthorized |
403 | Forbidden |
404 | Not Found |
422 | Validation Error |
429 | Rate Limited |
500 | Server Error |
Pagination​
List endpoints support pagination:
GET /v1/leads?page=2&per_page=50
| Parameter | Default | Max |
|---|---|---|
page | 1 | - |
per_page | 20 | 100 |
Filtering​
Filter results using query parameters:
# Filter leads by status
GET /v1/leads?status=new
# Multiple filters
GET /v1/leads?status=new&source=website
# Date range
GET /v1/leads?created_after=2024-01-01&created_before=2024-01-31
Sorting​
Sort results with sort and order:
# Sort by creation date, newest first
GET /v1/leads?sort=created_at&order=desc
# Sort by name, A-Z
GET /v1/leads?sort=name&order=asc
Field Selection​
Request specific fields to reduce payload:
GET /v1/properties?fields=id,name,price,status
Expanding Relations​
Include related data:
# Include property details with units
GET /v1/units?expand=property
# Multiple expansions
GET /v1/leads?expand=agent,property
Rate Limits​
See Rate Limits for details on API usage limits.
Versioning​
The API is versioned via the URL path (/v1/). We maintain backwards compatibility within a major version.
SDKs & Libraries​
Official SDKs: