Time estimate: 60 minutes. Assumes familiarity with Python and the provider model.
What you’ll build
Awebhooks provider with a single resource type: endpoint. Users will be able to create webhook endpoints like this:
Step 1: Scaffold the project
Step 2: Define the schema
Replacesrc/webhooks_provider/resources/example.py with your resource definition:
endpoint.py
- Config defines what users provide.
Field[str]means a field that accepts either a direct value or a field reference from another resource. - Outputs defines what this resource exposes. Other resources can reference
endpoint_idordelivery_urlvia field references. - Lifecycle methods must be idempotent — calling
on_createtwice with the same input should produce the same result.
Step 3: Register the resource
Updatesrc/webhooks_provider/resources/__init__.py to export your resource:
__init__.py
src/webhooks_provider/__init__.py to register it with the provider:
__init__.py
Step 4: Test locally
Write a test usingProviderHarness. Replace tests/test_example.py:
test_endpoint.py
Step 5: Deploy
Sync your resource schemas with the platform, then build and deploy:Step 6: Use it
Now users can create webhook endpoints as pragma-os resources:webhook.yaml
secret field uses a field reference — it pulls the value from a pragma/secret resource instead of hardcoding it. Other resources can reference this webhook’s outputs:
Deep dive
The Building Providers guide covers everything in detail:Getting Started
Full walkthrough of building a provider from scratch.
Config and Outputs
Schema design with validation, dependencies, and field references.
Lifecycle Methods
Implementing idempotent create, update, and delete handlers.
Testing
Testing with ProviderHarness and mocking external services.
Deployment
Building, pushing, and deploying your provider.
Best Practices
Idempotency patterns, error handling, and production readiness.