As you can see in ChatGPT's API reference, the parameter messages takes a list of messages with the conversation so far. The GuidedTrack program ChatGPT API - public only sends one message inside the list:
>> payload["messages"] = [ { "role" -> "user", "content" -> prompt_for_chatgpt } ]
You can use the program ChatGPT API with seleted parameters - public (https://www.guidedtrack.com/programs/22860) in order to include your whole conversation history inside the parameter messages. Create an association with the name payload on your main program, structure it as follows and then invoke the program:
>>payload = {"messages"-> [{"role"-> "user","content"-> "tell me a joke"},{"role"-> "assistant", "content"-> "why did the chicken cross the road" }, {"role"-> "user", "content"-> "I don't know, why did the chicken cross the road" }]}
*program: ChatGPT API with seleted parameters - public
For understanding roles: https://help.openai.com/en/articles/7042661-chatgpt-api-transition-guide
Also you may find this thread useful.