Checklist API¶
Comprehensive API for managing checklists, checklist items, documents, and progress tracking.
Overview¶
Checklist API Features
The ChecklistClient provides complete access to ReZEN's checklist functionality:
- ✅ Checklist Management: Create, retrieve, and update checklists
- 📋 Item Operations: Add, update, delete, and complete checklist items
- 📄 Document Handling: Upload documents and manage versions
- 📊 Progress Tracking: Monitor checklist completion status
- 🔄 Batch Operations: Update multiple checklists efficiently
- 💾 File Downloads: Retrieve document versions
Quick Start¶
from rezen import ChecklistClient
# Initialize client (uses REZEN_API_KEY from environment)
client = ChecklistClient()
# Get a checklist
checklist = client.get_checklist("3fa85f64-5717-4562-b3fc-2c963f66afa6")
# Get checklist item details
item = client.get_checklist_item("4fa85f64-5717-4562-b3fc-2c963f66afa7")
# Mark item as complete
client.complete_checklist_item(item["id"], is_complete=True)
Endpoint Reference¶
Checklist Operations¶
Get Checklist¶
Get checklist for given ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
checklist_id | str | The checklist ID | required |
Returns:
Type | Description |
---|---|
Dict[str, Any] | Dict containing checklist details and items |
Raises:
Type | Description |
---|---|
RezenError | If the API request fails |
Example:
checklist = client.get_checklist("3fa85f64-5717-4562-b3fc-2c963f66afa6")
# Response structure
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"createdAt": 1640995200000,
"name": "Transaction Checklist",
"items": [...],
"approved": False,
"locked": False,
"checklistDefinitionId": "...",
"fileApiVersion": "V1"
}
Create Checklist¶
Create checklist for given checklist definition ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
checklist_definition_id | str | The checklist definition ID | required |
checklist_data | Dict[str, Any] | Checklist creation data including parent info and assignees | required |
Returns:
Type | Description |
---|---|
Dict[str, Any] | Dict containing the API response |
Raises:
Type | Description |
---|---|
RezenError | If the API request fails |
Example:
checklist_data = {
"parentId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"parentType": "TRANSACTION",
"assignees": {
"agent1": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"agent2": "4fa85f64-5717-4562-b3fc-2c963f66afa7"
},
"brokerAgentId": "broker-123",
"ownerAgentId": "owner-123"
}
result = client.create_checklist(
checklist_definition_id="def-123",
checklist_data=checklist_data
)
Get Checklist Progress¶
Get checklists progress for given checklist IDs.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
checklist_ids | List[str] | List of checklist IDs | required |
Returns:
Type | Description |
---|---|
Dict[str, Any] | Dict containing progress information (API returns array in 'data' field) |
Raises:
Type | Description |
---|---|
RezenError | If the API request fails |
Example:
checklist_ids = ["checklist-1", "checklist-2", "checklist-3"]
progress = client.get_checklists_progress(checklist_ids)
# Response structure (list of progress objects)
[
{
"checklistId": "checklist-1",
"itemCount": 10,
"completedCount": 7,
"itemCountIncludingOptionals": 12,
"completedCountIncludingOptionals": 8
},
...
]
Batch Update Checklists¶
Update all checklists with the given IDs.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
batch_items | List[Dict[str, Any]] | List of items with checklistId and patch data | required |
Returns:
Type | Description |
---|---|
Dict[str, Any] | Dict containing the API response |
Raises:
Type | Description |
---|---|
RezenError | If the API request fails |
Example:
batch_items = [
{
"checklistId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"patch": {"locked": True}
},
{
"checklistId": "4fa85f64-5717-4562-b3fc-2c963f66afa7",
"patch": {"approved": True}
}
]
result = client.batch_update_checklists(batch_items)
Checklist Item Operations¶
Get Checklist Item¶
Get checklist item for given ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
checklist_item_id | str | The checklist item ID | required |
Returns:
Type | Description |
---|---|
Dict[str, Any] | Dict containing checklist item details |
Raises:
Type | Description |
---|---|
RezenError | If the API request fails |
Example:
item = client.get_checklist_item("3fa85f64-5717-4562-b3fc-2c963f66afa6")
# Response structure
{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"createdAt": 1640995200000,
"name": "Property Inspection",
"checklistId": "...",
"description": "Complete property inspection",
"position": 1,
"dueDate": "2025-06-09",
"required": True,
"urgent": False,
"complete": False,
"documents": [...],
"labels": [...]
}
Create Checklist Item¶
Create checklist item for given checklist ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
checklist_id | str | The checklist ID | required |
item_data | Dict[str, Any] | Item data including item details | required |
Returns:
Type | Description |
---|---|
Dict[str, Any] | Dict containing the API response |
Raises:
Type | Description |
---|---|
RezenError | If the API request fails |
Example:
item_data = {
"item": {
"name": "Final Walkthrough",
"description": "Conduct final property walkthrough with buyer",
"position": 10,
"dueDate": "2025-06-09",
"required": True,
"urgent": False,
"labels": [
{
"text": "Buyer Required"
}
]
}
}
result = client.create_checklist_item(
checklist_id="checklist-123",
item_data=item_data
)
Update Checklist Item¶
Update checklist item for given checklist item ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
checklist_item_id | str | The checklist item ID | required |
item_data | Dict[str, Any] | Item data including item details | required |
Returns:
Type | Description |
---|---|
Dict[str, Any] | Dict containing the API response |
Raises:
Type | Description |
---|---|
RezenError | If the API request fails |
Example:
update_data = {
"item": {
"id": "item-123",
"name": "Updated Item Name",
"description": "Updated description",
"dueDate": "2025-07-01",
"urgent": True,
"complete": False
}
}
result = client.update_checklist_item(
checklist_item_id="item-123",
item_data=update_data
)
Delete Checklist Item¶
Delete checklist item for given ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
checklist_item_id | str | The checklist item ID | required |
Returns:
Type | Description |
---|---|
Dict[str, Any] | Dict containing deletion status and message |
Raises:
Type | Description |
---|---|
RezenError | If the API request fails |
Example:
result = client.delete_checklist_item("item-123")
# Response
{
"status": True,
"message": "Checklist item deleted successfully"
}
Complete Checklist Item¶
Mark checklist item as complete or incomplete.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
checklist_item_id | str | The checklist item ID | required |
is_complete | bool | Whether to mark as complete (default: True) | True |
Returns:
Type | Description |
---|---|
Dict[str, Any] | Dict containing the API response |
Raises:
Type | Description |
---|---|
RezenError | If the API request fails |
Example:
# Mark as complete
client.complete_checklist_item("item-123", is_complete=True)
# Mark as incomplete
client.complete_checklist_item("item-123", is_complete=False)
Document Operations¶
Get Checklist Document¶
Get document for the given ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document_id | str | The document ID | required |
Returns:
Type | Description |
---|---|
Dict[str, Any] | Dict containing document details including versions |
Raises:
Type | Description |
---|---|
RezenError | If the API request fails |
Example:
document = client.get_checklist_document("doc-123")
# Response structure
{
"id": "doc-123",
"createdAt": 1640995200000,
"name": "Purchase Agreement",
"description": "Signed purchase agreement",
"versions": [
{
"id": "version-1",
"name": "Version 1.0",
"number": 1,
"uploaderId": "user-123",
"path": "documents/purchase-agreement-v1.pdf"
}
],
"currentVersion": {...},
"documentDefinitionId": "..."
}
Update Checklist Document¶
Update current version for the given document ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document_id | str | The document ID | required |
document_data | Dict[str, Any] | Document data including versions and current version | required |
Returns:
Type | Description |
---|---|
Dict[str, Any] | Dict containing the API response |
Raises:
Type | Description |
---|---|
RezenError | If the API request fails |
Example:
document_data = {
"id": "doc-123",
"name": "Updated Purchase Agreement",
"description": "Updated with amendments",
"currentVersion": {
"id": "version-2"
}
}
result = client.update_checklist_document(
document_id="doc-123",
document_data=document_data
)
Delete Checklist Document¶
Delete the given document ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
document_id | str | The document ID | required |
Returns:
Type | Description |
---|---|
Dict[str, Any] | Dict containing the API response |
Raises:
Type | Description |
---|---|
RezenError | If the API request fails |
Example:
Add Document to Checklist Item¶
Add a new document to the given checklist item ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
checklist_item_id | str | The checklist item ID | required |
name | str | Document name | required |
description | str | Document description | required |
uploader_id | str | ID of the user uploading the document | required |
transaction_id | str | Transaction ID | required |
file | Optional[BinaryIO] | File to upload (optional) | None |
Returns:
Type | Description |
---|---|
Dict[str, Any] | Dict containing document details |
Raises:
Type | Description |
---|---|
RezenError | If the API request fails |
Example:
# With file upload
with open("contract.pdf", "rb") as file:
result = client.add_document_to_checklist_item(
checklist_item_id="item-123",
name="Purchase Contract",
description="Signed purchase contract",
uploader_id="user-456",
transaction_id="txn-789",
file=file
)
# Without file (metadata only)
result = client.add_document_to_checklist_item(
checklist_item_id="item-123",
name="External Document",
description="Document stored externally",
uploader_id="user-456",
transaction_id="txn-789"
)
Add Document Version¶
Add a new version for given document ID.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
checklist_document_id | str | The checklist document ID | required |
name | str | Version name | required |
description | str | Version description | required |
uploader_id | str | ID of the user uploading the version | required |
transaction_id | str | Transaction ID | required |
file | Optional[BinaryIO] | File to upload (optional) | None |
Returns:
Type | Description |
---|---|
Dict[str, Any] | Dict containing version details |
Raises:
Type | Description |
---|---|
RezenError | If the API request fails |
Example:
with open("contract-v2.pdf", "rb") as file:
result = client.add_document_version(
checklist_document_id="doc-123",
name="Version 2.0",
description="Updated with amendments",
uploader_id="user-456",
transaction_id="txn-789",
file=file
)
# Response includes new version details
{
"id": "version-2",
"name": "Version 2.0",
"description": "Updated with amendments",
"number": 2,
"uploaderId": "user-456",
"path": "documents/contract-v2.pdf"
}
Download Document Version¶
Get the download URL for a document version.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
version_id | str | The version ID | required |
Returns:
Type | Description |
---|---|
Dict[str, Any] | Dict containing the download URL (response will be processed by base client) |
Raises:
Type | Description |
---|---|
RezenError | If the API request fails |
Example:
result = client.download_document_version("version-123")
# Response contains download URL
{
"downloadUrl": "https://example.com/secure/download/doc.pdf"
}
Usage Examples¶
Complete Checklist Workflow¶
End-to-End Checklist Management
from rezen import ChecklistClient
from rezen.exceptions import NotFoundError, ValidationError
def manage_transaction_checklist(transaction_id: str):
"""Complete checklist workflow for a transaction."""
client = ChecklistClient()
try:
# 1. Create a new checklist
print("Creating checklist...")
checklist_data = {
"parentId": transaction_id,
"parentType": "TRANSACTION",
"assignees": {
"listing_agent": "agent-123",
"buyer_agent": "agent-456"
}
}
checklist_result = client.create_checklist(
checklist_definition_id="standard-purchase",
checklist_data=checklist_data
)
checklist_id = checklist_result["checklistId"]
# 2. Get the checklist details
checklist = client.get_checklist(checklist_id)
print(f"Created checklist: {checklist['name']}")
# 3. Add custom items
custom_item = {
"item": {
"name": "Home Warranty Decision",
"description": "Buyer to decide on home warranty",
"required": False,
"position": 99,
"dueDate": "2025-06-15"
}
}
item_result = client.create_checklist_item(
checklist_id=checklist_id,
item_data=custom_item
)
print(f"Added custom item: {item_result['id']}")
# 4. Process existing items
checklist = client.get_checklist(checklist_id)
for item in checklist["items"]:
if item["required"] and not item["complete"]:
print(f"\nProcessing: {item['name']}")
# Upload document if needed
if "inspection" in item["name"].lower():
upload_inspection_report(client, item["id"], transaction_id)
# Mark as complete
client.complete_checklist_item(item["id"])
print(f"✓ Completed: {item['name']}")
# 5. Check progress
progress = client.get_checklists_progress([checklist_id])
if progress:
prog = progress[0] if isinstance(progress, list) else progress
print(f"\nProgress: {prog['completedCount']}/{prog['itemCount']} items")
# 6. Lock checklist when done
client.batch_update_checklists([
{
"checklistId": checklist_id,
"patch": {"locked": True, "approved": True}
}
])
print("Checklist locked and approved!")
return checklist_id
except NotFoundError as e:
print(f"Resource not found: {e}")
except ValidationError as e:
print(f"Validation error: {e}")
except Exception as e:
print(f"Unexpected error: {e}")
return None
def upload_inspection_report(client, item_id, transaction_id):
"""Upload inspection report to checklist item."""
try:
with open("inspection_report.pdf", "rb") as file:
result = client.add_document_to_checklist_item(
checklist_item_id=item_id,
name="Property Inspection Report",
description="Complete inspection findings",
uploader_id="inspector-001",
transaction_id=transaction_id,
file=file
)
print(f" Uploaded: {result['name']}")
except FileNotFoundError:
print(" ⚠️ Inspection report not found")
Document Version Management¶
Managing Document Versions
def manage_document_versions(doc_id: str):
"""Demonstrate document version management."""
client = ChecklistClient()
# Get current document info
document = client.get_checklist_document(doc_id)
print(f"Document: {document['name']}")
print(f"Current version: {document['currentVersion']['number']}")
# Upload new version
with open("contract-amended.pdf", "rb") as file:
new_version = client.add_document_version(
checklist_document_id=doc_id,
name=f"Version {len(document['versions']) + 1}",
description="Added inspection contingency",
uploader_id="agent-123",
transaction_id="txn-456",
file=file
)
print(f"Uploaded version {new_version['number']}")
# Update document to use new version
client.update_checklist_document(
document_id=doc_id,
document_data={
"currentVersion": {"id": new_version["id"]}
}
)
# Get download URL for specific version
download_info = client.download_document_version(new_version["id"])
print(f"Download URL: {download_info['downloadUrl']}")
Progress Monitoring¶
Monitor Multiple Checklists
def monitor_checklist_progress(checklist_ids: list):
"""Monitor progress across multiple checklists."""
client = ChecklistClient()
# Get progress for all checklists
progress_list = client.get_checklists_progress(checklist_ids)
total_items = 0
total_completed = 0
print("Checklist Progress Report")
print("=" * 50)
for progress in progress_list:
checklist_id = progress["checklistId"]
completed = progress["completedCount"]
total = progress["itemCount"]
percentage = (completed / total * 100) if total > 0 else 0
print(f"\nChecklist: {checklist_id}")
print(f"Progress: {completed}/{total} ({percentage:.1f}%)")
print(f"Optional items: {progress['itemCountIncludingOptionals'] - total}")
total_items += total
total_completed += completed
# Overall summary
overall_percentage = (total_completed / total_items * 100) if total_items > 0 else 0
print(f"\n{'=' * 50}")
print(f"Overall: {total_completed}/{total_items} ({overall_percentage:.1f}%)")
return overall_percentage >= 100
Error Handling¶
Common Errors
The ChecklistClient properly handles various error scenarios:
from rezen import ChecklistClient
from rezen.exceptions import (
NotFoundError,
ValidationError,
AuthenticationError,
ServerError
)
client = ChecklistClient()
try:
checklist = client.get_checklist("invalid-id")
except NotFoundError as e:
print(f"Checklist not found: {e}")
except ValidationError as e:
print(f"Invalid request: {e}")
except AuthenticationError as e:
print(f"Authentication failed: {e}")
except ServerError as e:
print(f"Server error: {e}")
Best Practices¶
Recommended Patterns
- Always handle exceptions - Wrap API calls in try-except blocks
- Check item requirements - Only mark required items as complete when truly done
- Use batch operations - Update multiple checklists in one call when possible
- Version documents - Use the version system for document updates
- Monitor progress - Regularly check completion status
- Validate before locking - Ensure all required items are complete before locking
File Upload Tips
- Always use context managers (
with
statement) for file operations - Provide meaningful names and descriptions for documents
- Include the transaction ID for proper association
- Handle
FileNotFoundError
gracefully
API Reference¶
Base Configuration¶
- Base URL:
https://sherlock.therealbrokerage.com/api/v1
- Authentication: Bearer token (API key)
- Content-Type:
application/json
(except for file uploads)
Rate Limits¶
API Rate Limits
- Standard rate limit: 100 requests per minute
- File upload limit: 10 MB per file
- Batch operations: Maximum 100 items per request
Migration Guide¶
Migrating from Legacy Methods
If you're using the old checklist methods, here's how to migrate:
Old Method | New Method |
---|---|
get_checklist_item(checklist_id, item_id) | get_checklist_item(item_id) |
update_checklist_item(checklist_id, item_id, data) | update_checklist_item(item_id, data) |
mark_checklist_item_complete(checklist_id, item_id) | complete_checklist_item(item_id, True) |
post_document_to_checklist(item_id, data, file) | add_document_to_checklist_item(...) |
delete_checklist_item_document(item_id, doc_id) | delete_checklist_document(doc_id) |
Next Steps¶
-
:material-file-document: Documents API
Deep dive into document management
-
:material-swap-horizontal: Transactions API
Learn about transaction operations
-
Explore other API endpoints