# Make your first API request

Call `GET /v1/integrations` to retrieve a list of all integrations in your account.

## 1. Get an API token

You'll need an API token from the account you want to call against. Any Celigo user with Administrator or account owner access can generate one.

1. Sign in to [integrator.io](https://integrator.io) (or the EU tenant at [eu.integrator.io](https://eu.integrator.io)).
2. Open **Resources → API tokens** and click **+ Create API token**.
3. Give it a name, pick an expiration, and choose **Full access** for your first try.
4. Copy the token.

See [Authentication](/api/getting-started/authentication.md) for scope-limited tokens and best practices.

## 2. Find your base URL

| Data center | Base URL                       |
| ----------- | ------------------------------ |
| NA          | `https://api.integrator.io`    |
| EU          | `https://api.eu.integrator.io` |

If your Celigo tenant lives on `integrator.io`, use the US URL. If it lives on `eu.integrator.io`, use the EU URL. The two tenants are entirely isolated — a US token does not work against EU, and vice versa. See [Environments & regions](/api/getting-started/environments.md).

## 3. Call the API

{% tabs %}
{% tab title="cURL" %}

```bash
export CELIGO_API_TOKEN="<your-token>"
export CELIGO_BASE_URL="https://api.integrator.io"

curl -s "$CELIGO_BASE_URL/v1/integrations" \
  -H "Authorization: Bearer $CELIGO_API_TOKEN" \
  -H "Accept: application/json"
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
const BASE  = "https://api.integrator.io";
const TOKEN = process.env.CELIGO_API_TOKEN;

const res = await fetch(`${BASE}/v1/integrations`, {
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    Accept: "application/json"
  }
});
const integrations = await res.json();
console.log(integrations);
```

{% endtab %}

{% tab title="Python" %}

```python
import os, requests

BASE  = "https://api.integrator.io"
TOKEN = os.environ["CELIGO_API_TOKEN"]

res = requests.get(
    f"{BASE}/v1/integrations",
    headers={"Authorization": f"Bearer {TOKEN}", "Accept": "application/json"},
    timeout=30,
)
res.raise_for_status()
print(res.json())
```

{% endtab %}

{% tab title="Celigo CLI" %}

```bash
celigo config set api_token "<your-token>"
celigo integrations list
```

{% endtab %}
{% endtabs %}

You should see a JSON array of integrations on your account.

```json
[
  {
    "_id": "5a1b2c3d4e5f6a7b8c9d0e1f",
    "name": "Shopify → NetSuite",
    "mode": "install",
    "createdAt": "2024-05-12T17:02:11.213Z"
  }
]
```

A non-`2xx` response? Jump to [Errors & status codes](/api/using-the-api/errors.md).

## REST semantics

Every resource in the API follows standard REST semantics.

| Verb     | Purpose                                                                                                                              |
| -------- | ------------------------------------------------------------------------------------------------------------------------------------ |
| `GET`    | Fetch a resource (`/v1/connections/{id}`) or list (`/v1/connections`).                                                               |
| `POST`   | Create a new resource.                                                                                                               |
| `PUT`    | **Full replace.** All omitted fields are erased. [Learn more about PUT](/api/getting-started/api-conventions.md#put-is-destructive). |
| `PATCH`  | Partial update (supported on a subset of endpoints).                                                                                 |
| `DELETE` | Delete a resource.                                                                                                                   |

> ⚠️ **`PUT` is destructive.** Celigo's API replaces the entire resource body on `PUT`. If you `PUT` a connection with only `{"name":"new name"}`, every other field on that connection becomes `undefined` and the connection will stop working. Always `GET` the resource first, modify only the fields you want to change, then `PUT` the complete object back. The CLI's `celigo <resource> set` command does this GET-modify-PUT round-trip for you.

Create a stub HTTP connection:

{% tabs %}
{% tab title="cURL" %}

```bash
curl -s -X POST "$CELIGO_BASE_URL/v1/connections" \
  -H "Authorization: Bearer $CELIGO_API_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "my-first-connection",
    "type": "http",
    "offline": true,
    "http": {
      "baseURI": "https://httpbin.org",
      "auth": { "type": "basic" }
    }
  }'
```

{% endtab %}

{% tab title="Node.js" %}

```javascript
const res = await fetch(`${BASE}/v1/connections`, {
  method: "POST",
  headers: {
    Authorization: `Bearer ${TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    name: "my-first-connection",
    type: "http",
    offline: true,
    http: {
      baseURI: "https://httpbin.org",
      auth: { type: "basic" }
    }
  })
});
const connection = await res.json();
console.log(connection._id);
```

{% endtab %}

{% tab title="Python" %}

```python
res = requests.post(
    f"{BASE}/v1/connections",
    headers={"Authorization": f"Bearer {TOKEN}", "Content-Type": "application/json"},
    json={
        "name": "my-first-connection",
        "type": "http",
        "offline": True,
        "http": {
            "baseURI": "https://httpbin.org",
            "auth": {"type": "basic"},
        },
    },
    timeout=30,
)
res.raise_for_status()
print(res.json()["_id"])
```

{% endtab %}

{% tab title="Celigo CLI" %}

```bash
cat <<'EOF' | celigo connections create
{
  "name": "my-first-connection",
  "type": "http",
  "offline": true,
  "http": {
    "baseURI": "https://httpbin.org",
    "auth": { "type": "basic" }
  }
}
EOF
```

{% endtab %}
{% endtabs %}

The response echoes the created resource, including its `_id`. Use that `_id` in subsequent `GET`, `PUT`, and `DELETE` calls.

## Build flows

To build anything useful you need three resources, in this order:

1. A **Connection** — credentials for the system you're talking to.
2. An **Export** — how records are pulled out of that system.
3. An **Import** — how records are written into another system.

Then you wrap them into a flow.

## What's next

* [Authentication](/api/getting-started/authentication.md) — scoped tokens, rotation, one-time tokens.
* [Pagination](/api/using-the-api/pagination.md) — how to iterate over long result sets.
* [CLI Reference](https://developer.celigo.com/cli) — do all of the above from `celigo <cmd>`.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://developer.celigo.com/api/getting-started/getting-started.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
