> For the complete documentation index, see [llms.txt](https://docs.gitloom.cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.gitloom.cloud/api-reference/overview.md). Agents can also search and read this documentation through its [MCP server](https://docs.gitloom.cloud/~gitbook/mcp).

# Overview

Base URL, authentication, the error envelope and the gateway's bare 401 and 403, and where every route lives.

GitLoom stores what an agent learns about a user as markdown in a git repository — one repository per namespace — and returns it when a later question needs it. This space is the machine-readable contract; [docs.gitloom.cloud/documentation](https://docs.gitloom.cloud/documentation/) is the narrative version, written to be read start to end.

### Base URL

```
https://api.gitloom.cloud
```

#### GET /health

The only route that needs no credential.

```json
{"status": "ok"}
```

#### GET /v1/whoami

Confirms a credential is valid and reports what it resolves to — the first call worth making when wiring up a client, since it fails for exactly one reason.

```bash
curl -s "$GITLOOM_API/v1/whoami" -H "Authorization: Bearer $GITLOOM_KEY"
```

```json
{"account": "acme", "auth": "api_key", "env": "live"}
```

### Authentication

Two credential types reach every endpoint:

{% tabs %}
{% tab title="API key" %}

```
Authorization: Bearer gl_live_3f9a2b7c1d4e6f80_kQ8vN2xR7mZpLd3Wc0Ty5Ub9Aj1Hs4Ge
```

Server-side only — account-wide read and write over every namespace, unless it was created with a `namespace`, which confines it to that one. Create one from [app.gitloom.cloud](https://app.gitloom.cloud/); it is shown once, at creation.
{% endtab %}

{% tab title="Dashboard session" %}

```
Authorization: Bearer <Cognito ID token>
```

What the dashboard itself uses. Required to list or revoke keys, to create an account-wide key, and for Licences — an API key gets `403 dashboard_only` there. An account-wide API key may create keys scoped to one namespace; see [Keys](https://docs.gitloom.cloud/api-reference/keys.md).
{% endtab %}
{% endtabs %}

### Errors

Every error a handler returns carries one envelope. Branch on `code`, which is stable; `message` is prose and may be reworded.

```json
{"error":{"code":"namespace_not_found","message":"create namespace \"user-8213\" before writing to it"}}
```

The exception is a missing or refused credential. API Gateway answers both before any handler runs, so the body is its own, with no `code`:

| status | when                                                                                                                  | body                         |
| ------ | --------------------------------------------------------------------------------------------------------------------- | ---------------------------- |
| `401`  | no `Authorization` header                                                                                             | `{"message":"Unauthorized"}` |
| `403`  | a credential the gateway refuses: malformed, expired, revoked, another scheme such as `Basic`, or a suspended account | `{"message":"Forbidden"}`    |

Branch on the status for these two; the SDKs report both as code `unauthorized`. A refused credential is deliberately uninformative — telling you which half of a guess was right is a gift to whoever is guessing. A `403` that does carry the envelope is a handler's own refusal, such as `dashboard_only`, `scoped_key` or `forbidden_namespace`.

{% hint style="info" %}
**Only `429 rate_limited` carries `Retry-After`**, the whole seconds until the request is admitted again. `429 quota_exceeded` and `402 balance_exhausted` have none, because waiting does not clear them.
{% endhint %}

### Every route

<table data-view="cards"><thead><tr><th></th><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><i class="fa-folder-tree" style="color:$primary;">:folder-tree:</i></td><td><strong>Namespaces</strong></td><td>Create and list namespaces.</td><td><a href="https://docs.gitloom.cloud/api-reference/namespaces.md">Namespaces</a></td></tr><tr><td><i class="fa-brain" style="color:$primary;">:brain:</i></td><td><strong>Memories</strong></td><td>Write, retrieve, read by path, delete, and navigate.</td><td><a href="https://docs.gitloom.cloud/api-reference/memories.md">Memories</a></td></tr><tr><td><i class="fa-book" style="color:$primary;">:book:</i></td><td><strong>Vocabulary</strong></td><td>Terms and abbreviations a namespace has learned.</td><td><a href="https://docs.gitloom.cloud/api-reference/vocabulary.md">Vocabulary</a></td></tr><tr><td><i class="fa-wrench" style="color:$primary;">:wrench:</i></td><td><strong>Skills</strong></td><td>Procedural know-how, found by task.</td><td><a href="https://docs.gitloom.cloud/api-reference/skills.md">Skills</a></td></tr><tr><td><i class="fa-credit-card" style="color:$primary;">:credit-card:</i></td><td><strong>Usage and billing</strong></td><td>Consumption, wallet, recharge, subscribe.</td><td><a href="https://docs.gitloom.cloud/api-reference/usage-and-billing.md">Usage and billing</a></td></tr><tr><td><i class="fa-key" style="color:$primary;">:key:</i></td><td><strong>Keys</strong></td><td>API key lifecycle, and keys scoped to one namespace.</td><td><a href="https://docs.gitloom.cloud/api-reference/keys.md">Keys</a></td></tr><tr><td><i class="fa-id-badge" style="color:$primary;">:id-badge:</i></td><td><strong>Licences</strong></td><td>Only for CLIs before 0.4.0; the CLI is free now.</td><td><a href="https://docs.gitloom.cloud/api-reference/licences.md">Licences</a></td></tr><tr><td><i class="fa-comments" style="color:$primary;">:comments:</i></td><td><strong>Conversations</strong></td><td>Durable chat history with a context guarantee.</td><td><a href="https://docs.gitloom.cloud/api-reference/conversations.md">Conversations</a></td></tr><tr><td><i class="fa-list" style="color:$primary;">:list:</i></td><td><strong>Logs</strong></td><td>Recent request activity for the account.</td><td><a href="https://docs.gitloom.cloud/api-reference/logs.md">Logs</a></td></tr></tbody></table>

[openapi.yaml](https://gitloom.cloud/docs/openapi.yaml) is the machine-readable contract for the deployed API and carries the full schemas and every status code. The pages here are written by hand against it, so where the two disagree the spec is right.

See also: [Plans and pricing](https://docs.gitloom.cloud/documentation/content/pricing) for what `quota_exceeded`, `balance_exhausted` and `rate_limited` mean and how to clear each one; [Limits and behaviour](https://docs.gitloom.cloud/documentation/content/limits) for what is asynchronous and what nothing enforces yet.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.gitloom.cloud/api-reference/overview.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
