### Quick Start Source: https://docs.usenotra.com/api/rust-sdk A basic example demonstrating how to initialize the SDK and list posts. ```APIDOC ## Quick Start This example shows how to set up the Notra client and fetch a list of posts. ```rust use notra::Notra; #[tokio::main] async fn main() -> Result<(), notra::NotraError> { let notra = Notra::builder() .bearer_auth(std::env::var("NOTRA_API_KEY").unwrap()) .build()?; let result = notra.content() .list_posts() .send() .await?; for post in &result.posts { println!("{} ({})", post.title, post.id); } Ok(()) } ``` ``` -------------------------------- ### Notra CLI Quickstart Commands Source: https://docs.usenotra.com/devtools/cli A sequence of commands to get started with the Notra CLI, including authentication, integration setup, and content generation. ```bash notra auth login notra integrations github --owner usenotra --repo notra notra brands generate --website-url https://usenotra.com --wait notra posts generate --content-type changelog --lookback last_7_days --wait notra posts list --status draft --limit 10 ``` -------------------------------- ### TypeScript SDK Example Source: https://docs.usenotra.com/api/getting-started Example of how to initialize the Notra SDK and list posts. ```APIDOC ## Quick Start Base URL: ```bash https://api.usenotra.com/v1/:resource ``` `:resource` is the endpoint path (e.g., `posts`, `posts/{postId}`). The organization is inferred from your API key, so there is no need to pass it in the URL. ```typescript SDK import { Notra } from "@usenotra/sdk"; const notra = new Notra({ bearerAuth: process.env.NOTRA_API_KEY ?? "", }); const result = await notra.content.listPosts(); console.log(result.posts); ``` Replace `YOUR_API_KEY` with your API key. Keys are scoped to an organization (set via `externalId` when created). ``` -------------------------------- ### Install Notra SDK with bun Source: https://docs.usenotra.com/api/getting-started Install the Notra SDK package using bun. ```bash bun add @usenotra/sdk ``` -------------------------------- ### Install MCP Server (Recommended) Source: https://docs.usenotra.com/devtools/mcp If your client supports `add-mcp`, you can install the server by providing the MCP server URL and your API key as a header. ```APIDOC ### `add-mcp` (Recommended) If your client supports [`add-mcp`](https://www.npmjs.com/package/add-mcp), you can install the server with a header override: ```bash npx add-mcp https://mcp.usenotra.com/mcp --header "Authorization: Bearer $TOKEN" ``` Set `TOKEN` to a Notra API key before running the command. ``` -------------------------------- ### cURL Example Source: https://docs.usenotra.com/api/getting-started Example of how to fetch posts using cURL with your API key. ```APIDOC ## Quick Start Base URL: ```bash https://api.usenotra.com/v1/:resource ``` `:resource` is the endpoint path (e.g., `posts`, `posts/{postId}`). The organization is inferred from your API key, so there is no need to pass it in the URL. ```bash cURL curl -H "Authorization: Bearer YOUR_API_KEY" \ "https://api.usenotra.com/v1/posts" ``` Replace `YOUR_API_KEY` with your API key. Keys are scoped to an organization (set via `externalId` when created). ``` -------------------------------- ### SDK Installation Source: https://docs.usenotra.com/api/getting-started Instructions for installing the Notra SDK using npm, yarn, pnpm, or bun. ```APIDOC ## SDK Installation Install the Notra SDK: ```bash npm npm install @usenotra/sdk ``` ```bash yarn yarn add @usenotra/sdk ``` ```bash pnpm pnpm add @usenotra/sdk ``` ```bash bun bun add @usenotra/sdk ``` Initialize the client with your API key: ```typescript import { Notra } from "@usenotra/sdk"; const notra = new Notra({ bearerAuth: process.env.NOTRA_API_KEY ?? "", }); ``` Store your API key in an environment variable. Create and manage keys in your [dashboard](https://app.usenotra.com) under **Developer → API Keys**. ``` -------------------------------- ### Install Notra SDK with pnpm Source: https://docs.usenotra.com/api/getting-started Install the Notra SDK package using pnpm. ```bash pnpm add @usenotra/sdk ``` -------------------------------- ### Install Notra SDK with npm Source: https://docs.usenotra.com/api/getting-started Install the Notra SDK package using npm. ```bash npm install @usenotra/sdk ``` -------------------------------- ### Install Notra CLI Source: https://docs.usenotra.com/devtools/cli Install the Notra CLI globally using your preferred package manager. You can also run commands without installation using `bunx` or `npx`. ```bash bun add -g notra ``` ```bash npm install -g notra ``` ```bash pnpm add -g notra ``` ```bash yarn global add notra ``` -------------------------------- ### Install Notra SDK with yarn Source: https://docs.usenotra.com/api/getting-started Install the Notra SDK package using yarn. ```bash yarn add @usenotra/sdk ``` -------------------------------- ### Install MCP Server with `add-mcp` Source: https://docs.usenotra.com/devtools/mcp Install the MCP server using the `add-mcp` command, overriding the default header with your Authorization token. Set the TOKEN environment variable to your Notra API key before running. ```bash npx add-mcp https://mcp.usenotra.com/mcp --header "Authorization: Bearer $TOKEN" ``` -------------------------------- ### Weekly Schedule Configuration Example Source: https://docs.usenotra.com/automation/scheduled Configure a weekly content generation schedule. Specify the day of the week, hour, and minute for the trigger. This example sets the schedule for Monday at 9:00 AM UTC. ```json { "frequency": "weekly", "dayOfWeek": 1, // Monday "hour": 9, "minute": 0 } ``` -------------------------------- ### Verify Notra CLI Installation Source: https://docs.usenotra.com/devtools/cli Check if the Notra CLI is installed correctly by verifying its version. ```bash notra --version ``` -------------------------------- ### Example LinkedIn Post Content Source: https://docs.usenotra.com/content/social-media This is an example of a generated LinkedIn post, showcasing the Hook → Story → Lesson → Takeaway structure and content guidelines. ```text Shipped something I've been thinking about for months. We just released cache component support with actionable error guidance for our developer tools. The problem we kept hearing: developers were hitting cryptic errors when using auth calls in cached contexts, with no clear path forward. Now the runtime catches these issues early and provides: • Clear migration guidance • The exact usage pattern needed • Zero guesswork Small change. Big impact on developer experience. What's the most frustrating error message you've encountered recently? ``` -------------------------------- ### Rust SDK Quick Start Source: https://docs.usenotra.com/api/rust-sdk Initialize the Notra client with your API key and perform a basic operation like listing posts. Requires `tokio` for async execution. ```rust use notra::Notra; #[tokio::main] async fn main() -> Result<(), notra::NotraError> { let notra = Notra::builder() .bearer_auth(std::env::var("NOTRA_API_KEY").unwrap()) .build()?; let result = notra.content() .list_posts() .send() .await?; for post in &result.posts { println!("{} ({})", post.title, post.id); } Ok(()) } ``` -------------------------------- ### Authentication Source: https://docs.usenotra.com/api/rust-sdk Examples of how to authenticate the SDK client using a bearer token and configure custom server URLs and timeouts. ```APIDOC ## Authentication Authenticate your requests by providing your API key during client initialization. ### Using Bearer Token ```rust use notra::Notra; let notra = Notra::builder() .bearer_auth(std::env::var("NOTRA_API_KEY").unwrap()) .build()?; ``` ### Custom Server URL and Timeout You can also specify a custom base URL for the API and set a request timeout. ```rust use std::time::Duration; use notra::Notra; let notra = Notra::builder() .bearer_auth("your-api-key") .server_url("https://api.usenotra.com") // default .timeout(Duration::from_secs(60)) // default: 30s .build()?; ``` ``` -------------------------------- ### Success Log Example Source: https://docs.usenotra.com/api/webhooks/events Represents a successfully processed incoming webhook event, such as a GitHub push. ```json { "id": "log_a1b2c3d4", "referenceId": "12345678-1234-1234-1234-123456789abc", "title": "Processed push event", "integrationType": "github", "direction": "incoming", "status": "success", "statusCode": 200, "errorMessage": null, "payload": { "event": "push", "action": "pushed", "data": { ... } }, "createdAt": "2024-03-02T10:30:00.000Z" } ``` -------------------------------- ### Manual MCP Server Installation Source: https://docs.usenotra.com/devtools/mcp Alternatively, you can manually configure the MCP server in your client's configuration file by specifying the URL and authorization headers. ```APIDOC ### Manual installation Add something like this to your MCP client config: ```json opencode.json "notra": { "type": "remote", "url": "https://mcp.usenotra.com/mcp", "enabled": true, "headers": { "Authorization": "Bearer YOUR_API_KEY" } } ``` ```json mcp.json (Cursor) "notra": { "url": "https://mcp.usenotra.com/mcp", "headers": { "Authorization": "Bearer YOUR_API_KEY" } } ``` ```json claude.json "notra": { "type": "http", "url": "https://mcp.usenotra.com/mcp", "headers": { "Authorization": "Bearer YOUR_API_KEY" } } ``` ``` -------------------------------- ### Conversational Tone Example Source: https://docs.usenotra.com/concepts/brand-voice Example of content written in a conversational tone, suitable for developer tools, startups, and open-source projects. Characterized by warmth, direct address, and clarity. ```text We've shipped some meaningful improvements this week. The new cache component support catches unsupported auth calls early and provides clear migration guidance. Email verification flows now support secure link completion with proper error handling for expired links. ``` -------------------------------- ### Casual Tone Example Source: https://docs.usenotra.com/concepts/brand-voice Example of content written in a casual tone, suitable for consumer apps, community-driven products, and creative tools. Uses friendly, approachable language and visible enthusiasm. ```text Hey folks! We've been busy this week. The cache system is now way smarter about catching auth issues before they become problems. Plus, email verification links actually work the way you'd expect, nice and reliable. ``` -------------------------------- ### Success Response Example Source: https://docs.usenotra.com/api/pagination A typical successful response when fetching paginated posts, including the list of posts and pagination metadata. ```json { "posts": [ { "id": "YOUR_POST_ID", "title": "February 12-19, 2026 Release", "content": "

This week brought meaningful improvements to organization management, scheduling, and mobile responsiveness.

Highlights

Organization membership unification with server validation

Leave and delete operations now use consistent, validated server logic with atomic operations to prevent race conditions on concurrent requests.

", "markdown": "This week brought meaningful improvements to organization management, scheduling, and mobile responsiveness.\n\n## Highlights\n\n### Organization membership unification with server validation\nLeave and delete operations now use consistent, validated server logic with atomic operations to prevent race conditions on concurrent requests.", "contentType": "changelog", "sourceMetadata": null, "status": "published", "createdAt": "2026-02-19T11:32:54.082Z", "updatedAt": "2026-02-19T11:32:54.082Z" } ], "pagination": { "limit": 10, "currentPage": 1, "nextPage": null, "previousPage": null, "totalPages": 1, "totalItems": 1 } } ``` -------------------------------- ### Start a new chat and stream the reply Source: https://docs.usenotra.com/api-reference/chats/start-a-new-chat-and-stream-the-reply Initiates a chat session and streams the response in real-time. The chat ID can be retrieved from the `X-Chat-Id` header or the `start` chunk of the stream. ```APIDOC ## POST /v1/chats ### Description Starts a new chat session and streams the reply. The `X-Chat-Id` response header contains the chat ID, or it can be found in the `start` chunk's `messageMetadata.chatId`. ### Method POST ### Endpoint /v1/chats ### Request Body - **message** (string) - Required - The user's message to the chat model. - **model** (string) - Optional - The model to use for the chat. Defaults to 'auto'. Available options: `auto`, `anthropic/claude-opus-4.7`, `anthropic/claude-sonnet-4.6`, `anthropic/claude-haiku-4.5`, `openai/gpt-5.4`, `openai/gpt-5.5`, `moonshotai/kimi-k2.6`. - **enableThinking** (boolean) - Optional - Whether to enable thinking steps. - **thinkingLevel** (string) - Optional - The level of thinking to enable. Available options: `off`, `low`, `medium`, `high`. - **timezone** (string) - Optional - The user's timezone. - **context** (array) - Optional - Context to include in the chat. Can be `github-repo` or `linear-team` objects. - **type** (string) - Required - Type of context (`github-repo` or `linear-team`). - **integrationId** (string) - Required - The ID of the integration. - **owner** (string) - Required if type is `github-repo` - The owner of the GitHub repository. - **repo** (string) - Required if type is `github-repo` - The name of the GitHub repository. - **teamName** (string) - Required if type is `linear-team` - The name of the Linear team. - **externalChannelId** (object) - Optional - Identifier for the external channel. - **source** (string) - Required - The source of the channel (e.g., `discord`, `slack`, `dashboard`). - **id** (string) - Required - The ID of the channel within the source. ### Response #### Success Response (200) - **text/event-stream** - Streaming UI message stream (newline-delimited JSON chunks). #### Error Responses - **400**: Invalid request body. - **401**: Missing or invalid API key. - **403**: Forbidden, or usage limit reached. - **404**: Chat not found. - **500**: Failed to process chat request. - **503**: Authentication service unavailable. ``` -------------------------------- ### Fetch Posts using Notra TypeScript SDK Source: https://docs.usenotra.com/api/getting-started Example of fetching a list of posts using the Notra TypeScript SDK. Ensure your API key is set as an environment variable. ```typescript import { Notra } from "@usenotra/sdk"; const notra = new Notra({ bearerAuth: process.env.NOTRA_API_KEY ?? "", }); const result = await notra.content.listPosts(); console.log(result.posts); ``` -------------------------------- ### Empty Result Set Example Source: https://docs.usenotra.com/api/pagination Response when no items are found for the given query. Note that `posts` is an empty array and pagination totals are zero. ```json { "posts": [], "pagination": { "limit": 10, "currentPage": 1, "nextPage": null, "previousPage": null, "totalPages": 1, "totalItems": 0 } } ``` -------------------------------- ### Configure GitHub Integration Outputs Source: https://docs.usenotra.com/quickstart Configure which content types Notra should generate from your GitHub repository. This example enables changelog, blog posts, and Twitter posts. ```json { "outputs": { "changelog": { "enabled": true }, "blog_post": { "enabled": true }, "twitter_post": { "enabled": true }, "linkedin_post": { "enabled": false } } } ``` -------------------------------- ### Failed Log Example Source: https://docs.usenotra.com/api/webhooks/events Indicates a failed incoming webhook event, often due to authentication issues like an invalid signature. ```json { "id": "log_x9y8z7w6", "referenceId": "87654321-4321-4321-4321-cba987654321", "title": "Invalid webhook signature", "integrationType": "github", "direction": "incoming", "status": "failed", "statusCode": 401, "errorMessage": "Invalid webhook signature", "payload": null, "createdAt": "2024-03-02T10:35:00.000Z" } ``` -------------------------------- ### Release Event Data Example Source: https://docs.usenotra.com/automation/event-based This JSON represents the data structure received when a GitHub release event triggers automation. It includes details about the event type, action, and specific release information. ```json { "eventType": "release", "eventAction": "published", "data": { "tagName": "v2.1.0", "name": "Version 2.1.0", "prerelease": false, "publishedAt": "2026-03-02T14:30:00Z" } } ``` -------------------------------- ### Push Event Data Example Source: https://docs.usenotra.com/automation/event-based This JSON illustrates the data structure for a push event trigger. It contains information about the event type, action, and details specific to code pushes, such as the branch and commit information. ```json { "eventType": "push", "eventAction": "pushed", "data": { "branch": "main", "commitCount": 3, "commitIds": ["abc123", "def456", "ghi789"], "firstCommitTimestamp": "2026-03-02T10:00:00Z", "lastCommitTimestamp": "2026-03-02T14:00:00Z" } } ``` -------------------------------- ### Example Changelog Markdown Source: https://docs.usenotra.com/content/changelogs This markdown demonstrates the structure and content of a changelog generated by Notra, including sections for highlights, security, bug fixes, and features. It shows how PR information is integrated into the changelog. ```markdown # Product Updates - Week of March 2, 2026 This week brought significant improvements to developer experience and reliability. We shipped enhanced error handling for cached components, improved email verification flows, and optimized authentication state management. The team also focused on security hardening with rotated webhook secret handling and cross-browser UI consistency improvements. ## Highlights ### Cache component support with actionable error guidance Runtime guardrails now catch unsupported auth calls in cached contexts and provide clear migration guidance with the correct usage pattern. ### Email link verification for signup flows Signup verification now supports secure email-link completion flows with clear status handling for expiration and mismatch cases. ### Async initial state support for modern React apps Initial auth state can resolve asynchronously at hook usage points, reducing root layout complexity and keeping top-level rendering predictable. ## More Updates ### Security - **Rotated webhook signing secret handling** [#131](https://github.com/org/repo/pull/131) - Improves secret lifecycle controls. (Author: [@lee](https://github.com/lee/)) ### Bug Fixes - **Fixed null-state crash in trigger editor** [#140](https://github.com/org/repo/pull/140) - Prevents editor crashes for partially configured triggers. (Author: [@sam](https://github.com/sam/)) ### Features & Enhancements - **Added repository filter presets** [#142](https://github.com/org/repo/pull/142) - Speeds up common workflow setup. (Author: [@alex](https://github.com/alex/)) ``` -------------------------------- ### Get Single Post by ID using SDK Source: https://docs.usenotra.com/api/getting-started Example of fetching a single post by its ID using the Notra SDK. ```typescript const post = await notra.content.getPost({ postId: "post_abc", }); ``` -------------------------------- ### Initialize CLI with Existing Key Source: https://docs.usenotra.com/devtools/cli Initialize the CLI by pasting an existing API key. This command prompts for the key interactively or accepts it as a flag. ```bash notra init ``` ```bash notra init --api-key ntra_xxxxxxxxxxxxxxxxxxxxxx ``` -------------------------------- ### Create a schedule from a JSON file Source: https://docs.usenotra.com/devtools/cli Create a new content generation schedule using a configuration file. The configuration can be provided via a file path or piped from stdin. ```bash notra schedules create --config-file ./schedule.json ``` ```bash cat schedule.json | notra schedules create --config-file - ``` -------------------------------- ### Professional Tone Example Source: https://docs.usenotra.com/concepts/brand-voice Example of content written in a professional tone, ideal for enterprise products, B2B SaaS, and corporate communications. Focuses on clarity, confidence, and business value. ```text This release delivers significant enhancements to the platform. New cache component validation ensures proper auth implementation with actionable error guidance. Email verification workflows now include comprehensive link-based completion flows. ``` -------------------------------- ### List Integrations Source: https://docs.usenotra.com/api/rust-sdk Retrieves a list of all configured integrations, including GitHub repositories. ```rust let integrations = notra.content() .list_integrations() .send() .await?; for gh in &integrations.github { println!("{}/{} ({})", gh.owner, gh.repo, gh.default_branch); } ``` -------------------------------- ### Example Blog Post Markdown Structure Source: https://docs.usenotra.com/content/blog-posts This Markdown structure provides a template for a blog post, including sections for title, challenge, solution, implementation details, impact, and future plans. It also includes placeholders for context and technical details. ```markdown # Introducing Email Link Verification: Secure, Seamless User Onboarding ## The Challenge User registration flows have always presented a tension between security and user experience. Traditional password-based flows require users to... [Context about the problem and user pain points] ## Our Solution We built a passwordless email verification system that balances security with convenience... [Technical overview of the approach] ### How It Works 1. User enters their email address 2. System generates a secure, time-limited verification token 3. Email is sent with a magic link 4. User clicks link and is authenticated [Detailed technical implementation] ### Security Considerations We implemented several safeguards: - **Time-limited tokens**: Links expire after 15 minutes - **Single-use tokens**: Each link can only be used once - **Rate limiting**: Prevents enumeration attacks - **Secure token generation**: Cryptographically random tokens [Deep dive into security measures] ## Implementation Details ```typescript // Example code showing key implementation ```` \[Technical details developers care about] ## Impact Since launching email verification: * 40% increase in registration completion * 60% reduction in password reset requests * 95% user satisfaction score \[Metrics and user feedback] ## What's Next We're already working on social authentication and passkey support... \[Future roadmap and next steps] ``` ``` -------------------------------- ### OpenAPI Specification for Get Chat Source: https://docs.usenotra.com/api-reference/chats/get-a-single-chat-with-messages This OpenAPI specification defines the GET /v1/chats/{chatId} endpoint for retrieving a chat session and its messages. It includes request parameters, response schemas, and error handling. ```yaml openapi: 3.1.1 info: title: Notra API version: 1.0.0 description: OpenAPI schema for authenticated content endpoints. servers: - url: https://api.usenotra.com description: Production security: - BearerAuth: [] tags: - name: Content description: >- Read content. Organization is inferred from the API key (identity.externalId). - name: Schedules description: >- Manage scheduled content generation. Organization is inferred from the API key (identity.externalId). - name: Chats description: >- Manage chat sessions. Organization is inferred from the API key (identity.externalId). paths: /v1/chats/{chatId}: get: tags: - Chats summary: Get a single chat with messages operationId: getChat parameters: - schema: type: string minLength: 1 example: chat_abc123 required: true name: chatId in: path responses: '200': description: Chat fetched successfully content: application/json: schema: $ref: '#/components/schemas/GetChatResponse' '400': description: Invalid path params content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '401': description: Missing or invalid API key content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '403': description: Forbidden content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '404': description: Chat not found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' '503': description: Authentication service unavailable content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' components: schemas: GetChatResponse: type: object properties: chat: $ref: '#/components/schemas/ChatSessionSummary' messages: type: array items: $ref: '#/components/schemas/ChatMessage' required: - chat - messages ErrorResponse: type: object properties: error: type: string required: - error ChatSessionSummary: type: object properties: chatId: type: string title: type: string createdAt: type: string updatedAt: type: string pinnedAt: type: - string - 'null' externalChannelId: $ref: '#/components/schemas/ExternalChannelId' required: - chatId - title - createdAt - updatedAt - pinnedAt ChatMessage: {} ExternalChannelId: type: - object - 'null' properties: source: type: string enum: - discord - slack - dashboard id: type: string maxLength: 200 required: - source securitySchemes: BearerAuth: type: http scheme: bearer bearerFormat: API Key description: Send your API key in the Authorization header as Bearer API_KEY. ``` -------------------------------- ### Using the SDK for Paginated Content Source: https://docs.usenotra.com/api/pagination Demonstrates how to fetch paginated posts and extract pagination information using the Notra SDK. ```APIDOC ## SDK Method: `listPosts` ### Description Retrieves a list of posts using the SDK, with support for pagination parameters. ### Method Signature `notra.content.listPosts({ page?: number, limit?: number })` ### Parameters - **page** (number) - Optional - The page number to retrieve. - **limit** (number) - Optional - The number of items per page. Defaults to 10. Values below 1 default to 1, values above 100 are capped at 100. Non-numeric values default to 10. ### Response - **posts** (array) - An array of post objects. - **pagination** (object) - An object containing pagination details: - **limit** (number) - The number of items per page. - **currentPage** (number) - The current page number. - **nextPage** (number | null) - The next page number, or null if there is no next page. - **previousPage** (number | null) - The previous page number, or null if there is no previous page. - **totalPages** (number) - The total number of pages. - **totalItems** (number) - The total number of items across all pages. ### Request Example ```typescript import type { Pagination } from "@usenotra/sdk/models/operations"; const result = await notra.content.listPosts({ page: 1, limit: 10, }); const { pagination } = result; const canGoBack = pagination.previousPage !== null; const canGoForward = pagination.nextPage !== null; const pageInfo = `Page ${pagination.currentPage} of ${pagination.totalPages}`; const itemCount = `${pagination.totalItems} total items`; ``` ``` -------------------------------- ### List available integrations Source: https://docs.usenotra.com/llms.txt Retrieves a list of all configured integrations. ```APIDOC ## List available integrations ### Description Retrieves a list of all available integrations (e.g., GitHub, Linear). ### Method GET ### Endpoint `/content/integrations` ``` -------------------------------- ### Get a single post Source: https://docs.usenotra.com/api/rust-sdk Retrieves a specific post by its ID. ```APIDOC ## Get a single post Fetch details for a specific post using its unique identifier. ```rust let result = notra.content() .get_post("post_abc") .send() .await?; if let Some(post) = result.post { println!("{}: {}", post.title, post.status); } ``` ``` -------------------------------- ### Get a single brand identity Source: https://docs.usenotra.com/llms.txt Retrieves details for a specific brand identity. ```APIDOC ## Get a single brand identity ### Description Retrieves the details of a specific brand identity. ### Method GET ### Endpoint `/content/brands/{brand_id}` ### Parameters #### Path Parameters - **brand_id** (string) - Required - The unique identifier of the brand identity to retrieve. ``` -------------------------------- ### List Available Integrations Source: https://docs.usenotra.com/api-reference/content/list-available-integrations Fetches a list of all available integrations, including details for GitHub, Slack, and Linear. ```APIDOC ## GET /v1/integrations ### Description Retrieves a list of all available integrations that can be connected to your Notra account. This includes details for GitHub repositories, Slack workspaces, and Linear teams. ### Method GET ### Endpoint /v1/integrations ### Parameters None ### Request Example None ### Response #### Success Response (200) - **github** (array) - List of available GitHub integrations. - **id** (string) - Unique identifier for the GitHub integration. - **displayName** (string) - Display name for the GitHub integration. - **owner** (string | null) - The owner of the GitHub repository. - **repo** (string | null) - The name of the GitHub repository. - **defaultBranch** (string | null) - The default branch of the GitHub repository. - **slack** (array) - List of available Slack integrations. - **linear** (array) - List of available Linear integrations. - **id** (string) - Unique identifier for the Linear integration. - **displayName** (string) - Display name for the Linear integration. - **linearOrganizationId** (string) - The ID of the Linear organization. - **linearOrganizationName** (string | null) - The name of the Linear organization. - **linearTeamId** (string | null) - The ID of the Linear team. - **linearTeamName** (string | null) - The name of the Linear team. - **organization** (object) - Information about the organization. - **id** (string) - Unique identifier for the organization. - **slug** (string) - The organization's slug. - **name** (string) - The name of the organization. - **logo** (string | null) - The URL of the organization's logo. #### Response Example ```json { "github": [ { "id": "github_123", "displayName": "My GitHub Repo", "owner": "myorg", "repo": "myrepo", "defaultBranch": "main" } ], "slack": [], "linear": [ { "id": "linear_456", "displayName": "My Linear Project", "linearOrganizationId": "linearorg_abc", "linearOrganizationName": "My Linear Org", "linearTeamId": "linearteam_xyz", "linearTeamName": "My Linear Team" } ], "organization": { "id": "org_789", "slug": "myorg", "name": "My Organization", "logo": "https://example.com/logo.png" } } ``` #### Error Responses - **401** - Missing or invalid API key - **403** - Forbidden - **404** - Organization not found - **503** - Authentication service unavailable ``` -------------------------------- ### Single Post Lookup Source: https://docs.usenotra.com/api/getting-started Example of how to fetch a single post using its ID with the Notra SDK. ```APIDOC For single-post lookups: ```typescript const post = await notra.content.getPost({ postId: "post_abc", }); ``` ``` -------------------------------- ### Get a single chat with messages Source: https://docs.usenotra.com/llms.txt Retrieves a specific chat conversation along with its associated messages. ```APIDOC ## Get a single chat with messages ### Description Retrieves a specific chat conversation, including all its messages. ### Method GET ### Endpoint `/chats/{chat_id}` ### Parameters #### Path Parameters - **chat_id** (string) - Required - The unique identifier of the chat to retrieve. ``` -------------------------------- ### Initialize Notra Client Source: https://docs.usenotra.com/api/getting-started Initialize the Notra client with your API key stored in an environment variable. ```typescript import { Notra } from "@usenotra/sdk"; const notra = new Notra({ bearerAuth: process.env.NOTRA_API_KEY ?? "", }); ``` -------------------------------- ### Get Generation Job Status Source: https://docs.usenotra.com/api-reference/content/get-async-post-generation-status Fetches the status of a specific asynchronous content generation job. ```APIDOC ## GET /generation-jobs/{jobId}/status ### Description Retrieves the status of an asynchronous content generation job. ### Method GET ### Endpoint /generation-jobs/{jobId}/status ### Parameters #### Path Parameters - **jobId** (string) - Required - The unique identifier of the generation job. ### Response #### Success Response (200) - **job** (object) - Information about the generation job. - **id** (string) - The job ID. - **type** (string) - The type of generation job. - **status** (string) - The current status of the job (e.g., PENDING, PROCESSING, COMPLETED, FAILED). - **createdAt** (string) - The timestamp when the job was created. - **updatedAt** (string) - The timestamp when the job was last updated. - **metadata** (object) - Additional metadata related to the job. - **events** (array) - A list of events associated with the job. - **id** (string) - The event ID. - **jobId** (string) - The ID of the job this event belongs to. - **type** (string) - The type of event. - **message** (string) - A message describing the event. - **createdAt** (string) - The timestamp when the event occurred. - **metadata** (object) - Additional metadata for the event. #### Error Response (401) - **error** (string) - Description of the error (e.g., "Missing or invalid API key"). #### Error Response (403) - **error** (string) - Description of the error (e.g., "Forbidden"). #### Error Response (404) - **error** (string) - Description of the error (e.g., "Generation job not found"). #### Error Response (503) - **error** (string) - Description of the error (e.g., "Content generation is unavailable"). ``` -------------------------------- ### Get Brand Identity by ID Source: https://docs.usenotra.com/api-reference/content/get-a-single-brand-identity Fetches a single brand identity by providing its ID in the path. ```APIDOC ## GET /v1/brand-identities/{brandIdentityId} ### Description Retrieves a single brand identity based on the provided `brandIdentityId`. ### Method GET ### Endpoint /v1/brand-identities/{brandIdentityId} ### Parameters #### Path Parameters - **brandIdentityId** (string) - Required - The unique identifier for the brand identity. ### Response #### Success Response (200) - **brandIdentity** (object) - Details of the brand identity. - **id** (string) - The unique identifier of the brand identity. - **name** (string) - The name of the brand identity. - **isDefault** (boolean) - Indicates if this is the default brand identity. - **websiteUrl** (string) - The website URL associated with the brand identity. - **companyName** (string | null) - The name of the company. - **companyDescription** (string | null) - A description of the company. - **toneProfile** (string | null) - The tone profile for content generation. - **customTone** (string | null) - Custom tone settings. - **customInstructions** (string | null) - Custom instructions for content generation. - **audience** (string | null) - The target audience for the brand. - **language** (string | null) - The primary language for the brand. - **createdAt** (string) - Timestamp when the brand identity was created. - **updatedAt** (string) - Timestamp when the brand identity was last updated. - **organization** (object) - Details of the organization. - **id** (string) - The unique identifier of the organization. - **slug** (string) - The organization's slug. - **name** (string) - The name of the organization. - **logo** (string | null) - The URL of the organization's logo. #### Response Example ```json { "brandIdentity": { "id": "51c2f3aa-efdd-4e28-8e69-23fa2dfd3561", "name": "Example Brand", "isDefault": true, "websiteUrl": "https://example.com", "companyName": "Example Corp", "companyDescription": "A leading company in its field.", "toneProfile": "professional", "customTone": "friendly and approachable", "customInstructions": "Always use positive language.", "audience": "Tech enthusiasts", "language": "en", "createdAt": "2023-01-01T10:00:00Z", "updatedAt": "2023-01-01T10:00:00Z" }, "organization": { "id": "org-123", "slug": "example-corp", "name": "Example Corporation", "logo": "https://example.com/logo.png" } } ``` ### Error Handling - **400**: Invalid path parameters. - **401**: Missing or invalid API key. - **403**: Forbidden. - **404**: Organization not found. - **503**: Authentication service unavailable. ``` -------------------------------- ### Generate Content with Options Source: https://docs.usenotra.com/devtools/cli Queue an asynchronous post-generation job with specified content type, brand, integration, and lookback period. Use `--wait` to poll for job completion. ```bash notra posts generate \ --content-type changelog \ --brand brand_abc \ --github-integration integration_xyz \ --lookback last_7_days \ --wait ``` -------------------------------- ### Get Async Post Generation Status Source: https://docs.usenotra.com/api-reference/content/get-async-post-generation-status Fetches the status of a post generation job using its unique ID. ```APIDOC ## GET /v1/posts/generate/{jobId} ### Description Retrieves the status of an asynchronous post generation job. ### Method GET ### Endpoint /v1/posts/generate/{jobId} ### Parameters #### Path Parameters - **jobId** (string) - Required - The unique identifier of the post generation job. ### Response #### Success Response (200) - **job** (object) - Contains details about the post generation job. - **id** (string) - The job ID. - **organizationId** (string) - The ID of the organization. - **status** (string) - The current status of the job (queued, running, completed, failed). - **contentType** (string) - The type of content being generated (changelog, blog_post, linkedin_post, twitter_post). - **lookbackWindow** (string) - The lookback window for content generation (current_day, yesterday, last_7_days, last_14_days, last_30_days). - **repositoryIds** (array) - A list of repository IDs used for generation. - **brandVoiceId** (string | null) - The ID of the brand voice used. - **workflowRunId** (string | null) - The ID of the workflow run. - **postId** (string | null) - The ID of the generated post, if available. - **error** (string | null) - Any error message if the job failed. - **source** (string) - The source of the job (api, dashboard). - **createdAt** (string) - The timestamp when the job was created. - **updatedAt** (string) - The timestamp when the job was last updated. - **completedAt** (string | null) - The timestamp when the job was completed. - **events** (array) - A list of events associated with the job. - **id** (string) - The event ID. - **jobId** (string) - The ID of the job this event belongs to. - **type** (string) - The type of event (queued, workflow_triggered, running, fetching_repositories, generating_content, post_created, completed, failed). - **message** (string) - A descriptive message for the event. - **createdAt** (string) - The timestamp when the event occurred. - **metadata** (object | null) - Additional metadata for the event. #### Response Example ```json { "job": { "id": "job_abc123", "organizationId": "org_xyz789", "status": "running", "contentType": "blog_post", "lookbackWindow": "last_7_days", "repositoryIds": ["repo_1", "repo_2"], "brandVoiceId": "bv_456", "workflowRunId": "wr_789", "postId": null, "error": null, "source": "api", "createdAt": "2023-10-27T10:00:00Z", "updatedAt": "2023-10-27T10:05:00Z", "completedAt": null }, "events": [ { "id": "evt_1", "jobId": "job_abc123", "type": "queued", "message": "Job has been queued.", "createdAt": "2023-10-27T10:00:00Z", "metadata": null }, { "id": "evt_2", "jobId": "job_abc123", "type": "running", "message": "Job is now running.", "createdAt": "2023-10-27T10:01:00Z", "metadata": null } ] } ``` ``` -------------------------------- ### Fetch Multiple Posts with Types Source: https://docs.usenotra.com/api/types Fetch a list of posts using `fetch` and type the response. Ensure your API key is set in the environment variables. ```typescript // Multiple posts const listResponse = await fetch("https://api.usenotra.com/v1/posts", { headers: { Authorization: `Bearer ${process.env.NOTRA_API_KEY}` }, }); const listData: NotraPostListResponse = await listResponse.json(); ``` -------------------------------- ### Get Async Post Generation Status Source: https://docs.usenotra.com/api-reference/content/get-async-post-generation-status This section details how to check the status of an asynchronous post generation request. ```APIDOC ## GET /posts/generation/status/{generation_id} ### Description Retrieves the status of an asynchronous post generation job. ### Method GET ### Endpoint /posts/generation/status/{generation_id} ### Parameters #### Path Parameters - **generation_id** (string) - Required - The unique identifier for the post generation job. ### Response #### Success Response (200) - **status** (string) - The current status of the generation job (e.g., "pending", "processing", "completed", "failed"). - **progress** (integer) - The completion percentage of the generation job (0-100). - **result_url** (string) - Optional - A URL to the generated content if the job is completed. - **error_message** (string) - Optional - A message describing the error if the job failed. ``` -------------------------------- ### Create a content generation schedule Source: https://docs.usenotra.com/devtools/cli Create a new cron-based content generation schedule. Configure name, frequency, time, output type, repository, lookback period, and enable status. For weekly/monthly schedules, specify --day-of-week or --day-of-month. ```bash notra schedules create \ --name "Daily changelog" \ --frequency daily --hour 9 --minute 0 \ --output-type changelog \ --repository repo_abc \ --lookback yesterday \ --enabled ```