{
  "info": {
    "_postman_id": "socialhub-api-v1",
    "name": "LetsPost API",
    "description": "Unified REST API for scheduling and publishing to 7 social platforms. Get an API key at https://letspost.app/dashboard/api-keys",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "auth": {
    "type": "bearer",
    "bearer": [{ "key": "token", "value": "{{SH_API_KEY}}", "type": "string" }]
  },
  "variable": [
    { "key": "base_url", "value": "https://us-central1-socialhub-750a9.cloudfunctions.net/api/api/v1", "type": "string" },
    { "key": "SH_API_KEY", "value": "sh_live_YOUR_KEY_HERE", "type": "string" }
  ],
  "item": [
    {
      "name": "Auth",
      "item": [
        {
          "name": "Get current user",
          "request": { "method": "GET", "url": { "raw": "{{base_url}}/auth/me", "host": ["{{base_url}}"], "path": ["auth", "me"] } }
        },
        {
          "name": "Get usage stats",
          "request": { "method": "GET", "url": { "raw": "{{base_url}}/auth/usage", "host": ["{{base_url}}"], "path": ["auth", "usage"] } }
        }
      ]
    },
    {
      "name": "Profiles",
      "item": [
        {
          "name": "List profiles",
          "request": { "method": "GET", "url": { "raw": "{{base_url}}/profiles", "host": ["{{base_url}}"], "path": ["profiles"] } }
        },
        {
          "name": "Create profile",
          "request": {
            "method": "POST",
            "url": { "raw": "{{base_url}}/profiles", "host": ["{{base_url}}"], "path": ["profiles"] },
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": { "mode": "raw", "raw": "{\n  \"name\": \"My Brand\",\n  \"imageUrl\": null\n}" }
          }
        },
        {
          "name": "Get profile",
          "request": { "method": "GET", "url": { "raw": "{{base_url}}/profiles/:profileId", "host": ["{{base_url}}"], "path": ["profiles", ":profileId"], "variable": [{ "key": "profileId", "value": "prof_abc123" }] } }
        },
        {
          "name": "Update profile",
          "request": {
            "method": "PATCH",
            "url": { "raw": "{{base_url}}/profiles/:profileId", "host": ["{{base_url}}"], "path": ["profiles", ":profileId"], "variable": [{ "key": "profileId", "value": "prof_abc123" }] },
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": { "mode": "raw", "raw": "{\n  \"name\": \"Updated Brand Name\"\n}" }
          }
        },
        {
          "name": "Delete profile",
          "request": { "method": "DELETE", "url": { "raw": "{{base_url}}/profiles/:profileId", "host": ["{{base_url}}"], "path": ["profiles", ":profileId"], "variable": [{ "key": "profileId", "value": "prof_abc123" }] } }
        }
      ]
    },
    {
      "name": "Posts",
      "item": [
        {
          "name": "List posts",
          "request": {
            "method": "GET",
            "url": {
              "raw": "{{base_url}}/posts?profileId=prof_abc123&status=published&limit=20",
              "host": ["{{base_url}}"],
              "path": ["posts"],
              "query": [
                { "key": "profileId", "value": "prof_abc123" },
                { "key": "status", "value": "published", "description": "draft | scheduled | published | failed" },
                { "key": "limit", "value": "20" }
              ]
            }
          }
        },
        {
          "name": "Create post",
          "request": {
            "method": "POST",
            "url": { "raw": "{{base_url}}/posts", "host": ["{{base_url}}"], "path": ["posts"] },
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": {
              "mode": "raw",
              "raw": "{\n  \"profileId\": \"prof_abc123\",\n  \"caption\": \"New drop 🔥 #launch\",\n  \"platforms\": [\"tiktok\", \"instagram\", \"youtube\"],\n  \"scheduledFor\": \"2026-05-01T10:00:00Z\"\n}"
            }
          }
        },
        {
          "name": "Get post",
          "request": { "method": "GET", "url": { "raw": "{{base_url}}/posts/:postId", "host": ["{{base_url}}"], "path": ["posts", ":postId"], "variable": [{ "key": "postId", "value": "post_abc123" }] } }
        },
        {
          "name": "Update post",
          "request": {
            "method": "PATCH",
            "url": { "raw": "{{base_url}}/posts/:postId", "host": ["{{base_url}}"], "path": ["posts", ":postId"], "variable": [{ "key": "postId", "value": "post_abc123" }] },
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": { "mode": "raw", "raw": "{\n  \"caption\": \"Updated caption\",\n  \"scheduledFor\": \"2026-05-02T10:00:00Z\"\n}" }
          }
        },
        {
          "name": "Delete post",
          "request": { "method": "DELETE", "url": { "raw": "{{base_url}}/posts/:postId", "host": ["{{base_url}}"], "path": ["posts", ":postId"], "variable": [{ "key": "postId", "value": "post_abc123" }] } }
        },
        {
          "name": "Get post metrics",
          "request": { "method": "GET", "url": { "raw": "{{base_url}}/posts/:postId/metrics", "host": ["{{base_url}}"], "path": ["posts", ":postId", "metrics"], "variable": [{ "key": "postId", "value": "post_abc123" }] } }
        }
      ]
    },
    {
      "name": "Connected Accounts",
      "item": [
        {
          "name": "List connections",
          "request": { "method": "GET", "url": { "raw": "{{base_url}}/platform/connections?profileId=prof_abc123", "host": ["{{base_url}}"], "path": ["platform", "connections"], "query": [{ "key": "profileId", "value": "prof_abc123" }] } }
        },
        {
          "name": "Connect platform (OAuth init)",
          "request": { "method": "GET", "url": { "raw": "{{base_url}}/platform/connect/tiktok?profileId=prof_abc123", "host": ["{{base_url}}"], "path": ["platform", "connect", "tiktok"], "query": [{ "key": "profileId", "value": "prof_abc123" }] } }
        },
        {
          "name": "Disconnect account",
          "request": { "method": "DELETE", "url": { "raw": "{{base_url}}/platform/connections/:connectionId", "host": ["{{base_url}}"], "path": ["platform", "connections", ":connectionId"], "variable": [{ "key": "connectionId", "value": "conn_abc123" }] } }
        }
      ]
    },
    {
      "name": "Analytics",
      "item": [
        {
          "name": "Account metrics",
          "request": { "method": "GET", "url": { "raw": "{{base_url}}/analytics/account-metrics?profileId=prof_abc123", "host": ["{{base_url}}"], "path": ["analytics", "account-metrics"], "query": [{ "key": "profileId", "value": "prof_abc123" }] } }
        },
        {
          "name": "Post metrics",
          "request": { "method": "GET", "url": { "raw": "{{base_url}}/analytics/post-metrics?profileId=prof_abc123&limit=20", "host": ["{{base_url}}"], "path": ["analytics", "post-metrics"], "query": [{ "key": "profileId", "value": "prof_abc123" }, { "key": "limit", "value": "20" }] } }
        }
      ]
    },
    {
      "name": "API Keys",
      "item": [
        {
          "name": "List API keys",
          "request": { "method": "GET", "url": { "raw": "{{base_url}}/api-keys", "host": ["{{base_url}}"], "path": ["api-keys"] } }
        },
        {
          "name": "Create API key",
          "request": {
            "method": "POST",
            "url": { "raw": "{{base_url}}/api-keys", "host": ["{{base_url}}"], "path": ["api-keys"] },
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": { "mode": "raw", "raw": "{\n  \"name\": \"Production key\"\n}" }
          }
        },
        {
          "name": "Delete API key",
          "request": { "method": "DELETE", "url": { "raw": "{{base_url}}/api-keys/:keyId", "host": ["{{base_url}}"], "path": ["api-keys", ":keyId"], "variable": [{ "key": "keyId", "value": "key_abc123" }] } }
        }
      ]
    },
    {
      "name": "Webhooks",
      "item": [
        {
          "name": "List webhooks",
          "request": { "method": "GET", "url": { "raw": "{{base_url}}/webhooks", "host": ["{{base_url}}"], "path": ["webhooks"] } }
        },
        {
          "name": "Create webhook",
          "request": {
            "method": "POST",
            "url": { "raw": "{{base_url}}/webhooks", "host": ["{{base_url}}"], "path": ["webhooks"] },
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": { "mode": "raw", "raw": "{\n  \"url\": \"https://your-server.com/webhook\",\n  \"events\": [\"post.published\", \"post.failed\"]\n}" }
          }
        },
        {
          "name": "Delete webhook",
          "request": { "method": "DELETE", "url": { "raw": "{{base_url}}/webhooks/:webhookId", "host": ["{{base_url}}"], "path": ["webhooks", ":webhookId"], "variable": [{ "key": "webhookId", "value": "wh_abc123" }] } }
        }
      ]
    },
    {
      "name": "Support",
      "item": [
        {
          "name": "List tickets",
          "request": { "method": "GET", "url": { "raw": "{{base_url}}/support", "host": ["{{base_url}}"], "path": ["support"] } }
        },
        {
          "name": "Create ticket",
          "request": {
            "method": "POST",
            "url": { "raw": "{{base_url}}/support", "host": ["{{base_url}}"], "path": ["support"] },
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": { "mode": "raw", "raw": "{\n  \"title\": \"Post failed to publish\",\n  \"body\": \"TikTok post failed with error code 400.\",\n  \"category\": \"bug\"\n}" }
          }
        },
        {
          "name": "Get ticket",
          "request": { "method": "GET", "url": { "raw": "{{base_url}}/support/:ticketId", "host": ["{{base_url}}"], "path": ["support", ":ticketId"], "variable": [{ "key": "ticketId", "value": "ticket_abc123" }] } }
        },
        {
          "name": "Reply to ticket",
          "request": {
            "method": "POST",
            "url": { "raw": "{{base_url}}/support/:ticketId/reply", "host": ["{{base_url}}"], "path": ["support", ":ticketId", "reply"], "variable": [{ "key": "ticketId", "value": "ticket_abc123" }] },
            "header": [{ "key": "Content-Type", "value": "application/json" }],
            "body": { "mode": "raw", "raw": "{\n  \"message\": \"Additional context about the issue.\"\n}" }
          }
        }
      ]
    },
    {
      "name": "Billing",
      "item": [
        {
          "name": "Get billing status",
          "request": { "method": "GET", "url": { "raw": "{{base_url}}/billing/status", "host": ["{{base_url}}"], "path": ["billing", "status"] } }
        },
        {
          "name": "List plans",
          "request": { "method": "GET", "url": { "raw": "{{base_url}}/billing/plans", "host": ["{{base_url}}"], "path": ["billing", "plans"] } }
        }
      ]
    },
    {
      "name": "Status",
      "item": [
        {
          "name": "Get components",
          "request": { "method": "GET", "url": { "raw": "{{base_url}}/status/components", "host": ["{{base_url}}"], "path": ["status", "components"] } }
        },
        {
          "name": "Get active incidents",
          "request": { "method": "GET", "url": { "raw": "{{base_url}}/status/incidents/active", "host": ["{{base_url}}"], "path": ["status", "incidents", "active"] } }
        }
      ]
    },
    {
      "name": "Health",
      "item": [
        {
          "name": "Health check",
          "request": { "method": "GET", "url": { "raw": "{{base_url}}/health", "host": ["{{base_url}}"], "path": ["health"] } }
        }
      ]
    }
  ]
}
