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, and publish 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

Delete src/webhooks_provider/resources/example.py and create src/webhooks_provider/resources/endpoint.py with your resource definition:
hooks.example.com stands in for the API of the webhooks service you integrate with; it is not a real service. Substitute your service’s endpoint and request format. The handlers show the shape of an observe-then-act provider and work only against a real service.
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 are observe-then-act. on_observe reports whether the endpoint exists, locating it from the resource identity and config alone; the platform then calls on_create for an absent endpoint and on_update for a present one. on_observe is mandatory: a resource without it fails to register.
  • Handlers await their I/O, here through httpx.AsyncClient, and must be idempotent — repeating a handler with the same input produces 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: Publish and install

Publish the provider version, then install it in your organization:
publish builds the wheel, extracts the resource schemas, and uploads both under <org>/webhooks, where <org> is your organization’s slug. install queues the provider for your organization, and the platform deploys it.

Step 5: 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 observe, create, update, and delete handlers.

Deployment

Publishing, installing, and deploying your provider.

Best Practices

Idempotency patterns, error handling, and production readiness.