#{ "type": "webhook", "name": "notify_webhook", "description": "Sends

1 messages · Page 1 of 1 (latest)

prime iceBOT
#
AI-generated Answer for nisha_35664

To add this webhook configuration to the custom tools of your agent and resolve the 400 Bad Request error, follow these steps:

1. Verify the Webhook URL

  • Ensure the URL (https://aiagents.app.n8n.cloud/webhook-test/7000752e-a7aa-4814-ac68-b567c748c3f8/bland-check-calendar) is correct and accessible. Test it using a tool like Postman to confirm it accepts requests.

2. Check the Request Body

  • The 400 error typically indicates a problem with the request body. Ensure the calendarId, botId, and calendarAccountId variables are being correctly populated with valid values before sending the request. For example:
    {
      "calendarId": "your_calendar_id",
      "botId": "your_bot_id",
      "calendarAccountId": "your_calendar_account_id"
    }
    

3. Set Up the Tool in the Agent

  • Go to the Tools section of your AI Agent in the ElevenLabs platform.
  • Add a new tool and configure it as follows:
    • Type: Webhook
    • Name: notify_webhook
    • Description: Sends a notification to a webhook with user details
    • URL: https://aiagents.app.n8n.cloud/webhook-test/7000752e-a7aa-4814-ac68-b567c748c3f8/bland-check-calendar
    • Method: POST
    • Headers:
      {
        "Content-Type": "application/json",
        "Authorization": "Bearer YOUR_API_KEY"
      }
      
    • Body:
      {
        "calendarId": "{{calendarId}}",
        "botId": "{{botId}}",
        "calendarAccountId": "{{calendarAccountId}}"
      }
      
    • **API Schema: Add the schema provided in your configuration.

4. Dynamic Variables

  • If you are using dynamic variables (e.g., {{calendarId}}), ensure they are correctly mapped in the agent's configuration. For example, you might need to pass these variables from the conversation context or a prior tool call.

5. Test the Tool

  • After setting up the tool, test it by triggering the webhook from the agent. Check the logs for any errors or missing parameters.

6. Debugging

  • If the issue persists, check the following:
    • Ensure all required fields (calendarId, botId, calendarAccountId) are included in the request body.
    • Verify that the API key in the Authorization header is valid.
    • Check the webhook server logs for more details on why the request is being rejected.

If you still encounter issues, please share the exact error message or logs for further assistance.

muted nymph
#

I want to set custom tool through update agent API not from dashboard

prime iceBOT
#
AI-generated Answer for nisha_35664

To set up a custom tool for your agent using the Update Agent API, you need to ensure the tool configuration is correctly formatted and included in the API request payload. Here's how you can do it:

Steps to Add Custom Tool via Update Agent API:

  1. Prepare the API Request:

    • Use the Update Agent endpoint to modify your agent.
    • Include the tools field in the payload with the configuration for your custom tool.
  2. Example Payload:
    Below is an example of how your payload might look when adding the custom tool:

    {
      "tools": [
        {
          "type": "webhook",
          "name": "notify_webhook",
          "description": "Sends a notification to a webhook with user details",
          "url": "https://aiagents.app.n8n.cloud/webhook-test/7000752e-a7aa-4814-ac68-b567c748c3f8/bland-check-calendar",
          "method": "POST",
          "headers": {
            "Content-Type": "application/json",
            "Authorization": "Bearer YOUR_API_KEY"
          },
          "body": {
            "calendarId": "your_calendar_id",
            "botId": "your_agent_hash_id",
            "calendarAccountId": "your_calendar_account_id"
          },
          "api_schema": {
            "type": "object",
            "properties": {
              "calendarId": {
                "type": "string",
                "description": "The ID of the calendar"
              },
              "botId": {
                "type": "string",
                "description": "The ID of the bot"
              },
              "calendarAccountId": {
                "type": "string",
                "description": "The calendar account ID"
              }
            },
            "required": ["calendarId", "botId", "calendarAccountId"]
          },
          "dynamic_variables": {
            "dynamic_variable_placeholders": {
              "user_name": "John Doe"
            }
          },
          "expects_response": false
        }
      ]
    }
    
  3. Check for Errors:

    • A 400 error typically indicates a bad request. Double-check the following:
      • Ensure all required fields (calendarId, botId, calendarAccountId) are provided and correctly formatted.
      • Verify the Authorization token is valid and has the necessary permissions.
      • Confirm the url is reachable and correctly formatted.
  4. Test the API Call:

    • Use tools like Postman or cURL to test the API request.
    • Example cURL command:
      curl -X POST https://api.elevenlabs.io/v1/agents/{agent_id} \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      -d '{
        "tools": [
          {
            "type": "webhook",
            "name": "notify_webhook",
            "description": "Sends a notification to a webhook with user details",
            "url": "https://aiagents.app.n8n.cloud/webhook-test/7000752e-a7aa-4814-ac68-b567c748c3f8/bland-check-calendar",
            "method": "POST",
            "headers": {
              "Content-Type": "application/json",
              "Authorization": "Bearer YOUR_API_KEY"
            },
            "body": {
              "calendarId": "your_calendar_id",
              "botId": "your_agent_hash_id",
              "calendarAccountId": "your_calendar_account_id"
            },
            "api_schema": {
              "type": "object",
              "properties": {
                "calendarId": {
                  "type": "string",
                  "description": "The ID of the calendar"
                },
                "botId": {
                  "type": "string",
                  "description": "The ID of the bot"
                },
                "calendarAccountId": {
                  "type": "string",
                  "description": "The calendar account ID"
                }
              },
              "required": ["calendarId", "botId", "calendarAccountId"]
            },
            "dynamic_variables": {
              "dynamic_variable_placeholders": {
                "user_name": "John Doe"
              }
            },
            "expects_response": false
          }
muted nymph
#

This conversation failed with the following reason:

Missing required dynamic variables in tools: {'calendarAccountId', 'date', 'calendarId', 'botId'}