User accounts management API

In some usage scenarios SeekTable users accounts should correspond to accounts that are present in another system. For instance, your users access SeekTable via embedded app view and each user should use its own SeekTable account. It makes sense to use special SeekTable's web API to keep user accounts in sync with your system.

Accounts API Authorization

All requests should include HTTP header Authorization with a value from Manage AccountGet API Key dialog. This user shoud have an "admin" role + a login email of this user should be specified in SeekTable_ST__Api__AccountManagementAllowedForEmail app's setting.
It is strongly recommended to create a dedicated "admin" user (without cubes/reports) and use its API key ONLY for accounts management API calls.

A list of user accounts

GET {SeekTable_BaseUrl}/api/account?email={email}&offset={offset}&limit={limit}
Header: Authorization (required) API key.
email (optional) Load only a user with specified login email.
offset (optional) The number of users to skip. By default = 0.
limit (optional) Max number of users to return. By default = 1000.
Response HTTP/200 (OK) + JSON array with users in the response body:
  {"Id" : 1, "Email": "", "TeamSharing":true},
  {"Id" : 2, "Email": "", "AdvancedPublishing":true}
curl -k -H "Authorization: SEEKTABLE_ADMIN_ACCOUNT_API_KEY" SEEKTABLE_BASE_URL/api/account -o "seektable_users.json"

Get user account by ID

GET {SeekTable_BaseUrl}/api/account/{id}
Header: Authorization (required) API key.
id (required) ID of the user to load.
Response HTTP/200 (OK) + JSON object with user's properties in the response body:
{"Id" : 1, "Email": "", "TeamSharing":true}
curl -k -H "Authorization: SEEKTABLE_ADMIN_ACCOUNT_API_KEY" SEEKTABLE_BASE_URL/api/account/1

Add a new user account

POST {SeekTable_BaseUrl}/api/account
Header: Authorization (required) API key.
Request body (required) JSON object with new user properties:
  "Email": "",
Important: TeamSharing and AdvancedPublishing roles can be set only if your installation has an appropriate capabilities ("Team sharing" and/or "Advanced publishing" for unlimited users).
Response HTTP/200 (OK) if a new user was added successfully + JSON object with user's properties in the response body.
Important: an account created in this way can be used only via embedded app view (or SSO). It is not possible to login into such account via login form because an access key is not initialized. However, "admin" can use login-as function (in UI) or assign an access key if needed.
echo {"Email":"","TeamSharing":true,"AdvancedPublishing":true} | curl -k -H "Authorization: SEEKTABLE_ADMIN_ACCOUNT_API_KEY" -H "Content-Type: application/json" -d @- SEEKTABLE_BASE_URL/api/account

Delete user account by ID

DELETE {SeekTable_BaseUrl}/api/account/{id}
Header: Authorization (required) API key.
id (required) ID of the user to delete.
Response HTTP/200 (OK) if specified user was deleted successfully.
curl -k -H "Authorization: SEEKTABLE_ADMIN_ACCOUNT_API_KEY" SEEKTABLE_BASE_URL/api/account/1

Add users to the team

POST {SeekTable_BaseUrl}/api/account/{id}/team
Header: Authorization (required) API key.
id (required) ID of the user that has activated "Team sharing" capability (owner of the team).
Request body (required) JSON array of login emails that should be added to the team:
["", ""]
Response HTTP/200 (OK) if operation ends successfully + JSON object with the result:
  "Added": [""],
  "Duplicates": [""],
  "Skipped": []
Important: specified emails are added into the list of team members even if there are no corresponding user accounts (with such login emails).
echo ["", ""] | curl -k -H "Authorization: SEEKTABLE_ADMIN_ACCOUNT_API_KEY" -H "Content-Type: application/json" -d @- SEEKTABLE_BASE_URL/api/account/USER_ID/team