Getting Error in POST request
# support
a
error in POST request while testing in postman { "message": [ "property customer should not exist", "property phoneNumberId should not exist", "property phoneNumber should not exist", "property assistantOverride should not exist" ], "error": "Bad Request", "statusCode": 400 }
v
Hi @AI, I'm an AI assistant for Vapi. I'll analyze available sources and get back to you shortly.
----------------------------- **While I generate an answer, here are some sources that might be helpful**: * [Create Phone Call]() * [Server Events]() * [Get Call]() * [List Calls]() -----------------------------
### Answer The error message you're encountering indicates that there are some properties in your POST request that are not recognized or are not expected by the Vapi API endpoint you're targeting. This typically means that the structure of your JSON payload does not match what the API expects. You should review the API documentation for the specific endpoint you're working with to ensure that your JSON payload includes only the expected properties and that they are correctly formatted. For example, if you are making a call to create a phone call, ensure that your payload aligns with the documented parameters. Here's a reference on how to structure a request for creating a phone call under Vapi's API, which requires specific fields such as
assistantId
, and
customer
with nested
number
information [(1)]() . Make sure to consult the official API reference to match your request body with the expected schema.
a
provide me the right schema
@Vapi Support
v
Hmm.. Seems like I didn't receive a question. Please start a new thread with your question.
a
provide the right schema for create phone call @Vapi Support
v
Thanks for the follow-up, @AI. I'll get back to you soon.
----------------------------- **While I generate an answer, here are some sources that might be helpful**: * [Create Phone Call]() * [Get Call]() * [List Calls]() * [Update Phone Number]() -----------------------------
### Answer To create a phone call using Vapi, you need to send a POST request with a JSON payload structured as follows:
Copy code
json
{
  "maxDurationSeconds": 1800,
  "customerId": "<string>",
  "customer": {
    "number": "<string>",
    "name": "<string>",
    "extension": "<string>"
  },
  "phoneNumberId": "<string>",
  "phoneNumber": {
    "twilioPhoneNumber": "<string>",
    "twilioAccountSid": "<string>",
    "twilioAuthToken": "<string>",
    "name": "<string>",
    "assistantId": "<string>",
    "serverUrl": "<string>",
    "serverUrlSecret": "<string>"
  },
  "metadata": {},
  "assistantId": "<string>",
  "assistantOverride": {
    "transcriber": {
      "provider": "deepgram",
      "model": "nova-2",
      "language": "cs",
      "smartFormat": true,
      "keywords": [
        "<string>"
      ]
    },
    "model": {
      "messages": [
        {
          "content": "<string>",
          "role": "assistant",
          "function_call": {},
          "tool_calls": [
            {}
          ],
          "tool_call_id": "<string>"
        }
      ],
      "tools": [
        {
          "type": "transferCall",
          "messages": [
            {
              "type": "request-start",
              "content": "<string>",
              "conditions": [
                {
                  "param": "<string>",
                  "value": {},
                  "operator": "eq"
                }
              ]
            }
          ],
          "destinations": [
            {}
          ],
          "server": {
            "url": "<string>",
            "secret": "<string>"
          },
          "function": {
            "name": "<string>",
            "description": "<string>",
            "parameters": {
              "type": "object",
              "properties": {},
              "required": [
                "<string>"
              ]
            }
          }
        }
      ],
      "provider": "openai",
      "model": "gpt-4o",
      "fallbackModels": [
        "gpt-4-0125-
Copy code
preview",
        "gpt-4-0613"
      ],
      "semanticCachingEnabled": true,
      "numFastTurns": 1,
      "temperature": 1,
      "knowledgeBase": {
        "topK": 123,
        "fileIds": [
          "<string>"
        ],
        "provider": "canonical"
      },
      "maxTokens": 525,
      "emotionRecognitionEnabled": true
    },
    "voice": {
      "inputMinCharacters": 10,
      "inputPunctuationBoundaries": [
        "。",
        ",",
        ".",
        "!",
        "?",
        ";",
        ")",
        "،",
        "۔",
        "।",
        "॥",
        "|",
        "||",
        ",",
        ":"
      ],
      "fillerInjectionEnabled": true,
      "provider": "azure",
      "voiceId": "andrew",
      "speed": 1.25
    },
    "forwardingPhoneNumber": "<string>",
    "firstMessageMode": "assistant-speaks-first",
    "voicemailDetectionTypes": [
      "machine_end_beep",
      "machine_end_silence",
      "machine_end_other"
    ],
    "recordingEnabled": true,
    "endCallFunctionEnabled": true,
    "dialKeypadFunctionEnabled": true,
    "hipaaEnabled": true,
    "clientMessages": [
      "transcript",
      "hang",
      "tool-calls",
      "speech-update",
      "metadata",
      "conversation-update"
    ],
    "serverMessages": [
      "end-of-call-report",
      "status-update",
      "hang",
      "tool-calls"
    ],
    "silenceTimeoutSeconds": 30,
    "responseDelaySeconds": 0.4,
    "llmRequestDelaySeconds": 0.1,
    "numWordsToInterruptAssistant": 1,
    "maxDurationSeconds": 1800,
    "backgroundSound": "office",
    "backchannelingEnabled": true,
    "variableValues": {},
    "name": "<string>",
    "firstMessage": "<string>",
    "voicemailDetectionEnabled": true,
    "voicemailMessage": "<string>",
    "endCallMessage": "<string>",
    "endCallPhrases": [
      "<string>"
    ],
    "metadata": {},
    "serverUrl": "<string>",
    "ser
Copy code
verUrlSecret": "<string>",
    "summaryPrompt": "<string>"
  }
}
Ensure that you replace placeholders (e.g.,
<string>
) with actual values relevant to your use case. This is the comprehensive structure required to configure various aspects of a phone call using Vapi's API [(1)]() .
a
generate complete json @Vapi Support
v
Thanks for the follow-up, @AI. I'll get back to you soon.
----------------------------- **While I generate an answer, here are some sources that might be helpful**: * [Outbound Calls from Python]() * [Create Phone Call]() * [Buy Phone Number]() * [Update Phone Number]() -----------------------------
### Answer Here is a complete JSON payload example for creating a phone call using the Vapi API. This example includes all necessary fields and attributes that can be adjusted as per your specific requirements:
Copy code
json
{
  "maxDurationSeconds": 1800,
  "customerId": "exampleCustomerId",
  "customer": {
    "number": "+15555555555",
    "name": "John Doe",
    "extension": "123"
  },
  "phoneNumberId": "examplePhoneId",
  "phoneNumber": {
    "twilioPhoneNumber": "+14444444444",
    "twilioAccountSid": "exampleSid",
    "twilioAuthToken": "exampleAuthToken",
    "name": "MyCompanyLine",
    "assistantId": "exampleAssistantId",
    "serverUrl": "https://example.com/webhook",
    "serverUrlSecret": "secretKey"
  },
  "metadata": {},
  "assistantId": "exampleAssistantId",
  "assistantOverride": {
    "transcriber": {
      "provider": "deepgram",
      "model": "nova-2",
      "language": "en",
      "smartFormat": true,
      "keywords": [
        "keyword1", "keyword2"
      ]
    },
    "model": {
      "messages": [
        {
          "content": "Hello, how can I assist you today?",
          "role": "assistant",
          "function_call": {},
          "tool_calls": [
            {}
          ],
          "tool_call_id": "exampleToolCallId"
        }
      ],
      "tools": [
        {
          "type": "transferCall",
          "messages": [
            {
              "type": "request-start",
              "content": "Transferring now",
              "conditions": [
                {
                  "param": "userRequest",
                  "value": "transfer",
                  "operator": "eq"
                }
              ]
            }
          ],
          "destinations": [
            {}
          ],
          "server": {
            "url": "https://example.com/transfer",
            "secret": "transferSecretKey"
          },
          "function": {
            "name": "transferFunction",
            "description": "Transfers the call based on conditions",
            "parameters": {
              "type": "object",
              "properties": {},
Copy code
"required": [
                "transferTarget"
              ]
            }
          }
        }
      ],
      "provider": "openai",
      "model": "gpt-4o",
      "fallbackModels": [
        "gpt-4-0125-preview",
        "gpt-4-0613"
      ],
      "semanticCachingEnabled": true,
      "numFastTurns": 1,
      "temperature": 1,
      "knowledgeBase": {
        "topK": 123,
        "fileIds": [
          "fileId1"
        ],
        "provider": "canonical"
      },
      "maxTokens": 525,
      "emotionRecognitionEnabled": true
    },
    "voice": {
      "inputMinCharacters": 10,
      "inputPunctuationBoundaries": [
        ".", "!"
      ],
      "fillerInjectionEnabled": true,
      "provider": "azure",
      "voiceId": "andrew",
      "speed": 1.25
    },
    "forwardingPhoneNumber": "+13333333333",
    "firstMessageMode": "assistant-speaks-first",
    "voicemailDetectionTypes": [
      "machine_end_beep"
    ],
    "recordingEnabled": true,
    "endCallFunctionEnabled": true,
    "dialKeypadFunctionEnabled": true,
    "hipaaEnabled": true,
    "clientMessages": [
      "transcript",
      "hang",
      "tool-calls",
      "speech-update",
      "metadata",
      "conversation-update"
    ],
    "serverMessages": [
      "end-of-call-report",
      "status-update",
      "hang",
      "tool-calls"
    ],
    "silenceTimeoutSeconds": 30,
    "responseDelaySeconds": 0.4,
    "llmRequestDelaySeconds": 0.1,
    "numWordsToInterruptAssistant": 1,
    "maxDurationSeconds": 1800,
    "backgroundSound": "office",
    "backchannelingEnabled": true,
    "variableValues": {},
    "name": "MyAssistant",
    "firstMessage": "Hello, how can I assist you today?",
    "voicemailDetectionEnabled": true,
    "voicemailMessage": "Please leave a message after the beep.",
    "endCallMessage": "Thank you for calling, goodbye.",
    "endCallPhrases": [
      "goodbye", "
Copy code
hang up"
    ],
    "metadata": {},
    "serverUrl": "https://example.com/end",
    "serverUrlSecret": "endSecretKey",
    "summaryPrompt": "Summary of the call"
  }
}
Make sure to replace placeholder values such as
exampleCustomerId
,
examplePhoneId
,
exampleSid
, etc., with actual values relevant to your application. This payload is comprehensive and includes configurations for advanced features like transcribing, model overrides, and call transfers [(1)]() .
s
I think this fixed your issue?
a
yeah it's working now..Thanks buddy
v
Glad I could be helpful. Feel free to create a new thread with any new questions you may have.
5 Views