https://retellai.com/?utm_source=discord&utm_medium=seo logo
im trying to parse a string of date iso time stamp...
# ❓・ai-evy-support
h
@AI Evy im trying to parse a string of date iso time stamps through to retell to trigger a call but also parse the times in under the assistant oveerides section in my payload but its giving me an error: { "error_message": "Expected ',' or '}' after property value in JSON at position 267" } anyways whats wrong and how do i get my assistant to be parsed slots form go high levels calendar or can you atleast suggest the best way please thanks
a
Thanks for tagging me @hans_70884. I'll look through relevant sources and get back to you shortly.
### Answer The JSON error suggests a formatting issue in your payload. For Retell AI calls, you can pass dynamic variables in several ways depending on your use case. For web calls, you can include dynamic variables in the
retell_llm_dynamic_variables
field [(1) ]() :
Copy code
javascript
const webCallResponse = await client.call.createWebCall({ 
  agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
  retell_llm_dynamic_variables: {
    "customer_name": "John Doe"
  }
}) ;
For inbound calls, you can set dynamic variables through the inbound webhook response [(2) ]() :
Copy code
json
{
 "call_inbound": {
 "override_agent_id": "agent_12345",
 "override_agent_version": 1,
 "dynamic_variables": {
 "customer_name": "John Doe"
 },
 "metadata": {
 "random_id": "12345"
 }
 }
}
You can also update dynamic variables during an ongoing call using the update call API [(3) ]() :
Copy code
javascript
const callResponse = await client.call.update('call_a4441234567890777c4a4a123e6', {
 override_dynamic_variables: { 
   "additional_discount": "15%" 
 }
}) ;
For integrating with external calendar systems like Go High Level, you'd typically use custom functions [(4) ]() . When the LLM needs calendar data, it can call your custom function which then fetches the appointment slots from your calendar API . To troubleshoot your JSON error, ensure your payload structure matches the expected format exactly, with proper comma placement and closing brackets .
​ To learn more, see the sources I considered: [[1] Create Web Call](https://docs.retellai.com/api-references/create-web-call) [[2] Inbound call webhook](https://docs.retellai.com/features/inbound-call-webhook) [[3] Update Call](https://docs.retellai.com/api-references/update-call) [[4] Integrate any system with custom function](https://docs.retellai.com/build/single-multi-prompt/custom-function) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.
h
hanks for the clarification, but my issue wasn’t about the dynamic variable method — it’s about the JSON parsing validation on your endpoint. Even when my JSON is valid, the /v2/create-phone-call endpoint rejects it if a dynamic variable contains an array or object. Example that fails: "retell_llm_dynamic_variables": { "data": ["slot1","slot2"] } Example that succeeds: "retell_llm_dynamic_variables": { "data": "slot1, slot2" } Can you confirm whether this “string-only” restriction for retell_llm_dynamic_variables is a current schema limitation or an intended constraint? It would help to have this clarified in the docs since valid JSON arrays cause a 400 error.
a
Thanks for the follow-up, @hans_70884. I'll get back to you soon.
h
@AI Evy anks for the clarification, but my issue wasn’t about the dynamic variable method — it’s about the JSON parsing validation on your endpoint. Even when my JSON is valid, the /v2/create-phone-call endpoint rejects it if a dynamic variable contains an array or object. Example that fails: "retell_llm_dynamic_variables": { "data": ["slot1","slot2"] } Example that succeeds: "retell_llm_dynamic_variables": { "data": "slot1, slot2" } Can you confirm whether this “string-only” restriction for retell_llm_dynamic_variables is a current schema limitation or an intended constraint? It would help to have this clarified in the docs since valid JSON arrays cause a 400 error.
a
### Answer Based on the documentation, you're correct about the string-only restriction for
retell_llm_dynamic_variables
[(1) ]() . The API documentation specifies that dynamic variables should be "key value pairs of string" . In the Create Phone Call API, the
retell_llm_dynamic_variables
field is defined as an object containing string key-value pairs :
Copy code
json
{ "customer_name": "John Doe" }
This same pattern is consistent across other endpoints - the Create Web Call API [(2) ]() and Create Chat API [(3) ]() also specify dynamic variables as string key-value pairs. A community member encountered a similar issue and received guidance to ensure proper JSON formatting with curly brackets [(4) ]() . The error you're seeing when using arrays or objects instead of strings is the expected behavior based on the current API schema. For your use case with calendar slots, you'll need to serialize your array data into a string format, such as: - Comma-separated:
"slot1, slot2"
- JSON string:
"[\"slot1\",\"slot2\"]"
- Custom delimiter:
"slot1|slot2"
Then parse this string within your agent's prompt or custom function logic to handle the individual slot values.
​ To learn more, see the sources I considered: [[1] Create Phone Call](https://docs.retellai.com/api-references/create-phone-call) [[2] Create Web Call](https://docs.retellai.com/api-references/create-web-call) [[3] Create Chat](https://docs.retellai.com/api-references/create-chat) [[4] Discord message from @fredg9582 on 2025-01-13](https://discord.com/channels/1186424376300679209/1186462578310910112/1328256759110045722) ​
Feel free to tag @AI Evy with additional questions. I also appreciate feedback, it helps me improve.