# Creating users using cli or api

**URL:** <https://forum.pritunl.com/t/creating-users-using-cli-or-api/3312>\
**Category:** Pritunl\
**Created:** [May 7, 2025, 11:32am UTC](https://forum.pritunl.com/t/creating-users-using-cli-or-api/3312 "2025-05-07T11:32:02Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![kkalugeroff](https://forum.pritunl.com/user_avatar/forum.pritunl.com/kkalugeroff/32/1298_2.png) [@kkalugeroff](https://forum.pritunl.com/u/kkalugeroff)\
**Post date:** [May 7, 2025, 11:32am UTC](https://forum.pritunl.com/t/creating-users-using-cli-or-api/3312/1 "2025-05-07T11:32:02Z")

</div>

Hello,

Is it possible to create users using cli or api, if so where can we read more about it?

Thanks,  
Kristiyan

---

<div class="post-metadata">

**Author:** ![zach](https://forum.pritunl.com/user_avatar/forum.pritunl.com/zach/32/1105_2.png) [@zach](https://forum.pritunl.com/u/zach)\
**Post date:** [May 7, 2025, 12:50pm UTC](https://forum.pritunl.com/t/creating-users-using-cli-or-api/3312/2 "2025-05-07T12:50:08Z")

</div>

There is a [**Pritunl Terraform Provider**](https://github.com/disc/terraform-provider-pritunl) but there is no CLI options to add users.

---

<div class="post-metadata">

**Author:** ![kkalugeroff](https://forum.pritunl.com/user_avatar/forum.pritunl.com/kkalugeroff/32/1298_2.png) [@kkalugeroff](https://forum.pritunl.com/u/kkalugeroff)\
**Post date:** [May 7, 2025, 1:40pm UTC](https://forum.pritunl.com/t/creating-users-using-cli-or-api/3312/3 "2025-05-07T13:40:50Z")

</div>

What about this - [API Access](https://docs.pritunl.com/docs/api) , is there any other methods supported?

---

<div class="post-metadata">

**Author:** ![zach](https://forum.pritunl.com/user_avatar/forum.pritunl.com/zach/32/1105_2.png) [@zach](https://forum.pritunl.com/u/zach)\
**Post date:** [May 8, 2025, 2:10pm UTC](https://forum.pritunl.com/t/creating-users-using-cli-or-api/3312/4 "2025-05-08T14:10:18Z")

</div>

There is an API but it is undocumented, that is only for the authentication.

---

<div class="post-metadata">

**Author:** ![kkalugeroff](https://forum.pritunl.com/user_avatar/forum.pritunl.com/kkalugeroff/32/1298_2.png) [@kkalugeroff](https://forum.pritunl.com/u/kkalugeroff)\
**Post date:** [May 8, 2025, 2:37pm UTC](https://forum.pritunl.com/t/creating-users-using-cli-or-api/3312/5 "2025-05-08T14:37:19Z")

</div>

Do you have any plans to documented it soon?

---

<div class="post-metadata">

**Author:** ![kkalugeroff](https://forum.pritunl.com/user_avatar/forum.pritunl.com/kkalugeroff/32/1298_2.png) [@kkalugeroff](https://forum.pritunl.com/u/kkalugeroff)\
**Post date:** [May 9, 2025, 1:10pm UTC](https://forum.pritunl.com/t/creating-users-using-cli-or-api/3312/6 "2025-05-09T13:10:33Z")

</div>

What I’m also trying to achieve is to retriev the peer certificate(ovpn) programmatically.  
Is there any option to achieve this ?  
The idea is to register a new peers into organization in a programmatic fashion and as a result of this operation to return the certificate the peer is supposed to use to connect to the PritunlVPN.

---

<div class="post-metadata">

**Author:** ![kkalugeroff](https://forum.pritunl.com/user_avatar/forum.pritunl.com/kkalugeroff/32/1298_2.png) [@kkalugeroff](https://forum.pritunl.com/u/kkalugeroff)\
**Post date:** [May 12, 2025, 3:38pm UTC](https://forum.pritunl.com/t/creating-users-using-cli-or-api/3312/7 "2025-05-12T15:38:21Z")

</div>

@zach ,

I have tried the approach described here → [API Access](https://docs.pritunl.com/docs/api)  
but the user section returned doesn’t contain anything related to client certificate/endpoint…  
Would you mind sharing your thoughts on this?

---

<div class="post-metadata">

**Author:** ![zach](https://forum.pritunl.com/user_avatar/forum.pritunl.com/zach/32/1105_2.png) [@zach](https://forum.pritunl.com/u/zach)\
**Post date:** [May 12, 2025, 9:45pm UTC](https://forum.pritunl.com/t/creating-users-using-cli-or-api/3312/8 "2025-05-12T21:45:54Z")

</div>

Certificates are downloaded from `/key/<org_id>/<user_id>.tar`

---

<div class="post-metadata">

**Author:** ![kkalugeroff](https://forum.pritunl.com/user_avatar/forum.pritunl.com/kkalugeroff/32/1298_2.png) [@kkalugeroff](https://forum.pritunl.com/u/kkalugeroff)\
**Post date:** [May 13, 2025, 7:20am UTC](https://forum.pritunl.com/t/creating-users-using-cli-or-api/3312/9 "2025-05-13T07:20:55Z")

</div>

@zach ,

This one works perfectly.  
Could you also provide similar endpoint but this time for creating new user in organization ?  
Thank you!

---

<div class="post-metadata">

**Author:** ![zach](https://forum.pritunl.com/user_avatar/forum.pritunl.com/zach/32/1105_2.png) [@zach](https://forum.pritunl.com/u/zach)\
**Post date:** [May 13, 2025, 11:27am UTC](https://forum.pritunl.com/t/creating-users-using-cli-or-api/3312/10 "2025-05-13T11:27:38Z")

</div>

Most of the endpoints can be found with Chrome Developer Tools it is a POST to `/user/<org_id>`
