Editing Queries

After you have created a query, it can be edited via the API. It accepts both HTTP PATCH and PUT requests.

Required Fields

When editing using PATCH method the query must include at least one of the optional fields in your request.

When using PUT method it requires the following:

ParameterDefinitionAccepted Values
idQuery IDInteger
nameQuery nameString
booleanQueryBoolean queryString

Optional Fields

PATCH Method

ParameterDefinitionAccepted Values
nameName of the queryString
displayNameDisplay name of the query in the UIString
removeDisplayNameDisplay name to remove, see note below.String
stateWhether the query is active or in draft, see note below.active or draft

📘

state Parameter Note

You can only set a query's state from draft to active. You cannot set a query's state from active to draft.

🚧

removeDisplayName Parameter Note

You cannot set displayName and removeDisplayName in the same request.

PUT Method

ParameterDefinitionAccepted Values
displayNameDisplay name of the query in the UIString
descriptionQuery descriptionString
languagesTwo letter language code, e.g. en, es, deString or string array
stateWhether the query is active or in draft, see note below.active or draft

📘

state Parameter Note

You can only set a query's state from draft to active. You cannot set a query's state from active to draft.

Editing Query

The following call will change a query's display name with a project with ID 1998159537 and query with ID 1999933037:

curl -X PATCH \  
  'https://api.brandwatch.com/projects/1998159537/queries/1999934807' \  
  -H 'Content-Type: application/json' \  
  -d '{"displayName": "New display name"}'

Alternatively, PUT methods are also accepted. The following will set the query's boolean query and name:

 curl -X PUT \
   'https://api.brandwatch.com/projects/1998159537/queries/999970708' \
   -H 'Content-Type: application/json' \
   -d '{"id": 999970708, "booleanQuery": "Brandwatch", "name": "New BW query name"}'

Response

{
	"id": 1999934807,
	"name": "Mentions of Pepsi",
	"displayName": "New display name",
	"description": null,
	"creationDate": "2025-04-08T11:03:58.341+0000",
	"lastModificationDate": "2025-05-20T12:08:18.505+0000",
	"languages": ["en"],
	"type": "monitor",
	"highlightTerms": ["pepsi"],
	"lastModifiedUsername": "[email protected]",
	"createdByUsername": "[email protected]",
	"lockedQuery": false,
	"lockedByUsername": null,
	"lockedTime": null,
	"booleanQuery": "pepsi",
	"monitorId": 7867716243,
	"startDate": "2025-03-01T00:00:00.000+0000",
	"percentComplete": 100,
	"samplePercentage": 100.0,
	"userRequestedSampling": false,
	"sampled": false,
	"queryLimitUsage": 1,
	"locationFilter": null,
	"imageFilter": null,
	"trackedPageFilter": null,
	"contentSources": ["news"],
	"audienceLists": null,
	"exclusionSnippets": [],
	"active": true,
	"state": "active",
	"projectId": 1,
	"sharedWithProjectIds": [1],
	"sentimentClassifierVersion": 3,
	"trendsEnabled": false
}