Unable to remove Zero Access seat via API

Trying to use the method here remove a users seat
https://developers.cloudflare.com/api/operations/zero-trust-seats-update-a-user-seat

Keep getting:
{
“result”: null,
“success”: false,
“errors”: [
{
“code”: 12074,
“message”: “access.api.error.invalid_user_seat”
}
],
“messages”:
}

The seat_uid is the same one retrieved from the /access/users request.

Thoughts?

Need a bit more detail about what language and code looks like.

I had this problem in Python, as I wasn’t sending the JSON as an array , i.e. the outer square brackets in the data you send are important.

Not sure if your problem was the same

Hey,

I have the same problem.
I’m using Powershell and the same result on Postman.
I tried with body as a String, Array, Hashtable, Converted to Json.
Nothing helped.

$data = @{
“access_seat” = $false
“gateway_seat” = $false
“seat_uid” = “HERE IS SEAT UID”
}

$data = ‘{
“seat_uid”: “HERE IS SEAT UID”,
“access_seat”: false,
“gateway_seat”: false
}’

$data = ‘{
“seat_uid”: HERE IS SEAT UID,
“access_seat”: false,
“gateway_seat”: false
}’

[array]$data = @{
“access_seat” = $false
“gateway_seat” = $false
“seat_uid” = “HERE IS SEAT UID”
}

My issue was actually resolved by making sure it was in an array.

Could you send final version of your json format?

Sure:

[{
“access_seat”: false,
“gateway_seat”: false,
“seat_uid”:“”
}]

For some reason Powershell while converting to JSON version skips outer square brackets.
So after converting I had to add brackets manually.

$data = @{
access_seat = $false
gateway_seat = $false
seat_uid = “seat_uid”
}
$jsonData = “[”, ($data | ConvertTo-Json), “]”

Thank you for the help!