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.1.tar.gz (8.6 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.1-py3-none-any.whl (8.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: relayed-0.2.1.tar.gz
  • Upload date:
  • Size: 8.6 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.1.tar.gz
Algorithm Hash digest
SHA256 550b1b6172a2270d9716e2cfb39dee3c95f5aafd7809bf12419007fc8fc8271a
MD5 30abb64cb6374fc28b2f608bca93a10d
BLAKE2b-256 a1b8163fa3a3d596b5fd124f5ae31640aff6771e37a0c7bad8ee71712059723f

See more details on using hashes here.

Provenance

The following attestation bundles were made for relayed-0.2.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: relayed-0.2.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8b1c5943b34b3e60effe261de728afc0dc764252aaede148c9c357ca2731de97
MD5 7fba98d99596a3a2507b8a347e308ecc
BLAKE2b-256 b0125e3c8ea1c9f5a687292d0fe0100091715512146c03bc6c7f3e5319a51c42

See more details on using hashes here.

Provenance

The following attestation bundles were made for relayed-0.2.1-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