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

# Rerun file form filling

> This endpoint is used to rerun the form filling of a file.

It is used to update the file fields based on the current file content and the current schema version.

The `fileId` field is used to specify the file that should be updated.

The `backgroundRerun` field is used to determine whether the form filling should be run in the background.

If set to `true`, the form filling will be run in the background. If set to `false`, the form filling will be run synchronously.

The `rerunOptions` field is used to specify the options for the form filling. The allowed fields are `paths`, `partialRerun`, and `notification`.

The `paths` field is used to specify the fields that should be updated. The fields that are specified in the `paths` field will be updated with the new schema fields.

The `partialRerun` field is used to determine whether the form filling should only be run for the modified fields.

If set to `true`, the form filling will only be run for the modified fields. If set to `false`, the form filling will be run for all fields.

The `notification` field is used to specify the notification options for the form filling. The allowed fields are `shouldSendOnCompletion`, `referenceEntityName`, `referenceEntityId`, and `referenceEntityAction`.

The `shouldSendOnCompletion` field is used to determine whether a notification should be sent when the form filling is completed.

If set to `true`, a notification will be sent when the form filling is completed. If set to `false`, no notification will be sent.

The `referenceEntityName` field is used to specify the name of the reference entity that should be used for the notification. The allowed values are `FILE` and `SCHEMA`.

The `referenceEntityId` field is used to specify the id of the reference entity that should be used for the notification.

The `referenceEntityAction` field is used to specify the action that should be used for the notification. The allowed values are `CREATE`, `UPDATE`, and `DELETE`.

It is used to update the file fields based on the current file content and the current schema version.

The **fileId** field is used to specify the file that should be updated.

The **backgroundRerun** field is used to determine whether the form filling should be run in the background.

* If set to **true**, the form filling will be run in the background.
* If set to **false**, the form filling will be run synchronously.

The **rerunOptions** field is used to specify the options for the form filling.

* The allowed fields are **paths**, **partialRerun**, and **notification**.

The **paths** field is used to specify the fields that should be updated. The fields that are specified in the paths field will be updated with the new schema fields.

The **partialRerun** field is used to determine whether the form filling should only be run for the modified fields.

* If set to **true**, the form filling will only be run for the modified fields.
* If set to **false**, the form filling will be run for all fields.

The **notification** field is used to specify the notification options for the form filling. The allowed fields are **shouldSendOnCompletion**, **referenceEntityName**, **referenceEntityId**, and **referenceEntityAction**.

The **shouldSendOnCompletion** field is used to determine whether a notification should be sent when the form filling is completed.

* If set to **true**, a notification will be sent when the form filling is completed.
* If set to **false**, no notification will be sent.

The **referenceEntityName** field is used to specify the name of the reference entity that should be used for the notification. The allowed values are **FILE** and **SCHEMA**.

The **referenceEntityId** field is used to specify the id of the reference entity that should be used for the notification.

The **referenceEntityAction** field is used to specify the action that should be used for the notification. The allowed values are **CREATE**, **UPDATE**, and **DELETE**.


## OpenAPI

````yaml patch /prod/v1/files/schema/rerun
openapi: 3.0.0
info:
  title: Public API
  description: >-

    ### Welcome to fileAI’s Public API Documentation.

    This API allows users to check the health of the system, upload and manage
    files, and manage AI Schemas.

    Should you have any questions, please reach out to fileAI via the “Contact a
    Developer” link below.



    [Contact a Developer](mailto:support@file.ai)



    ### Prerequisites


    Before using our API, please ensure you complete the following prerequisites

    - You must have a fileAI account. Sign up or login
    [here](https://orion.file.ai/en/sign-up)

    - You must have an API Key. After creating your fileAI account, you can
    generate your API Key. Refer to the Authentication section below for more
    details.



    ### Authentication

    All API requests require an API key for authentication.

    - To obtain your API key, please log in to your fileAI account and navigate
    to Project Settings in your dashboard

    - Keep your API key secure and do not share it publicly.


    ![Authentication](https://fileai-static-assets.s3.us-west-2.amazonaws.com/public-api-service/authentication.png)


    ### How to Use Your API Key

    Once you have your API key:

    - Click the Authorize button on the top-right of this page

    - Enter your API Key under Value

    - Click Authorize to start making authenticated requests directly from the
    documentation


    ![How to Use Your API
    Key](https://fileai-static-assets.s3.us-west-2.amazonaws.com/public-api-service/how-to-use-api-keys.png)
        
  version: '1.0'
  contact: {}
servers:
  - url: https://api.orion.file.ai
security: []
tags:
  - name: Public API V1
paths:
  /prod/v1/files/schema/rerun:
    patch:
      tags:
        - Public API V1
      summary: Rerun file form filling
      description: >-
        This endpoint is used to rerun the form filling of a file.


        It is used to update the file fields based on the current file content
        and the current schema version.


        The `fileId` field is used to specify the file that should be updated.


        The `backgroundRerun` field is used to determine whether the form
        filling should be run in the background.


        If set to `true`, the form filling will be run in the background. If set
        to `false`, the form filling will be run synchronously.


        The `rerunOptions` field is used to specify the options for the form
        filling. The allowed fields are `paths`, `partialRerun`, and
        `notification`.


        The `paths` field is used to specify the fields that should be updated.
        The fields that are specified in the `paths` field will be updated with
        the new schema fields.


        The `partialRerun` field is used to determine whether the form filling
        should only be run for the modified fields.


        If set to `true`, the form filling will only be run for the modified
        fields. If set to `false`, the form filling will be run for all fields.


        The `notification` field is used to specify the notification options for
        the form filling. The allowed fields are `shouldSendOnCompletion`,
        `referenceEntityName`, `referenceEntityId`, and `referenceEntityAction`.


        The `shouldSendOnCompletion` field is used to determine whether a
        notification should be sent when the form filling is completed.


        If set to `true`, a notification will be sent when the form filling is
        completed. If set to `false`, no notification will be sent.


        The `referenceEntityName` field is used to specify the name of the
        reference entity that should be used for the notification. The allowed
        values are `FILE` and `SCHEMA`.


        The `referenceEntityId` field is used to specify the id of the reference
        entity that should be used for the notification.


        The `referenceEntityAction` field is used to specify the action that
        should be used for the notification. The allowed values are `CREATE`,
        `UPDATE`, and `DELETE`.
      operationId: PublicAPIController_rerunDocumentFormFilling
      parameters: []
      requestBody:
        required: true
        description: Rerun file form filling input
        content:
          application/json:
            schema:
              type: string
            examples:
              example1:
                summary: Rerun file form filling
                value:
                  fileId: 8123612d-187c-44eb-8ac6-214e68506b7e
                  backgroundRerun: true
                  rerunOptions:
                    paths:
                      - /discount_amount
                    partialRerun: true
      responses:
        '200':
          description: The file form filling is updated
          content:
            application/json:
              example:
                success: true
              schema:
                type: object
                properties:
                  success:
                    type: boolean
        '401':
          description: Invalid API key | API key is missing
          content:
            application/json:
              example:
                message: Invalid API key | API key is missing
                error: Unauthorized
                statusCode: 401
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error:
                    type: string
                  statusCode:
                    type: number
        '403':
          description: Access denied. You are in readonly mode.
          content:
            application/json:
              example:
                message: Access denied. You are in readonly mode.
                error: Forbidden
                statusCode: 403
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error:
                    type: string
                  statusCode:
                    type: number
        '422':
          description: Invalid input
          content:
            application/json:
              example:
                message: Invalid fileId.
                error: Unprocessable Entity
                statusCode: 422
              schema:
                type: object
                properties:
                  message:
                    type: string
                  error:
                    type: string
                  statusCode:
                    type: number
        '429':
          description: Too Many Requests
          content:
            application/json:
              example:
                statusCode: 429
                message: Too Many Requests
              schema:
                type: object
                properties:
                  statusCode:
                    type: number
                  message:
                    type: string
      security:
        - x-api-key: []
components:
  securitySchemes:
    x-api-key:
      type: apiKey
      in: header
      name: x-api-key
      description: API key for authentication

````