A busca carrega apenas quando você a usa. Explore todas as categorias abaixo.

Análises e insights

Ler suas publicações no Threads

Ler uma página oficial limitada de publicações do Threads da conexão selecionada. Respostas próprias são excluídas e a cobertura permanece incompleta.

POST /analytics-api/threads-reads/provider-posts/query

Contrato revisado: · sha256:11debf801a5e6096

Visão geral

Ler uma página oficial limitada de publicações do Threads da conexão selecionada. Respostas próprias são excluídas e a cobertura permanece incompleta.

Uma resposta HTTP bem-sucedida pode significar que uma requisição foi aceita, não concluída. Para trabalho em segundo plano, salve o ID retornado e consulte a mesma operação até terminar. Um post agendado ou aceito só está publicado quando a plataforma confirma; um timeout do cliente não comprova o resultado.

Autenticação e permissões

Classes de credenciais aceitas
user_session, delegated_oauth, personal_access_token
Capacidade delegada
agent:operate
Função mínima no workspace
viewer
Escopo de acesso
Recursos que este usuário tem autorização para acessar
Consentimento para todos os workspaces obrigatório
Não
Altera o estado
Não
Quando a operação estiver concluída
bounded official data or explicit unavailable; granted scopes do not establish public App Review approval

Um token só pode usar os direitos do seu proprietário. Cada requisição verifica participação no workspace, propriedade de recursos, workspaces selecionados e capacidades concedidas. Os perfis core e full mudam as ferramentas exibidas; não concedem acesso.

Campos da requisição

Obrigatório significa obrigatório dentro do objeto pai e da ramificação selecionada. Um filho obrigatório não torna obrigatório um pai opcional. As regras e nomes de campos abaixo são copiados do contrato.

Campos da requisição
Campo / ramificaçãoTipo / obrigatórioRestrições
$objectObrigatório no objeto pai
  • additionalProperties: false
workspace_idstringObrigatório no objeto pai
  • 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_idstringObrigatório no objeto pai
  • 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)$"
sinceintegerOpcional / item
  • minimum: 1688540400
  • maximum: 9007199254740991
untilintegerOpcional / item
  • minimum: 1688540400
  • maximum: 9007199254740991
limitintegerOpcional / item
  • minimum: 1
  • maximum: 100
  • default: 25
afterstringOpcional / item
  • minLength: 1
  • maxLength: 4096
JSON Schema completo
{
  "$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)$"
    },
    "since": {
      "type": "integer",
      "minimum": 1688540400,
      "maximum": 9007199254740991
    },
    "until": {
      "type": "integer",
      "minimum": 1688540400,
      "maximum": 9007199254740991
    },
    "limit": {
      "default": 25,
      "type": "integer",
      "minimum": 1,
      "maximum": 100
    },
    "after": {
      "type": "string",
      "minLength": 1,
      "maxLength": 4096
    }
  },
  "required": [
    "workspace_id",
    "social_account_id"
  ],
  "additionalProperties": false
}

Resposta e conclusão

Códigos HTTP de sucesso: 200. Quando a operação estiver concluída: bounded official data or explicit unavailable; granted scopes do not establish public App Review approval.

Uma resposta HTTP bem-sucedida pode significar que uma requisição foi aceita, não concluída. Para trabalho em segundo plano, salve o ID retornado e consulte a mesma operação até terminar. Um post agendado ou aceito só está publicado quando a plataforma confirma; um timeout do cliente não comprova o resultado.

Obrigatório significa obrigatório dentro do objeto pai e da ramificação selecionada. Um filho obrigatório não torna obrigatório um pai opcional. As regras e nomes de campos abaixo são copiados do contrato.

Resposta e conclusão
Campo / ramificaçãoTipo / obrigatórioRestrições
$objectObrigatório no objeto pai—
contract_versionstringObrigatório no objeto pai
  • const: "threads-reads/v1"
operationstringObrigatório no objeto pai
  • const: "provider_posts"
sourcestringObrigatório no objeto pai
  • const: "official_threads_api"
workspace_idstringObrigatório no objeto pai
  • 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_idstringObrigatório no objeto pai
  • 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_account_idstringObrigatório no objeto pai
  • pattern: "^\\d{2,20}$"
provider_app_identitystring | nullObrigatório no objeto pai—
provider_app_identityanyOf 1stringObrigatório no objeto pai
  • minLength: 1
  • maxLength: 100
provider_app_identityanyOf 2nullObrigatório no objeto pai—
oauth_snapshot_idstring | nullObrigatório no objeto pai—
oauth_snapshot_idanyOf 1stringObrigatório no objeto pai
  • 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)$"
oauth_snapshot_idanyOf 2nullObrigatório no objeto pai—
fetched_atstringObrigatório no objeto pai
  • 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)))$"
statusstringObrigatório no objeto pai
  • enum: ["available","partial","unavailable"]
unavailable_reasonstring | nullObrigatório no objeto pai—
unavailable_reasonanyOf 1stringObrigatório no objeto pai
  • enum: ["grant_inventory_unknown","missing_permissions","issuing_app_unknown","credential_unavailable","credential_expired","account_unhealthy","provider_denied","provider_rate_limited","provider_unavailable","provider_response_invalid"]
unavailable_reasonanyOf 2nullObrigatório no objeto pai—
accessobjectObrigatório no objeto pai—
access.required_permissionsarrayObrigatório no objeto pai
  • maxItems: 4
access.required_permissions[]stringOpcional / item
  • pattern: "^[a-z][a-z0-9_]{0,99}$"
access.missing_permissionsarrayObrigatório no objeto pai
  • maxItems: 4
access.missing_permissions[]stringOpcional / item
  • pattern: "^[a-z][a-z0-9_]{0,99}$"
access.permission_statestringObrigatório no objeto pai
  • enum: ["granted","missing","unknown"]
access.grant_evidencestringObrigatório no objeto pai
  • enum: ["exact","unknown"]
access.app_accessstringObrigatório no objeto pai
  • const: "unverified"
dataarrayObrigatório no objeto pai
  • maxItems: 100
data[]objectOpcional / item—
data[].idstringObrigatório no objeto pai
  • pattern: "^\\d{2,20}$"
data[].textstring | nullObrigatório no objeto pai—
data[].textanyOf 1stringObrigatório no objeto pai
  • maxLength: 30000
data[].textanyOf 2nullObrigatório no objeto pai—
data[].usernamestring | nullObrigatório no objeto pai—
data[].usernameanyOf 1stringObrigatório no objeto pai
  • pattern: "^[A-Za-z0-9._]{1,30}$"
data[].usernameanyOf 2nullObrigatório no objeto pai—
data[].permalinkstring | nullObrigatório no objeto pai—
data[].permalinkanyOf 1stringObrigatório no objeto pai
  • format: "uri"
data[].permalinkanyOf 2nullObrigatório no objeto pai—
data[].timestampstring | nullObrigatório no objeto pai—
data[].timestampanyOf 1stringObrigatório no objeto pai
  • 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)))$"
data[].timestampanyOf 2nullObrigatório no objeto pai—
data[].media_typestring | nullObrigatório no objeto pai—
data[].media_typeanyOf 1stringObrigatório no objeto pai
  • enum: ["TEXT","TEXT_POST","IMAGE","VIDEO","CAROUSEL_ALBUM","AUDIO","REPOST_FACADE"]
data[].media_typeanyOf 2nullObrigatório no objeto pai—
data[].is_replyboolean | nullObrigatório no objeto pai—
data[].is_quote_postboolean | nullObrigatório no objeto pai—
data[].has_repliesboolean | nullObrigatório no objeto pai—
data[].root_post_idstring | nullOpcional / item—
data[].root_post_idanyOf 1stringOpcional / item
  • pattern: "^\\d{2,20}$"
data[].root_post_idanyOf 2nullOpcional / item—
data[].replied_to_idstring | nullOpcional / item—
data[].replied_to_idanyOf 1stringOpcional / item
  • pattern: "^\\d{2,20}$"
data[].replied_to_idanyOf 2nullOpcional / item—
profileobject | nullObrigatório no objeto pai—
profileanyOf 1objectObrigatório no objeto pai—
profile.usernameanyOf 1stringObrigatório no objeto pai
  • pattern: "^[A-Za-z0-9._]{1,30}$"
profile.nameanyOf 1string | nullObrigatório no objeto pai—
profile.nameanyOf 1 / anyOf 1stringObrigatório no objeto pai
  • maxLength: 200
profile.nameanyOf 1 / anyOf 2nullObrigatório no objeto pai—
profile.biographyanyOf 1string | nullObrigatório no objeto pai—
profile.biographyanyOf 1 / anyOf 1stringObrigatório no objeto pai
  • maxLength: 2000
profile.biographyanyOf 1 / anyOf 2nullObrigatório no objeto pai—
profile.is_verifiedanyOf 1boolean | nullObrigatório no objeto pai—
profile.follower_countanyOf 1integer | nullObrigatório no objeto pai—
profile.follower_countanyOf 1 / anyOf 1integerObrigatório no objeto pai
  • minimum: 0
  • maximum: 9007199254740991
profile.follower_countanyOf 1 / anyOf 2nullObrigatório no objeto pai—
profileanyOf 2nullObrigatório no objeto pai—
locationsarrayOpcional / item
  • maxItems: 100
locations[]objectOpcional / item—
locations[].idstringObrigatório no objeto pai
  • pattern: "^\\d{2,20}$"
locations[].namestring | nullObrigatório no objeto pai—
locations[].nameanyOf 1stringObrigatório no objeto pai
  • maxLength: 200
locations[].nameanyOf 2nullObrigatório no objeto pai—
locations[].addressstring | nullObrigatório no objeto pai—
locations[].addressanyOf 1stringObrigatório no objeto pai
  • maxLength: 500
locations[].addressanyOf 2nullObrigatório no objeto pai—
locations[].citystring | nullObrigatório no objeto pai—
locations[].cityanyOf 1stringObrigatório no objeto pai
  • maxLength: 200
locations[].cityanyOf 2nullObrigatório no objeto pai—
locations[].countrystring | nullObrigatório no objeto pai—
locations[].countryanyOf 1stringObrigatório no objeto pai
  • maxLength: 200
locations[].countryanyOf 2nullObrigatório no objeto pai—
locations[].postal_codestring | nullObrigatório no objeto pai—
locations[].postal_codeanyOf 1stringObrigatório no objeto pai
  • maxLength: 100
locations[].postal_codeanyOf 2nullObrigatório no objeto pai—
root_post_idstringOpcional / item
  • pattern: "^\\d{2,20}$"
target_usernamestringOpcional / item
  • pattern: "^[A-Za-z0-9._]{1,30}$"
coverageobjectObrigatório no objeto pai—
coverage.completebooleanObrigatório no objeto pai
  • const: false
coverage.next_cursorstring | nullObrigatório no objeto pai—
coverage.next_cursoranyOf 1stringObrigatório no objeto pai
  • minLength: 1
  • maxLength: 4096
coverage.next_cursoranyOf 2nullObrigatório no objeto pai—
coverage.omitted_rowsintegerObrigatório no objeto pai
  • minimum: 0
  • maximum: 9007199254740991
coverage.reasonsarrayObrigatório no objeto pai
  • maxItems: 8
coverage.reasons[]stringOpcional / item
  • maxLength: 400
quotaarrayObrigatório no objeto pai
  • maxItems: 1
quota[]objectOpcional / item—
quota[].providerstringObrigatório no objeto pai
  • const: "meta"
quota[].usageobjectObrigatório no objeto pai—
quota[].usage.call_countnumberOpcional / item—
quota[].usage.total_cputimenumberOpcional / item—
quota[].usage.total_timenumberOpcional / item—
quota[].usage.estimated_time_to_regain_accessnumberOpcional / item—
quota[].sourcesarrayObrigatório no objeto pai
  • maxItems: 2
quota[].sources[]stringOpcional / item
  • enum: ["x-app-usage","x-business-use-case-usage"]
JSON Schema completo
{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "type": "object",
  "properties": {
    "contract_version": {
      "type": "string",
      "const": "threads-reads/v1"
    },
    "operation": {
      "type": "string",
      "const": "provider_posts"
    },
    "source": {
      "type": "string",
      "const": "official_threads_api"
    },
    "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_account_id": {
      "type": "string",
      "pattern": "^\\d{2,20}$"
    },
    "provider_app_identity": {
      "anyOf": [
        {
          "type": "string",
          "minLength": 1,
          "maxLength": 100
        },
        {
          "type": "null"
        }
      ]
    },
    "oauth_snapshot_id": {
      "anyOf": [
        {
          "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)$"
        },
        {
          "type": "null"
        }
      ]
    },
    "fetched_at": {
      "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)))$"
    },
    "status": {
      "type": "string",
      "enum": [
        "available",
        "partial",
        "unavailable"
      ]
    },
    "unavailable_reason": {
      "anyOf": [
        {
          "type": "string",
          "enum": [
            "grant_inventory_unknown",
            "missing_permissions",
            "issuing_app_unknown",
            "credential_unavailable",
            "credential_expired",
            "account_unhealthy",
            "provider_denied",
            "provider_rate_limited",
            "provider_unavailable",
            "provider_response_invalid"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "access": {
      "type": "object",
      "properties": {
        "required_permissions": {
          "maxItems": 4,
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]{0,99}$"
          }
        },
        "missing_permissions": {
          "maxItems": 4,
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^[a-z][a-z0-9_]{0,99}$"
          }
        },
        "permission_state": {
          "type": "string",
          "enum": [
            "granted",
            "missing",
            "unknown"
          ]
        },
        "grant_evidence": {
          "type": "string",
          "enum": [
            "exact",
            "unknown"
          ]
        },
        "app_access": {
          "type": "string",
          "const": "unverified"
        }
      },
      "required": [
        "required_permissions",
        "missing_permissions",
        "permission_state",
        "grant_evidence",
        "app_access"
      ]
    },
    "data": {
      "maxItems": 100,
      "type": "array",
      "items": {
        "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"
        ]
      }
    },
    "profile": {
      "anyOf": [
        {
          "type": "object",
          "properties": {
            "username": {
              "type": "string",
              "pattern": "^[A-Za-z0-9._]{1,30}$"
            },
            "name": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 200
                },
                {
                  "type": "null"
                }
              ]
            },
            "biography": {
              "anyOf": [
                {
                  "type": "string",
                  "maxLength": 2000
                },
                {
                  "type": "null"
                }
              ]
            },
            "is_verified": {
              "type": [
                "boolean",
                "null"
              ]
            },
            "follower_count": {
              "anyOf": [
                {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "username",
            "name",
            "biography",
            "is_verified",
            "follower_count"
          ]
        },
        {
          "type": "null"
        }
      ]
    },
    "locations": {
      "maxItems": 100,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^\\d{2,20}$"
          },
          "name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "address": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 500
              },
              {
                "type": "null"
              }
            ]
          },
          "city": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "country": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 200
              },
              {
                "type": "null"
              }
            ]
          },
          "postal_code": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 100
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "name",
          "address",
          "city",
          "country",
          "postal_code"
        ]
      }
    },
    "root_post_id": {
      "type": "string",
      "pattern": "^\\d{2,20}$"
    },
    "target_username": {
      "type": "string",
      "pattern": "^[A-Za-z0-9._]{1,30}$"
    },
    "coverage": {
      "type": "object",
      "properties": {
        "complete": {
          "type": "boolean",
          "const": false
        },
        "next_cursor": {
          "anyOf": [
            {
              "type": "string",
              "minLength": 1,
              "maxLength": 4096
            },
            {
              "type": "null"
            }
          ]
        },
        "omitted_rows": {
          "type": "integer",
          "minimum": 0,
          "maximum": 9007199254740991
        },
        "reasons": {
          "maxItems": 8,
          "type": "array",
          "items": {
            "type": "string",
            "maxLength": 400
          }
        }
      },
      "required": [
        "complete",
        "next_cursor",
        "omitted_rows",
        "reasons"
      ]
    },
    "quota": {
      "maxItems": 1,
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "provider": {
            "type": "string",
            "const": "meta"
          },
          "usage": {
            "type": "object",
            "properties": {
              "call_count": {
                "type": "number"
              },
              "total_cputime": {
                "type": "number"
              },
              "total_time": {
                "type": "number"
              },
              "estimated_time_to_regain_access": {
                "type": "number"
              }
            }
          },
          "sources": {
            "maxItems": 2,
            "type": "array",
            "items": {
              "type": "string",
              "enum": [
                "x-app-usage",
                "x-business-use-case-usage"
              ]
            }
          }
        },
        "required": [
          "provider",
          "usage",
          "sources"
        ]
      }
    }
  },
  "required": [
    "contract_version",
    "operation",
    "source",
    "workspace_id",
    "social_account_id",
    "provider_account_id",
    "provider_app_identity",
    "oauth_snapshot_id",
    "fetched_at",
    "status",
    "unavailable_reason",
    "access",
    "data",
    "profile",
    "coverage",
    "quota"
  ]
}

Erros e repetições seguras

Confira o status HTTP e o corpo da resposta. Um erro de validação 400 pode conter ZodError; erros do handler usam os campos error, message e code. Guarde request_id ou x-request-id para diagnóstico, sem credenciais. Corrija erros de acesso 401/403 antes de tentar novamente e siga Retry-After para 429. Se uma gravação for incerta ou retornar 5xx, consulte primeiro o resultado existente. Reutilize uma chave de idempotência somente quando houver suporte; o comportamento de repetição varia por operação e não garante entrega exatamente uma vez.

Guia de solução de problemas

Exemplos

Estes exemplos usam valores fictícios verificados conforme os schemas. Substitua os IDs por aqueles que você tem autorização para usar, a mídia por ativos prontos e as datas pelo horário de publicação confirmado. Confira a elegibilidade da conta antes de enviar uma gravação. Esta página não envia requisições de API.

Defina SOSOAPI_ACCESS_TOKEN no servidor como uma credencial aceita por esta operação e mantenha-a fora do código do navegador. Para agentes de IA, use sosoapi auth login para entrar pelo navegador e deixe a CLI renovar suas credenciais.

request.json

{
  "workspace_id": "11111111-1111-4111-8111-111111111111",
  "social_account_id": "22222222-2222-4222-8222-222222222222",
  "limit": 25
}

cURL

curl --request POST \
  "https://gqeshlawtcexsapabaui.supabase.co/functions/v1/analytics-api/threads-reads/provider-posts/query" \
  -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/analytics-api/threads-reads/provider-posts/query", {
  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",
  "limit": 25
})
});
const result = await response.json();
// Check response.ok, the operation-specific body and completion state before continuing.

CLI

npx sosoapi api post /analytics-api/threads-reads/provider-posts/query < request.json

Exemplo de resposta sintética

{
  "workspace_id": "11111111-1111-4111-8111-111111111111",
  "social_account_id": "22222222-2222-4222-8222-222222222222",
  "contract_version": "threads-reads/v1",
  "operation": "provider_posts",
  "source": "official_threads_api",
  "provider_account_id": "12345",
  "provider_app_identity": null,
  "oauth_snapshot_id": null,
  "fetched_at": "2099-01-15T09:00:00Z",
  "status": "unavailable",
  "unavailable_reason": "issuing_app_unknown",
  "access": {
    "required_permissions": [
      "threads_basic"
    ],
    "missing_permissions": [],
    "permission_state": "unknown",
    "grant_evidence": "unknown",
    "app_access": "unverified"
  },
  "data": [],
  "profile": null,
  "quota": [],
  "coverage": {
    "complete": false,
    "next_cursor": null,
    "omitted_rows": 0,
    "reasons": [
      "Fictional documentation example: no provider request was made and no account data was read.",
      "App access and any pending permission review remain unverified; this is not successful provider or public-access evidence."
    ]
  }
}

MCP: sosoapi_query_threads_provider_posts