SearchStax API - Users


Overview

SearchStax® provides an API supporting the creation, deletion and management of SearchStax deployments.

This page describes how to manage the users of a SearchStax account through the API.

The API can be accessed through any tool that assembles HTTP requests and dispatch them to a server. Among these would be the Python coreapi package, the Postman tool, and cURL. For Windows, use PowerShell Core 6.1+.

Account Owner, Admin, or Technical Contact

To run the SearchStax Provisioning API, you must be the account Owner, an account Admin, or a Technical Contact. See SearchStax User Roles.

Symbols enclosed in carets (< and >) such as <username> are metavariables. Substitute your local values when you encounter them in the examples.

Contents:

Related Pages:

Users

The SearchStax Provisioning API provides methods for managing the users of a SearchStax Account from a remote application.

users > list

This method lists the SearchStax users for an account.

GET https://app.searchstax.com/api/rest/users/?account=<account_name>

where ?account=<account_name> is the name of the tenant account.

This method uses Token authentication.

There is no request body.

When invoked from Linux (Bash script):

curl --request GET https://app.searchstax.com/api/rest/users/?account=$ACCOUNT \
  --header "Authorization: Token <token>" 

When invoked from Windows (PowerShell script):

$ACCOUNT = "AccountName"

$RESULT = Invoke-RestMethod -Method Get -Headers $headers `
         -uri "https://app.searchstax.com/api/rest/users/?account=$ACCOUNT" 
$RESULT = $RESULT | ConvertTo-Json

The response is a JSON document containing the SearchStax users of the account and their details:

{
  "success": true,
  "users": [
    {
      "firstname": "FirstName",
      "lastname": "LastName",
      "email": "user@company.com",
      "role": "Team Member",
      "phone": "123-456-7890",
      "company": "Company",
      "id": 3201,
      "last_login": null,
      "created": "2021-01-06T19:51:28Z",
      "invitation_status": "Completed"
    }
  ]
}

user > delete

This method deletes a SearchStax user from an Account.

DELETE https://app.searchstax.com/api/rest/user/?account=<account_name>&id=<user_id>

where ?account=<account_name> is the name of the tenant account, and &id=<user_id> is the ID of the user.

This method uses Token authentication.

There is no request body.

When invoked from Linux (Bash script):

curl -H "Content-Type: application/json" -H "Authorization: Token $TOKEN" \
     -X DELETE "https://app.searchstax.com/api/rest/users/?account=$ACCOUNT&id=$DELUSER"

When invoked from Windows (PowerShell script):

$ACCOUNT = "AccountName"
$DELUSER = "1234"

$RESULT = Invoke-RestMethod -Method Delete -ContentType 'application/json' -Headers $headers `
         -uri "https://app.searchstax.com/api/rest/user/?account=$ACCOUNT&id=$DELUSER" 
$RESULT = $RESULT | ConvertTo-Json

This method returns a JSON document containing a success message.

{
   "id":3204,
   "success":true,
   "message":"User deleted successfully."
}

Questions?

Do not hesitate to contact the SearchStax Support Desk.