PATCH Request Updates the Whole Assistant Issue
# support
s
Hey there! I’m working on an interface using Flutterflow, and I’m running into an issue with updating an assistant via a PATCH endpoint. I thought I could just send the specific fields I need, but it looks like the request is resetting everything and only updating those fields. Unfortunately, I can't modify the GET assistant JSON body to include the fields I want because of Flutterflow’s limitations. Could you help me figure this out or offer some tips? I’d really appreciate any assistance! Thanks so much! Best, Sasha
s
@sasha chebukin it shouldn't be happening can please share the curl?
s
@sasha chebukin please share the patch curl
s
@User
Copy code
curl --request PATCH \
  --url https://api.vapi.ai/assistant/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "transcriber": {
    "provider": "deepgram",
    "model": "nova-2"
  },
  "model": {
    "messages": [
      {
        "role": "system",
        "content": "<main_prompt>"
      }
    ],
    "provider": "<ai_provider>",
    "model": "<ai_model>"
  },
  "voicemailMessage": "<voicemail_message>",
  "firstMessage": "<first_message>",
  "voice": {
    "provider": "<voice_provider>",
    "voiceId": "<voice_id>"
  },
  "name": "<assistant_name>"
}'
s
it's correct, can you try and share the assistant id.
s
yeah, I have tried multiple times, the id is 649b4430-b5a8-45f7-a16a-6c2bd9739288
s
Hey @sasha chebukin you have to pass all properties for the model property because of it's type, nested comparison isn't happening.
s
to be honest, I don't understand what you mean
should I kind of get a GET response for a specific assistant, and then modify it and send as a PATCH request?
s
Yes because model property it’s of type dictionary and we are not doing dictionary keys comparison so you ended up loosing exisiting config.