> ## 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.

# Common tasks

> Practical Notra API examples: update a post, generate content, read GEO visibility and trigger a scan.

## Update an existing post

Use `PATCH /v1/posts/{postId}` to update a post, and send at least one of these fields:

* `title`, up to 120 characters
* `slug`, up to 160 lowercase letters, numbers and hyphens, or `null` to clear it
* `markdown`, up to 100,000 characters
* `status`, `draft` or `published`
* `metadata`, the cover image, tags, excerpt, authors and other site fields of a blog post or changelog (see [Set blog metadata](#set-blog-metadata))

The response contains the updated post.

```typescript fetch theme={"system"}
type UpdatePostRequest = {
  title?: string;
  slug?: string | null;
  markdown?: string;
  status?: "draft" | "published";
  metadata?: {
    coverImage?: { url: string; alt?: string } | null;
    tags?: string[];
    excerpt?: string | null;
    authorIds?: string[];
    featured?: boolean;
    noindex?: boolean;
    hidden?: boolean;
    displayDate?: string | null;
  };
};

type Post = {
  id: string;
  title: string;
  slug: string | null;
  content: string;
  htmlUrl: string | null;
  markdown: string | null;
  rawHtml: string | null;
  recommendations: string | null;
  contentType:
    | "changelog"
    | "linkedin_post"
    | "twitter_post"
    | "blog_post"
    | "investor_update"
    | "image";
  sourceMetadata: unknown;
  /** Set for blog posts and changelogs, null for other content types. */
  metadata: {
    coverImage: { url: string; alt: string } | null;
    tags: string[];
    excerpt: string | null;
    authors: Array<{
      id: string;
      slug: string;
      name: string;
      title: string | null;
      avatarUrl: string | null;
      /** Profile links: full http(s) URLs, or null when not set. */
      url: string | null;
      x: string | null;
      linkedin: string | null;
      github: string | null;
      youtube: string | null;
      bluesky: string | null;
      mastodon: string | null;
      threads: string | null;
      instagram: string | null;
    }>;
    featured: boolean;
    noindex: boolean;
    hidden: boolean;
    displayDate: string | null;
  } | null;
  status: "draft" | "published";
  createdAt: string;
  updatedAt: string;
};

type UpdatePostResponse = {
  organization: {
    id: string;
    slug: string;
    name: string;
    logo: string | null;
  };
  post: Post;
};

async function updatePost(
  postId: string,
  updates: UpdatePostRequest
): Promise<UpdatePostResponse> {
  const response = await fetch(`https://api.usenotra.com/v1/posts/${postId}`, {
    method: "PATCH",
    headers: {
      "Content-Type": "application/json",
      Authorization: `Bearer ${process.env.NOTRA_API_KEY}`,
    },
    body: JSON.stringify(updates),
  });

  if (!response.ok) {
    throw new Error(`Failed to update post: ${response.status}`);
  }

  const data: UpdatePostResponse = await response.json();
  return data;
}
```

```bash cURL theme={"system"}
curl -X PATCH "https://api.usenotra.com/v1/posts/post_abc" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "title": "Ship notes for week 11",
    "markdown": "# Ship notes\n\nWe shipped a faster editor.",
    "status": "published"
  }'
```

```typescript SDK theme={"system"}
const updated = await notra.content.updatePost({
  postId: "post_abc",
  body: {
    title: "Ship notes for week 11",
    markdown: "# Ship notes\n\nWe shipped a faster editor.",
    status: "published",
  },
});

console.log(updated.post);
```

The limit for `PATCH /v1/posts/{postId}` is 60 requests per minute per key, and sending a body with none of the five fields returns `400`.

### Set blog metadata

Blog posts and changelogs carry site metadata that hosted sites and GitHub publishing write into the post's frontmatter. Every post response includes it as `metadata`; for other content types `metadata` is `null`, and sending it in an update returns `400`.

Inside `metadata`, send only the fields you want to change:

| Field | Value |
| - | - |
| `coverImage` | `{ "url": "https://…", "alt": "…" }`, or `null` to remove the cover. The URL must be https. |
| `tags` | Replaces all tags. Up to 12 tags of 40 characters; duplicates are dropped case-insensitively. |
| `excerpt` | Summary for post cards and meta descriptions, up to 300 characters. `null` or `""` derives it from the first paragraph. |
| `authorIds` | Replaces the credited authors, in display order. Up to 5 IDs from `GET /v1/posts/authors`. |
| `featured` | `true` pins the post to the top of the blog index. |
| `noindex` | `true` asks search engines not to index the post and leaves it out of the sitemap. |
| `hidden` | `true` keeps the hosted page reachable by direct link but removes it from site listings, feeds, search engine indexing, sitemaps and generated AI indexes. It does not make the page private. |
| `displayDate` | Date shown on the post as `YYYY-MM-DD`, or `null` to use the publish date. |

Authors are created in the dashboard. List them to find their IDs:

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

```json theme={"system"}
{
  "organization": { "id": "org_123", "slug": "acme", "name": "Acme", "logo": null },
  "authors": [
    {
      "id": "auth_8f2kq1",
      "slug": "jane-doe",
      "name": "Jane Doe",
      "title": "Head of Product",
      "bio": null,
      "avatarUrl": "https://cdn.example.com/avatars/jane.png",
      "url": null,
      "x": "https://x.com/janedoe",
      "linkedin": null,
      "github": null,
      "youtube": null,
      "bluesky": "https://bsky.app/profile/janedoe.com",
      "mastodon": null,
      "threads": null,
      "instagram": null
    }
  ]
}
```

Then set the metadata on a post:

```bash theme={"system"}
curl -X PATCH "https://api.usenotra.com/v1/posts/post_abc" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "metadata": {
      "coverImage": {
        "url": "https://cdn.example.com/covers/ship-notes.png",
        "alt": "Screenshot of the new editor"
      },
      "tags": ["editor", "performance"],
      "authorIds": ["auth_8f2kq1"],
      "displayDate": "2026-10-01"
    }
  }'
```

The response contains the post with the stored metadata, with each author ID resolved:

```json theme={"system"}
"metadata": {
  "coverImage": {
    "url": "https://cdn.example.com/covers/ship-notes.png",
    "alt": "Screenshot of the new editor"
  },
  "tags": ["editor", "performance"],
  "excerpt": null,
  "authors": [
    {
      "id": "auth_8f2kq1",
      "slug": "jane-doe",
      "name": "Jane Doe",
      "title": "Head of Product",
      "avatarUrl": "https://cdn.example.com/avatars/jane.png",
      "url": null,
      "x": "https://x.com/janedoe",
      "linkedin": null,
      "github": null,
      "youtube": null,
      "bluesky": "https://bsky.app/profile/janedoe.com",
      "mastodon": null,
      "threads": null,
      "instagram": null
    }
  ],
  "featured": false,
  "noindex": false,
  "hidden": false,
  "displayDate": "2026-10-01"
}
```

An author ID from another organization, or one that was deleted, returns `400`. When the post has a linked GitHub pull request, a metadata update syncs it like a title or markdown update.

## Create a new post

There is no `POST /v1/posts` endpoint for creating a post with arbitrary fields, because Notra creates posts through generation. Queue a job with `POST /v1/posts/generate` and then poll it until it reports a `postId`.

> [!WARNING]
>
> If a guide or AI answer suggests `POST /v1/posts` or an `author` field for post creation, it is wrong for the current Notra API.

### Queue a generation job

`contentType` is required (`changelog`, `blog_post`, `linkedin_post`, `twitter_post` or `image`). `lookbackWindow` defaults to `last_7_days` (`current_day`, `yesterday`, `last_7_days`, `last_14_days`, `last_30_days`). Point the job at connected sources with `integrations.github` and `integrations.linear` (integration ids from `GET /v1/integrations`) or at public repositories with `github.repositories`. When you pass no selector, the job uses every connected GitHub integration.

```bash theme={"system"}
curl -X POST "https://api.usenotra.com/v1/posts/generate" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "contentType": "changelog",
    "lookbackWindow": "last_7_days",
    "integrations": { "github": ["integration_1"] },
    "dataPoints": {
      "includePullRequests": true,
      "includeCommits": true,
      "includeReleases": true,
      "includeLinearData": false
    }
  }'
```

The API answers `202 Accepted` with the job:

```json theme={"system"}
{
  "organization": { "id": "org_123", "slug": "acme", "name": "Acme", "logo": null },
  "job": {
    "id": "job_123",
    "organizationId": "org_123",
    "status": "queued",
    "contentType": "changelog",
    "lookbackWindow": "last_7_days",
    "repositoryIds": [],
    "brandVoiceId": null,
    "workflowRunId": null,
    "postId": null,
    "error": null,
    "source": "api",
    "createdAt": "2026-09-02T10:00:00.000Z",
    "updatedAt": "2026-09-02T10:00:00.000Z",
    "completedAt": null
  }
}
```

### Poll the job

```typescript theme={"system"}
type GenerationJob = {
  id: string;
  status: "queued" | "running" | "completed" | "failed" | "skipped";
  postId: string | null;
  error: string | null;
};

type GenerationStatusResponse = {
  job: GenerationJob;
  events: Array<{ type: string; message: string; createdAt: string }>;
};

async function waitForPost(jobId: string): Promise<string> {
  while (true) {
    const response = await fetch(
      `https://api.usenotra.com/v1/posts/generate/${jobId}`,
      { headers: { Authorization: `Bearer ${process.env.NOTRA_API_KEY}` } }
    );
    if (!response.ok) {
      throw new Error(
        `Polling failed: ${response.status} ${await response.text()}`
      );
    }
    const data: GenerationStatusResponse = await response.json();

    if (data.job.status === "completed" && data.job.postId) {
      return data.job.postId;
    }
    if (data.job.status === "failed" || data.job.status === "skipped") {
      throw new Error(data.job.error ?? `Generation ${data.job.status}`);
    }

    await new Promise((resolve) => setTimeout(resolve, 5000));
  }
}
```

`skipped` means the job ended without creating a post. Because Notra does not send a webhook when a job finishes, you have to poll. `POST /v1/posts/generate` allows 10 requests per minute per key and needs an active paid plan or AI credits.

## Read GEO visibility for a project

Notra scopes GEO data to a project, so list projects first and then read the mention rate per engine for the last 30 days.

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

```json theme={"system"}
{
  "projects": [
    { "id": "proj_123", "name": "Acme", "brandSettingsId": "brand_123", "createdAt": "2026-08-01T09:00:00.000Z" }
  ],
  "organization": { "id": "org_123", "slug": "acme", "name": "Acme", "logo": null }
}
```

```bash theme={"system"}
curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.usenotra.com/v1/projects/proj_123/geo/visibility/overview?days=30"
```

```json theme={"system"}
{
  "configured": true,
  "engines": [
    {
      "engine": "chatgpt",
      "checks": 240,
      "mentions": 96,
      "mentionRate": 0.4,
      "avgPosition": 2.1,
      "lastCheckedAt": "2026-09-02T06:00:00.000Z"
    }
  ],
  "organization": { "id": "org_123", "slug": "acme", "name": "Acme", "logo": null }
}
```

Visibility and traffic reads accept either `days` (1 to 365, rolling window) or an explicit `from` and `to` (`YYYY-MM-DD`). When you set `from` and `to`, the API ignores `days`. `configured: false` means the project has no GEO settings yet, and you can configure it with `PATCH /v1/projects/{projectId}/geo/settings`.

These endpoints need `projects.read` and `visibility.read` plus a GEO plan, and without the plan the API returns `402`.

## Trigger a GEO scan

A scan checks every tracked prompt against every enabled engine and takes no request body.

```bash theme={"system"}
curl -X POST -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.usenotra.com/v1/projects/proj_123/geo/scans"
```

```json theme={"system"}
{
  "scanId": "scan_123",
  "statusUrl": "https://api.usenotra.com/v1/projects/proj_123/geo/scans/scan_123",
  "organization": { "id": "org_123", "slug": "acme", "name": "Acme", "logo": null }
}
```

Poll `statusUrl` until `scan.status` is `completed` or `failed`. Each organization can run 4 scans per hour, so poll instead of re-triggering. See [Rate Limits](https://www.usenotra.com/docs/api/rate-limits.md#geo).

## Submit feedback from an integration

Agents post to your public feedback URL without a key, while server-side code that already holds a key with `feedback.write` can use `POST /v1/feedback` instead:

```bash theme={"system"}
curl -X POST "https://api.usenotra.com/v1/feedback" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "message": "Export to CSV fails for reports over 10k rows.",
    "kind": "bug",
    "source": "api",
    "idempotencyKey": "ticket-4821"
  }'
```

See [Agent Feedback](https://www.usenotra.com/docs/feedback/send-feedback.md) for the full field list and the MCP tool.


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