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

# Queue async post generation



## 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.
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: 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).
paths:
  /v1/posts/generate:
    post:
      tags:
        - Content
      summary: Queue async post generation
      operationId: createPostGeneration
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              properties:
                contentType:
                  type: string
                  enum:
                    - changelog
                    - blog_post
                    - linkedin_post
                    - twitter_post
                    - image
                  example: blog_post
                lookbackWindow:
                  type: string
                  enum:
                    - current_day
                    - yesterday
                    - last_7_days
                    - last_14_days
                    - last_30_days
                  default: last_7_days
                  example: last_7_days
                brandVoiceId:
                  type: string
                  minLength: 1
                  example: voice_123
                brandIdentityId:
                  type:
                    - string
                    - 'null'
                  minLength: 1
                  example: voice_123
                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
                      example:
                        - integration_1
                        - integration_2
                    linear:
                      type: array
                      items:
                        type: string
                        minLength: 1
                      minItems: 1
                      example:
                        - linear_integration_1
                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
                  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
                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
              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
                      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'
                      error:
                        type:
                          - string
                          - 'null'
                      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.

````