/api/v4/social/postsソーシャル投稿を作成
ブランドに接続されたFacebook、Instagram、X、LinkedIn、Pinterestのアカウントで、下書き、予約済み、または即時公開の投稿を作成します。
パラメーター
ボディ
| 名前 | 型 | 必須 | 説明 |
|---|---|---|---|
| input | object | 必須 | Wrapper object. Every field below is a property of `input`, the entire body must be nested under it. |
| input.socialProfileId | string | 必須 | UUID of the brand publishing the post, the same value used as the `brandId` path token elsewhere. Every platform in `platforms` must already have a connection on this brand. |
| input.name | string | 必須 | Internal name for the post (not shown to the audience). Used to find it again in lists. |
| input.platforms | array of strings | 必須 | Platforms to publish to: `FACEBOOK`, `INSTAGRAM`, `TWITTER` (X), `LINKEDIN`, `PINTEREST`. |
| input.content | string | 必須 | The post body, published to every platform in `platforms`. |
| input.action | string | 必須 | `DRAFT` to save without publishing, `SCHEDULE` to publish at a future time (requires a schedule), or `PUBLISH` to publish now. |
| input.mediaUrls | array of strings | 任意 | Public https image URLs to attach. Instagram and Pinterest require at least one. |
| input.videoUrls | array of strings | 任意 | Public https video URLs to attach. |
| input.link | string | 任意 | Link to attach to the post where the platform supports one. |
| input.scheduledAt | string | 任意 | Publish time as an ISO-8601 timestamp with an offset, e.g. `2026-10-02T09:30:00-04:00`. Required when `action` is `SCHEDULE` unless you send `scheduleDate` + `scheduleTime`. Never send both forms. |
| input.scheduleDate | string | 任意 | Publish date as `YYYY-MM-DD`, interpreted in the **brand's** timezone. Must be sent together with `scheduleTime`. |
| input.scheduleTime | string | 任意 | Publish time as `HH:MM` (24-hour), interpreted in the **brand's** timezone. Must be sent together with `scheduleDate`. |
| input.connectedChannelIds | array of strings | 任意 | Restrict publishing to specific connections by their `id` from the connections list. Defaults to the brand's active connection for each platform in `platforms`. |
| input.clientReference | string | 任意 | Your own identifier for this post, stored and echoed back. Use it to reconcile the post against your own records without holding onto the returned UUID. |
リクエストの例
そのまま貼り付けられるボディです。プレースホルダーの ID と値をご自身のものに置き換えてください。
{ "input": { "socialProfileId": "6f2c9a41-7b0e-4d55-9a2f-3c8e1d47b902", "name": "Autumn collection launch", "platforms": ["INSTAGRAM", "FACEBOOK", "LINKEDIN"], "content": "Our autumn collection lands today. Solid oak, hand-finished, made two blocks from the shop. Come see it in person this weekend.", "mediaUrls": ["https://cdn.example.com/social/autumn-collection.jpg"], "link": "https://jennyhome.example/autumn", "action": "SCHEDULE", "scheduleDate": "2026-10-02", "scheduleTime": "09:30", "clientReference": "campaign-4471-slot-01" }}レスポンス
200Post accepted. Publishing runs asynchronously, poll GET /social/posts/{postId} for per-channel status.
{ "data": { "createSimpleSocialMediaPost": { "success": true, "error": [], "socialPostId": "c47a1e58-2b93-4f10-a6d7-58e0c9b12345", "status": "SCHEDULED" } }}200Validation failed. Nothing was created. The status is still 200: read `success` and the `error` array.
{ "data": { "createSimpleSocialMediaPost": { "success": false, "error": [ { "message": "SY95045: No connected channel for PINTEREST on this brand", "code": "SY95045", "contextInfo": [{ "key": "platform", "value": "PINTEREST" }] }, { "message": "SY95046: scheduleTime must be HH:MM in the brand's timezone", "code": "SY95046", "contextInfo": null } ], "socialPostId": null, "status": null } }}401Unauthenticated, missing or invalid API key.
404No brand with that ID on this account (`SY95043`).
1つのブランドの接続済みソーシャルアカウント(1つ以上)に向けて、投稿を1件作成します。同じ呼び出しで、DRAFTの保存、SCHEDULEのキューへの追加、即時のPUBLISHという3つのライフサイクルすべてに対応します。
ユースケース:独自のカレンダーからキャンペーンを予約する。 アプリには、クライアントが何をいつ発信したいかがすでに登録されています。各枠について、action: "SCHEDULE"と、scheduledAtまたはscheduleDate + scheduleTimeのいずれかを指定してこのエンドポイントを呼び出し、返されたUUIDを保存せずに照合できるように、独自の枠の識別子をclientReferenceとして渡します。GET /social/posts/{postId}ですべてのチャネルでの公開が確認できるまでは、その項目を保留中として表示し、POST /social/posts/cancelを呼び出すキャンセルボタンを用意します。
公開は非同期で行われます
action: "PUBLISH"は、応答を返す前に公開を行うことはありません。この呼び出しは投稿を受け付け、socialPostIdを返して、投稿を公開パイプラインに渡します。実際の結果を確認するには、GET /social/posts/{postId}をポーリングし、チャネルごとのchannels[]配列を読み取ります。各要素のstatusが、そのプラットフォームの結果を示します。同じリクエストでも、Instagramでは投稿に成功し、LinkedInでは失敗する場合があるため、channels[]が実際の結果を示し、投稿レベルのstatusはその概要を示します。
スケジュールの選択
action: "SCHEDULE"には、次の2つの形式のうち必ずどちらか1つを指定する必要があり、両方を指定することはできません。
両方を送信した場合、scheduleDateをscheduleTimeなしで送信した場合、またはオフセットのないscheduledAtを送信した場合は、SY95046で拒否されます。DRAFTとPUBLISHには、スケジュールを一切含めてはいけません。
注意事項。
- リクエストボディは
inputオブジェクトでラップする必要があります。 - HTTPステータスではなく、
successを確認してください。 検証に失敗すると、HTTP 200が返され、success: falseと、問題ごとに1つの要素を持つerror配列が含まれます。successがfalseの場合、何も作成されません。 - ブランドはボディ内の
socialProfileIdで識別します。brandIdはURLパスのトークンとしてのみ使用され、ボディのフィールドとして使用されることはありません。 platforms内のすべてのプラットフォームが、そのブランドですでに接続されている必要があります。 有効なチャネルがないプラットフォームはSY95045で失敗するため、まずブランドの接続を確認し、未接続のものについては接続リンクを通じてユーザーに接続してもらいます。- プラットフォームの値は、大文字の列挙名
FACEBOOK、INSTAGRAM、TWITTER、LINKEDIN、PINTERESTです。TWITTERはXを指し、値には旧名称が維持されており、小文字の値は拒否されます。 - InstagramとPinterestはテキストのみの投稿を受け付けないため、どちらかが
platformsに含まれる場合は、mediaUrlsの要素を少なくとも1つ指定してください。 - 投稿IDは通常のUUIDであり、拠点の投稿で使用するBase64のrelay IDではありません。
- 一度に数件を超える投稿を扱う場合は、同じ行形式を受け取り、バッチ全体を事前に検証する
POST /social/bulk-postsを使用してください。
書き込み操作:実際のアカウントに対しては実行していません。表示されているリクエストとレスポンスはAPIスキーマに基づいて作成されたものであり、実行すると実際のソーシャルアカウントに投稿が公開されます。
curl -X POST 'https://listingsapi.com/api/v4/social/posts' \ -H "Authorization: API $LISTINGSAPI_KEY" \ -H 'Content-Type: application/json' \ -d '{ "input": { "socialProfileId": "6f2c9a41-7b0e-4d55-9a2f-3c8e1d47b902", "name": "Autumn collection launch", "platforms": [ "INSTAGRAM", "FACEBOOK", "LINKEDIN" ], "content": "Our autumn collection lands today. Solid oak, hand-finished, made two blocks from the shop. Come see it in person this weekend.", "mediaUrls": [ "https://cdn.example.com/social/autumn-collection.jpg" ], "link": "https://jennyhome.example/autumn", "action": "SCHEDULE", "scheduleDate": "2026-10-02", "scheduleTime": "09:30", "clientReference": "campaign-4471-slot-01" } }'