Keep the API key server-side
Load the PostSider credential from an environment variable in your script, worker, Django service or FastAPI application.
Python + REST API
Python does not need a special integration layer here. Use requests, httpx or your existing HTTP client to talk to PostSider from a script, worker or backend.
Start with a working REST example, or explore the API and product use cases.
How it works
Your Python code owns the trigger and business logic. PostSider keeps the social account connections and publishing state out of your application.
Load the PostSider credential from an environment variable in your script, worker, Django service or FastAPI application.
Call the integrations endpoint and choose the account your Python job should publish to.
Send the content and target integration to the public API, adding a future UTC timestamp when the post should be scheduled.
Keep the returned post ID and read its state later, or consume webhooks when another part of your Python application depends on delivery.
Concrete example
There is no Python-specific SDK, and you do not need one: requests covers the whole flow. Resolve the channel, save the payload and key, create, then read the returned ID. Swap the settings block for another provider's fields from the API reference, and run it from cron, Celery or a scheduled function.
import os, uuid, requests
BASE = "https://api.postsider.com/public/v1"
HEADERS = {"Authorization": os.environ["POSTSIDER_API_KEY"]} # raw key, no "Bearer"
# 1. Resolve the channel ID from the integrations list.
channels = requests.get(f"{BASE}/integrations", headers=HEADERS, timeout=20)
channels.raise_for_status()
x = next(c for c in channels.json() if c["identifier"] == "x" and not c["disabled"])
# 2. Build the payload once and give it a stable idempotency key.
payload = {
"type": "schedule", # draft | schedule | now
"date": "2026-11-16T14:00:00.000Z", # future UTC ISO timestamp
"shortLink": False,
"tags": [],
"posts": [{
"integration": {"id": x["id"]},
"value": [{"content": "Weekly digest is live. Link in the first comment.", "image": []}],
"settings": {"__type": "x", "who_can_reply_post": "everyone"},
}],
}
key = str(uuid.uuid4()) # reuse on a timeout retry, never regenerate
# 3. Create, then read the exact post back. 2xx means accepted, not published.
created = requests.post(
f"{BASE}/posts",
json=payload,
headers={**HEADERS, "Idempotency-Key": key},
timeout=30,
)
created.raise_for_status()
post_id = created.json()[0]["postId"]
post = requests.get(f"{BASE}/posts/{post_id}", headers=HEADERS, timeout=20).json()
print(post["posts"][0]["state"], post["posts"][0]["publishDate"]) # QUEUE = scheduled Related developer guides
FAQ