Assignee Role Admin to a Username with REST API

Before you post: Your responses to these questions will help the community help you. Please complete this template if you’re asking a support question.
Don’t forget to select tags to help index your topic!

1. Describe your incident:
I’m trying to use REST API method to assign users to a role “Admin”, but I don’t figure out how.

2. Describe your environment:

  • OS Information:
    CentOS 7.9

  • Package Version:
    Graylog 4.2.9

  • Service logs, configurations, and environment variables:
    The response is blank.

3. What steps have you already taken to try and solve the problem?

curl -s -X PUT -s admin:admin -H ‘Content-Type: application/json’ -H ‘Accept: application/json’ -H ‘X-Requested-By: cli’ ‘https://my-domain-com/api/authz/roles/$ADMIN_ROLE_ID/assignees’ --data ‘{“username":"myuser@my-domain.com”}’

4. How can the community help?

Can someone help, I did using Browser-API, but I need to automate and Its important to do with curl.

Hello && Welcome

Have you tried testing this out in the API browser (i.e. under System/Nodes)? If so what did you see?

Hi @gsmith, thanks for the response.

I figured out how it works, It’s solved.

curl -s -X PUT -s admin:admin -H ‘Content-Type: application/json’ -H ‘Accept: application/json’ -H ‘X-Requested-By: cli’ ‘https://my-domain-com/api/authz/roles/$ADMIN_ROLE_ID/assignees --data ‘[“username”]’

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.