POST
your-webhook-endpoint
Message Events
curl --request POST \
  --url https://app.journeybee.io/api/v1/your-webhook-endpoint \
  --header 'Authorization: Bearer <token>'
{
  "company_uuid": "<string>",
  "user_uuid": "<string>",
  "event_id": "<string>",
  "api_key": "<string>",
  "message": {
    "uuid": "<string>",
    "created_at": 123,
    "updated_at": 123,
    "content": "<string>",
    "replied_to_message_uuid": "<string>",
    "room_uuid": "<string>",
    "created_by_user_uuid": "<string>",
    "created_by_user_email": "<string>",
    "created_by_user_first_name": "<string>",
    "created_by_user_last_name": "<string>",
    "created_by_user_profile_image_url": "<string>",
    "created_by_user_company_uuid": "<string>",
    "created_by_user_company_name": "<string>",
    "attachments": [
      {
        "uuid": "<string>",
        "file_name": "<string>",
        "file_size": 123,
        "mime_type": "<string>",
        "file_url": "<string>"
      }
    ],
    "partnership_uuid": "<string>",
    "partner_type": "<string>"
  },
  "configuration": [
    {
      "id": "<string>",
      "selected": [
        {
          "id": "<string>",
          "value": "<string>"
        }
      ]
    }
  ]
}

Event Types

  • message_created - New message in partnership room
  • message_updated - Message content updated
  • message_deleted - Message removed

Webhook Details

Event IDs: message_created, message_updated, message_deleted
Content-Type: application/json
Method: POST

Authentication

All webhooks include JWT authentication in the Authorization header:
const jwt = require('jsonwebtoken');

app.post('/webhook', (req, res) => {
  const token = req.headers.authorization?.split('Bearer ')[1];
  
  try {
    const decoded = jwt.verify(token, process.env.INTEGRATION_UUID);
    console.log('Event:', decoded.event_id); // 'message_created'
    console.log('Company:', decoded.company_uuid);
    
    const { message, configuration } = req.body;
    // Process message data...
    
    res.status(200).send('OK');
  } catch (error) {
    res.status(401).send('Invalid token');
  }
});

JWT Token Payload

company_uuid
string
UUID of the company where the message was created
user_uuid
string
UUID of the user who created the message
event_id
string
Always message_created for this event
api_key
string
Your integration’s API key

Webhook Payload Schema

message
object
The created message object
configuration
array
Integration configuration settings for field mapping

Example Payload

{
  "message": {
    "uuid": "message_12345678-1234-5678-9012-123456789abc",
    "created_at": 1716214515227,
    "updated_at": 1716214515227,
    "content": "Hello! I wanted to follow up on our partnership discussion from last week.",
    "replied_to_message_uuid": null,
    "room_uuid": "room_87654321-4321-8765-2109-876543210987",
    "created_by_user_uuid": "user_11111111-1111-1111-1111-111111111111",
    "created_by_user_email": "john@partner.com",
    "created_by_user_first_name": "John",
    "created_by_user_last_name": "Smith",
    "created_by_user_profile_image_url": "https://cdn.journeybee.io/profile/john.jpg",
    "created_by_user_company_uuid": "company_22222222-2222-2222-2222-222222222222",
    "created_by_user_company_name": "Partner Company",
    "attachments": [
      {
        "uuid": "asset_33333333-3333-3333-3333-333333333333",
        "file_name": "partnership-proposal.pdf",
        "file_size": 1048576,
        "mime_type": "application/pdf",
        "file_url": "https://cdn.journeybee.io/files/partnership-proposal.pdf"
      }
    ],
    "partnership_uuid": "partnership_44444444-4444-4444-4444-444444444444",
    "partner_type": "referral"
  },
  "configuration": []
}

Notes

  • Webhook is sent when a new message is created in a partnership room
  • JWT token must be verified using your Integration UUID as the secret
  • Messages can include file attachments with download URLs
  • replied_to_message_uuid is null for new messages, set for replies
  • Configuration array is typically empty for message events