Title: OpenAI Assistants API – “No thread found with id” Error During Initialization in API Connector
Hi everyone,
I’m integrating the OpenAI Assistants API (v2) with Bubble and running into a 404 error when initializing one of my API Connector calls. I’m hoping someone who has worked with dynamic URL parameters or OpenAI threads can point me in the right direction.
What I’m Trying To Do
I’m setting up a GET call to retrieve messages from an existing OpenAI thread:
GET https://api.openai.com/v1/threads/[thread_id]/messages
How I Have It Configured
URL parameter: thread_id
Value (for initialization): a real thread from my OpenAI dashboard
Header: OpenAI-Beta: assistants=v2
Data type: JSON
API key header is set correctly and works for other API calls
The Issue
When I click Initialize call, Bubble returns:
Status code 404
{
"error": {
"message": "No thread found with id 'thread_XXXXXXXX'",
"type": "invalid_request_error"
}
}
The strange part is:
The thread absolutely exists in my OpenAI dashboard.
I can see it in the Threads list with the exact same ID I’m using in the URL parameter.
Other calls (create thread, send message, run assistant) are working fine.
What I’ve Already Checked
Verified the thread_id is copied exactly (no spaces, no missing characters)
Tried multiple valid thread IDs from OpenAI
Recreated the API call from scratch in Bubble
Ensured OpenAI-Beta header is present
Confirmed the endpoint does not need assistant_id for GET requests
My Question
Is Bubble caching old values during initialization, or is there a known issue with URL parameters inside path segments for nested endpoints like this?
Has anyone successfully initialized:
GET https://api.openai.com/v1/threads/[thread_id]/messages
using the API Connector?
Any guidance, examples, or working screenshots would be greatly appreciated!
Hey @Tide88 Welcome to the community! I’ve run into this before with OpenAI’s thread endpoints in Bubble. A few things to check:
Path parameters in Bubble: The API Connector sometimes struggles with dynamic values in the middle of the URL path (like [thread_id]). Bubble doesn’t always replace it correctly during initialization. One workaround is to hardcode a real thread ID temporarily just to initialize the call, then swap in the dynamic parameter afterward.
Check API version & headers: Make sure you have OpenAI-Beta: assistants=v2 exactly set in the headers. Missing or incorrect headers can also trigger a 404.
Use full thread URL carefully: Sometimes extra slashes or whitespace in the URL can cause OpenAI to not find the thread, even if it exists in the dashboard.
Basically, Bubble’s initialization can be picky with path parameters, it’s not caching, it’s just trying to validate the endpoint before sending a real request. Once you get it initialized with a hardcoded value, dynamic parameters usually work fine at runtime. Hope this helps.
Quick update. I was able to work through to a solution. I’m still not sure what the challenge was but I believe it was a combination of backend workflows and picking the wrong thread_id (first vs last). But it is working.