Unicat API Reference

Up - API Reference - Home


/api/p/<project gid>/queries/update

Requires JWT

Update an existing query.

You cannot change the type of a query.

Request

POST /api/p/<project gid>/queries/update
Authorization: Bearer <JWT>

{
    "query": "<query gid>",
    "filter": ["or", "",
                  [
                      ["validation", "not_translated", "name"],
                      ["validation", "not_translated", "description"],
                      ["validation", "not_translated", "summary"],
                  ],
              ]
}

query the gid of the query that is updated

optional

These are all optional, but at least one must be provided.

name a user-defined name for the query
q search terms, like '+cms 225'
filter json with nested filter specification (see the basic workings of a filter)

Note: if the name exists within a type, a serial number is appended to make it unique.

Success response

Authorization: <JWT>

{
    "success": true,
    "result": {
        "query": "96ec02b2-fb8d-4fb4-b952-fad0c4b88a74"
    },
    "data": {
        "queries": {
            "96ec02b2-fb8d-4fb4-b952-fad0c4b88a74": {
                
            }
        }
    }
}

result

query the updated query.

data

queries Query info with type, name, q, and filter.

Error responses

400 Bad request - missing parameters or wrong type or value
401 Unauthorized - missing or expired JWT
403 Forbidden - not a member of this project
422 Unprocessable entity - cannot perform update