This topic might be out-of-date and is replaced by the following: |
In this Article
User and Group APIs enable you as an Org admin to perform operations on users and groups in a SnapLogic Org.
The following user-based operations are supported:
Creating a user
Updating a user
Deleting a user
Retrieving a user's information
The following group-based operations are supported:
Creating a group
Fetching a group's information
Fetching information of all groups in an Org
Updating members' list
Adding members in a group
Removing members from a group
Deleting a group
Any user can retrieve their own user data, but only Org admins can see other users and are able to make any modifications. |
The API authenticates requests using basic authentication over HTTPS. Support for more authentication methods is under consideration for future updates.
If you are using the REST Snaps to access the SnapLogic API, you will need to create a REST account with your SnapLogic credentials. |
Creating a User (POST)
Fetching Information
Get Users by Email (GET)
Get Users by Org (GET)
Updating a User (PUT)
Deleting a User (DELETE)
This is a POST-type request to create a new user. Only Org admins can use this API. The response from such a call is a document displaying details of the user.
POST /api/1/rest/public/users |
REST Client: POST https://<pod_name>/api/1/rest/public/users cURL Command: POST /api/1/rest/public/users HTTP/1.1 Host: <pod_name> Authorization: Basic <bearer_token> Cache-Control: no-cache Content-Type: application/json |
Key | Description | |
---|---|---|
String. Specifies the user's email. | ||
first_name | String. Specifies the user's first name. | |
last_name | String. Specifies the user's last name. | |
organization | String. Specifies the name of the organization in which to place the user. | |
administrator | Boolean. Specifies whether the user is an administrator. | |
allow_password_login | Boolean. Specifies whether the user can login with password. | |
create_home_directory | Boolean. Specifies whether a default project is to be created for the user. The path is
| |
ui_access | Boolean. Specifies whether the user has access to the UI. This value is set to false of service accounts. | |
email_notification | Boolean. Specifies whether the user receives a welcome email notification when an account is created. | |
utility | Boolean. Creates the user as a service account. |
Request: POST https://uat.elastic.snaplogic.com/api/1/rest/public/users Request Body: { "email":"john.doe@test.com", "first_name":"John", "last_name":"Doe", "organization":"Test_Org", "administrator":false, "ui_access":true, "allow_password_login":true, "create_home_directory":false } Response: { "last_name": "Doe", "password_last_updated": "2018-11-20T09:00:18.004000+00:00", "password_expired": false, "allow_password_login": true, "first_name": "John", "basic_access": null, "ui_access": true, "user_locked_out": true, "service_account": false, "email": "john.doe@test.com", “organizations”: [organization document, ...] } Organization document { “id”: “12345d1eiqdracdf4f8c7153” “name”: “Test_Org”, “administrator”: false, } |
Basic AccessThe |
Fetches user data for the specified Email.
GET /api/1/rest/public/users/<email_address> |
REST Client: GET https://<pod_name>/api/1/rest/public/users/<email_address> cURL Command: GET /api/1/rest/public/users/<email_address> HTTP/1.1 Host: <pod_name> Authorization: Basic <bearer_token> Cache-Control: no-cache |
Not applicable.
Request: GET https://uat.elastic.snaplogic.com/api/1/rest/public/users/john.doe@test.com Response: { "last_name": "Doe", "password_last_updated": "2017-01-20T11:19:55.535000+00:00", "password_expired": false, "allow_password_login": true, "first_name": "John", "basic_access": null, "ui_access": true, "user_locked_out": false, "service_account": false, "email": "john.doe@test.com" } |
Retrieves a list of members within an Org segregated by group.
GET /api/1/rest/public/groups/<org_name>/members |
REST Client: GET https://<pod_name>/api/1/rest/public/groups/<org_name>/members cURL Command: GET /api/1/rest/public/groups/<org_name>/members HTTP/1.1 Host: <pod_name> Authorization: Basic <bearer_token> Cache-Control: no-cache |
Not applicable.
Request: GET https://uat.elastic.snaplogic.com/api/1/rest/public/groups/Test_Org/members Response: {"name": "members", "members": [ "john.doe@test.com", "mary.doerina@test.com", "johnathan.doe@test.com" ] } |
Updates data of the specified user.
PUT /api/1/rest/public/users/<email_address> |
REST Client: PUT https://<pod_name>/api/1/rest/public/users/<email_address> cURL Command: PUT /api/1/rest/public/users/<email_address> HTTP/1.1 Host: <pod_name> Authorization: Basic <bearer_token> Cache-Control: no-cache Content-Type: application/json |
Key | Description |
---|---|
first_name | String. Specifies the user's first name. |
last_name | String. Specifies the user's last name. |
allow_password_login | Boolean. Specifies whether the user can login with a password. |
ui_access | Boolean. Specifies whether the user has access to the UI. This value is set to false of service accounts. |
created_by | String. Specifies the user who originally created the service account. This parameter enables an Org admin to change the user who originally created the service account in cases where the password recovery email for that user needs to be reset. You cannot specify the current Service Account user with this parameter.
For details, see Creating a User. |
Request: PUT https://uat.elastic.snaplogic.com/api/1/rest/public/users/john.doe@test.com Request Body: { "email":"new.johndoe@test.com", "first_name":"Mr John", "last_name":"Doeser", "organization":"Test_Org2", "administrator":false, "ui_access":true, "allow_password_login":true, "create_home_directory":false } Response: { "last_name": "Doeser", "password_last_updated": "2017-01-20T11:19:55.535000+00:00", "password_expired": false, "allow_password_login": true, "first_name": "Mr John", "basic_access": null, "ui_access": true, "user_locked_out": false, "service_account": false, "email": "new.johndoe@test.com" } |
Deletes a user from the database. To successfully perform this action, you need to be an admin on all of the user's orgs.
This delete action permanently removes the user from the system (unlike the SnapLogic user interface that only deletes a user from the org, but not from the system). To check if a user exists in other orgs (before deleting), use the PATCH /api/1/rest/public/groups/{organization}/{name} option on the user group of your org. |
DELETE /api/1/rest/public/users/{email} |
REST Client: DELETE https://<pod_name>/api/1/rest/public/users/<email_address> cURL Command: DELETE /api/1/rest/public/users/<email_address> HTTP/1.1 Host: <pod_name> Authorization: Basic <bearer_token> Cache-Control: no-cache |
Not applicable.
Request: https://uat.elastic.snaplogic.com/api/1/rest/public/users/john.doe@test.com Response: { “success”: “ok” } |
Creating a group
Fetching a group's information
Fetching information of all groups in an Org
Updating members' list
Adding members in a group
Removing members from a group
Deleting a group
To create a group and add members to it, you must do two API calls. Use this API to create the group. To add members to the group, make this API call again using the Members parameter.
Org and GroupsThis API does not check if the Org within which you plan to add the target group and users exists. Therefore, verify first that the Org is created, then create the group first, then add the members. |
Group NamesWe recommend you do not insert spaces in your Group name; instead, use an underscore. |
POST /api/1/rest/public/groups |
REST Client: POST https://<pod_name>/api/1/rest/public/groups cURL Command: POST /api/1/rest/public/groups HTTP/1.1 Host: <pod_name> Authorization: Basic <bearer_token> Cache-Control: no-cache Content-Type: application/json |
Key | Description |
---|---|
organization | String. Specifies the name of the organization within which the group is to be created. |
name | String. Specifies the name of the group. This value has to be unique within the Org. |
members | List. Specifies a list of the user's email belonging to the group. |
Request: POST https://uat.elastic.snaplogic.com/api/1/rest/public/groups Request Body: { "organization":"Test_Org", "name":"Test_Group", "members":[ "john.doe@test.com" ] } Response: { "name": "TestGroup", "members":[ "john.doe@test.com" ] } |
Retrieve an Org’s groups.
GET /api/1/rest/public/groups/<org_name> |
REST Client: GET https://<pod_name>/api/1/rest/public/groups/<org_name> cURL Command: GET /api/1/rest/public/groups/<org_name> HTTP/1.1 Host: <pod_name> Authorization: Basic <bearer_token> Cache-Control: no-cache |
Not applicable.
Request: GET https://uat.elastic.snaplogic.com/api/1/rest/public/groups/Test_Org Response: { “groups”: [ Test_Group1, Test_Group2, … ] } |
Fetches all information for the specified group.
GET /api/1/rest/public/groups/<org_name>/<group_name> |
REST Client: GET https://<pod_name>/api/1/rest/public/groups/<org_name>/<group_name> cURL Command: GET /api/1/rest/public/groups/<org_name>/<group_name> HTTP/1.1 Host: <pod_name> Authorization: Basic <bearer_token> Cache-Control: no-cache |
Not applicable.
Request: GET https://uat.elastic.snaplogic.com/api/1/rest/public/groups/Test_Org/Test_Group Response: { "name": "Test_Group", "members": [ "john.doe@test.com", "mary.doerina@test.com", "johnathan.doe@test.com" ] } |
Updates the members list of the specified group in the specified Org. Each time this call is executed, the members list is overwritten.
PUT /api/1/rest/public/groups/<org_name>/<group_name> |
REST Client: PUT https://<pod_name>/api/1/rest/public/groups/<org_name>/<group_name> cURL Command: PUT /api/1/rest/public/groups/<org_name>/<group_name> HTTP/1.1 Host: <pod_name> Authorization: Basic <bearer_token> Cache-Control: no-cache Content-Type: application/json |
Key | Description |
---|---|
members | List. Members in the group, the existing members list is overwritten. |
Request: PUT https://uat.elastic.snaplogic.com/api/1/rest/public/groups/Test_Org/Test_Group Request Body: { "organization":"Test_Org", "name":"Test_Group", "members":[ "john.doe@test.com", "john.doerina@test.com", "mary.doe@test.com", "johnny.dope@test.com" ] } Response: { "name": "TestGroup", "members":[ "john.doe@test.com", "john.doerina@test.com", "mary.doe@test.com", "johnny.dope@test.com" ] } |
Add/remove group, and add or remove users from that group.
PATCH /api/1/rest/public/groups/<org_name>/<group_name> |
REST Client: PATCH https://<pod_name>/api/1/rest/public/groups/<org_name>/<group_name> cURL Command: PATCH /api/1/rest/public/groups/<org_name>/<username> HTTP/1.1 Host: <pod_name> Authorization: Basic <bearer_token> Cache-Control: no-cache |
Key | Description |
---|---|
add_user | String. Specifies the email of the user to be added to the group. |
remove_user | String. Specifies the email of the user to be removed from the group. |
Only one of the above parameters can be used at a time. |
Request PATCH https://uat.elastic.snaplogic.com/api/1/rest/public/groups/Test_Org/Test_Group Request Body: { "add_user":"johnny.dope@test.com" } Response: { "name": "Test_Group", "members": [ "john.doe@test.com", "john.doerina@test.com", "mary.doe@test.com", "johnny.dope@test.com" ] } |
Use Members to add a userYou can add an existing user to an Org by adding the user to the Members group. |
Deletes the specified group from the specified Org.
DELETE /api/1/rest/groups/<org_name>/<group_name> |
REST Client: DELETE https://<pod_name>/api/1/rest/groups/<org_name>/<group_name> cURL Command: DELETE /api/1/rest/groups/<org_name>/<group_name> HTTP/1.1 Host: <pod_name> Authorization: Basic <bearer_token> Cache-Control: no-cache |
Not applicable.
Request DELETE https://uat.elastic.snaplogic.com/api/1/rest/public/groups/Test_Org/Test_Group Response: { “success”: “ok” } |
You can execute the following APIs using pipelines:
User API
Create User
Retrieve Members list for an Organization
Retrieve Users by email
Update a User
Delete a User
Group API
Create a Group
Retrieve Groups by Organization
Retrieve Group by Name
Update Members List
Add/Remove a User
Delete Group