createSavedSearch

Click to copy

Create saved search

Create a saved search or chart by specifying the search parameters in the json body. All search properties except for optional properties must be passed in the body to save the search or chart. The adminBasic or adminAdvanced privilege is required.

Create Saved Search Parameters:

ParameterDescriptionData Type
searchIdOptional. The unique ID of the search or chart to be created.String
nameRequired. The display name for the saved search or chart.String
folderOptional. The folder the saved search or chart will be categorized under.String
definitionRequired if the searchType is Standard. The search definition to be saved. For details on search definition syntax, see Search for jobs in the system.String
searchTypeOptional. The type for the saved search or chart. The accepted values are Standard, Chart and All. If not defined, the default search type is Standard.String
colorRampRequired if the searchType is Chart. The color ramp for the saved chart.String
sortIndexOptional. The sorting order for the saved search or chart.Integer

Body parameter

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
{
  "searchId": "string",
  "name": "string",
  "folder": "string",
  "definition": {
    "q": "string",
    "search": "string",
    "fields": [
      "string"
    ],
    "displayNames": [
      "string"
    ],
    "sortFields": [
      {
        "field": "string",
        "sortOrder": "Asc"
      }
    ],
    "spatialExtent": "string",
    "hasLocation": true,
    "start": 0,
    "num": 0
  },
  "searchType": "Chart",
  "colorRamp": "string",
  "sortIndex": 0
}

Query parameters

NameTypeRequired

token

string

Path parameters

NameTypeRequired

orgId

string

itemId

string

Examples

Request

Use dark colors for code blocksCopy
1
2
3
4
5
# You can also use wget
curl -X POST /{orgId}/{itemId}/searches \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H 'Authorization: Bearer {access-token}'

Response

200 Response

Use dark colors for code blocksCopy
1
2
3
{
  "searchId": "string"
}
StatusMeaningDescriptionSchema

200

OK

success

CreateSavedSearchResponse

400

Bad Request

invalid object

WorkflowJsonExceptionDTO

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.