Hi everyone! I have an issue that I can't solved. I'm trying to speak with one of my agent through n8n but I get this error all the time. And I'm sure this is the right workspace id. I'm using POST and URL https://dust.tt/api/v1/w/xxx/assistant/conversations to talk with the agent Any idea? 🙏 Thanks a lot
What does the body of your POST request look like?
{ "agentId": "xxx", "messages": [ { "role": "user", "content": "{{ $json.transcript }}" } ] }
So you're trying to create a new conversation, right? I think it should look more like:
{
"message": {
"content": "Conversation created from API",
"mentions": [
{
"configurationId": "claude-3-7-sonnet"
}
],
"context": {
"username": "yourname",
"timezone": "Europe/Paris"
}
},
"blocking": true
}
And pass your agent ID in configurationId instead of claude-3-7-sonnet.
Thank you! It's better I have a result but it is not an answer from the agent : id:xxxx owner id:xx sId:xxx name:xx role:builder segmentation:[null] ssoEnforced:false whiteListedProviders:[null] defaultEmbeddingProvider:[null] metadata isBusiness:false created:xx sId:xx title:[null] visibility:unlisted content:[empty array] requestedGroupIds:[empty array]
Pauline Leroy in my initial reply, I had forgotten the "blocking": true, and added it later above. Can you try adding that?
same results
It's a little hard to make sense of what you pasted, because it doesn't have the structure/braces. Normally, the response should have a conversation property, and a message property.
i think it will be better like this sorry
Ah, yes, clearer! Normally, the interesting part should be in the content array, but yours is empty and I'm not sure why. 🤔
My best suggestion is to isolate by starting simple. Does it work if you send exactly this in the body?
{
"message": {
"content": "What day is today?",
"mentions": [
{
"configurationId": "claude-3-7-sonnet"
}
],
"context": {
"username": "yourname",
"timezone": "Europe/Paris"
}
},
"blocking": true
}
Then if it does, you can add your things one by one: your agent ID, your content.
is it the right post url : https://dust.tt/api/v1/w/workspaceid/assistant/conversations
Yes, it's definitely the right one. https://docs.dust.tt/reference/post_api-v1-w-wid-assistant-conversations
No it's the same type of answer without content. Or can it be because we don't have the agent ID yet?
No, because in my simple case, you just use claude-3-7-sonnet, so you don't need your own agent ID. Sending this exact body works for me using postman. Maybe you can try postman to isolate, in case n8n is doing something funny?
I was also able to see it work using the test capabilities built right into the help page (https://docs.dust.tt/reference/post_api-v1-w-wid-assistant-conversations). Just enter the values for all the fields.
e.g.
[
{
"conversation": {
"id": xx,
"created": xx,
"sId": "tEHk6K7e1Y",
"owner": {
"id": 54093,
"sId": "xx",
"name": "xx",
"role": "builder",
"segmentation": null,
"ssoEnforced": false,
"whiteListedProviders": null,
"defaultEmbeddingProvider": null,
"metadata": {
"isBusiness": false
}
},
"title": "Current Date Inquiry",
"visibility": "unlisted",
"content": [
[
{
"id": 21620958,
"sId": "IwW9VVnmN4",
"type": "user_message",
"visibility": "visible",
"version": 0,
"created": xx,
"user": null,
"mentions": [
{
"configurationId": "claude-3-7-sonnet"
}
],
"content": "What day is today?",
"context": {
"username": "yourname",
"timezone": "Europe/Paris",
"fullName": null,
"email": null,
"profilePictureUrl": null,
"origin": "api"
}
}
],
[
{
"id": xx,
"agentMessageId": xx,
"sId": "xx",
"created": xx,
"type": "agent_message",
"visibility": "visible",
"version": 0,
"parentMessageId": "IwW9VVnmN4",
"status": "succeeded",
"actions": [],
"content": "Today is Tuesday, April 15, 2025.",
"chainOfThought": null,
"rawContents": [
{
"step": 0,
"content": "Today is Tuesday, April 15, 2025."
}
],
"error": null,
"configuration": {
"id": -1,
"sId": "claude-3-7-sonnet",
"version": 0,
"versionCreatedAt": null,
"versionAuthorId": null,
"name": "claude-3.7",
"description": "Anthropic's latest Claude 3.7 Sonnet model (200k context).",
"instructions": "Only use visualization if it is strictly necessary to visualize data or if it was explicitly requested by the user. Do not use visualization if markdown is sufficient.",
"pictureUrl": "https://dust.tt/static/systemavatar/claude_avatar_full.png",
"status": "active",
"scope": "global",
"userFavorite": false,
"model": {
"providerId": "anthropic",
"modelId": "claude-3-7-sonnet-20250219",
"temperature": 0.7
},
"actions": [],
"maxStepsPerRun": 8,
"visualizationEnabled": true,
"templateId": null,
"requestedGroupIds": []
}
}
]
],
"requestedGroupIds": []
},
"message": {
"id": xx,
"created": xx,
"sId": "IwW9VVnmN4",
"type": "user_message",
"visibility": "visible",
"version": 0,
"user": null,
"mentions": [
{
"configurationId": "claude-3-7-sonnet"
}
],
"content": "What day is today?",
"context": {
"timezone": "Europe/Paris",
"username": "yourname",
"fullName": null,
"email": null,
"profilePictureUrl": null,
"origin": "api",
"localMCPServerIds": []
},
"rank": 0
}
}
]
I have something now but not sure what's the reply is
The reply is the second item from the content array ("Today is Tuesday, April 15, 2025")
Thanks a lot!!! The only this is that when i want to replace with this element I have the following error: The data in "Body Parameters" is no valid JSON. Set Body Content Type to "RAW/Custom" for XML or other types of payloads
This looks like an n8n error, not Dust, right?
Yes sounds like this, I'll dig this out. Thanks a lot for your help 💪
One guess: try changing it to '{{$json["Text"]}}'. This is from reading this thread, but no idea if it's correct: https://community.n8n.io/t/http-request-body-parameters-is-no-valid-json/12861/7
Yes I’ve tried also but then I get all of this x1000
Ok, so that's clearly wrong. Probably best to ask https://community.n8n.io/ for that part. At least we have the Dust side sorted out 😛
Thanks a lot David ! When I’ll figure out the solution, I’ll post it here for anyone who might have a similar issue. 🙂 🙏
Turns out the issue was due to some carriage returns in the JSON text. I had to strip them out to get it working.
Great, nice job in figuring this out!