> ## Documentation Index
> Fetch the complete documentation index at: https://www.usenotra.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Getting started

> Call the Notra API: base URL, API keys, the TypeScript SDK and a map of every endpoint group.

The Notra API is a REST API served from `https://api.usenotra.com`. Everything the dashboard can do with GEO tracking, content, schedules, chats, skills and agent feedback is available over HTTP. The full contract is an OpenAPI 3.1 document at [api.usenotra.com/openapi.json](https://api.usenotra.com/openapi.json).

> [card] REST API
>
> Call endpoints directly with `curl` or `fetch`, which works for every endpoint group.

> [card] TypeScript SDK
>
> Use `@usenotra/sdk` for typed requests and responses on every endpoint, with retries, streaming and typed errors. The same package holds the AI traffic and web analytics tracking.

## Quick start

Base URL:

```bash theme={"system"}
https://api.usenotra.com
```

Paths are versioned (`/v1/...`, and `/v2/...` for the Agent group). Requests authenticate with a bearer credential, which is either an API key from the dashboard or an OAuth access token from the Notra authorization server. Notra infers the organization from the credential, so the URL has no organization segment.

Check that the API is reachable without a key:

```bash theme={"system"}
curl https://api.usenotra.com/v1/status
```

```json theme={"system"}
{
  "status": "ok",
  "service": "Notra API",
  "version": "1.0.0",
  "public": true,
  "authentication": {
    "type": "bearer",
    "resource_metadata": "https://api.usenotra.com/.well-known/oauth-protected-resource",
    "guide": "https://www.usenotra.com/auth.md"
  }
}
```

Then make an authenticated request:

```bash cURL theme={"system"}
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.usenotra.com/v1/posts"
```

```typescript fetch theme={"system"}
const response = await fetch("https://api.usenotra.com/v1/posts", {
  headers: {
    Authorization: `Bearer ${process.env.NOTRA_API_KEY}`,
  },
});

const data = await response.json();
console.log(data.posts);
```

```typescript SDK theme={"system"}
import { Notra } from "@usenotra/sdk";

const notra = new Notra(); // reads NOTRA_API_KEY

const result = await notra.content.listPosts();

console.log(result.posts);
```

## Create an API key

**1. Open API Keys**

In the [dashboard](https://app.usenotra.com), open **API Keys** at the bottom of the sidebar, which takes you to `app.usenotra.com/{org-slug}/api-keys`.

**2. Click Create API Key**

Pick a name, an expiration (no expiry, 7, 30, 60 or 90 days) and the permissions the key needs. Start from one of the presets (MCP Server, SDK, CLI) or choose **Restricted** to set read or write access per resource.

**3. Copy the key**

Keys start with `ntra_` and the dashboard shows each key only once, so store the value in a server-side environment variable such as `NOTRA_API_KEY`.

![API Keys in the Notra dashboard](https://mintcdn.com/notra/61y0WT4n5c9L1YWx/images/api/api-keys-light.webp?fit=max\&auto=format\&n=61y0WT4n5c9L1YWx\&q=85\&s=1fa24983d8adeb0523097591b1e698a5)

[Authentication](https://www.usenotra.com/docs/api/authentication.md) covers scopes, presets and error responses.

> [!NOTE]
>
> Building a CLI, MCP client or agent that acts for a signed-in user? Use OAuth instead of a pasted key. Register a client, run the authorization code flow with PKCE (or the device flow on headless machines) and send the access token in the same `Authorization: Bearer` header, which the Notra MCP server also accepts. [OAuth](https://www.usenotra.com/docs/api/authentication.md#oauth) has the details.

> [!WARNING]
>
> Keep API keys private. If a key ends up in client-side code, anyone can use it
> to burn through your [rate limits](https://www.usenotra.com/docs/api/rate-limits.md), even if the key is
> read-only, so make requests from your backend.

## SDK installation

```bash npm theme={"system"}
npm install @usenotra/sdk
```

```bash yarn theme={"system"}
yarn add @usenotra/sdk
```

```bash pnpm theme={"system"}
pnpm add @usenotra/sdk
```

```bash bun theme={"system"}
bun add @usenotra/sdk
```

Create the client. It reads your key from `NOTRA_API_KEY`, or pass it as `apiKey`:

```typescript theme={"system"}
import { Notra } from "@usenotra/sdk";

const notra = new Notra({
  apiKey: process.env.NOTRA_API_KEY,
  organization: "acme", // only needed for account keys in several workspaces
});

const post = await notra.content.getPost({ postId: "post_abc" });
const { projects } = await notra.geo.listProjects();
```

The SDK has one namespace per endpoint group: `notra.discovery`, `notra.content`, `notra.webhooks`, `notra.schedules`, `notra.eventTriggers`, `notra.chats`, `notra.skills`, `notra.sites`, `notra.feedback`, `notra.geo` and `notra.agent`. Each method is named after its operation's `operationId` in this reference and takes one object: path and query parameters by name and the JSON body as `body`. Failed requests throw `NotraAPIError` with the status, `code` and `recovery`; rate limits and server errors are retried for you. Set `environment: "sandbox"` to use the [sandbox](https://demo.usenotra.com) with sample data.

The source and the full guide are at [github.com/usenotra/typescript-sdk](https://github.com/usenotra/typescript-sdk).

## API groups

> [card] [Discovery](https://www.usenotra.com/docs/api-reference/discovery/check-public-api-reachability.md)
>
> `GET /v1/status` is a public reachability check that also returns the authentication discovery metadata agents use to find out how to get a credential.

> [card] [Content](https://www.usenotra.com/docs/api-reference/content/list-posts.md)
>
> Posts (list, get, update, delete, queue generation and poll its status), brand identities (list, generate, update, delete) and integrations (list, connect a GitHub repository, remove).

> [card] [Schedules](https://www.usenotra.com/docs/api-reference/schedules/list-schedules.md)
>
> Recurring content generation: list, create, update and delete schedules that turn repository activity into posts on a cadence.

> [card] [Event triggers](https://www.usenotra.com/docs/api-reference/event-triggers/list-event-triggers.md)
>
> Event-based generation fired by GitHub webhooks: list, create, get, update and delete triggers.

> [card] [Chats](https://www.usenotra.com/docs/api-reference/chats/list-chats.md)
>
> Start a chat and stream the reply, continue an existing chat, list chats or look a chat up by an external channel id.

> [card] [Skills](https://www.usenotra.com/docs/api-reference/skills/list-skills.md)
>
> Reusable writing skills, addressed by name: list, create, get, update and delete.

> [card] [Feedback](https://www.usenotra.com/docs/api-reference/feedback/list-feedback.md)
>
> AI agents post feedback to your public feedback URL without credentials, and you list, get and triage entries with an API key. [Agent Feedback](https://www.usenotra.com/docs/feedback/send-feedback.md) explains the setup.

> [card] [GEO](https://www.usenotra.com/docs/api-reference/geo/list-geo-projects.md)
>
> Generative engine optimization per project: settings, tracked prompts and prompt sequences, competitors, scans, visibility reads (mention rates, timeseries, share of voice), content gaps and briefs, agent readiness, AI traffic and the traffic ingest token. Requires a GEO plan.

> [card] [Agent](https://www.usenotra.com/docs/api-reference/agent/list-agent-sessions.md)
>
> Durable agent sessions under `/v2`: start a session, send follow-up messages or answer input requests, stream session events and list sessions.

## Responses and errors

Successful responses are JSON. List and detail responses in the Content and GEO groups also include an `organization` object (`id`, `slug`, `name`, `logo`) describing the organization the key belongs to.

Errors are JSON with an `error` message, and authentication failures add a machine-readable `code` and a `recovery` hint:

```json theme={"system"}
{
  "error": "Invalid API key",
  "code": "INVALID_API_KEY",
  "recovery": "Send Authorization: Bearer <NOTRA_API_KEY>. See https://www.usenotra.com/auth.md for agent credential discovery."
}
```

| Status | When |
| - | - |
| `400` | Validation failed. `error` names the field, for example `limit: Too big: expected number to be <=100`. |
| `401` | Missing, invalid or expired credential (API key or OAuth token). The response also carries a `WWW-Authenticate` header with the OAuth discovery URL. |
| `402` | The organization has no active paid plan or AI credits for a write, or no GEO plan for a GEO endpoint. |
| `403` | The key lacks the scope the endpoint needs. |
| `404` | Resource not found, or an unknown route. |
| `409` | Conflict, for example a duplicate name. |
| `429` | Rate limited. See [Rate Limits](https://www.usenotra.com/docs/api/rate-limits.md). |
| `503` | The authentication or billing service is temporarily unavailable. Retry with backoff. |

## Next steps

> [card] [Authentication](https://www.usenotra.com/docs/api/authentication.md)
>
> API keys, OAuth, scopes and the exact error envelope.

> [card] [Common tasks](https://www.usenotra.com/docs/api/common-tasks.md)
>
> Copy-paste examples for posts, generation jobs and GEO reads.

> [card] [Pagination](https://www.usenotra.com/docs/api/pagination.md)
>
> Page through posts, feedback and scan history.

> [card] [TypeScript types](https://www.usenotra.com/docs/api/types.md)
>
> Types and Zod schemas for the post endpoints.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.