Skip to main content

Testing & Sandbox

PostEverywhere does not have a separate sandbox environment, but there are several strategies to test your integration safely without publishing live posts.

Dry Run Mode

The Bulk Schedule endpoint supports a dryRun parameter that validates every post in the batch without actually creating or scheduling them.

Request

curl -X POST https://app.posteverywhere.ai/api/v1/posts/bulk \
-H "Authorization: Bearer pe_live_abc123..." \
-H "Content-Type: application/json" \
-d '{
"dryRun": true,
"posts": [
{
"text": "Hello from the API!",
"accountIds": ["acc_123", "acc_456"],
"scheduledAt": "2026-04-15T10:00:00Z"
},
{
"text": "",
"accountIds": ["acc_999"],
"scheduledAt": "2025-01-01T00:00:00Z"
}
]
}'

Response

{
"dryRun": true,
"total": 2,
"valid": 1,
"invalid": 1,
"results": [
{
"index": 0,
"valid": true
},
{
"index": 1,
"valid": false,
"errors": [
{ "code": "validation_error", "message": "Text is required." },
{ "code": "invalid_accounts", "message": "Account acc_999 not found." },
{ "code": "past_schedule_time", "message": "Scheduled time is in the past." }
]
}
]
}

Dry run validates text content, account IDs, media attachments, scheduling times, and platform-specific constraints -- all without creating any posts.

Testing Strategies

1. Use Dry Run for Bulk Validation

Before sending a production batch, run it with dryRun: true first. This catches validation errors (invalid accounts, missing text, past schedule times) without consuming your rate limit budget on failed create requests.

2. Create Dedicated Test Accounts

Connect social accounts that you use exclusively for testing on each platform. For example, create a private X account, a test Instagram business account, and a test LinkedIn page. This way, test posts publish to accounts your audience never sees.

3. Schedule-Then-Delete

Create posts scheduled far in the future (e.g., one year from now), inspect them via the API, then delete them before they publish:

# Schedule a post for next year
curl -X POST https://app.posteverywhere.ai/api/v1/posts \
-H "Authorization: Bearer pe_live_abc123..." \
-H "Content-Type: application/json" \
-d '{
"text": "Test post - will be deleted",
"accountIds": ["acc_123"],
"scheduledAt": "2027-04-15T10:00:00Z"
}'

# Inspect the post
curl https://app.posteverywhere.ai/api/v1/posts/post_abc123 \
-H "Authorization: Bearer pe_live_abc123..."

# Delete before it publishes
curl -X DELETE https://app.posteverywhere.ai/api/v1/posts/post_abc123 \
-H "Authorization: Bearer pe_live_abc123..."

4. Verify Media Before Attaching

Upload media and confirm it processes successfully before using it in posts:

# Upload
curl -X POST https://app.posteverywhere.ai/api/v1/media/upload \
-H "Authorization: Bearer pe_live_abc123..." \
-F "[email protected]"

# Check status (poll until "ready")
curl https://app.posteverywhere.ai/api/v1/media/med_abc123 \
-H "Authorization: Bearer pe_live_abc123..."

# Response when ready:
# { "id": "med_abc123", "status": "ready", "mimeType": "image/jpeg", ... }

Only attach media to posts once the status is ready. See Media Requirements for file size and dimension limits.

Rate Limits Apply to All Calls

Test requests count against your rate limits: 60 requests per minute and 1,000 per hour. Plan your test loops accordingly to avoid hitting rate_limit_exceeded errors.

If you are running automated test suites, add a short delay between requests:

// Simple delay between test API calls
async function testWithDelay(calls, delayMs = 1100) {
for (const call of calls) {
await call();
await new Promise((resolve) => setTimeout(resolve, delayMs));
}
}

See Rate Limits for the full details on limits and headers.

Pinterest Sandbox

Pinterest offers a dedicated sandbox environment for API testing. If you are integrating with Pinterest specifically, you can use the sandbox to test pin creation without publishing to live boards. Contact support at [email protected] if you need Pinterest sandbox access enabled for your account.

Production Readiness Checklist

Before going live, verify each of these:

  • Authentication works. Your API key returns a 200 on GET /accounts.
  • Error handling is implemented. Your code handles 400, 401, 429, and 500 errors distinctly (see Error Handling).
  • Retry logic uses exponential backoff. Retries only fire for 429 and 5xx responses.
  • Rate limits are respected. You are not exceeding 60 requests/minute.
  • Media uploads are validated. You check that media status is ready before attaching to posts.
  • Scheduling times are in the future. All scheduledAt values are at least 5 minutes ahead.
  • Dry run passes. A bulk dry run of your typical payload returns zero errors.
  • Post results are polled. You track publishing results via Get Post Results and handle failures.
  • Scopes are correct. Your API key has the minimum scopes needed (see Scopes).