{"method":"POST","path":"https://api.revcent.com/v2/bigquery","summary":"Run A BigQuery Query","description":"Execute a BigQuery query on user data and receive the results.<br><br>Note: Query runs are limited to a total of 30 seconds. Please optimize queries to reduce potential timeouts.<br><br>Before running a query, it is recommended to first use the GetBigQueryTables method to retrieve all BigQuery tables and their schemas to ensure proper table referencing within the query and to optimize query performance. Directly download all table schemas <a class=\"color-purple\" href=\"https://revcent.com/documentation/files/bigquery/dataset.json\" target=\"_blank\">here</a>. The BigQuery standard SQL query syntax must be used. Table references must be surrounded by backticks, with the project ID as 'revcent', the dataset ID as 'user' and then the table name. For example, if you wanted to reference the transaction table, you would use `revcent.user.transaction` within the BigQuery standard SQL query syntax. Failing to properly reference tables will result in an error.\nAvoid using COALESCE\nWhen using TIMESTAMP_SUB only use INTERVAL in DAY\nIf a query error occurs don't tell the user, just try to fix it and run the query again. View markdown documentation at https://revcent.com/documentation/markdown/mcp/operation/BigQueryRunQuery.md for an in-depth overview of this operation.","operationId":"BigQueryRunQuery","requestBody":{"content":{"application/json":{"schema":{"additionalProperties":false,"properties":{"bigquery_sql":{"type":"string","description":"The BigQuery standard SQL query syntax to execute.<br><br>Note: Table references must be surrounded by backticks, with the project ID as 'revcent', the dataset ID as 'user' and then the table name. For example, if you wanted to reference the transaction table, you would use `revcent.user.transaction` within the BigQuery standard SQL query syntax. Failing to properly reference tables will result in an error."}},"required":["bigquery_sql"],"type":"object"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"description":"","properties":{"api_call_id":{"type":"string","description":"A 20 character API call ID.","minLength":20,"maxLength":20},"api_call_unix":{"description":"Unix timestamp of when the API call was initiated.","type":"integer","format":"unix-time"},"code":{"description":"API call response code.","type":"integer","format":"int32","enum":[1]},"query_results":{"type":"array","description":"The BigQuery query results returned as an array of objects, where each object represents a row of the query results with key value pairs corresponding to column names and their respective values.","items":{"type":"object","additionalProperties":{"type":"string"}}},"result":{"type":"string","description":"A message indicating the result of the BigQuery query."}},"type":"object","additionalProperties":false}}},"description":"Successful response."},"default":{"content":{"application/json":{"schema":{"description":"","properties":{"api_call_id":{"type":"string","description":"A 20 character API call ID.","minLength":20,"maxLength":20},"api_call_unix":{"description":"Unix timestamp of when the API call was initiated.","type":"integer","format":"unix-time"},"code":{"description":"This value indicates that there is an error. Will always be 0.","type":"integer","enum":[0]},"error_code":{"description":"The specific error code.","type":"string"},"message":{"description":"A human readable description of the error.","type":"string"},"result":{"description":"A description of the API call result.","type":"string"}},"title":"APIStandardErrors","type":"object","additionalProperties":false}}},"description":"Error response."}}}