#Hey, I'm having a lot of trouble to 'translate' a request body schema with nested objects and array
1 messages · Page 1 of 1 (latest)
Short answer: In ElevenLabs Tools, the request body is described with api_schema.request_body_schema using a JSON-object schema that supports nested objects and arrays. Arrays are declared with type: "array" and an items schema; objects use type: "object" with properties and required. This is the same structure exposed in the Tools API reference (request_body_schema/type/properties/required) and the Server tools guide. (elevenlabs.io)
Example tool_config payload that matches your body exactly (array-of-strings, array-of-objects-with-array-of-objects, and an integer):
{
"tool_config": {
"type": "webhook",
"name": "hubspot_search_by_phone",
"description": "Search contacts by phone/mobilephone using contains-token filters.",
"api_schema": {
"url": "https://example.com/contacts/search",
"method": "POST",
"request_headers": {
"Content-Type": "application/json"
},
"request_body_schema": {
"type": "object",
"properties": {
"properties": {
"type": "array",
"items": { "type": "string" },
"description": "Contact properties to return."
},
"filterGroups": {
"type": "array",
"items": {
"type": "object",
"properties": {
"filters": {
"type": "array",
"items": {
"type": "object",
"properties": {
"propertyName": { "type": "string" },
"operator": { "type": "string" },
"value": { "type": "string" }
},
"required": ["propertyName", "operator", "value"]
}
}
},
"required": ["filters"]
},
"description": "Groups of filters combined with AND within a group; groups are combined with OR (per API semantics)."
},
"limit": { "type": "integer" }
},
"required": ["properties", "filterGroups", "limit"],
"description": "Search request for contacts."
}
}
}
}
Where this comes from:
- The Tools API shows api_schema.request_body_schema as an object with type, properties, required, and description fields. Arrays and nested objects are expressed by setting type to "array" with an items schema, and type to "object" with properties, respectively. (elevenlabs.io)
- The Server tools guide explains that agents generate body/query/path parameters from your tool configuration, which you define in the tool’s schema. (elevenlabs.io)
Tip: If you manage tools via API, use POST /v1/convai/tools with the tool_config above; you can later PATCH the tool to adjust the schema. (elevenlabs.io)
If you need this declared through the dashboard instead of
But wait, my current requestBodySchema is: