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

# Autofill Existing Form

> Autofill an existing form with new data. Pass the `form_id` of the existing form with either a `context` (background information), `instructions` (explicit filling rules).



## OpenAPI

````yaml post /v1/forms/{form_id}/autofill
openapi: 3.1.0
info:
  title: AI Form-Filler API
  version: 0.1.0
servers:
  - url: https://api.simplicity.ai
    description: Production
  - url: http://localhost:8000
    description: Local
security: []
paths:
  /v1/forms/{form_id}/autofill:
    post:
      tags:
        - forms
      summary: Autofill Existing Form
      description: >-
        Autofill an existing form with new data. Pass the `form_id` of the
        existing form with either a `context` (background information),
        `instructions` (explicit filling rules).
      operationId: autofill_existing_form_v1_forms__form_id__autofill_post
      parameters:
        - name: form_id
          in: path
          required: true
          schema:
            type: string
            title: Form Id
      requestBody:
        content:
          application/json:
            schema:
              anyOf:
                - $ref: '#/components/schemas/AutofillExistingFormRequest'
                - type: 'null'
              title: Request
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TaskCreateResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    AutofillExistingFormRequest:
      properties:
        instructions:
          anyOf:
            - type: string
            - type: 'null'
          title: Instructions
          description: Optional instructions to guide the AI filling process
        context:
          anyOf:
            - type: string
            - type: 'null'
          title: Context
          description: >-
            Optional text content to be used as context for filling the form
            using AI/LLM
      type: object
      title: AutofillExistingFormRequest
      description: Request body for autofilling an existing form with new context.
    TaskCreateResponse:
      properties:
        task_id:
          type: string
          title: Task Id
        status:
          $ref: '#/components/schemas/TaskStatus'
          default: processing
      type: object
      required:
        - task_id
        - status
      title: TaskCreateResponse
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TaskStatus:
      type: string
      enum:
        - pending
        - processing
        - completed
        - failed
      title: TaskStatus
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````