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

# Queue async post generation

> Queues a generation job for one content type and returns 202 with the job. Select sources with integrations.github, integrations.linear, or github.repositories; when no selector is given at all, every connected GitHub integration is used. Pass pullRequest to write about one pull request, and brief to say what the post should cover. Requests with every dataPoints flag false, or with no usable source, are rejected with 400 and code NO_ACTIVITY_TYPES_SELECTED or NO_AVAILABLE_SOURCES before a job is created. Poll GET /v1/posts/generate/{jobId} until job.status is completed, failed, or skipped. Subscribe to post.generation.completed, post.generation.failed, or post.generation.skipped using /v1/webhooks for completion notifications.



## OpenAPI

````yaml https://api.usenotra.com/openapi.json post /v1/posts/generate
openapi: 3.1.1
info:
  title: Notra API
  version: 1.0.0
  description: >-
    OpenAPI schema for Notra content endpoints. Use GET /v1/status for public
    reachability. Error responses include recovery guidance. Breaking changes
    ship under a new major path; deprecated operations send Deprecation and
    Sunset headers at least 90 days before removal.
servers:
  - url: https://api.usenotra.com
    description: Production
  - url: https://demo-api.usenotra.com
    description: >-
      Sandbox with sample data. Get a free sandbox key at demo.usenotra.com, no
      signup needed
security:
  - BearerAuth: []
tags:
  - name: Webhooks
    description: Manage outbound webhook subscriptions and delivery history.
  - name: Discovery
    description: Public API status and authenticated workspace discovery.
  - name: Content
    description: >-
      Manage posts, brand identities, and GitHub or Linear integrations, and
      queue content generation. 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: Event Triggers
    description: >-
      Manage event-based content generation triggered by GitHub webhooks.
      Organization is inferred from the API key (identity.externalId).
  - name: Chats
    description: >-
      Manage chat sessions. Organization is inferred from the API key
      (identity.externalId).
  - name: Skills
    description: >-
      Manage reusable writing skills. Organization is inferred from the API key
      (identity.externalId).
  - name: Feedback
    description: >-
      Collect and triage feedback submitted by AI agents. Agents post to the
      organization's feedback URL without credentials; reading and triage
      require an API key with feedback.read or feedback.write.
  - name: GEO
    description: >-
      Manage generative engine optimization: projects, tracking settings,
      prompts, prompt sequences, competitors, scans, visibility reads, content
      gaps and briefs, agent readiness and AI traffic. Project-scoped endpoints
      require the GEO plan entitlement in addition to their scope;
      organization-level ingest endpoints require only the traffic scope.
  - name: Sites
    description: >-
      Notra Sites are hosted blogs and changelogs built from a GitHub
      repository. Read Sites and their deployments, start builds, preview posts
      on a Site, open pull requests that publish posts to it, and manage
      blog.json authors and the author page through staged Design changes.
      Domains, settings, rollbacks and deletion stay in the dashboard.
externalDocs:
  description: Notra API versioning and deprecation policy
  url: https://www.usenotra.com/docs/api/versioning
paths:
  /v1/posts/generate:
    post:
      tags:
        - Content
      summary: Queue async post generation
      description: >-
        Queues a generation job for one content type and returns 202 with the
        job. Select sources with integrations.github, integrations.linear, or
        github.repositories; when no selector is given at all, every connected
        GitHub integration is used. Pass pullRequest to write about one pull
        request, and brief to say what the post should cover. Requests with
        every dataPoints flag false, or with no usable source, are rejected with
        400 and code NO_ACTIVITY_TYPES_SELECTED or NO_AVAILABLE_SOURCES before a
        job is created. Poll GET /v1/posts/generate/{jobId} until job.status is
        completed, failed, or skipped. Subscribe to post.generation.completed,
        post.generation.failed, or post.generation.skipped using /v1/webhooks
        for completion notifications.
      operationId: createPostGeneration
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                contentType:
                  type: string
                  enum:
                    - changelog
                    - blog_post
                    - linkedin_post
                    - twitter_post
                    - image
                  description: Type of content to generate.
                  example: blog_post
                lookbackWindow:
                  type: string
                  enum:
                    - current_day
                    - yesterday
                    - last_7_days
                    - last_14_days
                    - last_30_days
                  default: last_7_days
                  description: >-
                    How far back to collect source activity (commits, pull
                    requests, releases, Linear issues).
                  example: last_7_days
                brandVoiceId:
                  type: string
                  minLength: 1
                  description: Deprecated. Use brandIdentityId instead.
                  example: 51c2f3aa-efdd-4e28-8e69-23fa2dfd3561
                brandIdentityId:
                  type:
                    - string
                    - 'null'
                  minLength: 1
                  description: >-
                    Brand identity to write in. Defaults to the organization's
                    default brand identity.
                  example: 51c2f3aa-efdd-4e28-8e69-23fa2dfd3561
                repositoryIds:
                  type: array
                  items:
                    type: string
                    minLength: 1
                  example:
                    - repo_1
                    - repo_2
                  description: >-
                    Deprecated. Use integrations.github with GitHub integration
                    IDs instead.
                linearIntegrationIds:
                  type: array
                  items:
                    type: string
                    minLength: 1
                  example:
                    - linear_integration_1
                  description: >-
                    Deprecated. Use integrations.linear with Linear integration
                    IDs instead.
                integrations:
                  type: object
                  properties:
                    github:
                      type: array
                      items:
                        type: string
                        minLength: 1
                      minItems: 1
                      description: >-
                        GitHub integration IDs to use as sources, as returned by
                        GET /v1/integrations.
                      example:
                        - integration_1
                        - integration_2
                    linear:
                      type: array
                      items:
                        type: string
                        minLength: 1
                      minItems: 1
                      description: >-
                        Linear integration IDs to use as sources, as returned by
                        GET /v1/integrations.
                      example:
                        - linear_integration_1
                  description: >-
                    Source integrations to draw activity from. Omit this and
                    github.repositories to use every connected GitHub
                    integration.
                github:
                  type: object
                  properties:
                    repositories:
                      type: array
                      items:
                        type: object
                        properties:
                          owner:
                            type: string
                            minLength: 1
                          repo:
                            type: string
                            minLength: 1
                        required:
                          - owner
                          - repo
                      minItems: 1
                  required:
                    - repositories
                  description: >-
                    Select connected repositories by owner and name instead of
                    integration ID. Cannot be combined with integrations.github.
                  example:
                    repositories:
                      - owner: usenotra
                        repo: notra
                dataPoints:
                  type: object
                  properties:
                    includePullRequests:
                      type: boolean
                      default: true
                    includeCommits:
                      type: boolean
                      default: true
                    includeReleases:
                      type: boolean
                      default: true
                    includeLinearData:
                      type: boolean
                      default: false
                  default:
                    includePullRequests: true
                    includeCommits: true
                    includeReleases: true
                    includeLinearData: false
                  description: >-
                    Which kinds of activity to collect from the selected
                    sources. At least one must be true, unless pullRequest is
                    set, which ignores them.
                selectedItems:
                  type: object
                  properties:
                    commitShas:
                      type: array
                      items:
                        type: string
                    pullRequestNumbers:
                      type: array
                      items:
                        type: object
                        properties:
                          repositoryId:
                            type: string
                          number:
                            type: number
                        required:
                          - repositoryId
                          - number
                    releaseTagNames:
                      type: array
                      items:
                        anyOf:
                          - type: string
                          - type: object
                            properties:
                              repositoryId:
                                type: string
                              tagName:
                                type: string
                            required:
                              - repositoryId
                              - tagName
                    linearIssueIds:
                      type: array
                      items:
                        type: object
                        properties:
                          integrationId:
                            type: string
                          issueId:
                            type: string
                        required:
                          - integrationId
                          - issueId
                  description: >-
                    Restrict generation to specific commits, pull requests,
                    releases, or Linear issues instead of everything in the
                    lookback window.
                timezone:
                  type: string
                  minLength: 1
                  maxLength: 100
                  description: >-
                    IANA timezone used for relative lookback windows such as
                    current_day and yesterday.
                  example: America/New_York
                pullRequest:
                  type: object
                  properties:
                    owner:
                      type: string
                      minLength: 1
                    repo:
                      type: string
                      minLength: 1
                    number:
                      type: integer
                      exclusiveMinimum: 0
                  required:
                    - owner
                    - repo
                    - number
                  description: >-
                    Write about exactly this pull request in a connected
                    repository, open or merged, whatever its age. Uses only its
                    pull request data, so dataPoints and lookbackWindow do not
                    apply. Cannot be combined with other source selectors or
                    selectedItems.
                  example:
                    owner: usenotra
                    repo: notra
                    number: 2385
                brief:
                  type: string
                  minLength: 1
                  maxLength: 4000
                  description: >-
                    What the post should be about and what it should cover, in
                    your own words. Steers the topic, angle and structure; facts
                    still come from the selected sources.
                  example: >-
                    Announce mention-driven blog posts. Lead with the phone
                    workflow and show the comment that triggers it.
              required:
                - contentType
      responses:
        '202':
          description: Post generation queued successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  organization:
                    type: object
                    properties:
                      id:
                        type: string
                      slug:
                        type: string
                      name:
                        type: string
                      logo:
                        type:
                          - string
                          - 'null'
                    required:
                      - id
                      - slug
                      - name
                      - logo
                  job:
                    type: object
                    properties:
                      id:
                        type: string
                      organizationId:
                        type: string
                      status:
                        type: string
                        enum:
                          - queued
                          - running
                          - completed
                          - failed
                          - skipped
                        description: >-
                          Job state. Terminal states are completed, failed, and
                          skipped.
                      contentType:
                        type: string
                        enum:
                          - changelog
                          - blog_post
                          - linkedin_post
                          - twitter_post
                          - image
                      lookbackWindow:
                        type: string
                        enum:
                          - current_day
                          - yesterday
                          - last_7_days
                          - last_14_days
                          - last_30_days
                      repositoryIds:
                        type: array
                        items:
                          type: string
                      brandVoiceId:
                        type:
                          - string
                          - 'null'
                      workflowRunId:
                        type:
                          - string
                          - 'null'
                      postId:
                        type:
                          - string
                          - 'null'
                        description: >-
                          ID of the generated post. Set once the job reaches
                          completed.
                      error:
                        type:
                          - string
                          - 'null'
                        description: Failure reason when status is failed.
                      errorCode:
                        type:
                          - string
                          - 'null'
                        description: >-
                          Stable machine-readable failure code when status is
                          failed, such as NO_ACTIVITY_TYPES_SELECTED or
                          NO_AVAILABLE_SOURCES. Absent or null for other
                          failures and for older jobs.
                        example: NO_AVAILABLE_SOURCES
                      source:
                        type: string
                        enum:
                          - api
                          - dashboard
                      createdAt:
                        type: string
                      updatedAt:
                        type: string
                      completedAt:
                        type:
                          - string
                          - 'null'
                    required:
                      - id
                      - organizationId
                      - status
                      - contentType
                      - lookbackWindow
                      - repositoryIds
                      - brandVoiceId
                      - workflowRunId
                      - postId
                      - error
                      - source
                      - createdAt
                      - updatedAt
                      - completedAt
                required:
                  - organization
                  - job
        '400':
          description: Invalid request body
          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: Organization not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '429':
          description: >-
            Rate limit exceeded. This endpoint allows 10 requests per 1 minute
            per API key.
          headers:
            RateLimit-Limit:
              description: Maximum requests allowed in the current window.
              schema:
                type: integer
            RateLimit-Remaining:
              description: Requests remaining in the current window.
              schema:
                type: integer
            RateLimit-Reset:
              description: Seconds until the current window resets.
              schema:
                type: integer
            Retry-After:
              description: Seconds the client should wait before retrying.
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RateLimitErrorResponse'
        '503':
          description: Content generation is unavailable
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                  jobId:
                    type: string
                required:
                  - error
components:
  schemas:
    ErrorResponse:
      type: object
      properties:
        error:
          type: string
        code:
          type: string
        recovery:
          type: string
      required:
        - error
    RateLimitErrorResponse:
      type: object
      properties:
        error:
          type: string
        limit:
          type: integer
          minimum: 1
        remaining:
          type: integer
          minimum: 0
        reset:
          type: integer
      required:
        - error
        - limit
        - remaining
        - reset
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: API Key
      description: >-
        Send your API key in the Authorization header as Bearer API_KEY. Account
        API keys work in every workspace you belong to: send
        X-Notra-Organization-Id with the workspace id or slug to choose one.
        Workspace endpoints require it when you belong to more than one
        workspace; GET /v1/me/workspaces works without it. Organization keys
        only accept their own workspace there.

````

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