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.
curl -X POST https://api.getbluejay.ai/v1/send-http-text-message \
  -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "simulation_result_id": "13062",
    "message": "What operating system do you have?",
    "end_conversation": false,
    "end_turn":false,
    "message_id": "682098ae-2ec1-4d4f-8223-0cdd9580cff3"
}'
Request Parameters:
ParameterTypeRequiredDescription
messagestringYes (when type="message")The text message to send
simulation_result_idstringYesID of the simulation result
typestringNo"message" (default) for conversation turns; "tool_call" to log a tool call
end_conversationbooleanNoIf true, ends and evaluates the conversation
end_turnbooleanNoIf true (default), processes the message immediately; if false, stacks it for later
message_idstringNoUnique ID for deduplication
namestringYes (when type="tool_call")Name of the tool that was called
parametersobjectNoInput parameters passed to the tool
outputanyNoReturn value or result from the tool

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.
curl -X POST https://api.getbluejay.ai/v1/send-http-text-message \
  -H "X-API-Key: your-api-key" \
  -H "Content-Type: application/json" \
  -d '{
    "simulation_result_id": "13062",
    "type": "tool_call",
    "name": "lookup_order",
    "parameters": {"order_id": "ORD-2024-001"},
    "output": {"status": "shipped", "tracking_number": "1Z999AA1234567890"}
}'
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:
{
  "simulation_result_id": "13062",
  "message": "I can help you with that. Can you provide your order number?",
  "message_id": "15a481c1-asd2-s9322-9bac-788d52effdc8",
  "end_conversation": false
}
Webhook Request Headers:
HeaderDescription
Content-Typeapplication/json
X-Bluejay-SignatureHMAC-SHA256 signature for verification
X-Simulation-Result-IdThe simulation result ID for this conversation
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, you should verify the signature included in each request. Bluejay signs the request body using HMAC-SHA256 and includes the signature in the X-Bluejay-Signature header.