Skip to main content

Official OutReply Python SDK — schedule posts, moderate comments, and subscribe to signed webhooks.

Project description

outreply

Official Python SDK for the OutReply Developer API.

pip install outreply

Quick start

import os
from outreply import OutReply

client = OutReply(api_key=os.environ["OUTREPLY_API_KEY"])

# 1. Verify your key
me = client.account.retrieve()
print(f"Signed in as {me['email']}")

# 2. Schedule a post (idempotency-safe — retry freely)
post = client.posts.schedule(
    page_id="65f...",
    message="Launching tomorrow 🚀",
    publish_at="2026-05-01T10:00:00Z",
)

# 3. Subscribe to real-time events
hook = client.webhooks.create(
    url="https://example.com/webhooks/outreply",
    events=["post.published", "post.failed"],
)
print("Store this secret — it's shown only once:", hook["secret"])

Features

  • 🔐 Bearer-token auth. Supports scoped keys and sandbox tokens.
  • 🔁 Automatic Idempotency-Key on every mutating call.
  • 🪝 Built-in webhook signature verifier.
  • ⏱ Exponential-backoff retries that respect Retry-After.
  • 🧯 Typed exceptions mapped 1:1 with the error catalog.
  • 🧭 Full type hints. Works on Python 3.9+.

Resources

Namespace Methods
client.account retrieve()
client.brands list()
client.pages list(brand_id=..., platform=...)
client.posts schedule(), list_scheduled(), retrieve_scheduled(), cancel_scheduled(), list_published()
client.comments list(), reply()
client.media upload(), list(), retrieve(), delete()
client.webhooks list(), retrieve(), create(), delete()

Webhook verification (Flask)

from flask import Flask, request, abort
from outreply import construct_event

app = Flask(__name__)

@app.post("/webhooks/outreply")
def outreply_webhook():
    try:
        event = construct_event(
            payload=request.get_data(),  # raw bytes — NOT request.json
            header=request.headers.get("X-OutReply-Signature"),
            secret=os.environ["OUTREPLY_WEBHOOK_SECRET"],
            timestamp_header=request.headers.get("X-OutReply-Timestamp"),
            tolerance_sec=300,
        )
    except ValueError:
        abort(400)
    print("Received:", event["type"], event["data"])
    return "", 200

The verifier is dual-signature aware — it accepts comma-separated signatures so your receiver keeps accepting traffic during a 24-hour secret-rotation grace window.

Error handling

from outreply import (
    OutReply,
    OutReplyRateLimitError,
    OutReplyValidationError,
    OutReplyQuotaError,
)

try:
    client.posts.schedule(page_id="...", message="...", publish_at="...")
except OutReplyValidationError as err:
    print("Bad input:", err.details)
except OutReplyRateLimitError as err:
    print(f"Slow down — retry in {err.retry_after_sec}s")
except OutReplyQuotaError:
    print("Daily quota exceeded. Upgrade your plan.")

Configuration

client = OutReply(
    api_key=os.environ["OUTREPLY_API_KEY"],
    base_url="https://api.outreply.com/api/v1",
    timeout=30.0,
    max_retries=2,              # 3 attempts total
    default_headers={"X-Tenant": "acme-co"},
)

License

MIT © OutReply

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

outreply-1.0.0.tar.gz (8.9 kB view details)

Uploaded Source

Built Distribution

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

outreply-1.0.0-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file outreply-1.0.0.tar.gz.

File metadata

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

File hashes

Hashes for outreply-1.0.0.tar.gz
Algorithm Hash digest
SHA256 c6b8e87f6b8051c780b560f8e6098952117c89402e4db188ad53aa45856ea9ee
MD5 441eef77b26b85e8ed5b103e61fdeeb2
BLAKE2b-256 1e45ad168c9134ca88b21c6c511336894070ddd28e1ab295bc2ef112a28fbe65

See more details on using hashes here.

Provenance

The following attestation bundles were made for outreply-1.0.0.tar.gz:

Publisher: release.yml on PlayPalsStudio/outreply-python

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

File details

Details for the file outreply-1.0.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for outreply-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e793b9785de6f55645dfc236334a2946359928687810302588423e54040ba1cb
MD5 b6eee5e4147fbfd787137cbc8f03ebcc
BLAKE2b-256 bb9feebb7eebabe3fbc4faaac898728d3a0dc75e77467a53527d6172bca8d49c

See more details on using hashes here.

Provenance

The following attestation bundles were made for outreply-1.0.0-py3-none-any.whl:

Publisher: release.yml on PlayPalsStudio/outreply-python

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