Workspace API

Social media

Endpointy „Social media” Zanfia Workspace API — ze schematami i przykładami kodu.

8 min czytaniaOstatnia aktualizacja: 23 paź 2026

Połączone konta społecznościowe i posty: szkice trafiają do widoku Posty w panelu, planowanie publikuje o wskazanej porze, natychmiastowa publikacja działa tylko dla LinkedIn. Threads, YouTube i TikTok są we wczesnym dostępie: połączyć je mogą tylko workspace’y z wczesnym dostępem. Wymaga uprawnień social:read / social:write. Wszystkie endpointy wymagają nagłówka Authorization: Bearer — zobacz Uwierzytelnianie.

Lista połączonych kont społecznościowych

GET/social/accounts

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Response Body

application/json

application/json

curl -X GET "https://example.com/social/accounts"
{  "count": 0,  "accounts": [    {      "target": "string",      "network": "linkedin",      "label": "string",      "displayName": "string",      "handle": "string",      "profileUrl": "string",      "supportsScheduling": true,      "supportsImmediatePublish": true    }  ]}
{  "error": "string",  "message": "string"}

Lista postów społecznościowych

GET/social/posts

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Response Body

application/json

application/json

curl -X GET "https://example.com/social/posts"
{  "count": 0,  "posts": [    {      "id": "string",      "status": "draft",      "text": "string",      "targets": [        "string"      ],      "media": [        {          "mediaId": "string",          "url": "string",          "type": "image",          "name": "string"        }      ],      "firstComment": "string",      "youtube": {        "tags": [          "string"        ],        "categoryId": "string",        "notifySubscribers": true,        "embeddable": true,        "publicStatsViewable": true,        "license": "youtube",        "containsSyntheticMedia": true,        "defaultLanguage": "string",        "defaultAudioLanguage": "string",        "recordingDate": "string",        "thumbnailMediaId": "string",        "playlistId": "string",        "addCaptions": true,        "title": "string",        "privacyStatus": "private",        "madeForKids": true,        "isShort": true,        "description": "string"      },      "youtubeVisibility": {        "videoId": "string",        "privacyStatus": "private",        "publishAt": "string",        "changedAt": "string"      },      "scheduledAt": "string",      "publishedAt": "string",      "results": [        {          "target": "string",          "label": "string",          "permalink": "string",          "error": "string"        }      ],      "createdAt": "string",      "updatedAt": "string"    }  ]}
{  "error": "string",  "message": "string"}

Utwórz post społecznościowy

POST/social/posts

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/social/posts" \  -H "Content-Type: application/json" \  -d '{    "text": "string",    "targets": [      "string"    ]  }'
{  "postId": "string",  "status": "draft",  "scheduledAt": "string",  "results": [    {      "target": "string",      "label": "string",      "permalink": "string",      "error": "string"    }  ]}
{  "error": "string",  "message": "string"}

Szczegóły posta

GET/social/posts/{postId}

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

postId*string

Response Body

application/json

application/json

curl -X GET "https://example.com/social/posts/string"
{  "id": "string",  "status": "draft",  "text": "string",  "targets": [    "string"  ],  "media": [    {      "mediaId": "string",      "url": "string",      "type": "image",      "name": "string"    }  ],  "firstComment": "string",  "youtube": {    "tags": [      "string"    ],    "categoryId": "string",    "notifySubscribers": true,    "embeddable": true,    "publicStatsViewable": true,    "license": "youtube",    "containsSyntheticMedia": true,    "defaultLanguage": "string",    "defaultAudioLanguage": "string",    "recordingDate": "string",    "thumbnailMediaId": "string",    "playlistId": "string",    "addCaptions": true,    "title": "string",    "privacyStatus": "private",    "madeForKids": true,    "isShort": true,    "description": "string"  },  "youtubeVisibility": {    "videoId": "string",    "privacyStatus": "private",    "publishAt": "string",    "changedAt": "string"  },  "scheduledAt": "string",  "publishedAt": "string",  "results": [    {      "target": "string",      "label": "string",      "permalink": "string",      "error": "string"    }  ],  "createdAt": "string",  "updatedAt": "string"}
{  "error": "string",  "message": "string"}

Zaplanuj post

POST/social/posts/{postId}/schedule

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

postId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

curl -X POST "https://example.com/social/posts/string/schedule" \  -H "Content-Type: application/json" \  -d '{    "scheduledAt": "string"  }'
{  "postId": "string",  "status": "draft",  "scheduledAt": "string"}
{  "error": "string",  "message": "string"}

Opublikuj post teraz

POST/social/posts/{postId}/publish

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

postId*string

Response Body

application/json

application/json

curl -X POST "https://example.com/social/posts/string/publish"
{  "postId": "string",  "status": "draft",  "results": [    {      "target": "string",      "label": "string",      "permalink": "string",      "error": "string"    }  ]}
{  "error": "string",  "message": "string"}

Zmień widoczność opublikowanego filmu YouTube

POST/social/posts/{postId}/youtube-visibility

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

postId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

POST /social/posts/:postId/youtube-visibility — the published YouTube video of that post: private / unlisted / public, or a scheduled public release (publishAt with private). Needs the connection's force-ssl grant.

Response Body

application/json

application/json

curl -X POST "https://example.com/social/posts/string/youtube-visibility" \  -H "Content-Type: application/json" \  -d '{    "privacyStatus": "private"  }'
{  "postId": "string",  "videoId": "string",  "privacyStatus": "private",  "publishAt": "string"}
{  "error": "string",  "message": "string"}

Statystyki kanału YouTube

GET/social/youtube/channel

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Response Body

application/json

application/json

curl -X GET "https://example.com/social/youtube/channel"
{  "channel": {    "channelId": "string",    "title": "string",    "thumbnailUrl": "string",    "subscriberCount": 0,    "viewCount": 0,    "videoCount": 0  },  "recentVideos": [    {      "videoId": "string",      "title": "string",      "publishedAt": "string",      "thumbnailUrl": "string",      "viewCount": 0,      "likeCount": 0,      "commentCount": 0,      "privacyStatus": "private",      "durationSeconds": 0,      "liveStartedAt": "string"    }  ]}
{  "error": "string",  "message": "string"}

Analityka kanału YouTube, ostatnie 28 dni

GET/social/youtube/analytics

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Response Body

application/json

application/json

curl -X GET "https://example.com/social/youtube/analytics"
{  "summary": {    "startDate": "string",    "endDate": "string",    "views": 0,    "watchTimeMinutes": 0,    "averageViewDurationSeconds": 0,    "subscribersGained": 0,    "subscribersLost": 0  },  "days": [    {      "date": "string",      "views": 0,      "watchTimeMinutes": 0    }  ]}
{  "error": "string",  "message": "string"}

Lista filmów YouTube

GET/social/youtube/videos

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Query Parameters

maxResults?integer

Videos per page, 1-50 (default 24)

pageToken?string

nextPageToken of the previous page

Response Body

application/json

application/json

curl -X GET "https://example.com/social/youtube/videos"
{  "videos": [    {      "videoId": "string",      "title": "string",      "publishedAt": "string",      "thumbnailUrl": "string",      "viewCount": 0,      "likeCount": 0,      "commentCount": 0,      "privacyStatus": "private",      "durationSeconds": 0,      "liveStartedAt": "string"    }  ],  "nextPageToken": "string"}
{  "error": "string",  "message": "string"}

Statystyki filmu YouTube

GET/social/youtube/videos/{videoId}

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

videoId*string

Response Body

application/json

application/json

curl -X GET "https://example.com/social/youtube/videos/string"
{  "video": {    "videoId": "string",    "title": "string",    "publishedAt": "string",    "thumbnailUrl": "string",    "viewCount": 0,    "likeCount": 0,    "commentCount": 0,    "privacyStatus": "private",    "durationSeconds": 0,    "liveStartedAt": "string"  },  "analytics": {    "status": "ok",    "views": 0,    "watchTimeMinutes": 0,    "averageViewDurationSeconds": 0  }}
{  "error": "string",  "message": "string"}

Transkrypcja filmu YouTube

GET/social/youtube/videos/{videoId}/transcript

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Path Parameters

videoId*string

Response Body

application/json

application/json

curl -X GET "https://example.com/social/youtube/videos/string/transcript"
{  "status": "ok",  "language": "string",  "transcript": "string"}
{  "error": "string",  "message": "string"}

Statystyki Instagrama, ostatnie 30 dni

GET/social/instagram/insights

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Response Body

application/json

application/json

curl -X GET "https://example.com/social/instagram/insights"
{  "available": true,  "reach": 0,  "views": 0}
{  "error": "string",  "message": "string"}

Lista postów z Instagrama

GET/social/instagram/media

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Query Parameters

limit?integer

Items per page, 1-50 (default 24)

after?string

nextCursor of the previous page

Response Body

application/json

application/json

curl -X GET "https://example.com/social/instagram/media"
{  "items": [    {      "id": "string",      "mediaType": "IMAGE",      "mediaProductType": "FEED",      "mediaUrl": "string",      "thumbnailUrl": "string",      "permalink": "string",      "caption": "string",      "timestamp": "string",      "likeCount": 0,      "commentsCount": 0    }  ],  "nextCursor": "string"}
{  "error": "string",  "message": "string"}

Lista postów z Threads

GET/social/threads/posts

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Response Body

application/json

application/json

curl -X GET "https://example.com/social/threads/posts"
{  "items": [    {      "id": "string",      "mediaType": "string",      "text": "string",      "mediaUrl": "string",      "thumbnailUrl": "string",      "permalink": "string",      "timestamp": "string"    }  ]}
{  "error": "string",  "message": "string"}

Ostatni pomiar odbiorców

GET/social/snapshots/latest

Authorization

bearerAuth
AuthorizationBearer <token>

API key from Dashboard → Integrations → API, MCP and CLI.

In: header

Response Body

application/json

application/json

curl -X GET "https://example.com/social/snapshots/latest"
{  "snapshot": {    "date": "string",    "counts": {      "youtube": 0,      "instagram": 0,      "facebook": 0,      "linkedin": 0,      "threads": 0,      "tiktok": 0,      "telegram": 0,      "newsletter": 0    },    "source": {      "youtube": "auto",      "instagram": "auto",      "facebook": "auto",      "linkedin": "auto",      "threads": "auto",      "tiktok": "auto",      "telegram": "auto",      "newsletter": "auto"    },    "errors": {      "youtube": "string",      "instagram": "string",      "facebook": "string",      "linkedin": "string",      "threads": "string",      "tiktok": "string",      "telegram": "string",      "newsletter": "string"    },    "updatedAt": "string"  }}
{  "error": "string",  "message": "string"}

Czy ten artykuł był pomocny?

Powiązane artykuły

Coś się nie zgadza? Napisz do nas na support@zanfia.com.