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 /postslists posts of both modes, so checktestwhen 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 | |
|---|---|
| Validation | The same as live: text limits, media rules and platform options are checked per platform. |
| Publishing | Simulated. Each target is published with a platform_post_id like test_4f9a1c2b3d4e and a placeholder URL. |
| Scheduling and queue | Real: scheduled and queued posts are published in simulation at their time. |
| Webhooks | Real, signed and retried. Post events have "test": true. |
| Comments | Listing returns none; creating returns a placeholder ID. |
| Analytics | Zeros for posts and accounts; no follower history. |
| Lookup resources | One placeholder item, e.g. { "id": "test_boards_1", "name": "Test boards" }. |
| Rate limits and idempotency | The 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 toinstagram. You get422 validation_failedwith the issues. - Edits, cancels and publish now: create a post with
draft: trueor ascheduled_atan hour ahead, thenPATCH,DELETEorPOST /publishit. - 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.
