How to create users on Confluence problematically or using Ansible
Asked by Omar_Abdelrazik:

I have been looking for ways to create new users on Confluence using Ansible (or any scripting language) but couldn't find any documentation or a way around that.

All I got was page and space management; which is not what I need.

Is there a way to programatically create new users or is it not supported?


Answers:
author: Shannon S
body: Hello Omar,

Welcome to Atlassian Community. It's nice to have you join us. In order to work with Confluence programmatically, you will need to use the API. However, the Confluence API doesn't include a way to create users at this time. There's a feature request for this below.

* [CONFCLOUD-54893](https://jira.atlassian.com/browse/CONFCLOUD-54893) *Provide a Confluence Rest API to create a user*

If you also have Jira hosted on your Atlassian Cloud site, then as a workaround you can use the Jira Cloud API to create the user, and then assign the Confluence license groups all via REST-API. This is not possible if you do not have Jira hosted on your site.

For more information:

* [Jira Cloud REST API - Create user](https://developer.atlassian.com/cloud/jira/platform/rest/v3/#api-rest-api-3-user-get)
* [Atlassian Cloud Development](https://developer.atlassian.com/cloud/)

If you need any assistance in the future with this, you can visit our Atlassian Developer support resources below.

* [Atlassian Developer Community](https://community.developer.atlassian.com/)
* [Atlassian Developer Resources](https://developer.atlassian.com/resources/)

I hope that helps, but do let us know if you have any questions.

Shannon

comments: author: Omar_Abdelrazik
body: Thank you, Shannon.

I have Jira in fact but it's not JIRA cloud. Would this make a difference?

And if it's possible, could you please tell me how to do it? Will it be through duplicating user directors?

On JIRA, I wasn't able to find the JIRA User Server that facilities the connection.

And while we're at it, assuming that I used the JIRA User Server configuration, what should count as the account name and password?

Thanks a mil.


author: Shannon S
body: Hi Omar,

Unfortunately, in order for that to work, you would need to be able to do your user provisioning from Jira Server, which isn't possible in Confluence Cloud.

Atlassian Access, which is a paid extension to Cloud, has some ways to do external provisioning. You can read about from our document, [User Provisioning with Atlassian Access](https://confluence.atlassian.com/cloud/user-provisioning-959305316.htmlq). If you have Atlassian Access already, you can read more about how to configure that from [Configure User Provisioning](https://confluence.atlassian.com/cloud/user-provisioning-959305316.html). Then, depending on which provider you choose, you may be able to do it that way, instead of through Confluence.

Even though it's not possible to use Jira Server in this particular case, if you still want to know how to connect to Jira Server via REST-API, have a look here: [Jira Server REST-API Security Overview](https://developer.atlassian.com/server/jira/platform/security-overview/https://developer.atlassian.com/server/jira/platform/security-overview/).

Let me know if you have any questions about that.

Take care,

Shannon


author: Omar_Abdelrazik
body: [@Shannon S](/t5/user/viewprofilepage/user-id/510046) I am sorry, I believe I didn't get what you said.

In the first paragraph you mentioned that I need to do the user provisioning from Jira server.

I already have Jira but I can't find the option User Management -\> Jira User Server.

Would this be due to a limitation or do I need to purchase a plugin/service for the Jira User Server feature to appear on my admin portal?

Also I am trying to access the link for the Jira Server Rest API Security overview but it looks to be broken.

It would be very helpful to tell me why the Jira Server is not possible in my case and what could I do to make it happen (apart from subscribing for Atlassian Access).


author: Shannon S
body: Hi Omar,

My apologies, allow me to clarify that for you.

In summary, Confluence Cloud does *not* have a REST-API endpoint that will allow you to create new users. The feature request for that can be found here: [CONFCLOUD-54893](https://jira.atlassian.com/browse/CONFCLOUD-54893).

Jira Cloud *does* have a REST-API endpoint to create new users. You can use this as a workaround to add new Confluence Cloud users, since Jira and Confluence Cloud share the same userbase.

1. [Create the new user](https://developer.atlassian.com/cloud/jira/platform/rest/v3/?_ga=2.76704989.972333414.1592818730-1807160611.1583331418#api-rest-api-3-user-get) by using the Jira Cloud REST-API endpoint.
2. Again using REST-API, [assign the user to the required groups](https://developer.atlassian.com/cloud/jira/platform/rest/v3/?_ga=2.76704989.972333414.1592818730-1807160611.1583331418#api-rest-api-3-group-user-post) for the permissions they need to have (i.e. access to Confluence). You can check [Update Product Access Settings](https://confluence.atlassian.com/cloud/update-product-access-settings-744721629.html) for more information.

You asked about using Jira Server instead. Jira Server doesn't have the ability to control Confluence Cloud users, and it does not share the same userbase as Confluence Cloud. **Using [Jira Server as a Userbase](https://confluence.atlassian.com/adminjiraserver/allowing-connections-to-jira-for-user-management-938847045.html) only works with our other Server products.**

Finally, the link I included to the security overview appeared to be malformed by the editor. I'm correcting it now and including that link again below.

* [Jira Server Security Overview](https://developer.atlassian.com/server/jira/platform/security-overview/)

I hope that helps clarify things for you, but let me know if you have any further questions.

Regards,

Shannon


author: Omar_Abdelrazik
body: [@Shannon S](/t5/user/viewprofilepage/user-id/510046) Thank you Shannon for the clarification.

I already have an application link between Jira and Confluence but I am unable to login to confluence with the Jira credentials until I add the user with the same credentials to Confluence.

And on the Application Access page, I only see Jira Service Desk and Jira Software (no confluence).

Is there something I should do to make the seamless access happen?


author: Shannon S
body: Hello Omar,

It is not possible to login to Confluence Cloud with your Jira Server credentials.

If you're not able to find Confluence on your Application Access page, then you are probably looking at your Jira site instead. Make sure you're on your Confluence site first, then proceed with the article.

For more information on the integration between Cloud and Server:

* [Linking Server and Cloud apps - authentication](https://confluence.atlassian.com/confeval/other-atlassian-evaluator-resources/linking-server-and-cloud-apps-authentication)

> Atlassian Cloud uses either [Atlassian account](https://confluence.atlassian.com/cloud/administer-atlassian-accounts-873871209.html) or its native directory for authentication (we are progressively migrating all sites to use Atlassian account where internal directory is used). For [Cloud authentication](https://confluence.atlassian.com/cloud/authentication-873871233.html) with external user directory see [Google Apps integration](https://confluence.atlassian.com/cloud/setting-up-google-apps-for-your-ondemand-instance-342753901.html) and [SAML (Beta)](https://confluence.atlassian.com/cloud/saml-single-sign-on-943953302.html) options.

I hope that helps, but please do let me know if you still have any further doubts.

Regards,

Shannon


author: Omar_Abdelrazik
body: [@Shannon S](/t5/user/viewprofilepage/user-id/510046) The Jira and Confluence implementation in our site are Server based not Cloud as they are hosted locally. I think the suggestion you provided above was for Jira and Confluence Cloud right?

In this case, if they are not Cloud, they won't share the same user base, right? if so, will the action plan above work or will I need to do it via [this link?](https://confluence.atlassian.com/adminjiraserver/allowing-connections-to-jira-for-user-management-938847045.html?_ga=2.30891126.837004917.1592823172-1527359515.1592324820)

I am sorry for asking too many questions. I am just new to the platform and I really appreciate the help you provide.


author: Shannon S
body: Hi Omar,

That's correct; I was providing you the details for Confluence Cloud. Your question is showing on my end to be related to Confluence Cloud. If you did not select Confluence Cloud as your product when asking the question, then it may because you only have a Cloud site associated with your email address. Since you're referring to Confluence Server, the above information does not apply to you. My apologies.

In terms of a solution for **Confluence Server**, there is also no REST-API for user management just yet. We have the following feature request for that:

* [CONFSERVER-56205](https://jira.atlassian.com/browse/CONFSERVER-56205)

As an **unofficial workaround**, you may still be able to use the deprecated SOAP API service. Review Stephen's suggestion below:

* [When will Confluence REST API allow user creation?](https://community.atlassian.com/t5/Confluence-questions/When-will-Confluence-REST-API-allow-user-creation/qaq-p/594698)

Please note that this is technically deprecated since Confluence version 5.5, but some aspects of SOAP may still work at this time.

Otherwise, you may be able to use a [Command Line Interface](https://marketplace.atlassian.com/search?hosting=server&product=confluence&query=command%20line%20interface) add-on from Marketplace in order to add your users. You can find an example of how that would work from Bob Swift's documentation: [How to add users to groups in bulk](https://bobswift.atlassian.net/wiki/spaces/SUPPORT/pages/274301145/How+to+add+users+to+groups+in+bulk).

I hope that's clear, but let me know if you have any questions about that.

Shannon


Tags: cloud