> For clean Markdown of any page, append .md to the page URL. > For a complete documentation index, see https://docs.instabase.com/api-sdk/api-reference/runs/get-run-results/llms.txt. > For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.instabase.com/_mcp/server. # Get run results GET https://aihub.instabase.com/api/v2/apps/runs/{run_id}/results Get the results of a completed automation app run. The results from this endpoint are paginated. The `has_more` field in the response indicates if there are more results to fetch and the `file_offset` query parameter can be used to specify the starting point for the next set of results. For an example of using `file_offset` to fetch all results, see the *Retrieving paginated results* code sample. This API operation might return field names that differ from those in the automation project. The operation converts field names to valid Python variable names by: * Allowing only letters, numbers, and underscores * Requiring names to start with a letter or underscore * Replacing invalid characters with underscores * Converting single underscores to double underscores Examples: * `due date` → `due_date` * `driver's license` → `driver_s_license` * `3rd category` → `_3rd_category` * `secret_id` → `secret__id` These changes apply only to field names in the API response. The field names in the automation project are not changed. Reference: https://docs.instabase.com/api-sdk/api-reference/runs/get-run-results ## Authentication - `Authorization` header (bearer token, required) — Bearer HTTP authentication. ## Request ### Path parameters - `run_id` (string, required) — The run ID. ### Query parameters - `include_review_results` (boolean, optional, default: false) — Whether to include human review details in the results. When set to `true`, various human review details are returned.The review process can include manually correcting values. This endpoint doesn't support returning the original and corrected values.The following values are returned at the document level (`files/documents/...`):- `review_completed` - `class_edit_history` - `class_edit_history/timestamp` - `class_edit_history/user_id` - `class_edit_history/modifications` - `class_edit_history/modifications/message`The following values are returned at the field level (`files/documents/fields/...`):- `edit_history` - `edit_history/timestamp` - `edit_history/user_id` - `edit_history/modifications` - `edit_history/modifications/message`The following values are returned at the packet level (also known as case level) (`case_info/fields/...`):- `edit_history` - `edit_history/timestamp` - `edit_history/user_id` - `edit_history/modifications` - `edit_history/modifications/message`See the response schema for details and descriptions. - `include_confidence_scores` (boolean, optional, default: false) — Whether to include confidence scores in the results. When set to `true`, various confidence scores are returned. The following values are returned at the document level (`files/documents/...`): - `classification_confidence` The following values are returned at the field level (`files/documents/fields/...`): - `confidence/model` - `confidence/ocr` See the response schema for details and descriptions. - `include_validation_results` (boolean, optional, default: false) — Whether to include validation status in the results. When set to `true`, various validation results are returned. The following values are returned at the document level (`files/documents/...`): - `validations/final_result_pass` The following values are returned at the field level (`files/documents/fields/...`): - `validations/valid` - `validations/alerts` The following values are returned at the packet level (also known as case level) (`case_info/fields/...`): - `validations/valid` - `validations/failures` Cross-class validation ensures data quality and consistency across documents within a packet. See the response schema for details and descriptions. - `include_source_info` (boolean, optional, default: false) — Whether to include source information in the results. When set to `true`, various source details are returned. The following values are returned at the document level (`files/documents/...`): * `post_processed_paths` * `post_processed_pdf_path` A `post_processed_pdf_path` is populated when `settings/runtime_config/generate_post_process_pdf=true`. Paths to PDFs are generated from each document, with separate PDF paths for documents split during classification. * `page_layouts` The following values are returned at the field level (`files/documents/fields/...`): * `source_coordinates/top_x` * `source_coordinates/top_y` * `source_coordinates/bottom_x` * `source_coordinates/bottom_y` * `source_coordinates/page_number` See the response schema for details and descriptions. - `file_offset` (integer, optional, default: 0) — The initial file index to start returning results from. Defaults to `0`. ### Headers - `IB-Context` (string, optional) — Typically your organization ID. See [Authorization and context identification](/api-sdk/authorization#ib-context-header) for details. ## Response ### 200 Run results retrieved successfully. If errors occur at the class, field, or document levels, the response status code is `200` and the response body includes error details. - `id` (string, optional) — Run ID of the run. - `status` (enum, optional) — Status of the run. Possible values and meanings: - `CANCELLED` -- A user cancelled the run - `COMPLETE` -- The run successfully completed. A human review completed if it was required. Results are retrievable, but some fields may have failed and have the value `ERROR`. - `FAILED` -- The run failed to complete - `PAUSED` -- This status is reserved for future use - `RUNNING` -- The run is in progress and is not paused - `STOPPED_AT_CHECKPOINT` -- A validation error has paused the run for human review - Allowed values: `CANCELLED`, `COMPLETE`, `FAILED`, `PAUSED`, `RUNNING`, `STOPPED_AT_CHECKPOINT` - `message` (string, optional, nullable) — Message about the run. - `start_timestamp` (long, optional) — When the run started, in Unix time nanoseconds. - `finish_timestamp` (long, optional, nullable) — When the run finished, in Unix time nanoseconds. `null` if run is still in progress. - `batch_id` (string, optional) — The batch ID used as input for this run, if run using a batch. - `files` (list of fileWithDocuments, optional) - `keys` (ResultsResponseKeys, optional) - `case_info` (caseInfo, optional) — Packet-level information (also known as case-level information) captured for the run, including optional edit history per cross-class field when `include_review_results=true`. Cross-class fields consolidate data extracted from standard fields within a packet. For more information about packets and cross-class fields, see [Extracting data from packets](/automate/packet-schema). - `review_completed` (boolean, optional) — Indicates whether the run or document has completed review. - `has_more` (boolean, optional) — Indicates whether additional results are available beyond those included in the current response. Use the `file_offset` query parameter to specify the starting point when fetching the next set of results. ## Types ### fileWithDocuments - `original_file_name` (string, optional) — The original name of the file processed. - `input_file_path` (string, optional) — The file path of the input file. - `documents` (list of document, optional) — An array containing each document within the file. ### ResultsResponseKeys - `custom` (ResultsResponseKeysCustom, optional) — Key/value pairs representing non-secret custom keys set for the run. ### caseInfo - `fields` (list of caseInfoField, optional) — A list of cross-class fields captured for this run. Cross-class fields consolidate data extracted from standard fields within a packet. ### document - `fields` (list of documentField, optional) — A list containing the extracted fields from the document, each with its field name, extracted value, and type. See `` structure for details. - `review_completed` (boolean, optional) — Indicates whether the document has been marked as reviewed. - `class_name` (string, optional, nullable) — The classification label of the document. `null` if classification is not applicable. - `page_numbers` (list of integer, optional) — An array of the document's page numbers. - `page_layouts` (list of pageLayout, optional) — An array with one entry per page, containing page layout information including page number, width, and height. - `post_processed_paths` (list of string, optional) — An array of strings, each representing a path to post-processed documents. - `post_processed_pdf_path` (string, optional) — Path to post-processed PDF. - `class_edit_history` (list of modificationObject, optional) — An array containing the history of edits to the document class. - `validations` (DocumentValidations, optional) - `classification_confidence` (DocumentClassificationConfidence, optional) ### ResultsResponseKeysCustom Key/value pairs representing non-secret custom keys set for the run. ### caseInfoField - `name` (string, required) — Name of the cross-class field. - `value` (string, required) — The value of the cross-class field. - `input_fields` (list of caseInputField, optional) — Only applicable for ranked cross-class fields. Input options the user can choose from when determining the value of this ranked field. - `chosen_field` (caseInputField, optional, nullable) — Only applicable for ranked cross-class fields. The input option from `input_fields` that was selected for the ranked field's value. - `error_msg` (string, optional) — Error message for the cross-class field, if any. - `edit_history` (list of modificationObject, optional) — The history of edits to the cross-class field. Returned when `include_review_results=true`. - `validations` (CaseInfoFieldValidations, optional) — Validation results for the cross-class field. Returned when `include_validation_results` is `true` and field has cross-class validation results. Cross-class validation ensures data quality and consistency across documents within a packet. ### documentField - `field_name` (string, optional) — The name of the field. - `value` (string, optional) — The extracted value of the field. - `type` (string, optional) — The type of the field. - `error_msg` (string, optional) — The error message for the field. - `source_coordinates` (list of fieldSourceCoordinates, optional) - `edit_history` (list of modificationObject, optional) — An array containing the history of edits to the field. - `confidence` (DocumentFieldConfidence, optional) - `validations` (DocumentFieldValidations, optional) ### pageLayout - `page_number` (integer, required) — Zero-indexed page number. - `width` (float, required) — Width of the page. - `height` (float, required) — Height of the page. ### modificationObject - `timestamp` (string, required) — Datetime string of the edit history event. - `user_id` (string, required) — User ID of the user who made the edit. - `modifications` (list of ModificationObjectModificationsItems, optional) — List of modifications made in this single edit history event. ### DocumentValidations - `final_result_pass` (boolean, optional) — Indicates whether the document has passed all validation rules. ### DocumentClassificationConfidence - `model` (float, optional, nullable) — Classification confidence. Indicates the model's certainty in predicting the class of a document. ### caseInputField Input option for ranked cross-class fields. - `record_index` (integer, optional) — Index of the document used for the input option - `refined_phrase_name` (string, optional) — Refined phrase name of the input option. ### CaseInfoFieldValidations Validation results for the cross-class field. Returned when `include_validation_results` is `true` and field has cross-class validation results. Cross-class validation ensures data quality and consistency across documents within a packet. - `valid` (boolean, required) — Indicates whether the cross-class field has passed all validation rules. - `failures` (list of CaseInfoFieldValidationsFailuresItems, optional) — Array of validation failures for the cross-class field. Populated only if the `validations/valid` value is `false`. ### fieldSourceCoordinates - `top_x` (float, optional) — Top-left X coordinate of the bounding box. - `top_y` (float, optional) — Top-left Y coordinate of the bounding box. - `bottom_x` (float, optional) — Bottom-right X coordinate of the bounding box. - `bottom_y` (float, optional) — Bottom-right Y coordinate of the bounding box. - `page_number` (integer, optional) — Zero-indexed page number of the bounding box. ### DocumentFieldConfidence - `model` (float, optional, nullable) — Field confidence. Indicates the model's certainty in predicting results for a given field. - `ocr` (float, optional, nullable) — OCR confidence. Indicates the OCR processor's certainty in digitization accuracy. ### DocumentFieldValidations - `valid` (boolean, optional) — Indicates whether the document has passed validation rules pertaining to this field. - `alerts` (list of DocumentFieldValidationsAlertsItems, optional) — Alerts for field-level validation rules. Populated only if the `validations/valid` value is `false`. ### ModificationObjectModificationsItems - `message` (string, optional, nullable) — Message associated with the edit history modification. ### CaseInfoFieldValidationsFailuresItems - `type` (string, required) — Type of validation failure (for example, "lambda_code", "all_inputs_match"). - `msg` (string, required) — Message describing the validation failure. ### DocumentFieldValidationsAlertsItems - `alert_level` (string, optional) — Alert level of the validation failure. Always set to `FAILURE`. - `msg` (string, optional) — Description of alert. - `blocked` (boolean, optional) — If this validation failure is blocking. - `type` (string, optional) — Type of validation alert. - `locations` (list of DocumentFieldValidationsAlertsItemsLocationsItems, optional) ### DocumentFieldValidationsAlertsItemsLocationsItems ## Examples ### Simple request **Response** ```json { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "status": "COMPLETE", "message": "Completed single_flow", "start_timestamp": 1765912514238248700, "finish_timestamp": 1765912529614834000, "batch_id": "1235", "files": [ { "original_file_name": "test.png", "input_file_path": "instabase-sandbox-org/test-org/fs/Instabase Drive/app-runs/a1b2c3d4-e5f6-7890-abcd-ef1234567890/input/test.png", "documents": [ { "fields": [ { "field_name": "employers_address_and_ZIP_code", "value": "123 STREET RD ANYWHERE, USA,12345", "type": "TEXT" } ], "class_name": "Wage And Tax Statement", "page_numbers": [ 1, 2 ] } ] }, { "original_file_name": "test2.png", "input_file_path": "instabase-sandbox-org/test-org/fs/Instabase Drive/app-runs/a1b2c3d4-e5f6-7890-abcd-ef1234567890/input/test2.png", "documents": [ { "fields": [ { "field_name": "sex", "value": "Male", "type": "TEXT" } ], "class_name": "Driver License", "page_numbers": [ 1 ] } ] } ], "keys": [ { "custom": {} } ], "case_info": { "fields": [ { "name": "Employee_Address", "value": "123 STREET RD ANYWHERE, USA,12345", "input_fields": [ { "record_index": 0, "refined_phrase_name": "employers_address_and_ZIP_code" } ], "chosen_field": { "record_index": 0, "refined_phrase_name": "employers_address_and_ZIP_code" }, "edit_history": [ { "timestamp": "08/27/2025 00:58:39", "user_id": "john.doe_instabase.com", "modifications": [ { "message": "Edited to \"123 STREET RD ANYWHERE, USA,12345\"" } ] } ] }, { "name": "Sex", "value": "Male", "input_fields": [ { "record_index": 0, "refined_phrase_name": "sex" } ], "chosen_field": { "record_index": 0, "refined_phrase_name": "sex" } } ] }, "has_more": false } ``` **SDK Code** ```python Simple request with SDK from aihub import AIHub client = AIHub( api_root="https://aihub.instabase.com/api", api_key="abcdefghijklmnopqrst1234567890", ib_context="john.doe_acme.com" ) results = client.apps.runs.results( run_id="a1b2c3d4-e5f6-7890-abcd-ef1234567890" ) print(f"Retrieved results from {len(results.files)} files") ``` ```python Simple request without SDK import requests run_id = "a1b2c3d4-e5f6-7890-abcd-ef1234567890" url = f"https://aihub.instabase.com/api/v2/apps/runs/{run_id}/results" headers = { "Authorization": "Bearer abcdefghijklmnopqrst1234567890", "IB-Context": "john.doe_acme.com" } # make the GET request response = requests.get(url, headers=headers) # handle the response if response.status_code == 200: print(f"Retrieved results from {len(response.json()['files'])} files") else: print(f"Error: {response.status_code} - {response.text}") ``` ```javascript Simple request const url = 'https://aihub.instabase.com/api/v2/apps/runs/a1b2c3d4-e5f6-7890-abcd-ef1234567890/results'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Simple request package main import ( "fmt" "net/http" "io" ) func main() { url := "https://aihub.instabase.com/api/v2/apps/runs/a1b2c3d4-e5f6-7890-abcd-ef1234567890/results" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Simple request require 'uri' require 'net/http' url = URI("https://aihub.instabase.com/api/v2/apps/runs/a1b2c3d4-e5f6-7890-abcd-ef1234567890/results") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java Simple request import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://aihub.instabase.com/api/v2/apps/runs/a1b2c3d4-e5f6-7890-abcd-ef1234567890/results") .header("Authorization", "Bearer ") .asString(); ``` ```php Simple request request('GET', 'https://aihub.instabase.com/api/v2/apps/runs/a1b2c3d4-e5f6-7890-abcd-ef1234567890/results', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp Simple request using RestSharp; var client = new RestClient("https://aihub.instabase.com/api/v2/apps/runs/a1b2c3d4-e5f6-7890-abcd-ef1234567890/results"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift Simple request import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://aihub.instabase.com/api/v2/apps/runs/a1b2c3d4-e5f6-7890-abcd-ef1234567890/results")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ``` ### Using query parameters with SDK **Response** ```json { "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890", "status": "COMPLETE", "message": "Completed single_flow", "start_timestamp": 1765912514238248700, "finish_timestamp": 1765912529614834000, "batch_id": "9706", "files": [ { "original_file_name": "test.png", "documents": [ { "fields": [ { "field_name": "employers_address_and_ZIP_code", "value": "123 STREET RD ANYWHERE, USA,12345", "type": "TEXT", "source_coordinates": [ { "top_x": 36, "top_y": 181, "bottom_x": 84, "bottom_y": 212, "page_number": 0 }, { "top_x": 90, "top_y": 182, "bottom_x": 198, "bottom_y": 211, "page_number": 0 } ], "confidence": { "model": 0.5900550516, "ocr": 0.6900550516 } } ], "class_name": "Wage And Tax Statement", "page_layouts": [ { "page_number": 0, "width": 1012, "height": 639 } ], "post_processed_paths": [ "instabase-org/orguser/fs/S3 Drive/app-runs/dd97-42cb-8b8e-28a63066887e/4180-8508-b103afb67185/s1_process_files/images/test.png.PNG" ] } ] }, { "original_file_name": "test2.png", "documents": [ { "fields": [ { "field_name": "sex", "value": "Male", "type": "TEXT", "source_coordinates": [], "confidence": { "model": 0.6915, "ocr": 0.7915 } } ], "class_name": "Driver License", "page_layouts": [ { "page_number": 0, "width": 1012, "height": 639 } ], "post_processed_paths": [ "instabase-org/orguser/fs/S3 Drive/app-runs/dd97-42cb-8b8e-28a63066887e/4180-8508-b103afb67185/s1_process_files/images/test2.png.PNG" ] } ] } ], "case_info": { "fields": [ { "name": "Employee_Address", "value": "123 STREET RD ANYWHERE, USA,12345", "input_fields": [ { "record_index": 0, "refined_phrase_name": "employers_address_and_ZIP_code" } ], "chosen_field": { "record_index": 0, "refined_phrase_name": "employers_address_and_ZIP_code" }, "edit_history": [ { "timestamp": "08/27/2025 00:58:39", "user_id": "john.doe_instabase.com", "modifications": [ { "message": "Edited to \"123 STREET RD ANYWHERE, USA,12345\"" } ] } ] }, { "name": "Sex", "value": "Male", "input_fields": [ { "record_index": 0, "refined_phrase_name": "sex" } ], "chosen_field": { "record_index": 0, "refined_phrase_name": "sex" } } ] }, "review_completed": false, "has_more": false } ``` **SDK Code** ```python Using query parameters with SDK from aihub import AIHub client = AIHub( api_root="https://aihub.instabase.com/api", api_key="abcdefghijklmnopqrst1234567890", ib_context="john.doe_acme.com" ) results = client.apps.runs.results( run_id="a1b2c3d4-e5f6-7890-abcd-ef1234567890", include_confidence_scores=True, include_source_info=True ) print(f"Retrieved results from {len(results.files)} files") ``` ```python Using query parameters without SDK import requests run_id = "a1b2c3d4-e5f6-7890-abcd-ef1234567890" url = f"https://aihub.instabase.com/api/v2/apps/runs/{run_id}/results" headers = { "Authorization": "Bearer abcdefghijklmnopqrst1234567890", "IB-Context": "john.doe_acme.com" } params = { "include_confidence_scores": True, "include_source_info": True } # make the GET request response = requests.get(url, headers=headers, params=params) # handle the response if response.status_code == 200: print(f"Retrieved results for {len(response.json()['files'])} files") else: print(f"Error: {response.status_code} - {response.text}") ``` ```python Retrieving paginated results with SDK # The results from this endpoint are paginated. # The `has_more` field in the response indicates whether there are more results to fetch, # and `file_offset` specifies the starting point for the next set of results. # This example retrieves all results. from aihub import AIHub client = AIHub( api_root="https://aihub.instabase.com/api", api_key="abcdefghijklmnopqrst1234567890", ib_context="john.doe_acme.com" ) all_files_results = [] current_offset = 0 run_id = "a1b2c3d4-e5f6-7890-abcd-ef1234567890" while True: # fetch results with the current offset response = client.apps.runs.results( run_id=run_id, file_offset=current_offset ) # extend the list with the files from the current response all_files_results.extend(response.files) # check if there are more results to fetch if not response.has_more: break # increment the offset by the number of files received in the current response current_offset += len(response.files) print(f"Retrieved results from {len(all_files_results)} total files") ``` ```python Retrieving paginated results without SDK # The results from this endpoint are paginated. # The `has_more` field in the response indicates whether there are more results to fetch, # and `file_offset` specifies the starting point for the next set of results. # This example retrieves all results. import requests run_id = "a1b2c3d4-e5f6-7890-abcd-ef1234567890" url = f"https://aihub.instabase.com/api/v2/apps/runs/{run_id}/results" headers = { "Authorization": "Bearer abcdefghijklmnopqrst1234567890", "IB-Context": "john.doe_acme.com" } file_offset = 0 all_files_results = [] while True: params = {"file_offset": file_offset} # make the GET request response = requests.get(url, headers=headers, params=params) # handle the response if response.status_code == 200: print(f"Retrieved results for {len(response.json()['files'])} files") all_files_results.extend(response.json()['files']) if response.json()['has_more']: file_offset += len(response.json()['files']) else: break else: print(f"Error: {response.status_code} - {response.text}") break print(f"Retrieved results from {len(all_files_results)} total files") ``` ```javascript Using query parameters with SDK const url = 'https://aihub.instabase.com/api/v2/apps/runs/a1b2c3d4-e5f6-7890-abcd-ef1234567890/results'; const options = {method: 'GET', headers: {Authorization: 'Bearer '}}; try { const response = await fetch(url, options); const data = await response.json(); console.log(data); } catch (error) { console.error(error); } ``` ```go Using query parameters with SDK package main import ( "fmt" "net/http" "io" ) func main() { url := "https://aihub.instabase.com/api/v2/apps/runs/a1b2c3d4-e5f6-7890-abcd-ef1234567890/results" req, _ := http.NewRequest("GET", url, nil) req.Header.Add("Authorization", "Bearer ") res, _ := http.DefaultClient.Do(req) defer res.Body.Close() body, _ := io.ReadAll(res.Body) fmt.Println(res) fmt.Println(string(body)) } ``` ```ruby Using query parameters with SDK require 'uri' require 'net/http' url = URI("https://aihub.instabase.com/api/v2/apps/runs/a1b2c3d4-e5f6-7890-abcd-ef1234567890/results") http = Net::HTTP.new(url.host, url.port) http.use_ssl = true request = Net::HTTP::Get.new(url) request["Authorization"] = 'Bearer ' response = http.request(request) puts response.read_body ``` ```java Using query parameters with SDK import com.mashape.unirest.http.HttpResponse; import com.mashape.unirest.http.Unirest; HttpResponse response = Unirest.get("https://aihub.instabase.com/api/v2/apps/runs/a1b2c3d4-e5f6-7890-abcd-ef1234567890/results") .header("Authorization", "Bearer ") .asString(); ``` ```php Using query parameters with SDK request('GET', 'https://aihub.instabase.com/api/v2/apps/runs/a1b2c3d4-e5f6-7890-abcd-ef1234567890/results', [ 'headers' => [ 'Authorization' => 'Bearer ', ], ]); echo $response->getBody(); ``` ```csharp Using query parameters with SDK using RestSharp; var client = new RestClient("https://aihub.instabase.com/api/v2/apps/runs/a1b2c3d4-e5f6-7890-abcd-ef1234567890/results"); var request = new RestRequest(Method.GET); request.AddHeader("Authorization", "Bearer "); IRestResponse response = client.Execute(request); ``` ```swift Using query parameters with SDK import Foundation let headers = ["Authorization": "Bearer "] let request = NSMutableURLRequest(url: NSURL(string: "https://aihub.instabase.com/api/v2/apps/runs/a1b2c3d4-e5f6-7890-abcd-ef1234567890/results")! as URL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0) request.httpMethod = "GET" request.allHTTPHeaderFields = headers let session = URLSession.shared let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in if (error != nil) { print(error as Any) } else { let httpResponse = response as? HTTPURLResponse print(httpResponse) } }) dataTask.resume() ```