Wrong response from "Update current organization" endpoint

Hi, I am using the grafana image from Docker hub (tag: latest). For initialization I’m making use of the HTTP APIs.

What I’m trying to achieve

After creating a new organization using the POST /api/orgs endpoint, I am trying to update my current organization (from Main Org.) to the newly created organization (say, Org XYZ)

I’m using the basic authentication to auth. Following are the parameters that I’ve used.

Method: PUT
URL: http://admin:admin@community.grafana.com/api/org
BODY

{
    "name": "Org XYZ"
}

Result

{
    "message": "Organization name taken",
    "traceID": ""
}

The result

Based on the docs the response should have been

{
    "message": "Organization updated"
}

but, as mentioned I’m getting the aforementioned response, so I’m unable to set the org to be the “current” organization.

Note

I’ve tried passing “Main Org.” as name in the request, in that case, I’m getting the appropriate response. But in case of an organization I’m creating this issue is occurring.