Skip to main content

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​

HeaderRequiredDescription
AuthorizationYesBearer token or API key
Content-TypeYes*application/json for POST/PUT
AcceptNoapplication/json (default)
X-Workspace-IDNoOverride 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​

CodeMeaning
200Success
201Created
204No Content (successful delete)
400Bad Request
401Unauthorized
403Forbidden
404Not Found
422Validation Error
429Rate Limited
500Server Error

Pagination​

List endpoints support pagination:

GET /v1/leads?page=2&per_page=50
ParameterDefaultMax
page1-
per_page20100

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:

Support​