Pogton
Docs Sandbox and testing

Getting started

Sandbox and testing

Use test keys and sandbox accounts to build against the Pogton Connect API without real social accounts. What test mode validates, simulates and sends.

Test mode lets you build and run your integration end to end without connecting a real social account and without posting anything in public.

Test keys

Create a key with Test mode under Dashboard → Connect → API. Test keys start with pk_test_, and every response to them has X-Pogton-Mode: test.

How the two modes relate:

  • Test keys only see and use sandbox accounts. Live keys only see and use real accounts. Mixing them returns 403 mode_mismatch.
  • Posts created with a test key have "test": true. GET /posts lists posts of both modes, so check test when it matters.
  • Users, webhooks, queue schedules and uploads are shared by both modes.

Sandbox accounts

curl -X POST https://pogton.com/api/v1/sandbox/accounts \
  -H "Authorization: Bearer pk_test_..." \
  -H "Content-Type: application/json" \
  -d '{ "user_id": "user_123", "platform": "instagram", "name": "Acme test" }'

Returns 201 with an account object with "test": true, and sends account.connected with "test": true in data. Create as many as you need, on any platform. A live key gets 403 test_mode_only.

Remove them like any account, with DELETE /api/v1/accounts/{id}, or all of a user's at once with DELETE /api/v1/users/{user_id}.

What test mode does

In test mode
ValidationThe same as live: text limits, media rules and platform options are checked per platform.
PublishingSimulated. Each target is published with a platform_post_id like test_4f9a1c2b3d4e and a placeholder URL.
Scheduling and queueReal: scheduled and queued posts are published in simulation at their time.
WebhooksReal, signed and retried. Post events have "test": true.
CommentsListing returns none; creating returns a placeholder ID.
AnalyticsZeros for posts and accounts; no follower history.
Lookup resourcesOne placeholder item, e.g. { "id": "test_boards_1", "name": "Test boards" }.
Rate limits and idempotencyThe same as live.

Webhook endpoints registered with a test key may use http:// URLs, so you can point them at a local tunnel.

Testing failure paths

  • Validation errors: send content that breaks a rule, such as 300 characters to twitter, or no image to instagram. You get 422 validation_failed with the issues.
  • Edits, cancels and publish now: create a post with draft: true or a scheduled_at an hour ahead, then PATCH, DELETE or POST /publish it.
  • Webhook handling: use POST /webhooks/{id}/test, and redeliver real deliveries from the deliveries log.

Sandbox publishing always succeeds, so failed and partially published posts can't be produced in test mode. Build those paths from the post object and webhook payloads documented here.

With the MCP server

A test key works with the MCP server too. The create_sandbox_account tool creates sandbox accounts, so an AI assistant can try posting without touching real accounts.