Update dataset

Updates the specified dataset.

Required Permissions

Requires the MEMBER role or higher. Only datasets you own or that are shared with you are affected.

HTTP Request

PUT /api/sonar/datasets/:guid
cURL Example
curl -H "Authorization: Bearer <API_KEY>" \
     -d name="Login failure dataset" \
     -d description="Recent login failure events" \
     -d 'query=table login | search result == "fail"' \
     -d 'shared_users=[{"guid":"66666666-7777-8888-9999-000000000000","read_only":true}]' \
     -d 'shared_groups=[]' \
     -X PUT \
     https://HOSTNAME/api/sonar/datasets/a1b2c3d4-e5f6-7890-abcd-ef1234567890
Request Parameters
Path Parameters
KeyTypeDescriptionNote
guidStringDataset identifier36 characters
Request Body Parameters
KeyRequiredTypeDescriptionNote
nameYesStringDataset name-
descriptionNoStringDataset description-
pivotNoString key/valuePivot configurationJSON object
queryYesStringQuery string-
shared_usersYesObject arrayList of accounts to share withPass an empty array to skip sharing
shared_groupsYesObject arrayList of account groups to share withPass an empty array to skip sharing

shared_users object properties

Each element is either an account GUID string or an object with the following properties. If an element is a plain string, it is treated as a read-only share GUID.

  • guid (String): Shared account identifier
  • name (String, optional): Display name
  • read_only (Boolean, optional): Whether the share is read-only
  • id (32-bit integer, optional): Internal identifier

shared_groups object properties

Each element is either an account group GUID string or an object with the following properties. If an element is a plain string, it is treated as a read-only share GUID.

  • guid (String): Shared account group identifier
  • name (String, optional): Display name
  • read_only (Boolean, optional): Whether the share is read-only
  • id (32-bit integer, optional): Internal identifier

Success Response

{}

Error Responses

Required parameter is missing

HTTP status code 400

{
  "error_code": "null-argument",
  "error_msg": "name should be not null"
}
Dataset identifier is not in GUID format

HTTP status code 400

{
  "error_code": "invalid-param-type",
  "error_msg": "guid should be guid type."
}
Dataset does not exist

HTTP status code 500

{
  "error_code": "illegal-state",
  "error_msg": "dataset not found: a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
Insufficient permissions

HTTP status code 500

{
  "error_code": "illegal-state",
  "error_msg": "no-permission"
}