プライバシー設定

必須機能

セキュリティとサイトの基本機能に必要です。

常に有効

任意の利用状況解析

PostHogの利用状況解析を許可しますか?フッターでいつでも変更できます。

この公開サイトでのセッションリプレイも許可する

リプレイには公開ページと操作が表示され、入力内容や非公開コンテンツはマスクされます。Appのリプレイは別途選択します。

分析の有効化が必要です。ウェブサイトのリプレイは初期設定でオフです。

ブラウザーの分析設定でアカウントの分析が有効になることはありません。

検索は使用時のみ読み込みます。以下ですべてのカテゴリを閲覧できます。

リスニングとメンション

アカウントへのメンションを分類する

expected_revision を使ってローカルのアカウントメンション分類を更新します。プロバイダーのコンテンツへの返信、非表示、削除は行いません。agent:research が必要です。

POST /listening-api/mentions/set-state

契約確認日: · sha256:ab393e91e9b7f18a

概要

expected_revision を使ってローカルのアカウントメンション分類を更新します。プロバイダーのコンテンツへの返信、非表示、削除は行いません。agent:research が必要です。

HTTP成功は完了ではなく受理の場合があります。バックグラウンド処理はIDを保存し、同じ処理を完了まで確認します。予約・受理された投稿はプラットフォーム確認後のみ公開済みです。タイムアウトだけでは結果を判断できません。

認証と権限

受け付ける認証情報の種類
user_session, delegated_oauth, personal_access_token
委任された機能権限
agent:research
ワークスペースの最低ロール
editor
アクセス範囲
このユーザーがアクセスを許可されたリソース
すべてのワークスペースへの同意が必要
いいえ
状態を変更
はい
操作完了時
committed Workspace-only triage version; no provider action

トークンは所有者の権利内でのみ使えます。各要求で所属、リソース所有権、選択ワークスペース、付与機能を確認します。coreとfullは表示だけを変え、アクセスは付与しません。

リクエストのフィールド

必須とは、親オブジェクトと選択分岐内で必須という意味です。必須の子があっても任意の親は必須になりません。以下のルールとフィールド名は契約から転記しています。

リクエストのフィールド
フィールド/分岐型/必須制約
$object親要素内で必須
  • additionalProperties: false
workspace_idstring親要素内で必須
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
social_account_idstring親要素内で必須
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
idstring親要素内で必須
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
mutation_idstring親要素内で必須
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
expected_revisioninteger親要素内で必須
  • maximum: 9007199254740991
  • exclusiveMinimum: 0
handledboolean任意/項目—
archivedboolean任意/項目—
完全なJSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "workspace_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "social_account_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "mutation_id": {
      "type": "string",
      "format": "uuid",
      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
    },
    "expected_revision": {
      "type": "integer",
      "exclusiveMinimum": 0,
      "maximum": 9007199254740991
    },
    "handled": {
      "type": "boolean"
    },
    "archived": {
      "type": "boolean"
    }
  },
  "required": [
    "workspace_id",
    "social_account_id",
    "id",
    "mutation_id",
    "expected_revision"
  ],
  "additionalProperties": false
}

レスポンスと完了条件

成功時のHTTPステータス: 200. 操作完了時: committed Workspace-only triage version; no provider action.

HTTP成功は完了ではなく受理の場合があります。バックグラウンド処理はIDを保存し、同じ処理を完了まで確認します。予約・受理された投稿はプラットフォーム確認後のみ公開済みです。タイムアウトだけでは結果を判断できません。

必須とは、親オブジェクトと選択分岐内で必須という意味です。必須の子があっても任意の親は必須になりません。以下のルールとフィールド名は契約から転記しています。

レスポンスと完了条件
フィールド/分岐型/必須制約
$object親要素内で必須—
mentionobject親要素内で必須—
mention.idstring親要素内で必須
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
mention.workspace_idstring親要素内で必須
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
mention.social_account_idstring親要素内で必須
  • format: "uuid"
  • pattern: "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
mention.provider_post_idstring親要素内で必須
  • pattern: "^\\d{2,20}$"
mention.sourcestring親要素内で必須
  • const: "threads"
mention.relationshipstring親要素内で必須
  • const: "account_mention"
mention.revisioninteger親要素内で必須
  • maximum: 9007199254740991
  • exclusiveMinimum: 0
mention.handledboolean親要素内で必須—
mention.archivedboolean親要素内で必須—
mention.availabilitystring親要素内で必須
  • enum: ["available","expired","unavailable"]
mention.postobject | null親要素内で必須—
mention.postanyOf 1object親要素内で必須—
mention.post.idanyOf 1string親要素内で必須
  • pattern: "^\\d{2,20}$"
mention.post.textanyOf 1string | null親要素内で必須—
mention.post.textanyOf 1 / anyOf 1string親要素内で必須
  • maxLength: 30000
mention.post.textanyOf 1 / anyOf 2null親要素内で必須—
mention.post.usernameanyOf 1string | null親要素内で必須—
mention.post.usernameanyOf 1 / anyOf 1string親要素内で必須
  • pattern: "^[A-Za-z0-9._]{1,30}$"
mention.post.usernameanyOf 1 / anyOf 2null親要素内で必須—
mention.post.permalinkanyOf 1string | null親要素内で必須—
mention.post.permalinkanyOf 1 / anyOf 1string親要素内で必須
  • format: "uri"
mention.post.permalinkanyOf 1 / anyOf 2null親要素内で必須—
mention.post.timestampanyOf 1string | null親要素内で必須—
mention.post.timestampanyOf 1 / anyOf 1string親要素内で必須
  • format: "date-time"
  • pattern: "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
mention.post.timestampanyOf 1 / anyOf 2null親要素内で必須—
mention.post.media_typeanyOf 1string | null親要素内で必須—
mention.post.media_typeanyOf 1 / anyOf 1string親要素内で必須
  • enum: ["TEXT","TEXT_POST","IMAGE","VIDEO","CAROUSEL_ALBUM","AUDIO","REPOST_FACADE"]
mention.post.media_typeanyOf 1 / anyOf 2null親要素内で必須—
mention.post.is_replyanyOf 1boolean | null親要素内で必須—
mention.post.is_quote_postanyOf 1boolean | null親要素内で必須—
mention.post.has_repliesanyOf 1boolean | null親要素内で必須—
mention.post.root_post_idanyOf 1string | null任意/項目—
mention.post.root_post_idanyOf 1 / anyOf 1string任意/項目
  • pattern: "^\\d{2,20}$"
mention.post.root_post_idanyOf 1 / anyOf 2null任意/項目—
mention.post.replied_to_idanyOf 1string | null任意/項目—
mention.post.replied_to_idanyOf 1 / anyOf 1string任意/項目
  • pattern: "^\\d{2,20}$"
mention.post.replied_to_idanyOf 1 / anyOf 2null任意/項目—
mention.postanyOf 2null親要素内で必須—
mention.first_observed_atstring親要素内で必須
  • format: "date-time"
  • pattern: "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
mention.last_checked_atstring親要素内で必須
  • format: "date-time"
  • pattern: "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
mention.expires_atstring親要素内で必須
  • format: "date-time"
  • pattern: "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
mention.coveragestring親要素内で必須
  • const: "partial_native_page"
完全なJSON Schema
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "mention": {
      "type": "object",
      "properties": {
        "id": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "workspace_id": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "social_account_id": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "provider_post_id": {
          "type": "string",
          "pattern": "^\\d{2,20}$"
        },
        "source": {
          "type": "string",
          "const": "threads"
        },
        "relationship": {
          "type": "string",
          "const": "account_mention"
        },
        "revision": {
          "type": "integer",
          "exclusiveMinimum": 0,
          "maximum": 9007199254740991
        },
        "handled": {
          "type": "boolean"
        },
        "archived": {
          "type": "boolean"
        },
        "availability": {
          "type": "string",
          "enum": [
            "available",
            "expired",
            "unavailable"
          ]
        },
        "post": {
          "anyOf": [
            {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^\\d{2,20}$"
                },
                "text": {
                  "anyOf": [
                    {
                      "type": "string",
                      "maxLength": 30000
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "username": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9._]{1,30}$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "permalink": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "uri"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "timestamp": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "media_type": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": [
                        "TEXT",
                        "TEXT_POST",
                        "IMAGE",
                        "VIDEO",
                        "CAROUSEL_ALBUM",
                        "AUDIO",
                        "REPOST_FACADE"
                      ]
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "is_reply": {
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "is_quote_post": {
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "has_replies": {
                  "type": [
                    "boolean",
                    "null"
                  ]
                },
                "root_post_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^\\d{2,20}$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "replied_to_id": {
                  "anyOf": [
                    {
                      "type": "string",
                      "pattern": "^\\d{2,20}$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "text",
                "username",
                "permalink",
                "timestamp",
                "media_type",
                "is_reply",
                "is_quote_post",
                "has_replies"
              ]
            },
            {
              "type": "null"
            }
          ]
        },
        "first_observed_at": {
          "type": "string",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
          "format": "date-time"
        },
        "last_checked_at": {
          "type": "string",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
          "format": "date-time"
        },
        "expires_at": {
          "type": "string",
          "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d(?::[0-5]\\d(?:\\.\\d+)?)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$",
          "format": "date-time"
        },
        "coverage": {
          "type": "string",
          "const": "partial_native_page"
        }
      },
      "required": [
        "id",
        "workspace_id",
        "social_account_id",
        "provider_post_id",
        "source",
        "relationship",
        "revision",
        "handled",
        "archived",
        "availability",
        "post",
        "first_observed_at",
        "last_checked_at",
        "expires_at",
        "coverage"
      ]
    }
  },
  "required": [
    "mention"
  ]
}

エラーと安全な再試行

HTTPステータスとレスポンス本文を確認します。400の検証エラーにはZodErrorが含まれる場合があります。ハンドラーエラーはerror、message、codeを使用します。診断用にrequest_idまたはx-request-idを保持し、認証情報は含めないでください。401/403はアクセス問題を解消してから再試行し、429はRetry-Afterに従います。書き込み結果が不確か、または5xxの場合は、まず既存の結果を取得してください。冪等性キーは対応する操作でのみ再利用します。再試行の挙動は操作ごとに異なり、厳密に一回の配信は保証しません。

トラブルシューティングガイド

例

スキーマ確認済みの架空値の例です。認可されたID、準備済みメディア、確認済みの公開日時に置き換え、書き込み前に適格性を確認してください。このページはAPIを呼びません。

サーバーのSOSOAPI_ACCESS_TOKENに操作が受け付ける認証情報を設定し、ブラウザーコードに含めないでください。AIエージェントはsosoapi auth loginでブラウザーログインし、CLIに更新を任せます。

request.json

{
  "workspace_id": "11111111-1111-4111-8111-111111111111",
  "social_account_id": "22222222-2222-4222-8222-222222222222",
  "id": "30000000-0000-4000-8000-000000000006",
  "mutation_id": "40000000-0000-4000-8000-000000000004",
  "expected_revision": 1,
  "handled": true
}

cURL

curl --request POST \
  "https://gqeshlawtcexsapabaui.supabase.co/functions/v1/listening-api/mentions/set-state" \
  -H "Authorization: Bearer $SOSOAPI_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  --data-binary @request.json

JavaScript

// Server-side JavaScript. Do not print tokens or credential-bearing responses.
const token = process.env.SOSOAPI_ACCESS_TOKEN;
if (!token) throw new Error("Set an accepted credential for this operation");
const response = await fetch("https://gqeshlawtcexsapabaui.supabase.co/functions/v1/listening-api/mentions/set-state", {
  method: "POST",
  headers: { "Content-Type": "application/json", Authorization: "Bearer " + token },
  body: JSON.stringify({
  "workspace_id": "11111111-1111-4111-8111-111111111111",
  "social_account_id": "22222222-2222-4222-8222-222222222222",
  "id": "30000000-0000-4000-8000-000000000006",
  "mutation_id": "40000000-0000-4000-8000-000000000004",
  "expected_revision": 1,
  "handled": true
})
});
const result = await response.json();
// Check response.ok, the operation-specific body and completion state before continuing.

CLI

npx sosoapi api post /listening-api/mentions/set-state < request.json

合成レスポンス例

{
  "mention": {
    "id": "30000000-0000-4000-8000-000000000006",
    "workspace_id": "11111111-1111-4111-8111-111111111111",
    "social_account_id": "22222222-2222-4222-8222-222222222222",
    "provider_post_id": "9999999999999999",
    "source": "threads",
    "relationship": "account_mention",
    "revision": 2,
    "handled": true,
    "archived": false,
    "availability": "unavailable",
    "post": null,
    "first_observed_at": "2099-01-15T09:00:00Z",
    "last_checked_at": "2099-01-15T09:00:00Z",
    "expires_at": "2099-01-16T09:00:00Z",
    "coverage": "partial_native_page"
  }
}

MCP: sosoapi_listening_mentions_set_state