Reply to content
Send a provider reply from a Koil content event.
Use replies when your application receives a content.* event and needs to respond on the provider, such as replying to a comment or message.
How it works
-
Receive and verify the Koil event from Subscribe to Events.
-
Store the event ID for dedupe, then read the identifiers from the event body:
connectedProfileIdcontentTypeexternalId
-
Check whether replies are supported for that content type.
GET /v1/connected-profiles/{connectedProfileId}/capabilities -
Submit a reply Publish Request using the event's
connectedProfileIdandexternalId.POST /v1/publish-requests -
Store the returned publish request ID and status URL.
-
Read status until the reply is completed, failed, or canceled.
GET /v1/publish-requests/{publishRequestId}
Example
{
"publishRequests": [
{
"contentType": "instagram.media.comments",
"variant": "reply",
"connectedProfileId": "cp_123",
"clientItemId": "reply-comment-456",
"args": {
"target": {
"contentType": "instagram.media.comments",
"externalId": "comment_456"
},
"text": "Thanks for reaching out."
}
}
]
}Dedupe and retries
Use the connectedProfileId from the event unless your product intentionally lets an operator choose another eligible Connected Profile.
Events can be retried or replayed. Dedupe inbound events by Koil-Event-Id, and send an Idempotency-Key header when submitting the reply so customer-side retries do not create duplicate replies.
If your reply UI needs fresh provider state, fetch the content before replying:
GET /v1/content/{contentType}/{externalId}?connectedProfileId={connectedProfileId}