Create a User

Use the Create User API to create a local or LDAP user in Pulse.

The API supports creating:

  • Local Pulse users

  • LDAP users

  • Users with predefined Pulse roles

  • Users with optional catalog roles

Before invoking this API, authenticate with the Pulse server. For more information, see Authenticate with Pulse APIs.


Endpoint

Property


Value

Method


POST

Endpoint


/graphql

API Type


GraphQL


Request

Invoke the addUser GraphQL mutation to create a user.

curl -X POST 'https://<pulse_url>/graphql' \ -H 'Content-Type: application/json' \ -b cookies.txt \ -H "role: $ROLE" \ -d '{ "query": "mutation AddUser($definition: AppUsersDef!) { addUser(definition: $definition) { _id username role } }", "variables": { "definition": { "username": "john.doe", "password": "<base64_encoded_password>", "role": "DataEngineer", "ldapUser": false } } }'

Request Parameters

Field

Required

Description

username

Yes

Unique user name.

password

Yes*

Base64-encoded password. Not required when ldapUser is true.

role

Yes

Existing Pulse role assigned to the user.

ldapUser

No

Specifies whether the user is an LDAP user. Default: false.

catalogRole

No

Optional catalog-level role assigned to the user.


Example Request

Create a local user.

{ "query": "mutation AddUser($definition: AppUsersDef!) { addUser(definition: $definition) { _id username role } }", "variables": { "definition": { "username": "john.doe", "password": "<base64_password>", "role": "DataEngineer", "ldapUser": false } } }

Example Response

{ "data": { "addUser": { "_id": "66571d6a5d2d9e0012345678", "username": "john.doe", "role": "DataEngineer" } } }

Create an LDAP User

To create an LDAP user, set ldapUser to true.

The password is not required because authentication is performed through the LDAP server.

Example:

{ "definition": { "username": "jane.smith", "role": "Viewer", "ldapUser": true } }

Validation Rules

When creating a user:

  • The user name must be unique.

  • The specified role must already exist.

  • Passwords for local users must be Base64 encoded.

  • The password is optional only for LDAP users.


Troubleshooting

Issue

Resolution

User already exists

Specify a unique user name.

Invalid role

Verify that the role exists in Pulse.

Verify that the role exists in Pulse.

Authenticate again and verify that the JWT cookie and role header are included.

Invalid password

Ensure that the password is Base64 encoded.