Read post destinations

social.destinations.read@2

Checks whether selected accounts can take a post with the declared image count and MIME types, before anything is written, made or saved. Report mode gives each incompatible account a specific reason. This reads local connector constraints, not a live provider, and grants no asset-use or publication rights. It needs a key with Read social.

Check an image post

Check an account against one PNG image before production.

# A new operationId for each new request; the same one to retry it.
curl https://api.growlocal.site/api/v1/profiles/YOUR_BUSINESS_ID/invocations \
  -H "Authorization: Bearer gl_YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "target": {
    "featureId": "YOUR_FEATURE_ID",
    "export": "readMediaDestinations",
    "contractRef": "social.destinations.read@2"
  },
  "operationId": "check-image-destinations-1",
  "input": {
    "accountRefs": [
      {
        "businessProfileId": "YOUR_BUSINESS_ID",
        "featureId": "juniper-cakes.social",
        "collectionId": "juniper-cakes.accounts",
        "id": "YOUR_ACCOUNT_ID"
      }
    ],
    "format": "post",
    "media": {
      "kind": "image",
      "count": 1,
      "mimeTypes": [
        "image/png"
      ]
    }
  }
}'
// A new operationId for each new request; the same one to retry it.
const response = await fetch(
  "https://api.growlocal.site/api/v1/profiles/YOUR_BUSINESS_ID/invocations",
  {
    method: "POST",
    headers: {
      Authorization: "Bearer gl_YOUR_API_KEY",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      "target": {
        "featureId": "YOUR_FEATURE_ID",
        "export": "readMediaDestinations",
        "contractRef": "social.destinations.read@2"
      },
      "operationId": "check-image-destinations-1",
      "input": {
        "accountRefs": [
          {
            "businessProfileId": "YOUR_BUSINESS_ID",
            "featureId": "juniper-cakes.social",
            "collectionId": "juniper-cakes.accounts",
            "id": "YOUR_ACCOUNT_ID"
          }
        ],
        "format": "post",
        "media": {
          "kind": "image",
          "count": 1,
          "mimeTypes": [
            "image/png"
          ]
        }
      }
    }),
  },
);
const receipt = await response.json();
console.log(response.status, receipt);
import requests

# A new operationId for each new request; the same one to retry it.
response = requests.post(
    "https://api.growlocal.site/api/v1/profiles/YOUR_BUSINESS_ID/invocations",
    headers={"Authorization": "Bearer gl_YOUR_API_KEY"},
    json={
        "target": {
            "featureId": "YOUR_FEATURE_ID",
            "export": "readMediaDestinations",
            "contractRef": "social.destinations.read@2",
        },
        "operationId": "check-image-destinations-1",
        "input": {
            "accountRefs": [
                {
                    "businessProfileId": "YOUR_BUSINESS_ID",
                    "featureId": "juniper-cakes.social",
                    "collectionId": "juniper-cakes.accounts",
                    "id": "YOUR_ACCOUNT_ID",
                },
            ],
            "format": "post",
            "media": {
                "kind": "image",
                "count": 1,
                "mimeTypes": [
                    "image/png",
                ],
            },
        },
    },
    timeout=30,
)
print(response.status_code, response.json())

Parameters

What goes in input:

Name Type Required Description
accountRefs array of object Yes The accounts to check, 1 to 10; one listed twice is refused.
accountRefs[].businessProfileId string Yes Your business's id.
accountRefs[].featureId string Yes The featureId of the account's row.
accountRefs[].collectionId string Yes The collectionId of the account's row.
accountRefs[].id string Yes The account's id.
format post Yes Always post: only plain posts can be checked here.
incompatible one of refuse, report No refuse (the default) rejects the call when an account cannot take the post; report answers with the accounts that can in destinations and the ones that cannot in incompatible, each with the reason.
media any JSON value Yes The complete declared post-media shape.
media.kind one of none, image Yes none for text only, or image for one to ten images.
media.count integer Yes Zero for none; otherwise the exact number of attachments, one to ten.
media.mimeTypes array of string Yes All distinct possible image MIME types, such as image/png; empty for text only.

Response

A call that worked answers 200 with an applied receipt; its output holds these fields, among others. GET /catalog/social.destinations.read@2 answers the complete shape as JSON Schema.

Name Type Description
destinations array of object The accounts that can take the post, in the order you asked. Empty only when incompatible is sent and no account can.
destinations[].accountRef object The account.
destinations[].platform one of facebook, instagram, linkedin, x, tiktok, youtube, pinterest, threads, bluesky Its platform.
destinations[].label string The account's name.
destinations[].constraints object What the platform allows.
destinations[].constraints.captionLimit integer The longest caption, in characters.
destinations[].constraints.formats array of one of post, story, reel The formats it takes: post, story, reel.
destinations[].constraints.options array of one of altText, link, firstComment, title, privacy, shareToFeed, collaborators, allowComments, allowDuet, allowStitch, discloseBrand, brandedContent, aiGenerated, madeForKids, replySettings The extra settings a post can carry there, such as link or altText.
destinations[].constraints.optionChoices object The values allowed for privacy and replySettings, where they are limited.
destinations[].constraints.mediaRequired boolean Whether a post must have a photo or video.
destinations[].constraints.maxMedia integer The most photos or videos a post can carry.
destinations[].constraints.mediaTypes array of string The kinds of file it takes.
incompatible array of object Only with incompatible report: the accounts that cannot take the post, in the order you asked, each with its accountRef, platform and a reason in plain words.
{
  "status": "applied",
  "operationId": "check-image-destinations-1",
  "output": {
    "destinations": [
      {
        "accountRef": {
          "businessProfileId": "YOUR_BUSINESS_ID",
          "featureId": "juniper-cakes.social",
          "collectionId": "juniper-cakes.accounts",
          "id": "YOUR_ACCOUNT_ID"
        },
        "platform": "x",
        "label": "Juniper Cakes",
        "constraints": {
          "captionLimit": 280,
          "formats": [
            "post"
          ],
          "options": [
            "replySettings"
          ],
          "mediaRequired": false,
          "maxMedia": 4,
          "mediaTypes": [
            "image/jpeg",
            "image/png"
          ],
          "optionChoices": {
            "replySettings": [
              "everyone",
              "following",
              "mentionedUsers",
              "subscribers",
              "verified"
            ]
          }
        }
      }
    ]
  }
}

Errors

It reads and changes nothing. Besides the answers every request can get (Errors), its receipt can say:

Status HTTP What it means
rejected 400, or 403 when it's a matter of access Not done. diagnostics says why: each has a code, a path into what you sent and a message.

The codes in diagnostics you're most likely to see:

Code Status What it means
DATA.ROW_NOT_FOUND rejected No such account here for this key.
SOCIAL.ACCOUNT_DUPLICATE rejected An account is listed twice.
SOCIAL.PLATFORM_UNSUPPORTED rejected An account's platform cannot be published to. Not raised with incompatible report.
SOCIAL.MEDIA_REQUIRED rejected An account's platform needs a photo or video, so it cannot take a text-only post. Not raised with incompatible report.
SOCIAL.MEDIA_UNSUPPORTED rejected A destination cannot take a declared image MIME type; report mode returns the reason instead.
SOCIAL.MEDIA_TOO_MANY rejected The image count exceeds this destination’s attachment limit; report mode returns the reason instead.