Skip to content
Discussion options

You must be logged in to vote

Hi @owalencikecn — your payload format looks correct on the surface. The CreateGroupDto accepts participant IDs in the 628123456789@c.us format (exactly what you're using), so the 400 Bad Request isn't coming from the DTO validation itself.

A few things to check:

  1. Content-Type header. Make sure your request includes Content-Type: application/json. Without it, the body isn't parsed as JSON and the DTO receives an empty object — which does fail validation with a 400.

    curl -X POST http://localhost:2785/api/sessions/{sessionId}/groups \\
      -H "X-API-Key: YOUR_KEY" \\
      -H "Content-Type: application/json" \\
      -d '{"name":"My Group","participants":["33612345678@c.us"]}'
  2. The full error body.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by rmyndharis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants