{
  "info": {
    "name": "dopost API v1",
    "description": "Public API for publishing social media posts, managing recurring schedules, and reading analytics from external tools.",
    "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
  },
  "variable": [
    {
      "key": "BASE_URL",
      "value": "https://dopost.co",
      "type": "string"
    },
    {
      "key": "API_KEY",
      "value": "",
      "type": "secret"
    },
    {
      "key": "jobId",
      "value": "",
      "type": "string"
    },
    {
      "key": "accountId",
      "value": "REPLACE_WITH_ACCOUNT_ID",
      "type": "string"
    },
    {
      "key": "communityId",
      "value": "REPLACE_WITH_X_COMMUNITY_ID",
      "type": "string"
    },
    {
      "key": "recurringPostId",
      "value": "",
      "type": "string"
    },
    {
      "key": "GOOGLE_BUSINESS_ACCOUNT_ID",
      "value": "replace-with-dopost-location-account-id",
      "type": "string"
    }
  ],
  "auth": {
    "type": "apikey",
    "apikey": [
      {
        "key": "key",
        "value": "x-api-key",
        "type": "string"
      },
      {
        "key": "value",
        "value": "{{API_KEY}}",
        "type": "string"
      },
      {
        "key": "in",
        "value": "header",
        "type": "string"
      }
    ]
  },
  "item": [
    {
      "name": "List Accounts",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{BASE_URL}}/api/v1/social/accounts",
          "host": ["{{BASE_URL}}"],
          "path": ["api", "v1", "social", "accounts"]
        },
        "description": "Returns all connected social accounts for your workspace."
      },
      "response": []
    },
    {
      "name": "List Saved X Communities",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{BASE_URL}}/api/v1/social/accounts/{{accountId}}/x-communities",
          "host": ["{{BASE_URL}}"],
          "path": [
            "api",
            "v1",
            "social",
            "accounts",
            "{{accountId}}",
            "x-communities"
          ]
        },
        "description": "List the Communities saved for a connected X account. Use a returned communityId when publishing."
      },
      "response": []
    },
    {
      "name": "Add Saved X Community",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"community\": \"https://x.com/i/communities/{{communityId}}\"\n}"
        },
        "url": {
          "raw": "{{BASE_URL}}/api/v1/social/accounts/{{accountId}}/x-communities",
          "host": ["{{BASE_URL}}"],
          "path": [
            "api",
            "v1",
            "social",
            "accounts",
            "{{accountId}}",
            "x-communities"
          ]
        },
        "description": "Validate and save an X Community. Repeating the request does not create a duplicate."
      },
      "response": []
    },
    {
      "name": "Remove Saved X Community",
      "request": {
        "method": "DELETE",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"communityId\": \"{{communityId}}\"\n}"
        },
        "url": {
          "raw": "{{BASE_URL}}/api/v1/social/accounts/{{accountId}}/x-communities",
          "host": ["{{BASE_URL}}"],
          "path": [
            "api",
            "v1",
            "social",
            "accounts",
            "{{accountId}}",
            "x-communities"
          ]
        },
        "description": "Remove one saved X Community. The API also accepts communityName when the saved name is unique."
      },
      "response": []
    },
    {
      "name": "Publish Post",
      "event": [
        {
          "listen": "test",
          "script": {
            "exec": [
              "const res = pm.response.json();",
              "if (res.jobId) {",
              "  pm.collectionVariables.set('jobId', res.jobId);",
              "  console.log('Saved jobId:', res.jobId);",
              "}"
            ],
            "type": "text/javascript"
          }
        }
      ],
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"accountId\": \"REPLACE_WITH_ACCOUNT_ID\",\n  \"text\": \"Hello from the dopost API!\",\n  \"media\": [],\n  \"publishAt\": null\n}"
        },
        "url": {
          "raw": "{{BASE_URL}}/api/v1/post/publish",
          "host": ["{{BASE_URL}}"],
          "path": ["api", "v1", "post", "publish"]
        },
        "description": "Publish, schedule, reply to a post, or create a thread.\n\n- `publishAt: null` → publish immediately\n- `publishAt: \"2025-12-25T12:00:00Z\"` → schedule for later\n- `replyTo` → external X or Threads post ID\n- `thread` → ordered follow-up posts for X, Threads, or Mastodon"
      },
      "response": []
    },
    {
      "name": "Publish to X Community",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"accountId\": \"{{accountId}}\",\n  \"text\": \"Community update from dopost\",\n  \"platformOptions\": {\n    \"communityId\": \"{{communityId}}\",\n    \"shareWithFollowers\": false\n  }\n}"
        },
        "url": {
          "raw": "{{BASE_URL}}/api/v1/post/publish",
          "host": ["{{BASE_URL}}"],
          "path": ["api", "v1", "post", "publish"]
        },
        "description": "Publish to a saved X Community. Find communityId with List Saved X Communities first. shareWithFollowers defaults to true when omitted."
      },
      "response": []
    },
    {
      "name": "Publish X Thread",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"accountId\": \"REPLACE_WITH_X_ACCOUNT_ID\",\n  \"text\": \"First post in the thread\",\n  \"thread\": [\n    { \"text\": \"Second post\" },\n    { \"text\": \"Third post\", \"media\": [\"PUBLIC_MEDIA_URL\"] }\n  ]\n}"
        },
        "url": {
          "raw": "{{BASE_URL}}/api/v1/post/publish",
          "host": ["{{BASE_URL}}"],
          "path": ["api", "v1", "post", "publish"]
        },
        "description": "Create a reply chain in one operation. Use `thread` on X, Threads, or Mastodon. Add `replyTo` with an external platform post ID to make the first item reply to an existing X or Threads post."
      },
      "response": []
    },
    {
      "name": "Create Recurring Post",
      "event": [
        {
          "listen": "test",
          "script": {
            "exec": [
              "const res = pm.response.json();",
              "if (res.recurringPostId) pm.collectionVariables.set('recurringPostId', res.recurringPostId);"
            ],
            "type": "text/javascript"
          }
        }
      ],
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"accountId\": \"REPLACE_WITH_ACCOUNT_ID\",\n  \"text\": \"A useful weekly update from dopost\",\n  \"startsAt\": \"2027-01-15T10:00:00Z\",\n  \"timezone\": \"Europe/Madrid\",\n  \"recurrence\": {\n    \"frequency\": \"WEEKLY\",\n    \"interval\": 1,\n    \"weekdays\": [5],\n    \"endType\": \"AFTER_OCCURRENCES\",\n    \"occurrenceCount\": 8\n  }\n}"
        },
        "url": {
          "raw": "{{BASE_URL}}/api/v1/recurring-post",
          "host": ["{{BASE_URL}}"],
          "path": ["api", "v1", "recurring-post"]
        },
        "description": "Create a daily, weekly, or monthly recurring post series."
      },
      "response": []
    },
    {
      "name": "List Recurring Posts",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{BASE_URL}}/api/v1/recurring-post?status=ACTIVE",
          "host": ["{{BASE_URL}}"],
          "path": ["api", "v1", "recurring-post"],
          "query": [
            {
              "key": "status",
              "value": "ACTIVE"
            }
          ]
        },
        "description": "List recurring series with an optional lifecycle status filter."
      },
      "response": []
    },
    {
      "name": "Update Recurring Post",
      "request": {
        "method": "PATCH",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "body": {
          "mode": "raw",
          "raw": "{\n  \"startsAt\": \"2027-01-22T10:00:00Z\",\n  \"text\": \"Updated weekly copy\",\n  \"recurrence\": { \"interval\": 2 }\n}"
        },
        "url": {
          "raw": "{{BASE_URL}}/api/v1/recurring-post/{{recurringPostId}}",
          "host": ["{{BASE_URL}}"],
          "path": ["api", "v1", "recurring-post", "{{recurringPostId}}"]
        },
        "description": "Update the next occurrence, future content, or recurrence rules."
      },
      "response": []
    },
    {
      "name": "Analytics Overview",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{BASE_URL}}/api/v1/analytics/overview?days=30&comparison=previous",
          "host": ["{{BASE_URL}}"],
          "path": ["api", "v1", "analytics", "overview"],
          "query": [
            {
              "key": "days",
              "value": "30"
            },
            {
              "key": "comparison",
              "value": "previous"
            }
          ]
        },
        "description": "Read canonical KPIs, rankings, comparisons, coverage, and freshness. Requires analytics:read."
      },
      "response": []
    },
    {
      "name": "Post Performance",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{BASE_URL}}/api/v1/analytics/posts?days=30&sortBy=overall&limit=20",
          "host": ["{{BASE_URL}}"],
          "path": ["api", "v1", "analytics", "posts"],
          "query": [
            {
              "key": "days",
              "value": "30"
            },
            {
              "key": "sortBy",
              "value": "overall"
            },
            {
              "key": "limit",
              "value": "20"
            }
          ]
        },
        "description": "List analyzed posts published through dopost."
      },
      "response": []
    },
    {
      "name": "Content Insights",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{BASE_URL}}/api/v1/analytics/insights?days=90",
          "host": ["{{BASE_URL}}"],
          "path": ["api", "v1", "analytics", "insights"],
          "query": [
            {
              "key": "days",
              "value": "90"
            }
          ]
        },
        "description": "Read Best Time, Best Day, Format Opportunity, and Platform Pulse."
      },
      "response": []
    },
    {
      "name": "Audience Analytics",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{BASE_URL}}/api/v1/analytics/audience?accountId={{accountId}}&metric=followerDemographics&dimension=country",
          "host": ["{{BASE_URL}}"],
          "path": ["api", "v1", "analytics", "audience"],
          "query": [
            {
              "key": "accountId",
              "value": "{{accountId}}"
            },
            {
              "key": "metric",
              "value": "followerDemographics"
            },
            {
              "key": "dimension",
              "value": "country"
            }
          ]
        },
        "description": "Read available aggregated audience dimensions for one account."
      },
      "response": []
    },
    {
      "name": "Platform Limits",
      "request": {
        "method": "GET",
        "header": [],
        "url": {
          "raw": "{{BASE_URL}}/api/v1/social/limits/instagram",
          "host": ["{{BASE_URL}}"],
          "path": ["api", "v1", "social", "limits", "instagram"]
        },
        "description": "Get validation limits for a platform.\n\nReplace `instagram` with: bluesky, facebook, linkedin, mastodon, pinterest, threads, tiktok, x, youtube"
      },
      "response": []
    },
    {
      "name": "Google Business Event",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{BASE_URL}}/api/v1/post/publish",
          "host": ["{{BASE_URL}}"],
          "path": ["api", "v1", "post", "publish"]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"accountId\": \"{{GOOGLE_BUSINESS_ACCOUNT_ID}}\",\n  \"platformOptions\": {\n    \"postType\": \"event\",\n    \"eventTitle\": \"Open day\",\n    \"eventStart\": \"2027-01-23T10:00:00\",\n    \"eventEnd\": \"2027-01-23T12:00:00\"\n  }\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "description": "Google Business example. Unzoned dates use the workspace timezone. Replace placeholder media with a public valid file."
      },
      "response": []
    },
    {
      "name": "Google Business Offer",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{BASE_URL}}/api/v1/post/publish",
          "host": ["{{BASE_URL}}"],
          "path": ["api", "v1", "post", "publish"]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"accountId\": \"{{GOOGLE_BUSINESS_ACCOUNT_ID}}\",\n  \"platformOptions\": {\n    \"postType\": \"offer\",\n    \"eventTitle\": \"January offer\",\n    \"eventStart\": \"2027-01-20T10:00:00\",\n    \"eventEnd\": \"2027-01-31T18:00:00\",\n    \"couponCode\": \"JAN10\"\n  }\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "description": "Google Business example. Unzoned dates use the workspace timezone. Replace placeholder media with a public valid file."
      },
      "response": []
    },
    {
      "name": "Google Business Profile Photo",
      "request": {
        "method": "POST",
        "header": [
          {
            "key": "Content-Type",
            "value": "application/json"
          }
        ],
        "url": {
          "raw": "{{BASE_URL}}/api/v1/post/publish",
          "host": ["{{BASE_URL}}"],
          "path": ["api", "v1", "post", "publish"]
        },
        "body": {
          "mode": "raw",
          "raw": "{\n  \"accountId\": \"{{GOOGLE_BUSINESS_ACCOUNT_ID}}\",\n  \"media\": [\n    \"https://cdn.example.com/logo.png\"\n  ],\n  \"platformOptions\": {\n    \"postType\": \"media\",\n    \"mediaCategory\": \"PROFILE\"\n  }\n}",
          "options": {
            "raw": {
              "language": "json"
            }
          }
        },
        "description": "Google Business example. Unzoned dates use the workspace timezone. Replace placeholder media with a public valid file."
      },
      "response": []
    },
    {
      "name": "Google Business Analytics",
      "request": {
        "method": "GET",
        "header": [],
        "url": "{{BASE_URL}}/api/v1/analytics/overview?platform=GOOGLE_BUSINESS&accountId={{GOOGLE_BUSINESS_ACCOUNT_ID}}&days=30"
      },
      "response": []
    },
    {
      "name": "Google Business Search Terms",
      "request": {
        "method": "GET",
        "header": [],
        "url": "{{BASE_URL}}/api/v1/analytics/search-terms?accountId={{GOOGLE_BUSINESS_ACCOUNT_ID}}&days=30&limit=100"
      },
      "response": []
    },
    {
      "name": "Google Business Limits",
      "request": {
        "method": "GET",
        "header": [],
        "url": "{{BASE_URL}}/api/v1/social/limits/google-business"
      },
      "response": []
    }
  ]
}
