API Index
Alphabetical index of public scripting APIs. Each entry links to the full reference on its namespace page.
A
console.assert(condition, ...args)— When condition is truthy, nothing is logged.
C
console.clear()— Clears all console lines captured so far in the current script run and resets group nesting depth.
D
console.debug(...args)— Same as console.log (captured at the log level).
E
console.error(...args)— Same argument formatting as console.log, captured at the error level (styled as an error in the Logs UI).
G
console.group(...label)— Logs an optional label, then increases indentation for following lines by two spaces.console.groupCollapsed(...label)— Same as console.group in HarborClient (labels and indentation only; groups are not collapsible in the Logs UI).console.groupEnd()— Ends the current group and decreases indentation (floored at zero).
L
console.log(...args)— Logs one or more values.
T
console.table(data, columns?)— Formats arrays and objects as a table and logs them.console.time(label?)— Starts a named timer (default label "default").console.timeEnd(label?)— Stops a named timer and logs label: <elapsed>ms.console.timeLog(label?, ...args)— Logs the current elapsed time for a named timer without stopping it.console.trace(...args)— Logs Trace: (plus any arguments) and a path-sanitized stack trace at the log level.
W
console.warn(...args)— Same argument formatting as console.log, captured at the warn level (styled as a warning in the Logs UI).
A
hc.ask(prompt, options?)— Sends a one-shot prompt to a configured AI model and returns the model's text response.
C
hc.collection.auth— Read and write collection-level authorization for the current send.hc.collection.auth.get()— Returns the same flat auth snapshot shape as hc.request.auth.get().hc.collection.auth.set(input)— Merges collection auth fields from a partial flat object.hc.collection.auth.update(field, value)— Updates a single auth field on the collection configuration.hc.collection.headers— Parameter bag for collection-level headers sent with every request in the collection.hc.collection.headers.clear()— Removes all collection headers for the remainder of this send.hc.collection.headers.get()— Returns a plain object of all enabled collection headers with non-empty keys.hc.collection.headers.get(key)— Returns the value of the first enabled collection header whose name matches key case-insensitively.hc.collection.headers.set(entries)— Batch-upserts multiple collection headers.hc.collection.headers.set(key, value)— Updates an existing enabled collection header or appends a new one.hc.collection.id— Storage id of the collection, or null when the request has no collection.hc.collection.name— Display name of the collection the request belongs to.hc.collection.variables— Get and set collection variables for the current send.hc.collection.variables.clear(key)— Removes a collection variable by exact key, or every key under a namespace.hc.collection.variables.get(key)— Returns the value set during this send (via hc.collection.variables.set) if present; otherwise returns the merged runtime variable value (global, collection, folder, and environment chain).hc.collection.variables.set(key, value)— Sets a collection variable for the remainder of this send and persists it to the collection when the send completes.hc.cookies.clear(name)— Removes a cookie by name for the request host.hc.cookies.get(name)— Returns the cookie value for name (case-insensitive).hc.cookies.set(name, value)— Sets a cookie for the request host.
D
hc.data (get)— Returns the current data object.hc.data (set)— Replaces the entire data object.
E
hc.environment.name— Display name of the active environment.hc.environment.variables.clear(key)— Removes an environment variable by exact key, or every key under a namespace.hc.environment.variables.get(key)— Returns the value set during this send (via hc.environment.variables.set) if present; otherwise returns the merged runtime variable value (global, collection, folder, and the active environment’s inheritance chain).hc.environment.variables.set(key, value)— Sets an environment variable for the remainder of this send and persists it to the active environment when the send completes (not to parent environments in an inheritance chain).hc.execution.setNextRequest(name)— After the current request finishes, jump to the saved request with that name in the run order.hc.execution.skipRequest()— Skip the HTTP send for the current request.hc.execution.workflowNextAction(actionId)— After the current workflow action finishes, jump to the action whose UUID matches actionId.hc.execution.workflowSkipAction()— Skip the remainder of the current workflow action and advance to the next.hc.expect(actual)— Returns a Chai.js BDD assertion helper for use inside hc.test.hc.expect(actual).to.be.ok— Asserts that actual is truthy.hc.expect(actual).to.eql(expected)— Deep equality.hc.expect(actual).to.equal(expected)— Strict equality (===).hc.expect(actual).to.include(value)— Asserts that actual contains value — works on strings, arrays, and objects.
F
hc.fetch(input, init?)— Sends an outbound HTTP request from the script sandbox using the same signature as the browser fetch() API.hc.fs.append(path, contents)— Appends UTF-8 text to a file, creating it when missing.hc.fs.exists(path)— Returns whether the path exists under the root.hc.fs.readBytes(path)— Reads a binary file as a Uint8Array.hc.fs.readCsv(path, options?)— Reads and parses a CSV file.hc.fs.readJson(path)— Reads and parses a JSON file.hc.fs.readText(path)— Reads a UTF-8 text file.hc.fs.readYaml(path)— Reads and parses a YAML file.hc.fs.stat(path)— Returns file metadata, or null when the path does not exist.hc.fs.writeBytes(path, bytes)— Writes binary data.hc.fs.writeCsv(path, rows, options?)— Serializes CSV and writes it.hc.fs.writeJson(path, value, options?)— Serializes JSON and writes it.hc.fs.writeText(path, contents)— Writes UTF-8 text, creating parent directories as needed.hc.fs.writeYaml(path, value)— Serializes YAML and writes it.
G
hc.globals.clear(key)— Removes a global variable by exact key, or every key under a namespace.hc.globals.get(key)— Returns the value set during this send (via hc.globals.set) if present; otherwise returns the merged runtime variable value (global, collection, and environment).hc.globals.set(key, value)— Sets a global variable for the remainder of this send and persists it to app settings when the send completes.
I
hc.info— Postman-compatible metadata about the current script run, plus HarborClient workflow and live-page fields.
L
hc.livePage— Type: async factory — (url?: string, options?: { reuse?: boolean }) => Promise<LivePageHandle> Opens or reuses an embedded browser tab and returns a handle for focus, close, navigation, DOM query/evaluate/inject, and screenshots.
P
hc.parse.csv(text, options?)— Options match hc.fs.readCsv.hc.parse.yaml(text)— hc.parse.yaml(text) scripting API.
R
hc.request.auth— Read and write request-level authorization for the current send.hc.request.auth.get()— Returns a plain snapshot of the current auth configuration.hc.request.auth.set(input)— Merges auth fields from a partial flat object onto the current configuration.hc.request.auth.update(field, value)— Updates a single auth field.hc.request.body— Request body as text.hc.request.headers— Parameter bag for the request-level header list (not collection-level headers).hc.request.headers.clear()— Removes all request-level headers for the remainder of this send.hc.request.headers.get()— Returns a plain object of all enabled headers with non-empty keys.hc.request.headers.get(key)— Returns the value of the first enabled header whose name matches key case-insensitively.hc.request.headers.set(entries)— Batch-upserts multiple headers.hc.request.headers.set(key, value)— Updates the value of an existing enabled header with the same name (case-insensitive), or appends a new enabled header if none exists.hc.request.method— HTTP method for the request (for example GET, POST).hc.request.notes— Accessor for the request tags and comment fields shown in the Discuss tab when using legacy notes (local collections, or Team Hub without threaded discussions).hc.request.notes.clear()— Clears both tags and comment ('' for each).hc.request.notes.get()— Returns the current tags and comment strings.hc.request.notes.get(field)— Returns a single notes field.hc.request.notes.set(entries)— Batch-updates one or both notes fields.hc.request.notes.set(field, value)— Updates a single notes field.hc.request.params— Parameter bag for the request query params list.hc.request.params.clear()— Removes all request query params for the remainder of this send.hc.request.params.get()— Returns a plain object of all enabled query params with non-empty keys.hc.request.params.get(key)— Returns the value of the first enabled param whose key matches exactly.hc.request.params.set(entries)— Batch-upserts multiple query params.hc.request.params.set(key, value)— Updates an existing enabled param or appends a new one.hc.request.url— Request URL.hc.request.variables— Get and set variables for the current send (or the current live-page navigation).hc.request.variables.clear(key)— Removes a variable for the remainder of this send or navigation.hc.request.variables.get(key)— Returns the session value set during this send or navigation (via hc.request.variables.set) if present; otherwise returns the seeded runtime variable value.hc.request.variables.replaceIn(template)— Replaces placeholders in a string using the same resolution order as send-time substitution: session values set with hc.request.variables.set, then merged runtime variables (global, collection, folder, and environment chain — plus live-page variables when running live-page scripts), then dynamic variables such as and .hc.request.variables.set(key, value)— Sets an ephemeral variable for the remainder of this send or navigation.hc.response.code— HTTP status code (for example 200, 404).hc.response.document()— Parses the response body as HTML and returns a document object for CSS selector queries.hc.response.headers— Response headers as a flat key-value map.hc.response.json()— Parses the response body as JSON and returns the result.hc.response.responseTime— Round-trip time for the request in milliseconds.hc.response.status— HTTP status text (for example OK, Not Found).hc.response.text()— Returns the response body as a string.hc.response.to— Postman-style response assertions powered by Chai.
S
hc.send(text, statusCode?, contentType?)— Treats the given text as the HTTP response for the current send — replacing status, headers, and body that would otherwise come from the remote server.hc.sendJSON(value, statusCode?)— Same as hc.send, but the body is JSON.stringify(value) and Content-Type is application/json.hc.sleep(milliseconds)— Pauses the script for the given number of milliseconds, then continues.hc.stringify.csv(rows, options?)— Options match hc.fs.writeCsv.hc.stringify.yaml(value)— hc.stringify.yaml(value) scripting API.
T
hc.test(name, fn)— Registers a named test.
