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

# reprocess knowledge group

> Reprocess every document in a knowledge group with the group's current
chunk settings and the organization's current embedding model, for
example after changing the settings with `PUT /v1/knowledge/groups/{id}`.
Documents stay searchable until their new version is `READY`.

Documents with their own `chunkSize` or `chunkOverlap` keep them by
default. Send `settings: "recommended"`, or a `chunkSize` and
`chunkOverlap`, to use that pair for every document instead. Once a
document is queued, the pair also becomes the group's own chunk
settings (see `folderSettingsUpdated`).

The single-document limits apply to each document: a 24-hour cooldown
(1 hour after a failure), and each queued file's size counts against
the monthly knowledge allowance. One request starts at most 500
documents. When the allowance can't cover them all, documents
processed longest ago go first and `FAILED` documents last. Documents
left out are counted in `skipped`; call again after `nextAvailableAt`
to process them.




## OpenAPI

````yaml https://api.anam.ai/swagger.json post /v1/knowledge/groups/{id}/reprocess
openapi: 3.1.0
info:
  title: Anam AI API
  version: '1.0'
servers:
  - url: https://api.anam.ai
    description: Anam API
security:
  - BearerAuth: []
tags:
  - name: Sessions
  - name: Avatar Videos
  - name: Meetings
  - name: Watermark Checks
  - name: Personas
  - name: Avatars
  - name: Voices
  - name: Pronunciation Dictionaries
  - name: LLMs
  - name: Knowledge
  - name: Tools
  - name: Share Links
  - name: Engine
paths:
  /v1/knowledge/groups/{id}/reprocess:
    post:
      tags:
        - Knowledge
      summary: reprocess knowledge group
      description: >
        Reprocess every document in a knowledge group with the group's current

        chunk settings and the organization's current embedding model, for

        example after changing the settings with `PUT
        /v1/knowledge/groups/{id}`.

        Documents stay searchable until their new version is `READY`.


        Documents with their own `chunkSize` or `chunkOverlap` keep them by

        default. Send `settings: "recommended"`, or a `chunkSize` and

        `chunkOverlap`, to use that pair for every document instead. Once a

        document is queued, the pair also becomes the group's own chunk

        settings (see `folderSettingsUpdated`).


        The single-document limits apply to each document: a 24-hour cooldown

        (1 hour after a failure), and each queued file's size counts against

        the monthly knowledge allowance. One request starts at most 500

        documents. When the allowance can't cover them all, documents

        processed longest ago go first and `FAILED` documents last. Documents

        left out are counted in `skipped`; call again after `nextAvailableAt`

        to process them.
      operationId: reprocessKnowledgeGroup
      parameters:
        - in: path
          name: id
          required: true
          schema:
            type: string
          description: Knowledge group ID, from `GET /v1/knowledge/groups`
      requestBody:
        required: false
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/KnowledgeReprocessRequest'
            examples:
              recommended:
                summary: Use Anam's recommended chunk settings
                value:
                  settings: recommended
              chunkSettings:
                summary: Use a given chunk pair
                value:
                  chunkSize: 500
                  chunkOverlap: 50
      responses:
        '200':
          description: The group has no documents; nothing was queued.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeGroupReprocess'
        '202':
          description: At least one document is queued; their status is now `PROCESSING`.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/KnowledgeGroupReprocess'
        '400':
          description: >-
            The body is not empty and is not JSON with either an optional
            `settings` of `current` or `recommended`, or a valid `chunkSize` and
            `chunkOverlap` together.
        '401':
          description: Unauthorized - Invalid or missing API key
        '403':
          description: Forbidden - API key lacks the `knowledge` write permission
        '404':
          description: Knowledge group not found, or it belongs to another organization
        '409':
          description: Every document is still uploading or processing.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/KnowledgeGroupReprocess'
                  - $ref: '#/components/schemas/KnowledgeReprocessRefusal'
        '422':
          description: >-
            Nothing could be queued because the files that could be are over the
            50 MB upload limit in storage (`reason` is `too_large`). Upload them
            again within the limit.
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/KnowledgeGroupReprocess'
                  - $ref: '#/components/schemas/KnowledgeReprocessRefusal'
        '429':
          description: >-
            Too Many Requests - nothing could be queued because of a limit;
            retry after `availableAt`. `reason` is `cooldown`, `monthly_limit`
            or `contended` (uploads or reprocesses in progress hold the rest of
            the allowance, or another request took this batch first).
          headers:
            Retry-After:
              description: Seconds until more documents can be reprocessed.
              schema:
                type: integer
          content:
            application/json:
              schema:
                allOf:
                  - $ref: '#/components/schemas/KnowledgeGroupReprocess'
                  - $ref: '#/components/schemas/KnowledgeReprocessRefusal'
        '500':
          description: Server error
        '503':
          description: >-
            Reprocessing is unavailable, or the API key could not be checked.
            Retry after `Retry-After` seconds.
          headers:
            Retry-After:
              schema:
                type: integer
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ServiceUnavailableError'
components:
  schemas:
    KnowledgeReprocessRequest:
      type: object
      description: >-
        Optional. An empty body is `current`. Give either `settings`, or
        `chunkSize` and `chunkOverlap` together, not both.
      properties:
        settings:
          type: string
          enum:
            - current
            - recommended
          default: current
          description: >-
            `current` uses each document's own `chunkSize` and `chunkOverlap` if
            it has them, else its group's. `recommended` uses Anam's recommended
            chunk settings (350 and 0) whatever the document or group sets, and
            clears the document's own, so it follows its group again on later
            reprocesses. On a group it also sets the group's chunk settings to
            the recommended ones. Every reprocess embeds with the organization's
            current embedding model.
        chunkSize:
          type: integer
          minimum: 100
          maximum: 2000
          description: >-
            With `chunkOverlap`, the chunk pair to use instead of `settings`, in
            tokens, as on upload. On a document it becomes the document's own
            chunk settings. On a group it becomes the group's, and its documents
            drop their own and follow it. JSON documents are kept whole (split
            only when large) whatever the pair.
        chunkOverlap:
          type: integer
          minimum: 0
          maximum: 1000
          description: >-
            Tokens shared by neighbouring chunks, at most half of `chunkSize`.
            Given with `chunkSize`.
      additionalProperties: false
    KnowledgeGroupReprocess:
      type: object
      properties:
        knowledgeFolderId:
          type: string
        queuedCount:
          type: integer
          description: Documents queued for processing by this request.
        documentIds:
          type: array
          items:
            type: string
          description: The queued documents.
        skipped:
          type: object
          properties:
            inProgress:
              type: integer
              description: Still uploading or processing.
            coolingDown:
              type: integer
              description: >-
                Processed within the last 24 hours, or failed within the last
                hour.
            overMonthlyLimit:
              type: integer
              description: >-
                Could be reprocessed, but doesn't fit in what is left of this
                month's knowledge allowance.
            contended:
              type: integer
              description: >-
                Would fit this month, but uploads or reprocesses in progress
                hold the rest for now; retry shortly.
            errored:
              type: integer
              description: Could not be started because of an error on Anam's side; retry.
            tooLarge:
              type: integer
              description: >-
                The file in storage is larger than the 50 MB upload limit;
                upload it again.
            deferred:
              type: integer
              description: >-
                One request starts at most 500 documents; call again to start
                these.
        nextAvailableAt:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            The earliest time another request could start more of this group -
            now for `deferred` documents, 30 seconds for `contended`, a
            cooldown's end for a document that fits what is left, or the month's
            reset. Null if nothing was skipped for a limit.
        queuedBytes:
          type: integer
          description: >-
            Total file size of the queued documents, counted against the monthly
            allowance. A file replaced in storage with a larger one counts at
            its stored size.
        monthlyAllowance:
          type:
            - object
            - 'null'
          description: >-
            This month's knowledge allowance after this request, shared with
            uploads. Null if it could not be read.
          properties:
            limitBytes:
              type: integer
            remainingBytes:
              type: integer
            resetsAt:
              type: string
              format: date-time
        folderSettingsUpdated:
          type: boolean
          description: >-
            With `settings` `recommended` or a `chunkSize` and `chunkOverlap`,
            whether the group's own chunk settings are now that pair. False if
            nothing was queued, if they were changed while this request ran
            (that change is kept), or if the update failed; check `GET
            /v1/knowledge/groups/{id}`. Always false for `current`.
    KnowledgeReprocessRefusal:
      type: object
      required:
        - error
        - reason
        - availableAt
      properties:
        error:
          type: string
          description: Why nothing was reprocessed, in words to show a user.
        reason:
          type: string
          enum:
            - in_progress
            - cooldown
            - monthly_limit
            - contended
            - too_large
        availableAt:
          type:
            - string
            - 'null'
          format: date-time
          description: When to try again; null for `in_progress`.
    ServiceUnavailableError:
      type: object
      required:
        - error
        - message
      properties:
        error:
          type: string
          example: Service temporarily unavailable
        message:
          type: string
          example: We could not check your API key. Please retry shortly.
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer

````

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