Failed to parse json with additional fields

I have add an additional field for team in organization plugin:

organization({
  schema: {
    team: {
      additionalFields: {
        metadata: {
          type: "json",
          input: true,
          required: true,
          returned: true
        }
      }
    }
  }
})


It's OK to create a new team. However, when I try to update a team with metadata field, I got an error:

2025-12-01T16:03:28.496Z ERROR [Better Auth]: SyntaxError SyntaxError: Failed to parse JSON

# SERVER_ERROR:  SyntaxError: Failed to parse JSON

 HTTP  2025-12-2 0:3:28 POST 200 /v1/auth/organization/update-team 16096μs


This is the payload that I sent to update-team

{
    "teamId": "bUT3dVLNfP57EXXuGBmnvyeyGayWmRZL",
    "data": {
        "metadata": {
            "color": "rgb(255, 36, 189)",
            "description": "This is my inherent team..."
        },
    }
}


Anyone tell me how to solve or debug this error?
Was this page helpful?