Skip to main content

Onepostly — One API for all social media

PyPI version License

Official Python SDK for the Onepostly API — publish, schedule, and read results
across all supported social platforms with one request shape. See the docs for the current platform list.

Python 3.10+.

Installation

pip install onepostly

Usage

Every resource is its own API class built on a shared Configuration and ApiClient:

import os
from onepostly import ApiClient, Configuration
from onepostly.api.posts_api import PostsApi

configuration = Configuration(
    api_key={"ApiKeyHeader": os.environ["ONEPOSTLY_API_KEY"]},  # sent as the `x-api-key` header
)

with ApiClient(configuration) as api_client:
    posts = PostsApi(api_client)

    response = await posts.create_post(
        create_post_body={
            "text": "Hello from Onepostly",
            "mediaKind": "text",
            "destinations": [{"accountId": "…"}],
        }
    )
    print(response.post.id, response.post.status)  # "queued"

Methods are async and return deserialized pydantic models (PostResponse, ListPosts200Response, …). The …with_http_info() variants return an ApiResponse with status_code, headers, and raw_data alongside data.

Pass plain dicts anywhere a model is expected — pydantic validates and coerces them (alias names like accountId and mediaKind are accepted on both keys and fields).

Scheduling

await posts.create_post(
    create_post_body={
        "text": "Tomorrow morning",
        "scheduledFor": "2026-09-01T09:00:00",  # timezone-naive local time
        "timezone": "Europe/Istanbul",
        "destinations": [{"accountId": "…"}],
    }
)
# 201 Created, status "scheduled"

Media

from onepostly.api.media_api import MediaApi

media_api = MediaApi(api_client)

with open("photo.jpg", "rb") as f:
    upload = await media_api.upload_media(file=f)
media_url = upload.media.url

await posts.create_post(
    create_post_body={
        "text": "With an image",
        "mediaKind": "image",
        "mediaUrls": [media_url],
        "destinations": [{"accountId": "…"}],
    }
)

Analytics

from onepostly.api.analytics_api import AnalyticsApi

analytics_api = AnalyticsApi(api_client)

post_analytics = await analytics_api.get_analytics(post=post_id)
for subject in post_analytics.analytics.subjects or []:
    print(subject.platform, subject.metrics)

timeline = await analytics_api.get_analytics_timeline(
    post=post_id,
    var_from="2026-08-01",  # inclusive, YYYY-MM-DD (`from` is a Python keyword)
    to="2026-08-28",        # inclusive, YYYY-MM-DD
)

Error handling

Every non-2xx response raises an ApiException subclass with the HTTP status, reason, and the raw response body attached. Subclasses map to status families (UnauthorizedException, ForbiddenException, NotFoundException, ConflictException, ServiceException, …):

from onepostly import ApiException

try:
    await posts.create_post(create_post_body={/* … */})
except ApiException as error:
    print(error.status, error.body)
    # 402 {"error": {"code": "INSUFFICIENT_WALLET", "message": "…"}}

API reference

All methods take named keyword arguments.

ConnectionsApi

Method Description
connections.list_connections() List connections
connections.connect_bluesky() Connect Bluesky via App Password
connections.start_o_auth() Start OAuth connect
connections.list_facebook_pages() List Facebook Pages for pending connect
connections.select_facebook_page() Select Facebook Page and finish connect
connections.list_instagram_accounts() List linked Instagram accounts for pending connect
connections.select_instagram_account() Select Instagram account and finish connect
connections.get_connection_stats() Get connection account stats
connections.set_connection_messenger_profile() Set Messenger profile
connections.list_connection_media() List creator media
connections.get_tik_tok_creator_info() Get TikTok creator info
connections.list_pinterest_boards() List Pinterest boards
connections.create_pinterest_board() Create Pinterest board
connections.get_bluesky_settings() Get Bluesky account settings
connections.update_bluesky_settings() Update Bluesky account settings
connections.list_profiles() List profiles
connections.create_profile() Create profile
connections.delete_profile() Delete profile

MediaApi

Method Description
media.get_media_presigned_url() Get a presigned upload URL
media.list_media() List media
media.delete_media() Delete media

PostsApi

Method Description
posts.list_posts() List posts
posts.create_post() Create post.
posts.get_post() Get post
posts.cancel_post() Cancel post
posts.delete_post_destination() Remote-delete destination
posts.sync_external() Sync external posts

AnalyticsApi

Method Description
analytics.get_analytics() Get analytics
analytics.get_analytics_timeline() Get daily analytics timeline

CommentsApi

Method Description
comments.list_comments() List comments
comments.create_comment() Create reply
comments.delete_comment() Delete own comment
comments.hide_comment() Hide or unhide comment
comments.like_comment() Like comment
comments.unlike_comment() Unlike comment
comments.create_private_reply() Send private reply

EngagementApi

Method Description
engagement.list_automations() List inbox automations
engagement.create_automation() Create inbox automation
engagement.delete_automations() Delete inbox automations
engagement.like() Like
engagement.unlike() Unlike
engagement.bookmark() Bookmark
engagement.remove_bookmark() Remove bookmark
engagement.list_retweeters() List retweeters
engagement.retweet() Retweet
engagement.undo_retweet() Undo retweet
engagement.quote() Quote tweet

InboxApi

Method Description
inbox.list_inbox_conversations() List inbox conversations
inbox.create_inbox_conversation() Create inbox conversation
inbox.list_inbox_messages() List inbox messages
inbox.send_inbox_message() Send inbox message

WebhooksApi

Method Description
webhooks.list_webhook_event_types() List webhook event types
webhooks.list_webhooks() List webhooks
webhooks.create_webhook() Create webhook
webhooks.get_webhook_delivery_summary() Get webhook delivery summary
webhooks.get_webhook() Get webhook
webhooks.delete_webhook() Delete webhook
webhooks.update_webhook() Update webhook
webhooks.list_webhook_deliveries() List webhook deliveries
webhooks.test_webhook() Send test event

Representative signatures:

# PostsApi — id/destination-scoped actions take id / destination_id
await posts.create_post(create_post_body=…)            # → PostResponse
await posts.list_posts(limit=None, offset=None)        # → ListPosts200Response
await posts.get_post(id=…)                             # → PostResponse
await posts.cancel_post(id=…)                          # → PostResponse
await posts.delete_post_destination(id=…, destination_id=…)  # remote-delete

# EngagementApi — body-bearing actions take a body model or dict
await engagement.retweet(id=…, destination_id_body={"destinationId": "…"})
await engagement.undo_retweet(id=…, destination_id=…)
await engagement.like(id=…, destination_id_body={"destinationId": "…"})
await engagement.quote(id=…, quote_body={"destinationId": "…", "text": "…"})
await engagement.list_retweeters(id=…, destination_id=None, limit=None, cursor=None)

# CommentsApi
await comments.create_comment(id=…, create_comment_body={"destinationId": "…", "text": "…"})
await comments.list_comments(id=…, destination_id=None, limit=None, cursor=None)
await comments.delete_comment(id=…, comment_id=…, destination_id=…)

# WebhooksApi
await webhooks.create_webhook(create_webhook_body={"name": "…", "url": "…", "events": […]})
await webhooks.update_webhook(id=…, update_webhook_body={…})
await webhooks.rotate_webhook_secret(id=…)
await webhooks.test_webhook(id=…)

License

Apache-2.0

Metadata

Release files for onepostly 0.2.19

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

Source distribution (sdist)

Source distribution for onepostly 0.2.19
File Size Uploaded Provenance
onepostly-0.2.19.tar.gz 95.0 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for onepostly 0.2.19
File Interpreter ABI Platform
onepostly-0.2.19-py3-none-any.whl Python 3 none any Details

Total release size: 361.2 kB

Release files / onepostly-0.2.19.tar.gz

Download URL onepostly-0.2.19.tar.gz
Size 95.0 kB
Tags Source
SHA-256 checksum
How to use checksums
149e9b3140209b4cb81e1a60e0c43f4ece51a73d11e2553678500c8f1a64be47
BLAKE2b-256 checksum
How to use checksums
cad73283738184c431579a9285bab060f2aef8c727249b9c2019a9268499c161
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 16, 2026.

Transparency log

Release files / onepostly-0.2.19-py3-none-any.whl

Download URL onepostly-0.2.19-py3-none-any.whl
Size 266.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9c32be0dbdb2a2724441626d39f98441616207bd1931be3e3bf5d93cbc21f07f
BLAKE2b-256 checksum
How to use checksums
ee96806e091c591904cbb07929326b437bcd9b12477c599927f7f75eb103b46e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 16, 2026.

Transparency log

Security for onepostly 0.2.19

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

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for onepostly-0.2.19.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 16, 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.

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