> For the complete documentation index, see [llms.txt](https://developers.gallantreecapital.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developers.gallantreecapital.com/getting-started/first-request.md).

# Your first request

This quickstart calls `GET /api/v1/loans` and shows you the response shape. Total time: about two minutes.

## Prerequisites

* A [registered sandbox app](/getting-started/register-an-app.md) with an API key you can copy.
* `curl` (or any HTTP client) available in your terminal.

The sandbox environment ships with a small seeded dataset so you'll get a real response even before you have any loans of your own.

## 1. Set your key as a shell variable

```bash
export GALLANTREE_API_KEY="gt_..."
```

Replace the placeholder with the full key the portal showed you. Every developer key starts with the `gt_` prefix followed by a random suffix. Whether a key routes to sandbox or production is a property of the app it belongs to, not the key string — always confirm the environment pill in the portal before you copy a key into config.

## 2. Make the call

```bash
curl -sS https://developers.gallantreecapital.com/api/v1/loans \
  -H "x-api-key: $GALLANTREE_API_KEY"
```

You should get a `200 OK` and a JSON body that looks roughly like this:

```json
{
  "data": [
    {
      "id": "65f3a8b1d5c9e4f2a1b3c4d5",
      "reference": "SBX-000123",
      "status": "active",
      "principal": {
        "amount": 1250000,
        "currency": "AUD"
      },
      "capitalProgramId": "65f3a8b1d5c9e4f2a1b3c4d0",
      "createdAt": "2026-07-14T02:11:00.000Z",
      "updatedAt": "2026-08-02T09:42:11.000Z"
    }
  ],
  "pagination": {
    "page": 1,
    "limit": 25,
    "total": 8,
    "totalPages": 1
  }
}
```

The list is paginated (default page size: 25). Add `?page=2&limit=50` to page through larger result sets — see [pagination](/guides/versioning.md#pagination) for the full parameter set.

## 3. Check the rate-limit headers

Every response carries three headers you can watch to stay under your tier's quota:

```
x-ratelimit-limit: 60
x-ratelimit-remaining: 59
x-ratelimit-reset: 1755267600
```

`x-ratelimit-reset` is a Unix timestamp — the point at which your window resets. See [Rate limits](/guides/rate-limits.md) for the tier table and back-off recommendations.

## 4. Handle a failure

Change your key to garbage and re-run the request:

```bash
curl -sS https://developers.gallantreecapital.com/api/v1/loans \
  -H "x-api-key: nope" -i | head -20
```

You'll get a `401 Unauthorized` with a body of:

```json
{ "message": "The API key you provided is not valid." }
```

The response is deliberately generic — it never tells you whether the key exists, is expired, or belongs to another environment. That's an anti-enumeration measure, not a bug. See [Error model](/guides/error-model.md) for the full list of shapes.

## Where to go next

* **Reads:** The [API reference](/reference/openapi.md) lists every resource, filter, and response schema.
* **Writes:** Read [Idempotency](/guides/idempotency.md) before you send a `POST`.
* **Webhooks:** [Subscribe](/webhooks/subscribe.md), then [verify signatures](/webhooks/verify-signature.md).


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://developers.gallantreecapital.com/getting-started/first-request.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
