# Sync an external post

Syncs an external post.

```http
POST https://api.pozy.ai/v1/posts/sync-external
```

- Area: Analytics / Analytics
- Auth: Authorization: Bearer pz_live_...

## Request body

Content type: `application/json`

- `accountId`, string, required
- `url`, string
- `postId`, string

## Example request

```bash
curl -X POST "https://api.pozy.ai/v1/posts/sync-external" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "accountId": "696e0b682d0a31188e7a2ba9"
}'
```

```ts
const res = await fetch("https://api.pozy.ai/v1/posts/sync-external", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.POZY_API_KEY}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    accountId: "696e0b682d0a31188e7a2ba9"
  }),
});
const data = await res.json();
if (!res.ok) throw new Error(data?.error ?? `Request failed with status ${res.status}`);
console.log(data);
```

```python
import os
import requests

resp = requests.post(
    "https://api.pozy.ai/v1/posts/sync-external",
    headers={"Authorization": f"Bearer {os.environ['POZY_API_KEY']}"},
    json={
        "accountId": "696e0b682d0a31188e7a2ba9",
    },
    timeout=30,
)
resp.raise_for_status()
print(resp.json())
```

## Response 200

- `synced`, object
  - `postsFound`, integer
  - `postsSynced`, integer
  - `skipped`, boolean
- `found`, boolean
- `post`, object
  - one of: External Post Summary
    - `platform`, string
    - `platformPostId`, string
    - `platformPostUrl`, string
    - `content`, string
    - `publishedAt`, string (date-time)
    - `mediaType`, string
    - `thumbnailUrl`, string
    - `mediaItems`, array of object
    - `mediaProductType`, string
    - `isAiGenerated`, boolean
    - `isSharedToFeed`, boolean
    - `mediaAudioType`, string
    - `analytics`, object
      - `likes`, integer
      - `comments`, integer
      - `shares`, integer
      - `saves`, integer
      - `sends`, integer
      - `clicks`, integer
      - `views`, integer
      - `reach`, integer
      - `impressions`, integer
      - `engagementRate`, number
      - `lastUpdated`, string (date-time)
- `posts`, array of object
  - `platform`, string
  - `platformPostId`, string
  - `platformPostUrl`, string
  - `content`, string
  - `publishedAt`, string (date-time)
  - `mediaType`, string
  - `thumbnailUrl`, string
  - `mediaItems`, array of object
  - `mediaProductType`, string
  - `isAiGenerated`, boolean
  - `isSharedToFeed`, boolean
  - `mediaAudioType`, string
  - `analytics`, object
    - `likes`, integer
    - `comments`, integer
    - `shares`, integer
    - `saves`, integer
    - `sends`, integer
    - `clicks`, integer
    - `views`, integer
    - `reach`, integer
    - `impressions`, integer
    - `engagementRate`, number
    - `lastUpdated`, string (date-time)

```json
{
  "synced": {
    "postsFound": 1,
    "postsSynced": 1,
    "skipped": true
  },
  "found": true,
  "post": {
    "platform": "instagram",
    "platformPostId": "637f799b3039e6602e83fa4f",
    "platformPostUrl": "https://pozy.ai/media/example-1.jpg",
    "content": "Hello from Pozy",
    "publishedAt": "2026-10-02T09:00:00.000Z",
    "mediaType": "string",
    "thumbnailUrl": "https://pozy.ai/media/example-1.jpg",
    "mediaItems": [
      {}
    ],
    "mediaProductType": "string",
    "isAiGenerated": true,
    "isSharedToFeed": true,
    "mediaAudioType": "string",
    "analytics": {
      "likes": 1,
      "comments": 1,
      "shares": 1,
      "saves": 1,
      "sends": 1,
      "clicks": 1,
      "views": 1,
      "reach": 1,
      "impressions": 1,
      "engagementRate": 12.5,
      "lastUpdated": "2026-10-02T09:00:00.000Z"
    }
  },
  "posts": [
    {
      "platform": "instagram",
      "platformPostId": "637f799b3039e6602e83fa4f",
      "platformPostUrl": "https://pozy.ai/media/example-1.jpg",
      "content": "Hello from Pozy",
      "publishedAt": "2026-10-02T09:00:00.000Z",
      "mediaType": "string",
      "thumbnailUrl": "https://pozy.ai/media/example-1.jpg",
      "mediaItems": [
        {}
      ],
      "mediaProductType": "string",
      "isAiGenerated": true,
      "isSharedToFeed": true,
      "mediaAudioType": "string",
      "analytics": {
        "likes": 1,
        "comments": 1,
        "shares": 1,
        "saves": 1,
        "sends": 1,
        "clicks": 1,
        "views": 1,
        "reach": 1,
        "impressions": 1,
        "engagementRate": 12.5,
        "lastUpdated": "2026-10-02T09:00:00.000Z"
      }
    }
  ]
}
```
