RBAC - Create Subaccount API

Use the ChaosSearch API to create and delete subaccounts for your organization.

Create Subaccount

The ChaosSearch API /user/createSubAccount endpoint creates and updates subaccounts for the ChaosSearch platform.

This example shows how to create a subaccount that can be granted access to the ChaosSearch system. If successful, the endpoint returns the UID for the new subaccount.

Endpoint: /user/createSubAccount
Method: POST
Authentication: Requires JWT for the primary user
Example JSON body: Defines a new subaccount.

{
  "GroupIds": [
    "GROUP-ID-INPUT-HERE"
  ],
  "Hocon": [
    "override.Services.worker.quota=6"
  ],
  "Password": "test",
  "UserInfoBlock": {
    "Email": "[email protected]",
    "FullName": "Kibana User",
    "Username": "KibanaUser"
  }
}
curl --request POST\
     --url https:/mycompany.chaossearch.com/user/createSubAccount \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --header 'x-amz-chaossumo-route-token: login' \
     --header 'x-amz-security-token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJTZ...WNyZXRBWQ5I' \
     --data '{"UserInfoBlock":{"Username":"test","FullName":"testuser","Email":"testuser"},"GroupIds":["default"],"Password":"test"}'
{"Exists":false,"Uid":"07a8eadf-2e08-41a5-ac06-c6827f6bb0de"}

The "Exists":false, string is expected for a new subaccount. If your command returns the string "Exists":true, the subaccount already exists.

Delete Subaccount

The ChaosSearch API /user/deleteSubAccount endpoint deletes subaccounts from the ChaosSearch platform.

Endpoint: /user/deleteSubAccount
Method: POST
Authentication: Requires JWT for the primary user
Example JSON body: Deletes the specified subaccounts.

("Username": "testuser"}
curl --request POST\
     --url https://poc-trial.chaossearch.io/user/deleteSubAccount \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --header 'x-amz-chaossumo-route-token: login' \
     --header 'x-amz-security-token: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJTZ...WNyZXRBWQ5I' \
     --data '{"Username": "testuser"}' 
{"Exists":false}%

The "Exists":false" string is expected