Skip to main content
In this quickstart, you’ll build a provider that manages webhook endpoints. You’ll define a resource schema, implement lifecycle methods, test locally, and deploy to Pragmatiks.
Time estimate: 60 minutes. Assumes familiarity with Python and the provider model.

What you’ll build

A webhooks provider with a single resource type: endpoint. Users will be able to create webhook endpoints like this:

Step 1: Scaffold the project

This creates the project structure:

Step 2: Define the schema

Replace src/webhooks_provider/resources/example.py with your resource definition:
endpoint.py
Key points:
  • 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_id or delivery_url via field references.
  • Lifecycle methods must be idempotent — calling on_create twice with the same input should produce the same result.

Step 3: Register the resource

Update src/webhooks_provider/resources/__init__.py to export your resource:
__init__.py
Update src/webhooks_provider/__init__.py to register it with the provider:
__init__.py

Step 4: Test locally

Write a test using ProviderHarness. Replace tests/test_example.py:
test_endpoint.py
Run the tests:

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 Pragmatiks resources:
webhook.yaml
The 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.