Notification

This section will help you understand the Bodyguard.ai webhook notification payload.

Headers

Notification headers contain the following informations:

  • Name
    Content-Type
    Type
    string
    Description

    Specify the JSON content of the request.
    Example: application/json

  • Name
    Content-Length
    Type
    string
    Description

    The length of the Notification payload in bytes.
    Example: 770

  • Name
    X-Hub-Signature
    Type
    string
    Description

    The signature of the request. See the section about this signature for more information.
    Exemple: f47ff6fe9524f5...d195fa9e6672e

Payloads

Every notification payloads contains common fields:

  • Name
    version
    Type
    number
    Description

    The current version of Bodyguard's Webhooks.

  • Name
    challenge
    Type
    string
    Description

    See Challenge section.

  • Name
    time
    Type
    number
    Description

    The timestamps at which the event was triggered.

  • Name
    organization
    Type
    object
    Description

    Details about your Organization (name and ID).

  • Name
    eventType
    Type
    string
    Description

    The event that triggered the Webhook.

Each eventType has its own dedicated field:

  • Name
    messageUpdatedData
    Type
    MessageUpdatedData
    Description

    Triggered when the eventType field is MESSAGE_UPDATED.

  • Name
    authorUpdatedData
    Type
    AuthorUpdatedData
    Description

    Triggered when the eventType field is AUTHOR_UPDATED.

  • Name
    contentUpdatedData
    Type
    ContentUpdatedData
    Description

    Triggered when the eventType field is CONTENT_UPDATED.

Example:

Payload

{
	"version": 1,
	"challenge": "b4835ef24b353a16760262ad55fe8b2e574ad2fefaafd5870632fc7437309e01",
	"time": 1623764480,
	"organization": {
		"name": "Your organization name",
		"id": "The identifier of your organization"
	},
	"eventType": "MESSAGE_UPDATED | AUTHOR_UPDATED | CONTENT_UPDATED",
	"messageUpdatedData | authorUpdatedData | contentUpdatedData": {
		// ... Depending on the eventType
	}
}