API
Snippets
curl, JavaScript, and Python. No published SDK.
Hawkeye does not publish an SDK. These snippets use the HTTP API. Keep the key in an environment variable.
Message
curl -s https://hawkeye.brownhawke.engineering/api/partner/v1/messages \
-H "Authorization: Bearer $HAWKEYE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"agent_id":"receptionist","message":{"role":"user","content":"A customer is asking about an MOT tomorrow."}}'const res = await fetch(process.env.HAWKEYE_HOST + "/api/partner/v1/messages", {
method: "POST",
headers: {
Authorization: "Bearer " + process.env.HAWKEYE_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
agent_id: "receptionist",
conversation_id: conversationId,
message: { role: "user", content: "Do you have a slot on Thursday?" },
}),
});
const data = await res.json();import os, requests
r = requests.post(
os.environ["HAWKEYE_HOST"] + "/api/partner/v1/messages",
headers={"Authorization": "Bearer " + os.environ["HAWKEYE_API_KEY"]},
json={
"agent_id": "garage-front-desk",
"message": {"role": "user", "content": "Is the Golf ready?"},
},
timeout=60,
)
r.raise_for_status()
print(r.json()["message"]["content"])Chat completion
The full request is on Chat completions. Streaming and attachments have their own pages.
Verify a webhook
The check is on Webhooks. Use the raw body bytes.