unable to add summery plan prompt through api
# support
v
@Kavish It seems like you're trying to add a summary plan prompt through the API but are encountering an issue. To assist you effectively, I would need more information about the API endpoint you're using and the specific problem you're facing. Could you please provide more details or clarify the issue you're experiencing? This will help me guide you through the correct steps to resolve your problem.
You can continue this conversation by mentioning me in the message.
k
@Vapi
v
@Kavish Please ask support for more info on this.
@Kavish Please ask support for more info on this.
k
curl -X POST https://api.vapi.ai/assistant \ -H "Authorization: Bearer 7c3d8578e463aed" \ -H "Content-Type: application/json" \ -d '{ @Vapi
v
@Kavish It looks like you're attempting to make a POST request to the VAPI API to create or update an assistant configuration, but your data payload seems incomplete. To help you further, please ensure that your JSON payload is complete and valid. Here's an example of how you can structure your JSON payload:
Copy code
json
{
  "analysisPlan": {
    "successEvaluationPlan": {
      "rubric": "AutomaticRubric",
      "enabled": false,
      "messages": []
    },
    "summaryPlan": {
      "messages": [
        {
          "content": "Your summary message here"
        }
      ]
    },
    "structuredDataPlan": {}
  },
  "monitorPlan": {
    "listenEnabled": true,
    "controlEnabled": true
  },
  "server": {
    "url": "https://make.com"
  },
  "name": "my assistant"
}
Make sure to replace
"Your summary message here"
with the actual summary message you want to include. Once you have your complete JSON payload, you can make the POST request like this:
Copy code
bash
curl -X POST https://api.vapi.ai/assistant \
     -H "Authorization: Bearer 7c3d8578e463aed" \
     -H "Content-Type: application/json" \
     -d '{
  "analysisPlan": {
    "successEvaluationPlan": {
      "rubric": "AutomaticRubric",
      "enabled": false,
      "messages": []
    },
    "summaryPlan": {
      "messages": [
        {
          "content": "Your summary message here"
        }
      ]
    },
    "structuredDataPlan": {}
  },
  "monitorPlan": {
    "listenEnabled": true,
    "controlEnabled": true
  },
  "server": {
    "url": "https://make.com"
  },
  "name": "my assistant"
}'
If you encounter any issues or need further assistance, please let me know!
k
how to multiline prompt
@Vapi how to write multiline prompt
v
@Kavish To write a multiline prompt in a JSON payload, you can use a backslash followed by a newline character to break the string across multiple lines, or you can simply include the newline characters within a single string. Here's an example of both methods: Using backslash and newline character:
Copy code
json
{
  "prompt": "This is the first line.\n\
This is the second line.\n\
This is the third line."
}
Using newline characters within a single string:
Copy code
json
{
  "prompt": "This is the first line.\nThis is the second line.\nThis is the third line."
}
In both cases, the
\n
represents a newline character, which will create a multiline prompt when the JSON is parsed. When you're writing this inside a
curl
command, make sure to wrap your JSON data with single quotes
'
to avoid any issues with shell interpretation of the newline characters. Here's how it would look in a
curl
command:
Copy code
bash
curl -X POST https://api.vapi.ai/assistant \
     -H "Authorization: Bearer 7c3d8578e463aed" \
     -H "Content-Type: application/json" \
     -d '{
  "prompt": "This is the first line.\nThis is the second line.\nThis is the third line."
}'
Remember to replace the URL and the authorization token with your actual endpoint and token. If you have any further questions or need additional assistance, feel free to ask!
k
"summaryPlan": { "messages": [ { "role": "system", "content":"You are an AI assistant helping summarize phone conversations for business purposes. Your task is to generate a professional summary of the call based on the transcript provided.\n\nInstructions:\n1. Summarize the main purpose of the call.\n2. Highlight key topics or points discussed.\n3. Note any questions asked by the caller and the responses provided.\n4. Identify any action items or next steps mentioned.\n5. Provide the tone of the conversation (e.g., friendly, professional, urgent).\n\nHere is the transcript of the call:\n[Insert transcript here]\n\nYour output should be concise, clear, and formatted like this:\n\n- Call Purpose: [Brief description]\n- Key Discussion Points:\n 1. [Point 1]\n 2. [Point 2]\n- Questions Asked:\n - [Question 1]: [Response]\n- Action Items/Next Steps:\n - [Item 1]\n - [Item 2]\n- Call Tone: [Tone description]" } ] }, "structuredDataPlan": {} }, "monitorPlan": { "listenEnabled": true, "controlEnabled": true }, "server": { "url": "https://make.com" }, "name": "my assistant", "forwardingPhoneNumber": "+918980579954" }'```````` @Vapi
v
@Kavish It looks like you've crafted a JSON payload for configuring a summary plan within an assistant on the VAPI platform. Your payload includes a detailed instruction set for the AI assistant to follow when summarizing phone conversations. To ensure that your payload is correctly formatted for a
curl
request, you should wrap it in single quotes and make sure there are no stray backticks at the end. Here's how you can structure your
curl
command:
Copy code
bash
curl -X POST https://api.vapi.ai/assistant \
     -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
     -H "Content-Type: application/json" \
     -d '{
  "summaryPlan": {
    "messages": [
      {
        "role": "system",
        "content": "You are an AI assistant helping summarize phone conversations for business purposes. Your task is to generate a professional summary of the call based on the transcript provided.\n\nInstructions:\n1. Summarize the main purpose of the call.\n2. Highlight key topics or points discussed.\n3. Note any questions asked by the caller and the responses provided.\n4. Identify any action items or next steps mentioned.\n5. Provide the tone of the conversation (e.g., friendly, professional, urgent).\n\nHere is the transcript of the call:\n[Insert transcript here]\n\nYour output should be concise, clear, and formatted like this:\n\n- Call Purpose: [Brief description]\n- Key Discussion Points:\n  1. [Point 1]\n  2. [Point 2]\n- Questions Asked:\n  - [Question 1]: [Response]\n- Action Items/Next Steps:\n  - [Item 1]\n  - [Item 2]\n- Call Tone: [Tone description]"
      }
    ]
  },
  "structuredDataPlan": {},
  "monitorPlan": {
    "listenEnabled": true,
    "controlEnabled": true
  },
  "server": {
    "url": "https://make.com"
  },
  "name": "my assistant",
  "forwardingPhoneNumber": "+918980579954"
}'
Make sure to replace
YOUR_ACCESS_TOKEN
with your actual VAPI access token. If you have any further questions or need additional assistance, feel free to ask!
k
@Vapi my acccess tolkken is valid but still it not keeping my summery prompt (BTW i m creating new assitant )
v
@Kavish If your access token is valid and you're still having trouble with the summary prompt not being saved when creating a new assistant, there might be a few reasons for this issue: 1. **API Endpoint or Method**: Ensure you're using the correct API endpoint and HTTP method for creating a new assistant. It's typically a POST request to a specific URL provided by the API documentation. 2. **JSON Payload**: Double-check your JSON payload for any formatting issues or missing required fields. The payload must be well-formed and include all necessary information. 3. **API Limits**: There might be limits on the API that prevent certain operations or require specific conditions to be met before you can add a summary prompt. 4. **API Version**: Make sure you're using the correct version of the API. Sometimes, APIs get updated, and the way to interact with them might change. 5. **Error Messages**: Look for any error messages in the API response. They can provide clues about what's going wrong. Since you're creating a new assistant, here's a checklist to follow: - Verify the API endpoint for creating a new assistant. - Ensure your JSON payload is complete and correctly formatted. - Check the API documentation for any specific requirements for the summary prompt. - Make the
curl
request and carefully read the API response for any error messages or indications of what might be wrong. If you've gone through these steps and the issue persists, it might be best to reach out to the API support team for further assistance. They can provide more detailed guidance based on the specifics of their system. If you can share the error message or response you're receiving from the API, I might be able to offer more targeted advice.