Skip to main content

RelayWA Python SDK

PyPI Python

Official server-side Python SDK for RelayWA, providing WhatsApp messaging, session management, and webhooks through the existing RelayWA REST API.

Installation

Requires Python 3.9 or newer.

python -m pip install relaywa-sdk

To install a specific version:

python -m pip install relaywa-sdk==0.1.1

Version 0.1.1 will be available only after the release is published on PyPI.

Quick start

Keep your RelayWA session key in a server-side environment variable. Never embed it in browser or mobile application code.

import os
from relaywa import RelayWA

client = RelayWA(os.environ["RELAYWA_SESSION_KEY"])

# Read sessions without changing any WhatsApp connection.
sessions = client.sessions()
print(sessions)

# Sending is a live operation; uncomment only when ready.
# client.send_text("12025550123", "Hello from RelayWA")

The default API base URL is https://relaywa.com/api.

Common operations

# Read a session and its chats.
session = client.session("your-session-id")
chats = client.session_chats("your-session-id")

# Send a message (this affects live WhatsApp state).
# client.send_text("12025550123", "Your order is ready")

# List webhook endpoints.
webhooks = client.webhooks()

Other SDK methods cover media (image, video, audio, document), location, contacts, polls, replies, reactions, session lifecycle, directory resources, and webhook management.

Security and operational safety

  • Keep session keys secret and server-side. Avoid logging credentials or request authorization headers.
  • Use HTTPS for API requests and webhook destinations.
  • Sending messages and changing session state are real operations. Do not automatically retry timed-out sends or mutations: the first request may have succeeded.
  • Run integration tests against a dedicated test session, not a production WhatsApp account.
  • Validate incoming webhook signatures before processing webhook events. Refer to the RelayWA API documentation for the relevant headers and verification requirements.

Error handling

from relaywa import RelayWAError

try:
    sessions = client.sessions()
except RelayWAError as error:
    print(f"RelayWA request failed: {error}")

Resources

License

MIT.

Metadata

Release files for relaywa-sdk 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for relaywa-sdk 0.1.1
File Size Uploaded Provenance Actions
relaywa_sdk-0.1.1.tar.gz 7.3 kB With provenance Details for relaywa_sdk-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for relaywa-sdk 0.1.1
File Interpreter ABI Platform Actions
relaywa_sdk-0.1.1-py3-none-any.whl Python 3 none any Details for relaywa_sdk-0.1.1-py3-none-any.whl

Total release size: 13.7 kB

Release files / relaywa_sdk-0.1.1.tar.gz

Download URL relaywa_sdk-0.1.1.tar.gz
Size 7.3 kB
Tags Source
SHA-256 checksum
How to use checksums
201c545f754d61e2e6d7555b79d36f52bb84d7b65406c5fad2c6381399a25565
BLAKE2b-256 checksum
How to use checksums
e4616dbdc71f0155546861061c98eb4de5d583bbdbeb828cf54e883e1bfa9fc1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Release files / relaywa_sdk-0.1.1-py3-none-any.whl

Download URL relaywa_sdk-0.1.1-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
099e8f0ead274c8f395a0cd0c3e46b1d20c62a639a78f9b3d0c9476ed8d270ec
BLAKE2b-256 checksum
How to use checksums
7d4e7c241c5beb1d4fe3f5d9da31d72ec92e42cd290672af765f1df3ef9899f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

Security for relaywa-sdk 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for relaywa_sdk-0.1.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page