Official Python SDK for SchedulifyX API - Social media scheduling made easy
Project description
schedulifyx
Official Python SDK for SchedulifyX API - Social media scheduling made easy.
Installation
pip install schedulifyx
Quick Start
from schedulifyx import SchedulifyX
client = SchedulifyX('sk_live_YOUR_API_KEY')
# List all posts
posts = client.posts.list()
print(posts['data'])
# Create a scheduled post
post = client.posts.create(
content='Hello from the SDK! 🚀',
platforms=[{'platform': 'twitter', 'accountId': 'acc_123'}],
scheduled_for='2024-12-20T10:00:00Z'
)
# Publish immediately
client.posts.publish(post['data']['id'])
Configuration
from schedulifyx import SchedulifyX
# Simple initialization
client = SchedulifyX('sk_live_YOUR_API_KEY')
# With options
client = SchedulifyX(
api_key='sk_live_YOUR_API_KEY',
base_url='https://api.schedulifyx.com', # optional, default
timeout=30 # optional, in seconds, default 30
)
API Reference
Posts
# List posts with filters
posts = client.posts.list(
status='scheduled',
account_id='acc_123',
limit=20,
offset=0
)
# Get single post
post = client.posts.get('post_123')
# Create post
new_post = client.posts.create(
content='Hello world!',
platforms=[
{'platform': 'twitter', 'accountId': 'acc_123'},
{'platform': 'instagram', 'accountId': 'acc_456'}
],
scheduled_for='2024-12-20T10:00:00Z',
media_urls=['https://example.com/image.jpg']
)
# Update post
client.posts.update('post_123', content='Updated content', scheduled_for='2024-12-21T10:00:00Z')
# Delete post
client.posts.delete('post_123')
# Publish immediately
client.posts.publish('post_123')
Accounts
# List all connected accounts
accounts = client.accounts.list()
# Filter by platform
instagram_accounts = client.accounts.list(platform='instagram')
# Get single account
account = client.accounts.get('acc_123')
# Get Pinterest boards
boards = client.accounts.get_pinterest_boards('acc_pinterest_123')
Profiles
# List publishing profiles
profiles = client.profiles.list()
# Create a profile
profile = client.profiles.create(
name='Morning Posts',
description='Profile for morning content',
color='#3B82F6'
)
# Update a profile
client.profiles.update('profile_123', name='Updated Name')
# Delete a profile
client.profiles.delete('profile_123')
Analytics
# Get overview
overview = client.analytics.overview()
# Get account-specific analytics
account_analytics = client.analytics.for_account('acc_123', days=30)
# Get all analytics
all_analytics = client.analytics.list(
start_date='2024-01-01',
end_date='2024-12-31'
)
Queue
# Get queue schedule
queue = client.queue.get_slots('acc_123')
# Set queue schedule
client.queue.set_slots(
account_id='acc_123',
timezone='America/New_York',
slots=[
{'dayOfWeek': 1, 'time': '09:00'},
{'dayOfWeek': 1, 'time': '15:00'},
{'dayOfWeek': 3, 'time': '12:00'}
],
is_active=True
)
# Get next available slot
next_slot = client.queue.get_next_slot('acc_123')
# Preview upcoming slots
preview = client.queue.preview('acc_123', count=10)
# Get all queue schedules
all_queues = client.queue.get_all()
# Delete queue schedule
client.queue.delete_slots('acc_123')
Webhooks
# Create a webhook
webhook = client.webhooks.create(
name='My Webhook',
url='https://your-server.com/webhooks',
events=['post.published', 'post.failed']
)
# List webhooks
webhooks = client.webhooks.list()
# Update a webhook
client.webhooks.update('wh_123', events=['post.published'], is_active=False)
# Rotate secret
rotated = client.webhooks.rotate_secret('wh_123')
# Test a webhook
client.webhooks.test('wh_123', event_type='post.published')
# Get event history
events = client.webhooks.get_events('wh_123')
# Get available event types
types = client.webhooks.get_event_types()
# Delete a webhook
client.webhooks.delete('wh_123')
Comments
comments = client.comments.list(sentiment='positive', limit=20)
comment = client.comments.get('comment_123')
replies = client.comments.get_replies('comment_123')
client.comments.reply('comment_123', message='Thanks!')
stats = client.comments.stats()
Inbox
conversations = client.inbox.list(status='open', has_unread=True)
messages = client.inbox.get_messages('conv_123')
client.inbox.reply('conv_123', message='Thanks for reaching out!')
inbox_stats = client.inbox.stats()
Mentions
mentions = client.mentions.list(platform='instagram', status='unread')
mention_stats = client.mentions.stats()
X/Twitter BYOK
config = client.x_twitter.get_config()
client.x_twitter.set_credentials(
api_key='...', api_secret='...',
access_token='...', access_token_secret='...'
)
client.x_twitter.switch_mode(account_id='acc_123', mode='byok')
Usage
usage = client.usage()
print(f"{usage['data']['requestsToday']}/{usage['data']['dailyLimit']} daily requests used")
Multi-Tenant
# Create a tenant
tenant = client.tenants.create(
external_id='user_123',
email='user@example.com',
name='John Doe'
)
# Get OAuth URL for tenant
response = client.tenants.get_connect_url(tenant['data']['id'], 'instagram')
# List tenant's accounts
accounts = client.tenants.list_accounts(tenant['data']['id'])
# Connect Bluesky for tenant
client.tenants.connect_bluesky(
tenant['data']['id'],
identifier='user.bsky.social',
app_password='xxxx-xxxx-xxxx-xxxx'
)
# Disconnect account
client.tenants.disconnect_account(tenant['data']['id'], 'acc_123')
Error Handling
from schedulifyx import SchedulifyX, SchedulifyXError
client = SchedulifyX('sk_live_YOUR_API_KEY')
try:
client.posts.create(
content='Test',
platforms=[{'platform': 'twitter', 'accountId': 'acc_123'}]
)
except SchedulifyXError as e:
print(f'API Error: {e.code} - {e.message}')
print(f'Status: {e.status}')
print(f'Details: {e.details}')
Type Hints
The SDK includes type hints and dataclasses:
from schedulifyx import (
SchedulifyX,
SchedulifyXError,
Post,
Account,
Profile,
Analytics,
AnalyticsOverview,
Usage,
Tenant,
QueueSlot,
QueueSchedule,
Webhook,
Comment,
CommentStats,
Conversation,
InboxMessage,
InboxStats,
Mention,
MentionStats,
PaginatedResponse,
)
License
MIT
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file schedulifyx-1.2.0.tar.gz.
File metadata
- Download URL: schedulifyx-1.2.0.tar.gz
- Upload date:
- Size: 11.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d44ce6123a7ae369a949d5fad06b077dfd519354ddc732cd2b42a7fcd925b345
|
|
| MD5 |
b16f1ab2afcc2cd6922315cc5aa144d9
|
|
| BLAKE2b-256 |
6396ccad84744304471ae41e716c2e6c77848451fcb0d33d73634923faee3f93
|
Provenance
The following attestation bundles were made for schedulifyx-1.2.0.tar.gz:
Publisher:
publish.yml on Eh-Mr-SK/schedulifyx-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
schedulifyx-1.2.0.tar.gz -
Subject digest:
d44ce6123a7ae369a949d5fad06b077dfd519354ddc732cd2b42a7fcd925b345 - Sigstore transparency entry: 988444231
- Sigstore integration time:
-
Permalink:
Eh-Mr-SK/schedulifyx-sdk-python@320407c5ad2762f06d61a623359b46a9c7b78233 -
Branch / Tag:
refs/tags/v1.2.0 - Owner: https://github.com/Eh-Mr-SK
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@320407c5ad2762f06d61a623359b46a9c7b78233 -
Trigger Event:
release
-
Statement type:
File details
Details for the file schedulifyx-1.2.0-py3-none-any.whl.
File metadata
- Download URL: schedulifyx-1.2.0-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e57dca27bad65f1ba4a98d07df052eceb49b76361ea162a5e18ffb662c26cb68
|
|
| MD5 |
d222e2b3cf66250dca598931c6b6ad43
|
|
| BLAKE2b-256 |
f55c58d1e6b9ca39b9b174fc71a3478a0aa385cc4304451cce72fd3f82d1472f
|
Provenance
The following attestation bundles were made for schedulifyx-1.2.0-py3-none-any.whl:
Publisher:
publish.yml on Eh-Mr-SK/schedulifyx-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
schedulifyx-1.2.0-py3-none-any.whl -
Subject digest:
e57dca27bad65f1ba4a98d07df052eceb49b76361ea162a5e18ffb662c26cb68 - Sigstore transparency entry: 988444355
- Sigstore integration time:
-
Permalink:
Eh-Mr-SK/schedulifyx-sdk-python@320407c5ad2762f06d61a623359b46a9c7b78233 -
Branch / Tag:
refs/tags/v1.2.0 - Owner: https://github.com/Eh-Mr-SK
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@320407c5ad2762f06d61a623359b46a9c7b78233 -
Trigger Event:
release
-
Statement type: