Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.social-api.ai/llms.txt

Use this file to discover all available pages before exploring further.

Every comment, DM, review, and mention returned by the API has a stable, opaque id field. These IDs are designed to be stored and reused across calls.

Format

sapi_{type}_{32 character payload}
The 32-character payload encodes platform:platformID using a SocialAPI custom base-35 alphabet. It is reversible: given the ID, the API recovers the original platform and the platform’s native ID without a database lookup. The prefix tells you the interaction type:
PrefixType
sapi_cmt_Comment
sapi_rev_Review
sapi_dm_Direct message
sapi_mnt_Mention
Examples:
  • sapi_cmt_GXRM4BNTW7KFYSD3HAEV6QJZ2CLP9U — a comment
  • sapi_rev_GXRM4BNTW7KFYSD3HAEV6QJZ2CLP9U — a review
  • sapi_dm_GXRM4BNTW7KFYSD3HAEV6QJZ2CLP9U — a DM
The payload alphabet uses A-Z and 1-9 (no 0) in a shuffled, non-standard order, so do not assume the payload is base64url or hex.

Why this matters

The prefix lets handlers route requests without a lookup. Each inbox endpoint accepts the appropriate prefix in its path parameter:
  • Comment routes (POST /v1/inbox/comments/:postId, POST /v1/inbox/comments/:postId/:commentId/hide, etc.) accept sapi_cmt_ IDs in :postId and :commentId.
  • Review routes (POST /v1/inbox/reviews/:id/reply) accept sapi_rev_ IDs in :id.
  • Conversation routes (POST /v1/inbox/conversations/:id/messages) accept sapi_dm_ thread IDs in :id.
If you pass an ID with the wrong prefix to a route, the call returns 400 validation.field_invalid.

Stability

IDs are deterministic. The same (type, platform, platform_id) tuple always produces the same SocialAPI ID, so you can safely store IDs in your own database and join against them across calls.

Using IDs

List comments on a connected account, then reply to one using the comment’s id:
# 1. List commented posts for the account
curl "https://api.social-api.ai/v1/inbox/comments" \
  -H "Authorization: Bearer $SOCAPI_KEY"

# 2. Reply to a comment on a given post
curl -X POST \
  "https://api.social-api.ai/v1/inbox/comments/sapi_cmt_GXRM4BNTW7KFYSD3HAEV6QJZ2CLP9U" \
  -H "Authorization: Bearer $SOCAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "account_id": "acc_01HZ9X3Q4R5M6N7P8V2K0W1J",
    "comment_id": "sapi_cmt_GXRM4BNTW7KFYSD3HAEV6QJZ2CLP9U",
    "text": "Thank you!"
  }'
Hide a comment:
curl -X POST \
  "https://api.social-api.ai/v1/inbox/comments/{postId}/sapi_cmt_GXRM4BNTW7KFYSD3HAEV6QJZ2CLP9U/hide" \
  -H "Authorization: Bearer $SOCAPI_KEY" \
  -d '{"account_id": "acc_01HZ9X3Q4R5M6N7P8V2K0W1J"}'
Reply to a review:
curl -X POST \
  "https://api.social-api.ai/v1/inbox/reviews/sapi_rev_GXRM4BNTW7KFYSD3HAEV6QJZ2CLP9U/reply" \
  -H "Authorization: Bearer $SOCAPI_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "account_id": "acc_01HZ9X3Q4R5M6N7P8V2K0W1J",
    "text": "Thanks for the feedback!"
  }'
See the Inbox guide for the full list of routes that take interaction IDs.