User accounts management API

In some usage scenarios, SeekTable accounts should correspond to users that are present in another (host) system. For instance, your users access SeekTable via embedded app view and each user should use their own SeekTable account. It makes sense to use SeekTable's accounts management 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) Admin 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": "user1@company.com", "TeamSharing":true},
  {"Id" : 2, "Email": "user2@company.com", "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) Admin 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": "user1@company.com", "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) Admin API key.
Request body (required) JSON object with new user properties:
{
  "Email": "user1@company.com",
  "TeamSharing":true,
  "AdvancedPublishing":true
}
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":"user1@company.com","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) Admin API key.
id (required) ID of the user to delete.
Response HTTP/200 (OK) if specified user was deleted successfully.
curl -k -X "DELETE" -H "Authorization: SEEKTABLE_ADMIN_ACCOUNT_API_KEY" SEEKTABLE_BASE_URL/api/account/1

Get a list of user's team members

GET {SeekTable_BaseUrl}/api/account/{id}/team/member?email={email}&offset={offset}&limit={limit}
Header: Authorization (required) Admin API key.
email (optional) Return details only about a team member with a specified email address.
offset (optional) The number of team members to skip. By default = 0.
limit (optional) Max number of team members to return. By default = 1000.
Response HTTP/200 (OK) + JSON array with team members in the response body:
[
  {"Email": "user1@company.com", "AccountId":2},
  {"Email": "user2@company.com", "AccountId":null}
]
If "AccountId" is not set this means that user account for this login email is not created yet.
curl -k -H "Authorization: SEEKTABLE_ADMIN_ACCOUNT_API_KEY" SEEKTABLE_BASE_URL/api/account/USER_ID/team/member -o "seektable_team_members.json"

Add users to the team

POST {SeekTable_BaseUrl}/api/account/{id}/team/member
Header: Authorization (required) Admin 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:
["user1@company.com", "user2@company.com"]
Response HTTP/200 (OK) if operation ends successfully + JSON object with the result:
{
  "Added": ["user1@company.com"],
  "Duplicates": ["user2@company.com"],
  "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 ["user1@company.com", "user2@company.com"] | curl -k -H "Authorization: SEEKTABLE_ADMIN_ACCOUNT_API_KEY" -H "Content-Type: application/json" -d @- SEEKTABLE_BASE_URL/api/account/USER_ID/team/member

Remove users from the team

DELETE {SeekTable_BaseUrl}/api/account/{id}/team/member
Header: Authorization (required) Admin 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 (case-sensitive!) that should be removed from the team:
["user1@company.com", "user2@company.com"]
Response HTTP/200 (OK) if operation ends successfully + number of removed team members (integer):
1
Important: emails are case sensitive for this operation.
echo ["user1@company.com", "user2@company.com"] | curl -k -X "DELETE" -H "Authorization: SEEKTABLE_ADMIN_ACCOUNT_API_KEY" -H "Content-Type: application/json" -d @- SEEKTABLE_BASE_URL/api/account/USER_ID/team/member

Get a list of user's team groups

GET {SeekTable_BaseUrl}/api/account/{id}/team/group?offset={offset}&limit={limit}
Header: Authorization (required) Admin API key.
offset (optional) The number of team groups to skip. By default = 0.
limit (optional) Max number of team groups to return. By default = 1000.
Response HTTP/200 (OK) + JSON array with team groups in the response body:
[
  {"Id":1, "Name": "Group 1", "ReportOverrideParameters": null},
  {"Id":2, "Name": "Group 1", "ReportOverrideParameters": {"param_company_id", 1} }
]
curl -k -H "Authorization: SEEKTABLE_ADMIN_ACCOUNT_API_KEY" SEEKTABLE_BASE_URL/api/account/USER_ID/team/group -o "seektable_team_groups.json"

Add a new team group

POST {SeekTable_BaseUrl}/api/account/{id}/team/group
Header: Authorization (required) Admin API key.
id (required) ID of the user with activated "Team sharing" capability (owner of the team).
Request body (required) JSON object with new team group's properties:
{
  "Name": "Group 1",
  "ReportOverrideParameters":{"param_1":"param1_fixed_value"}
}
Response HTTP/200 (OK) if a new group was added successfully + JSON object with group's properties (including its "Id") in the response body.
echo {"Name":"Group 1","ReportOverrideParameters":{"param_1":"param1_fixed_value"}} | curl -k -H "Authorization: SEEKTABLE_ADMIN_ACCOUNT_API_KEY" -H "Content-Type: application/json" -d @- SEEKTABLE_BASE_URL/api/account/USER_ID/team/group

Delete team group by ID

DELETE {SeekTable_BaseUrl}/api/account/{id}/team/group/{group_id}
Header: Authorization (required) Admin API key.
id (required) ID of the user with activated "Team sharing" capability (owner of the team).
group_id (required) ID of the group to delete.
Response HTTP/200 (OK) if specified team group was deleted successfully.
curl -k -X "DELETE" -H "Authorization: SEEKTABLE_ADMIN_ACCOUNT_API_KEY" SEEKTABLE_BASE_URL/api/account/USER_ID/team/group/GROUP_ID

Get a list of members in the team group

GET {SeekTable_BaseUrl}/api/account/{id}/team/group/{group_id}/member
Header: Authorization (required) Admin API key.
id (required) ID of the user that has activated "Team sharing" capability (owner of the team).
group_id (required) ID of the group.
Response HTTP/200 (OK) + JSON array with specified team group members in the response body:
[
  {"Email": "user1@company.com", "AccountId": 1},
  {"Email": "user2@company.com", "AccountId": 2 }
]
curl -k -H "Authorization: SEEKTABLE_ADMIN_ACCOUNT_API_KEY" SEEKTABLE_BASE_URL/api/account/USER_ID/team/group/GROUP_ID/member -o "seektable_team_group_members.json"

Add users to the team group

POST {SeekTable_BaseUrl}/api/account/{id}/team/group/{group_id}/member
Header: Authorization (required) Admin API key.
id (required) ID of the user that has activated "Team sharing" capability (owner of the team).
group_id (required) ID of the group.
Request body (required) JSON array of team members (emails) that should be added to the specified team group:
["user1@company.com", "user2@company.com"]
Note: emails are case sensitive for this operation.
Response HTTP/200 (OK) if operation ends successfully + number of removed team members (integer):
2
Important: specified emails are added only if they match existing team members.
echo ["user1@company.com", "user2@company.com"] | curl -k -H "Authorization: SEEKTABLE_ADMIN_ACCOUNT_API_KEY" -H "Content-Type: application/json" -d @- SEEKTABLE_BASE_URL/api/account/USER_ID/team/group/GROUP_ID/member

Remove users from the team group

DELETE {SeekTable_BaseUrl}/api/account/{id}/team/group/{group_id}/member
Header: Authorization (required) Admin API key.
id (required) ID of the user that has activated "Team sharing" capability (owner of the team).
group_id (required) ID of the group.
Request body (required) JSON array of team members (emails) that should be added to the specified team group:
["user1@company.com", "user2@company.com"]
Note: emails are case sensitive for this operation.
Response HTTP/200 (OK) if operation ends successfully + number of actually removed team members (integer):
2
Important: specified emails are removed only if they match existing team members.
echo ["user1@company.com", "user2@company.com"] | curl -k -X "DELETE" -H "Authorization: SEEKTABLE_ADMIN_ACCOUNT_API_KEY" -H "Content-Type: application/json" -d @- SEEKTABLE_BASE_URL/api/account/USER_ID/team/group/GROUP_ID/member