https://discord.gg/botpress logo
Request for Backend Access to Generate HITL X-User...
# 🤝help
e
Hi! I’m integrating the HITL (Human in the Loop) API into my own backend service, and I need to programmatically generate a valid X-User-Key so I can send messages through the HITL endpoint without manually refreshing the key every time it expires. After inspecting the network traffic from the Botpress Cloud dashboard (via browser DevTools), I identified the following behavior and endpoints being used: I can successfully send messages to the HITL integration when using a valid X-User-Key: POST https://hitl.botpress.cloud//messages Authorization: Bearer X-User-Key: Content-Type: application/json This works perfectly from my backend once I have a valid x-user-key. Problem: Generating the X-User-Key The web dashboard appears to generate the key by calling one of the following internal endpoints, but neither of them works from a backend environment: POST https://hitl.botpress.cloud//login Authorization: Bearer Content-Type: application/json Body: {} And I get response: 403 Forbidden ("Invalid credentials") From the DevTools traces, it seems that the Botpress web app calls a private internal service which authenticates the user session and then internally generates the HITL key via the /login endpoint. However, these routes are not available publicly on api.botpress.cloud, even when using a valid Personal Access Token (PAT) generated from my workspace settings. I have a Plus plan and a valid PAT and I am calling from my own Node.js backend (server-side only, no browser context). What I need: I would like to programmatically obtain a valid X-User-Key for the HITL integration using my workspace PAT or another stable API key, so that my backend can refresh the key automatically without requiring cookies or browser context.
l
Hello @early-state-34882 if you are a plus plan member I urge you to contact our solution engineers. You can quickly do this by clicking the headphones icon in your dashboard!
I see we have tried helping you in the past for the same issue however it seems to have still presisted right? @early-state-34882
e
Okay! I'll contact them through there.
Yes, I had already inquired about this, but I decided to use a static x-user-key, but it's difficult because it expires and I have to keep changing it.
l
Ohhhh that makes sense!
Hopefully a solution can be found soon 🫡
e
Thank you for your response and your help!!
l
Anytime! Let me know how it goes once its all settled
2 Views