through API we are unable to add organisation and teams to the users

18 views
Skip to first unread message

Wajid Baig

unread,
Nov 15, 2022, 5:45:13 AM11/15/22
to AWX Project
In the orchestration we are able to create the users manually and able to add organization and teams also.
But through API we are unable to add organization and teams to the users.
We tried 2 different API's to add organization and teams. But every time either organization or teams we are able to add but not both.

1. Through teams API we create the user and able to add the teams not the organization.
     API URL:   /api/v2/teams/{team_id}/users/
2. Through organization API we create the user and able to map the organization not the teams.
     API URL: /api/v2/organizations/{org_id}/users/

But the other API also we tried that is User API. But in that case we are able to create only user.
Is there any possible way to add both the teams and organization to that user through API?

Please help!
Thanks in advance,

AWX Project

unread,
Nov 16, 2022, 2:57:29 PM11/16/22
to AWX Project
When the UI is interacting with the API they have to make 2 different API calls to set the orgs and teams for a user. We are pretty positive you will have to do the same.

-The AWX Team

Wajid Baig

unread,
Nov 18, 2022, 9:08:06 AM11/18/22
to AWX Project
Hi AWX Project, 

Thank you very much for your response. Can you please share the 2 API calls that are called by UI?

Thanks again, 

Best wishes & Regards,
Ahmed

AWX Project

unread,
Dec 9, 2022, 2:03:09 PM12/9/22
to AWX Project
Apologies for the delay in response. Since AWX is an API first application the UI will make the same calls to the API that you will need to make. So the best way to do this is to open the developer console in the browser and make the request though the UI and just watch the traffic. The developer console will even show you the payloads it used when it made the requests to the API.

-The AWX Team

Reply all
Reply to author
Forward
0 new messages