PostPost

Get Post

Retrieve details and publishing status of a post group.

Endpoint

GET https://api.postpost.dev/api/v1/get-post/:postGroupId

Headers

HeaderRequiredDescription
x-api-keyYesYour API key
x-postpost-user-idNoManaged user ID (workspace only)
x-postpost-clientNoClient identifier (e.g., "mcp")

Path Parameters

ParameterTypeDescription
postGroupIdstringThe post group ID returned from create-post

Response

{
  "success": true,
  "postGroupId": "507f1f77bcf86cd799439011",
  "posts": [
    {
      "_id": "663a1b2c3d4e5f6a7b8c9d01",
      "platform": "twitter",
      "platformId": "123456789",
      "content": "Excited to share our new product launch! 🚀",
      "status": "published",
      "postedId": "1234567890123456789"
    },
    {
      "_id": "663a1b2c3d4e5f6a7b8c9d02",
      "platform": "linkedin",
      "platformId": "ABC123",
      "content": "Excited to share our new product launch! 🚀",
      "status": "published",
      "postedId": "urn:li:share:7654321"
    }
  ]
}

Note: With .lean(), the error field may be absent (undefined) for non-failed posts if the error subdocument was never populated — it will not necessarily be null. When a post has failed, the error field contains an error object with details about the failure.

Note: For draft and scheduled posts, the postedId field will be absent from the response since the post has not yet been published to the platform. Only published posts include a postedId.

Note: The platformId field returns the raw platform ID (e.g., "123456789"), not the compound format used by list-posts (e.g., "twitter-123456789"). See the list-posts endpoint for details on this difference.

Failed Post Response

When a post fails, the response includes detailed error information:

{
  "success": true,
  "postGroupId": "507f1f77bcf86cd799439011",
  "posts": [
    {
      "_id": "663a1b2c3d4e5f6a7b8c9d03",
      "platform": "threads",
      "platformId": "17841412345678",
      "content": "Check out our new feature!",
      "status": "failed",
      "error": {
        "code": "PLATFORM_AUTH_EXPIRED",
        "message": "Error validating access token",
        "platformStatusCode": 401,
        "platformError": "Invalid OAuth access token",
        "failedAt": "2026-02-22T14:30:00.000Z",
        "retryable": false
      }
    }
  ]
}

Post Status Values

StatusMeaning
draftSaved but not yet scheduled
scheduledWaiting for scheduled time
pendingBeing processed by scheduler
processingCurrently publishing to platform
publishedSuccessfully posted
failedPublishing failed (see error object for details)

Note: The statuses above apply to individual platform posts. The post group itself can also have a status of partially_published, which occurs when some platform posts in the group succeeded while others failed. For example, if a post group targets Twitter, LinkedIn, and Threads, and the Threads post fails while the others succeed, the group status will be partially_published. Query individual posts within the group to determine which platforms succeeded or failed.

Error Codes

When status is failed, the error object contains:

FieldTypeDescription
codestringError classification code (see table below)
messagestringHuman-readable error message
platformStatusCodenumber/undefinedHTTP status code from the platform API (field may be absent rather than explicitly null)
platformErrorstring/nullRaw error message from the platform
failedAtstringTimestamp when the failure occurred
retryablebooleanWhether the error might succeed on retry
Error CodeDescriptionRetryable
PLATFORM_AUTH_EXPIREDAccess token expired or revokedNo
RATE_LIMITEDPlatform rate limit exceededYes
INVALID_CONTENTContent rejected by platform (e.g., too long, banned words)No
CONTENT_TOO_LARGEMedia file exceeds platform limitsNo
PLATFORM_SERVER_ERRORPlatform API returned 5xx errorYes
NETWORK_ERRORCould not reach platform APIYes
TIMEOUT_ERRORRequest timed outYes
UNKNOWN_ERRORUnclassified errorMaybe

Note: The error codes listed above are not exhaustive. The schema does not validate error codes, so additional codes beyond these eight may appear in the response. Always handle unknown codes gracefully.

Examples

JavaScript (fetch)

const postGroupId = '507f1f77bcf86cd799439011';
const response = await fetch(
  `https://api.postpost.dev/api/v1/get-post/${postGroupId}`,
  { headers: { 'x-api-key': 'YOUR_API_KEY' } }
);
const data = await response.json();

for (const post of data.posts) {
  console.log(`${post.platform}: ${post.status}`);
  if (post.postedId) {
    console.log(`  Platform post ID: ${post.postedId}`);
  }
}

Python (requests)

import requests

post_group_id = '507f1f77bcf86cd799439011'
response = requests.get(
    f'https://api.postpost.dev/api/v1/get-post/{post_group_id}',
    headers={'x-api-key': 'YOUR_API_KEY'}
)
data = response.json()

for post in data['posts']:
    print(f"{post['platform']}: {post['status']}")

cURL

curl https://api.postpost.dev/api/v1/get-post/507f1f77bcf86cd799439011 \
  -H "x-api-key: YOUR_API_KEY"

Node.js (axios)

const axios = require('axios');

const { data } = await axios.get(
  `https://api.postpost.dev/api/v1/get-post/${postGroupId}`,
  { headers: { 'x-api-key': 'YOUR_API_KEY' } }
);
// Check if all posts published successfully
const allPublished = data.posts.every(p => p.status === 'published');
console.log(`All published: ${allPublished}`);

Errors

StatusErrorCause
400"Invalid x-postpost-user-id"The x-postpost-user-id header value is not a valid ObjectId format
401"API key is required"Missing x-api-key header
401"Invalid API key"The provided API key is not valid
401"Invalid API key owner"The API key exists but its owner account could not be found
403"API access is not enabled for this account"The account does not have API access enabled
403"MCP access is not enabled for this account"The account does not have MCP access enabled (MCP-only keys)
403"Workspace access is not enabled for this key"The API key does not have workspace/managed-user permissions
403"User is not managed by key"The x-postpost-user-id references a user not managed by this API key
404"Post group not found"Invalid ID or post belongs to another user
500"Failed to fetch post group"Malformed post group ID or internal server error
500"Internal server error"Unexpected server error in middleware

Note: If x-postpost-user-id matches the API key owner, no workspace check is triggered — the header is effectively a no-op in that case.

Note: If the postGroupId is not a valid MongoDB ObjectId format (e.g., too short, contains invalid characters), the server returns a 500 error ("Failed to fetch post group") instead of a 400 validation error. Ensure you pass only valid ObjectId strings received from the create-post or list-posts endpoints.


On this page