Updating Tool Issue
# support
h
curl -X PATCH https://api.vapi.ai/tool/74e52bba-b7c6-4d21-995d-0b4556048fcd \ -H "Authorization: Bearer " \ -H "Content-Type: application/json" \ -d '{ "type": "function", "function": { "name": "knowledge_base_liv", "parameters": { "type": "object", "properties": { "query": { "type": "string", "description": "The query to send to the vector store (usually the full question is fine)" } }, "required": [ "query" ] }, "strict": true, "description": "Use this to access context about liv from their vector store" } }' Is bringing back a: { "message": [ "property type should not exist" ], "error": "Bad Request", "statusCode": 400 }
v
Hi there! 👋 I can see what's causing your error. When updating a tool with a PATCH request, you shouldn't include the
"type"
property in your JSON payload. The error message "property type should not exist" indicates that this field should be omitted when updating an existing tool. Try modifying your request by removing the
"type": "function"
line from your JSON payload, like this:
Copy code
bash
curl -X PATCH https://api.vapi.ai/tool/74e52bba-b7c6-4d21-995d-0b4556048fcd \
     -H "Authorization: Bearer " \
     -H "Content-Type: application/json" \
     -d '{
  "function": {
    "name": "knowledge_base_liv",
    "parameters": {
      "type": "object",
      "properties": {
        "query": {
          "type": "string",
          "description": "The query to send to the vector store (usually the full question is fine)"
        }
      },
      "required": [
        "query"
      ]
    },
    "strict": true,
    "description": "Use this to access context about liv from their vector store"
  }
}'
The
type
property appears to be immutable after tool creation, so it can't be modified in update requests [according to the API documentation](https://docs.vapi.ai/api-reference/tools/update). Let me know if this resolves your issue! Source: - [Vapi API Documentation Update Tool](https://docs.vapi.ai/api-reference/tools/update)
h
Btw this is from the api reference so the issue needs to be fixed within the UI>
v
Message marked as helpful by @Hugo! 🎉
s
@Hugo checking if this is resolved for you.
h
Yes it is
3 Views