Docs
APIAPI referenceEngagement

GET /v1/projects/:projectId/engagement

Read each social account's reply policy - whether Layers replies to comments on its posts, and whether a human reviews each reply first.

View as Markdown
GET/v1/projects/:projectId/engagement
Phase 1stable
Auth
Bearer
Scope
engagement:read

Lists every TikTok and Instagram account on the project with its reply policy. A reply policy answers two questions: does Layers generate replies to comments on the account's own posts, and does a human review each reply in the Comments tab before it posts.

How a reply reads is not configured here. Layers writes each reply from the post, the comment and the project's app context.

Path
  • projectId
    stringrequired
    Project whose accounts you want.

Example request

curl https://api.layers.com/v1/projects/prj_254a4ce1-f4ca-42b1-9e36-17ca45ef3d39/engagement \
  -H "Authorization: Bearer lp_..."
const { accounts } = await layers.engagement.get({
  projectId: "prj_254a4ce1-f4ca-42b1-9e36-17ca45ef3d39",
});

const reviewing = accounts.filter((a) => a.replyMode === "draft");
policies = layers.engagement.get(project_id="prj_254a4ce1-f4ca-42b1-9e36-17ca45ef3d39")

Response

200Reply policies
{
  "accounts": [
    {
      "socialAccountId": "sa_e4fc4f78-0d04-4896-b391-272757b077fe",
      "platform": "tiktok",
      "handle": "marcusmoveson",
      "replyMode": "draft",
      "replyDelay": 60
    },
    {
      "socialAccountId": "sa_a5fe16b9-1e39-4c55-ba27-6a0d6a5464c1",
      "platform": "instagram",
      "handle": "rocky.rebuild",
      "replyMode": "off",
      "replyDelay": 60
    }
  ]
}

Field reference

FieldShape
socialAccountIdThe account the policy belongs to. Round-trip it into PATCH.
platformtiktok or instagram.
handleThe account's handle on the platform.
replyModeoff: nothing is generated. draft: each reply waits for a human in the Comments tab. automatic: replies post on their own.
replyDelaySeconds a connected account waits before posting a generated reply, 30 to 600.

Errors

StatusCodeWhen
401UNAUTHENTICATEDMissing or invalid key.
403FORBIDDEN_SCOPEKey lacks engagement:read.
404NOT_FOUNDProject not in your organization.

See also

On this page