I am setting up a topic and trying to grant permission to gmail to send email notification to this topic, but the API call throws "User not authorized to perform this action". I get the same error when I tried from the https://cloud.google.com/pubsub/reference/rest/v1/projects.topics/setIamPolicy. BTW, I started seeing this issue recently. It was working fine before.
POST https://pubsub.googleapis.com/v1/projects/macro-xxxxx-xxx/topics/exxxxx-inxxx:setIamPolicy?key={YOUR_API_KEY}
{
"policy": {
"bindings": [
{
"role": "roles/pubsub.publisher",
"members": [
"serviceAccount:gmail-api-push@system.gserviceaccount.com"
]
}
]
}
}
{
"error": {
"code": 403,
"message": "User not authorized to perform this action.",
"status": "PERMISSION_DENIED"
}
}
Appreciate any help, Thanks.