Social
Social accounts, publications, comments, replies, and engagement sync
The Social module manages connected social accounts, scheduled publications, synced comments, comment threads, replies, classification, and engagement metrics.
Social accounts use the dedicated Social Accounts API. Store deploy hooks, payments, and managed shipping use their own SDK surfaces.
Social Accounts
GET
/v1/stores/{storeId}/social-accounts/capabilities SDK:
sdk.social.account.getCapabilities() GET
/v1/stores/{storeId}/social-accounts SDK:
sdk.social.account.list() POST
/v1/stores/{storeId}/social-accounts/oauth/connect SDK:
sdk.social.account.connect() DELETE
/v1/stores/{storeId}/social-accounts/{id} SDK:
sdk.social.account.delete() const capabilities = await sdk.social.account.getCapabilities();
const { authorization_url } = await sdk.social.account.connect({
provider_type: "instagram_business",
});
const accounts = await sdk.social.account.list();
Parameters
| Name | Type | Description |
|---|---|---|
provider_type required | facebook_page | instagram_business | youtube_channel | tiktok_account | x_account | Social provider type to connect |
Publications
GET
/v1/stores/{storeId}/social-publications SDK:
sdk.social.publication.find() POST
/v1/stores/{storeId}/social-publications/validate SDK:
sdk.social.publication.validate() POST
/v1/stores/{storeId}/social-publications SDK:
sdk.social.publication.create() POST
/v1/stores/{storeId}/social-publications/{id}/schedule SDK:
sdk.social.publication.schedule() const content = {
type: "instagram_business",
caption: "New work is live",
placement: "reel",
share_to_feed: true,
media_ids: ["media_reel_123"],
};
const validation = await sdk.social.publication.validate({
social_account_id: accounts[0].id,
content,
});
const { publication } = await sdk.social.publication.create({
social_account_id: accounts[0].id,
content,
});
await sdk.social.publication.schedule({
id: publication.id,
scheduled_at: Math.floor(Date.now() / 1000) + 3600,
});
social_account_id is the ID of a connected social account record returned by sdk.social.account.list().
Comments And Threads
POST
/v1/stores/{storeId}/social-publications/engagement/sync SDK:
sdk.social.publication.syncEngagement() GET
/v1/stores/{storeId}/social-publications/{publicationId}/comments SDK:
sdk.social.publication.getComments() GET
/v1/stores/{storeId}/social-publications/{publicationId}/comments/{commentId}/thread SDK:
sdk.social.publication.getCommentThread() POST
/v1/stores/{storeId}/social-publications/{publicationId}/comments/{commentId}/reply SDK:
sdk.social.publication.replyToComment() await sdk.social.publication.syncEngagement({
publication_ids: [publication.id],
max_publications: 1,
max_comment_pages_per_publication: 1,
max_comments_per_publication: 50,
sync_metrics: true,
});
const topLevel = await sdk.social.publication.getComments({
publication_id: publication.id,
limit: 50,
});
const thread = await sdk.social.publication.getCommentThread({
publication_id: publication.id,
comment_id: topLevel.items[0].id,
});
await sdk.social.publication.replyToComment({
publication_id: publication.id,
comment_id: topLevel.items[0].id,
text: "Thanks for reaching out.",
});
Comment sync stores top-level comments by default. Opening a thread fetches the provider thread for that root comment and stores replies with parent IDs so Admin can show the conversation tree.
Classification And Metrics
POST
/v1/stores/{storeId}/social-publications/comments/classify SDK:
sdk.social.publication.classifyComments() GET
/v1/stores/{storeId}/social-publications/{publicationId}/metrics SDK:
sdk.social.publication.getMetrics() await sdk.social.publication.classifyComments({
publication_id: publication.id,
force: false,
limit: 50,
});
const metrics = await sdk.social.publication.getMetrics({
publication_id: publication.id,
});