Payload Structure
The format of every webhook request Oktopost sends.
When an event occurs, Oktopost sends an HTTP POST to your webhook URL. The body is a JSON array of one or more payload objects. A single action normally produces one element. Payloads that are still waiting to be delivered can be sent together in the same array. Each webhook is subscribed to one event, so every element is that event's payload.
The event name is not in the body. X-Oktopost-Webhook is the webhook id. X-Oktopost-Payload is the payload id, or a comma-separated list when several payloads are sent together.
Inbox events include an inbox item. newInboxItem sends the item as each element of data. The other inbox events nest that same item under Item. ItemType is Conversation, Post, Mention, or Reply, and Data follows that type. See Inbox item Data.
Origin is owned when the activity is from a profile connected to the account, and external otherwise.
For Facebook personal profiles, Origin can be wrong. Facebook uses one profile ID when the profile is connected to Oktopost and a different ID on mentions and comments, so a mention or comment from the connected personal profile can be reported as external.
{
"event": "newAssignment",
"timestamp": 1705315200,
"webhookId": "0WA000000000001",
"data": {
// Event-specific data
}
}