# Is it possible to call external APIs in Celigo hooks?

**URL:** <https://connective.celigo.com/t/is-it-possible-to-call-external-apis-in-celigo-hooks/6008>\
**Category:** Integrator.io\
**Tags:** hooks, connection, http\
**Created:** [January 21, 2026, 9:57am UTC](https://connective.celigo.com/t/is-it-possible-to-call-external-apis-in-celigo-hooks/6008 "2026-01-21T09:57:42Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![tharakaathukorala](https://avatars.discourse-cdn.com/v4/letter/t/ecb155/32.png) [@tharakaathukorala](https://connective.celigo.com/u/tharakaathukorala)\
**Post date:** [January 21, 2026, 9:57am UTC](https://connective.celigo.com/t/is-it-possible-to-call-external-apis-in-celigo-hooks/6008/1 "2026-01-21T09:57:43Z")

</div>

Hi,

Is there any way to call external APIs in JavaScript hooks in Celigo?  
At least in the Celigo custom API builder?

We need to get a response from an API without creating an HTTP universal connection inside Celigo.

Refer to the sample JS code below.

> ```javascript
> const requestHelpers = {
> "HTTPRequestHeaders": {
> "accept": "application/json,text/javascript, /; q=0.01",
> "accept-language": "en-GB,en-US;q=0.9,en;q=0.8,es;q=0.7",
> "cache-control": "no-cache",
> "pragma": "no-cache",
> "sec-ch-ua": ""Not(A:Brand";v="8", "Chromium";v="144", "Google Chrome";v="144"",
> "sec-ch-ua-mobile": "?0",
> "sec-ch-ua-platform": ""Linux"",
> "sec-fetch-dest": "empty",
> "sec-fetch-mode": "cors",
> "sec-fetch-site": "same-origin",
> "x-requested-with": "XMLHttpRequest",
> "cookie": " ****Cookie is predefined and never expires. The Cookie length is more than 1024 characters****",
> "Referer": "https://externalURL.com"
> },
> "getClientList": "https://externalURL.com/getClients",
> "getAllDevices": "https://externalURL.com/getDevices"
> }
> 
> async function getClientList(options) {
> const url = requestHelpers.getClientList;
> const response = await fetch(url, {
> method: 'GET',
> headers: requestHelpers.HTTPRequestHeaders
> });
> 
> const data = await response.json();
> return {
> statusCode: 200,
> body: data
> };
> 
> }
> 
> ```

We need to do a similar approach with Celigo.

---

<div class="post-metadata">

**Author:** ![tylerlamparter](https://sea1.discourse-cdn.com/flex001/user_avatar/connective.celigo.com/tylerlamparter/32/9204_2.png) [@tylerlamparter](https://connective.celigo.com/u/tylerlamparter)\
**Post date:** [January 21, 2026, 4:03pm UTC](https://connective.celigo.com/t/is-it-possible-to-call-external-apis-in-celigo-hooks/6008/2 "2026-01-21T16:03:14Z")

</div>

Yes, but not how you've attempted to do it. You need to use a JSRT function, specifically the `exports.run`, `imports.run`, `exports.runVirtual`, `imports.runVirtual`, or `exports.runVirtualWithPaging` function.  
[https://docs.celigo.com/hc/en-us/articles/20239758683035-integrator-io-API-and-JavaScript-runtime-objects](https://docs.celigo.com/hc/en-us/articles/20239758683035-integrator-io-API-and-JavaScript-runtime-objects)
