API operational
Getting started

Test mode & sandbox

Exercise the complete publish lifecycle against a simulated sandbox adapter, then switch to live delivery without changing your integration.

3

Endpoint summary

All operations in this resource, with the minimum accepted key scope.

Method & endpointPurposeScope
POST/api/api-keys

Issue a pg_test_ or pg_live_ key

full
POST/api/environments

Create a test or live environment

full
POST/api/profiles/connect

Create a hosted connection, including a sandbox fixture profile

full
01

Test keys run the real lifecycle, minus delivery

A pg_test_ key routes every profile through the simulated sandbox adapter for that request, regardless of which real platform the profile is actually connected to. Validation, job queueing, target status transitions, delivery logs, retries, and webhooks all behave exactly as they do in live mode — only the outbound call to the social network is replaced with a simulated response.
Build CI against test mode
Point automated tests and staging environments at a pg_test_ key so your integration exercises asynchronous delivery, partial failures, and webhook payloads without ever publishing real content.
02

Connect a fixture profile with no real account

Beyond test keys, sandbox is itself a connectable platform. Start a hosted connection with "platform": "sandbox" the same way you would for a credential-based provider — no OAuth app or client secret required — and PostGate creates a fixture profile that always simulates delivery, even under a live key.
Connect a sandbox fixture profilePostGate API
curl -X POST https://postgate.studio/api/profiles/connect \
  -H "Authorization: Bearer $POSTGATE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "platform": "sandbox",
    "profile_group_id": "grp_acme123",
    "return_url": "https://app.example.com/settings/social"
  }'
03

Isolate test traffic with a dedicated environment

Every new organization starts with a Test and a Production environment. Create additional ones for other branded, embedded connection surfaces by setting mode explicitly.
Create a test environmentPostGate API
curl -X POST https://postgate.studio/api/environments \
  -H "Authorization: Bearer $POSTGATE_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Acme Connect (staging)",
    "mode": "test",
    "brand": { "product_name": "Acme Social" }
  }'
04

Promote to live without changing your integration

Swap the pg_test_ key for a pg_live_ key. Request and response shapes stay identical, so no endpoint, payload, or webhook handler needs to change. Profiles connected to real accounts were never touched by test-mode traffic — they start delivering for real the moment a live key addresses them.
Never reuse a live key in development or CI
A pg_live_ key reaches real connected accounts. Keep it out of local environments, test suites, and shared staging deployments.