Skip to main content
This guide walks you from a fresh account to a live post on Instagram and Facebook.

1. Get an API key

Sign in to app.madiad.com, open API Keys, and create one. Keys are shown only once — copy it immediately.
export MADIAD_API_KEY="mdc_live_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
Treat API keys like passwords. Do not commit them to git or expose them in client-side code.

2. Connect a profile

A profile represents a brand, client, or sub-account that you publish on behalf of. Create one and connect the social platforms you want to publish to.
curl -X POST https://api.madiad.com/v1/profiles \
  -H "Authorization: Bearer $MADIAD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "friendly_name": "Acme Coffee" }'
Response:
{
  "id": "prof_01HZX9F2K4M7N6QR8T0V2W4Y6Z",
  "friendly_name": "Acme Coffee",
  "connect_url": "https://connect.madiad.com/o/abc123def456",
  "created_at": "2026-05-31T08:00:00Z"
}
Open connect_url in a browser and sign in to each social platform you want to publish to (Instagram, Facebook, TikTok, etc.). Connections persist until revoked.

3. Publish to multiple platforms

Send a single request — the Hub fans it out.
curl -X POST https://api.madiad.com/v1/posts/photos \
  -H "Authorization: Bearer $MADIAD_API_KEY" \
  -H "Idempotency-Key: launch-2026-05-31-001" \
  -F "profile_id=prof_01HZX9F2K4M7N6QR8T0V2W4Y6Z" \
  -F "platforms[]=instagram" \
  -F "platforms[]=facebook" \
  -F "caption=New blend dropping today" \
  -F "photos[]=@./launch.jpg"
Response:
{
  "id": "post_01HZX9G4P6R8S0T2V4W6X8Y0Z2",
  "status": "published",
  "results": {
    "instagram": { "status": "published", "url": "https://instagram.com/p/abc123" },
    "facebook":  { "status": "published", "url": "https://facebook.com/12345/posts/67890" }
  }
}

4. (Optional) Schedule for later

Replace the immediate publish with a future timestamp.
-F "scheduled_at=2026-06-01T15:00:00Z" \
-F "timezone=Asia/Ho_Chi_Minh"

5. (Optional) Subscribe to webhooks

Get notified when scheduled posts publish or async jobs finish.
curl -X POST https://api.madiad.com/v1/webhooks \
  -H "Authorization: Bearer $MADIAD_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
        "url": "https://example.com/madiad-webhook",
        "events": ["post.published", "post.failed"]
      }'
The Hub signs every callback with HMAC-SHA256. See Webhooks for verification.

Next steps

Profile model

How profiles work across brands and clients.

Per-platform fields

Override captions, thumbnails, and visibility per platform.

Scheduling

Exact times vs. recurring queue slots.

Idempotency

Make safe retries from any client.