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.
/v1/projects/:projectId/engagement- 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.
projectIdstringrequiredProject 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
{
"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
| Field | Shape |
|---|---|
socialAccountId | The account the policy belongs to. Round-trip it into PATCH. |
platform | tiktok or instagram. |
handle | The account's handle on the platform. |
replyMode | off: nothing is generated. draft: each reply waits for a human in the Comments tab. automatic: replies post on their own. |
replyDelay | Seconds a connected account waits before posting a generated reply, 30 to 600. |
Errors
| Status | Code | When |
|---|---|---|
| 401 | UNAUTHENTICATED | Missing or invalid key. |
| 403 | FORBIDDEN_SCOPE | Key lacks engagement:read. |
| 404 | NOT_FOUND | Project not in your organization. |
See also
PATCH /v1/projects/:id/engagement- change an account's policy
Engagement
Each social account's reply policy - whether Layers replies to comments on its posts, and whether a human reviews first.
PATCH /v1/projects/:projectId/engagement
Change one social account's reply policy - switch replies off, to review, or to automatic, and set the delay before a reply posts.