Skip to main content
Queries

Update an existing query

This method requires the Queries:Update permission to be associated with your role.

PUT
/gb/queries/{query_id}
Authorizationstringheaderrequired

For accessing the API a valid token must be passed in all the queries in the 'Authorization' header.

A valid token is generated by the API and returned by the /authenticate method by supplying a valid username and password.

The following syntax must be used in the 'Authorization' header :

Bearer aaaaaa/bbbbbb.ccccccc.dddddd
query_idstringrequired

Query Id to update

Audit-User-Idstringheader

(Optional) User Id to use for audit purposes. This header requires the Audit:UserIdOverride permission to be associated with your role.

Maximum string length: 5
Pattern: ^[1-9]{1}[0-9]*$
Time-Zonestringheaderdefault:UTC

The timezone value can be given in several formats, none of which are case sensitive:

  • As a named time zone, such as 'Europe/Helsinki', 'US/Eastern', or 'MET'.
  • As a string indicating an offset from UTC of the form [H]H:MM, prefixed with a + or -, such as '+10:00', '-6:00', or '+05:30'. A leading zero can optionally be used for hours values less than 10;
Maximum string length: 100
Pattern: ^[a-zA-Z0-9\/\:\+\-\_]+$

Body

application/json

JSON Payload

descriptionstringdefault:null

Decription of the query

Example: List of contacts for client ABC
namestringdefault:null

Name of the new query

Example: List of contacts
querystring

SQL query to add

Example: Select contact_id from fm_contacts;
query_idstring

Query Id

Example: 100001
status_flagenum<string>default:active

Status of the query

Available options: active, inactive
Example: active
super_flagenum<string>default:yes

When checked ON, only 'super' users can Edit and Save changes to queries.

Available options: yes, no
Example: yes

Response

application/vnd.catch-e-api.v1+json

Success

_embeddedobject
descriptionstring

Description of the query

Example: List of contacts
maximum_execution_timeinteger

Maximum run time set in seconds

Example: 300
namestring

Name of the query

Example: List of contacts
querystring

SQL query

Example: SELECT * FROM fm_contacts;
query_idstring

Query ID

Example: 123456
status_flagenum<string>default:active

Status of the query

Available options: active, inactive, deleted
super_flagenum<string>

When checked ON, only 'super' users can Edit and Save changes to queries

Available options: yes, no
Example: yes