Skip to main content

Python client for Relayed, a webhook delivery service

Project description

Relayed

A Python Client for Relayed, a Webhooks Delivery Service.

Installation

pip install relayed

Quick start

import uuid
from relayed import RelayedClient, RelayedClientError

client = RelayedClient(
    api_key="your-api-key",
    base_url="https://relayed.example.com",
    )

subscription = client.create_subscription(
        destination_url="https://example.com",
        event_types=["invoice.paid", "invoice.unpaid"],
        description="Subscription for a contractor to send webhook whether customer paid the invoice"
    )
try:
    response = client.send_event(
        event_type="invoice.paid",
        payload={"invoice_id": "inv_123", "amount": 4200},
        idempotency_key=str(uuid.uuid4()),  # use a stable value across retries
    )
    print(response)  # {"event_id": "...", "delivery_ids": [...]}
except RelayedClientError as e:
    print(f"Cannot send event: {e}")

Error Handling

All errors raised by the SDK inherit from RelayedError, so you can catch everything with a single except clause, or catch specific subclasses for fine-grained handling.

from relayed import (
    RelayedError,
    RelayedAuthError,
    RelayedNotFoundError,
    RelayedConflictError,
    RelayedClientError,
    RelayedServerError,
)

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

relayed-0.2.0.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

relayed-0.2.0-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

Details for the file relayed-0.2.0.tar.gz.

File metadata

  • Download URL: relayed-0.2.0.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for relayed-0.2.0.tar.gz
Algorithm Hash digest
SHA256 a29f38344e4ddbdeecda98c929368ab75e131c12ae9c3ab4d9250b92d2a0cc74
MD5 a31b45bacbe33f2806a96f254d4781d6
BLAKE2b-256 700a0ef1a72e82c8f99d2b9c0d2a392d7c13605b5f8f81d4b3ded36d23206f55

See more details on using hashes here.

Provenance

The following attestation bundles were made for relayed-0.2.0.tar.gz:

Publisher: publish-to-pypi.yml on JoeCosta7/Relayed

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file relayed-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: relayed-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 8.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for relayed-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d5718868921f3cb2b05d3b9b1298327af5e8a0d2abe71d87dcd9a8e61e0d6188
MD5 4c40a84503a2180b02c681212edb7115
BLAKE2b-256 435ef69825b9d850404298cf126777131d6bd369ef465f323a09838e3842a4b3

See more details on using hashes here.

Provenance

The following attestation bundles were made for relayed-0.2.0-py3-none-any.whl:

Publisher: publish-to-pypi.yml on JoeCosta7/Relayed

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page