Create a user
Create a new user in a realm.
Note: The requesting user must be an administrator.
POST https://omegaletter.chat/api/v1/users
Usage examples
curl https://omegaletter.chat/api/v1/users \ -u BOT_EMAIL_ADDRESS:BOT_API_KEY \ -d "email=newbie@zulip.com" \ -d "full_name=New User" \ -d "short_name=newbie" \ -d "password=temp"
#!/usr/bin/env python import zulip # You need a zuliprc-admin with administrator credentials client = zulip.Client(config_file="~/zuliprc-admin") # Create a user request = { 'email': 'newbie@zulip.com', 'password': 'temp', 'full_name': 'New User', 'short_name': 'newbie' } result = client.create_user(request) print(result)
More examples and documentation can be found here.
const zulip = require('zulip-js'); // You need a zuliprc-admin with administrator credentials const config = { zuliprc: 'zuliprc-admin', }; zulip(config).then((client) => { // Create a user const params = { email: 'newbie@zulip.com', password: 'temp', full_name: 'New User', short_name: 'newbie' }; client.users.create(params).then(console.log); });
Arguments
Argument | Example | Required | Description |
---|---|---|---|
email |
newbie@zulip.com |
Required | The email address of the new user. |
password |
abdec@7982 |
Required | The password of the new user. |
full_name |
John Smith |
Required | The full name of the new user. |
short_name |
jsmith |
Required | The short name of the new user. |
Response
Example response
A typical successful JSON response may look like:
{ "msg": "", "result": "success" }
A typical JSON response for when another user with the same email address already exists in the realm:
{ "msg": "Email 'newbie@zulip.com' already in use", "result": "error" }