Build with Wagent
Read conversations and contacts, control human takeover, send safe idempotent replies, and react to real-time Wagent events.
Authentication
Create an API key in Dashboard → Developer API. The secret is shown once. Send it as a Bearer token and request only the scopes your automation needs.
curl https://www.hirewagent.com/api/v1/me \
-H "Authorization: Bearer wagent_live_..." \
-H "Accept: application/json"Endpoints
Base URL: https://www.hirewagent.com/api/v1
/meVerify the API connection and inspect its scopes.
—/agentsList setters in the connected Wagent account.
agents:read/conversationsList conversations with cursor pagination and filters.
conversations:read/conversations/{id}Retrieve one conversation.
conversations:read/conversations/{id}/messagesList messages in a conversation.
conversations:read/conversations/{id}/messagesSend a reply and place the chat in human takeover.
conversations:write/conversations/{id}/pausePause AI and request human takeover.
conversations:write/conversations/{id}/resumeResume AI replies for a conversation.
conversations:write/contactsList contacts or find one by exact email or phone.
contacts:read/contacts/{id}Retrieve one contact.
contacts:read/contacts/{id}Update contact fields, tags, or metadata.
contacts:write/bookingsList Calendly bookings.
bookings:read/webhooksList registered webhook endpoints.
webhooks:read/webhooksRegister a signed webhook endpoint.
webhooks:write/webhooks/{id}Delete a webhook endpoint.
webhooks:writePagination
Collection endpoints use opaque cursor pagination. Pass the returned next_cursor unchanged. Page size defaults to 25 and is capped at 100.
{
"data": [ ... ],
"pagination": {
"has_more": true,
"next_cursor": "eyJ0aW1lc3RhbXAiOi4uLn0"
}
}Safe message delivery
Every outbound message requires a unique Idempotency-Key. Retrying the same request with the same key returns the original result instead of sending a duplicate. Reusing it for different content returns HTTP 409.
curl -X POST \
https://www.hirewagent.com/api/v1/conversations/CONVERSATION_ID/messages \
-H "Authorization: Bearer wagent_live_..." \
-H "Content-Type: application/json" \
-H "Idempotency-Key: 2ed28d6e-78bd-4c1f-a18b-5d931ee77028" \
-d '{"content":"I can help with that."}'Signed webhooks
Register a public HTTPS endpoint. Wagent returns its signing secret once, signs the exact body with HMAC-SHA256, retries temporary failures with exponential backoff, and disables endpoints that return HTTP 410.
message.receivedA new inbound message was received.
message.sentWagent or a human sent a message.
conversation.handoff_requestedA conversation needs human attention.
contact.createdA new contact entered Wagent.
booking.createdA Calendly booking was created.
booking.canceledA Calendly booking was canceled.
Delivery headers
Wagent-Event— event nameWagent-Delivery— unique delivery identifierWagent-Timestamp— Unix timestampWagent-Signature—t=TIMESTAMP,v1=HEX_DIGEST
Node.js verification
import crypto from "node:crypto";
const timestamp = req.headers["wagent-timestamp"];
const supplied = req.headers["wagent-signature"].split("v1=")[1];
const expected = crypto
.createHmac("sha256", process.env.WAGENT_WEBHOOK_SECRET)
.update(timestamp + "." + rawRequestBody)
.digest("hex");
if (!crypto.timingSafeEqual(Buffer.from(supplied), Buffer.from(expected))) {
throw new Error("Invalid Wagent signature");
}Errors and rate limits
Errors are JSON and include a stable machine-readable code plus a request ID. Each key may make 120 requests per minute. Read X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset.
400Invalid request, JSON, cursor, or missing idempotency key.
401API key is missing, malformed, expired, or revoked.
403The key lacks a required scope or the account is inactive.
404The resource does not exist in the authenticated account.
409Idempotency or resource conflict.
422A supplied field failed validation.
429The API key exceeded its per-minute rate limit.
500/503A temporary internal or dependency error occurred.
{
"error": {
"code": "insufficient_scope",
"message": "This request requires: contacts:write.",
"request_id": "31fe2bf4-..."
}
}Automation platforms
Use an HTTP action for API calls and a webhook trigger for instant events. The same contract powers Zapier, Make, HighLevel, n8n, and Pipedream.
View integration guidesSupport and policies
Include the response header X-Request-Id when reporting an API problem.