Skip to main content

How It Works

The HTTP webhook integration allows you to simulate conversations with your text-based agent. Bluejay sends messages to your agent via HTTP, and your agent responds through a configured webhook endpoint.

Tutorial

1

Create an Agent

Go to the “Agents & Simulations” section in the sidebar. Click the ”+” button to create a new agent. Choose “Text/Chat” as the agent type and select “HTTP Webhook” as the integration. Make sure to enter your webhook URL in the designated field.
Create Agent
2

Create a Simulation

Click the “Create new simulation” button.
Create Simulation
3

Create Digital Humans

After selecting the number of agents in the “Goal Adherence” section, click “Next”.
Create Digital Humans
4

Queue a Simulation Run

Click “Create and start X chats” to queue a new simulation run. The “#ID” shown is the simulation_result_id that you’ll need for sending messages.
Queue Simulation Run
5

Send Messages

Use the Send HTTP Text Message endpoint to send messages during the simulation. Each message should include the simulation_result_id from the previous step.
Request Parameters:

Logging Tool Calls Live

If your agent invokes tools during the conversation, you can log them in real time by sending a request with type="tool_call". This records the tool call against the simulation result for evaluation — it does not append anything to the conversation transcript or trigger a Digital Human response.
Send one request per tool call, as close to when the tool runs as possible. Bluejay will automatically calculate the start_offset_ms from the conversation start time.
Tool call logs sent via type="tool_call" are available for evaluation immediately. You can mix regular messages and tool call logs freely — send them in whichever order they occur in your agent’s execution.
6

Receive Webhook Responses

Bluejay sends the Digital Human’s responses to your configured webhook URL. Your server should be ready to receive POST requests with the conversation messages.Webhook Payload:When a Digital Human responds, Bluejay will POST to your webhook URL with the following structure:
Webhook Request Headers:Your webhook endpoint should:
  1. Return a 200 OK status code to acknowledge receipt
  2. Verify the X-Bluejay-Signature header (see Verifying Webhook Signatures section below)
  3. Process the message and send follow-up messages using the Send HTTP Text Message endpoint

Verifying Webhook Signatures

To ensure webhook requests are genuinely from Bluejay, verify the signature included in each request. Bluejay signs the raw request body with HMAC-SHA256 using your signing key (generated in the agent’s Connection settings) and sends the hex digest in the X-Bluejay-Signature header. The signing key is created the first time an HTTP webhook is saved. Later updates, including ones that send http_webhook again, leave that key in place. Generate a new key from the agent’s Connection settings when you want to rotate it.
Compute the digest over the raw bytes of the body (before any JSON parsing) and compare it to the header with a constant-time comparison. Reject the request if they don’t match.