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

# Regenerate a catalog from knowledge

> Re-draft one catalog `kind` (service, voice, fit_criterion) from the organization's knowledge, forced past the no-nag gate that normally skips an already-configured catalog. Additive: it proposes only the genuinely missing items (deduped against what already exists) and never writes to the live catalog. Asynchronous — 202 with a `catalog_generation` in `running`; poll it, then accept the proposals via `/resource_drafts/{id}/accept`.




## OpenAPI

````yaml https://app.pepline.ai/api/v1/openapi.yaml post /catalogs/{kind}/regenerate
openapi: 3.1.0
info:
  title: pepline API
  version: '1'
  description: |
    The pepline knowledge ingestion API: push knowledge into your
    organization's library from your own systems — CMS hooks, sync scripts,
    Zapier/Make/n8n scenarios — and keep whole websites fresh. One inbound
    API instead of N connectors; you own the trigger, we own idempotency.
servers:
  - url: https://app.pepline.ai/api/v1
security:
  - bearerAuth: []
tags:
  - name: Organization
    description: The identity behind your key — confirm it works and read your agent slugs.
  - name: Knowledge sources
    description: >-
      Push and sync the knowledge your agents stand on — text, files, pages,
      whole websites.
  - name: Agents
    description: List and provision agents, and tune each agent's widget settings.
  - name: Services
    description: The offerings your agents present and reason about.
  - name: Fit criteria
    description: What makes a good or poor lead — the signals your agents qualify against.
  - name: Voice profiles
    description: How your agents sound — tone, formality, phrasing.
  - name: Flow
    description: >-
      Author an agent's conversation — its phases and the answers each one
      captures.
  - name: Catalog
    description: >-
      Draft services, voice, and fit criteria from your knowledge, then accept
      or dismiss the proposals.
paths:
  /catalogs/{kind}/regenerate:
    post:
      tags:
        - Catalog
      summary: Regenerate a catalog from knowledge
      description: >
        Re-draft one catalog `kind` (service, voice, fit_criterion) from the
        organization's knowledge, forced past the no-nag gate that normally
        skips an already-configured catalog. Additive: it proposes only the
        genuinely missing items (deduped against what already exists) and never
        writes to the live catalog. Asynchronous — 202 with a
        `catalog_generation` in `running`; poll it, then accept the proposals
        via `/resource_drafts/{id}/accept`.
      operationId: regenerateCatalog
      parameters:
        - name: kind
          in: path
          required: true
          schema:
            type: string
            enum:
              - service
              - voice
              - fit_criterion
              - flow
        - name: agent
          in: query
          required: false
          schema:
            type: string
          description: Agent slug — required when kind=flow (the flow is agent-scoped).
      responses:
        '202':
          description: Accepted; the regeneration runs in the background.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CatalogGeneration'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '422':
          $ref: '#/components/responses/Invalid'
components:
  schemas:
    CatalogGeneration:
      type: object
      required:
        - object
        - id
        - kinds
        - trigger
        - status
        - result
        - created_at
      properties:
        object:
          type: string
          const: catalog_generation
        id:
          type: integer
        kinds:
          type: array
          items:
            type: string
            enum:
              - service
              - voice
              - fit_criterion
              - flow
        agent:
          type:
            - string
            - 'null'
          description: Set for flow regenerations (agent-scoped).
        trigger:
          type: string
          enum:
            - onboarding
            - manual
            - api
        status:
          type: string
          enum:
            - running
            - completed
            - attention
            - failed
        result:
          type: object
          description: >-
            Per-kind debrief, e.g. {"service": {"proposed": 3, "expected": 4,
            "covered": 4, "note": "…"}}.
        started_at:
          type:
            - string
            - 'null'
          format: date-time
        finished_at:
          type:
            - string
            - 'null'
          format: date-time
        created_at:
          type: string
          format: date-time
    Error:
      type: object
      required:
        - error
      properties:
        error:
          type: object
          required:
            - type
            - code
            - message
          properties:
            type:
              type: string
              enum:
                - authentication_error
                - invalid_request_error
                - rate_limit_error
                - api_error
            code:
              type: string
              enum:
                - missing_api_key
                - invalid_api_key
                - resource_missing
                - method_not_allowed
                - resource_archived
                - idempotency_conflict
                - parameter_invalid
                - parameter_missing
                - parameter_unknown
                - organization_required
                - rate_limited
                - flow_invalid
                - internal
            message:
              type: string
            param:
              type: string
  responses:
    Unauthorized:
      description: Missing, malformed, or revoked API key.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    Invalid:
      description: Validation failed — `error.param` names the field.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: >-
        Your secret key (pep_sk_…) from Settings → API. Keys are org-scoped;
        treat them like passwords.

````