Python client for the Airtable API providing comprehensive database operations, ORM functionality, enterprise features, and testing utilities
—
Webhook management for real-time notifications when data changes in Airtable bases, enabling event-driven applications and integrations.
Create and manage webhooks to receive notifications about base changes.
def webhooks(self) -> list[object]:
"""
List all webhooks for this base.
Returns:
List of Webhook objects
"""
def add_webhook(self, notify_url: str, spec: dict) -> object:
"""
Create webhook for base.
Parameters:
- notify_url: URL to receive webhook notifications
- spec: Webhook specification dict defining what changes to monitor
Returns:
CreateWebhookResponse with webhook ID and secret for validation
"""
class Webhook:
@property
def id(self) -> str:
"""Webhook ID."""
@property
def are_notifications_enabled(self) -> bool:
"""Whether notifications are currently enabled."""from pyairtable import Api
api = Api('your_token')
base = api.base('base_id')
# Create webhook for table changes
webhook = base.add_webhook(
notify_url='https://myapp.com/webhook/airtable',
spec={
'options': {
'filters': {
'dataTypes': ['tableData'],
'recordChangeScope': 'tblYourTableId'
}
}
}
)
print(f"Webhook created: {webhook.id}")
print(f"Secret: {webhook.secret}") # Use for validating webhook calls
# List existing webhooks
webhooks = base.webhooks()
for webhook in webhooks:
print(f"Webhook {webhook.id}: enabled={webhook.are_notifications_enabled}")Install with Tessl CLI
npx tessl i tessl/pypi-pyairtable