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

# Create a prefilled link

> Build a public link that opens the form with some answers already filled in. Nothing is saved. Draft and deleted questions, and questions that take no typed answer (such as file upload, signature, payment and captcha), are not accepted.

> [!NOTE]
>
> Replace `{your-subdomain}` with your workspace’s subdomain. \
> Learn how to find your subdomain in [Workspace subdomain](https://apidocs.neetoform.com/api/workspace-subdomain.md).


## OpenAPI

````yaml bundled/share.yaml POST /forms/{form_id}/prefilled_link
openapi: 3.0.3
info:
  title: NeetoForm Share APIs
  version: 2.0.0
servers:
  - description: NeetoForm APIs
    url: https://{your-subdomain}.neetoform.com/api/external/v2
    variables:
      your-subdomain:
        default: spinkart
        description: >-
          Replace **spinkart** with your [workspace's
          subdomain](/api/workspace-subdomain).
security: []
tags:
  - name: Share
    description: APIs to share a form with links, embed codes and email invitations.
paths:
  /forms/{form_id}/prefilled_link:
    post:
      tags:
        - Share
      summary: Create a prefilled link
      description: >-
        Build a public link that opens the form with some answers already filled
        in. Nothing is saved. Draft and deleted questions, and questions that
        take no typed answer (such as file upload, signature, payment and
        captcha), are not accepted.
      parameters:
        - $ref: '#/components/parameters/api_key_header'
        - $ref: '#/components/parameters/form_id_param'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/prefilled_link_request'
      responses:
        '200':
          description: OK - Link created
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/prefilled_link_response'
        '404':
          description: Not Found - Form with the given ID does not exist
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_response'
              example:
                error: Form does not exist.
        '422':
          description: Unprocessable Entity - An answer or the discount code is not valid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_response'
              example:
                error: >-
                  Question 0b7e5c2a-1d3f-4a6b-8c9d-0e1f2a3b4c5d is not a
                  published question of this form that can be pre-filled
components:
  parameters:
    api_key_header:
      in: header
      name: X-Api-Key
      description: >-
        Use the X-Api-Key header to provide your workspace API key. Refer to
        [Authentication](/api/authentication) for more information.
      required: true
      schema:
        type: string
        default: your-api-key
    form_id_param:
      in: path
      name: form_id
      description: >-
        Unique ID of the form. Refer to [Getting the Form
        ID](/api/getting-form-id) for detailed instructions.
      required: true
      schema:
        type: string
  schemas:
    prefilled_link_request:
      type: object
      properties:
        answers:
          type: array
          description: >-
            Answers to fill in. The array can be empty. Question labels used
            inside values (options, rows, columns, products, address fields)
            must match the form exactly.
          items:
            type: object
            properties:
              question_id:
                type: string
                description: ID of a published question of the form that accepts an answer.
                example: 0b7e5c2a-1d3f-4a6b-8c9d-0e1f2a3b4c5d
              value:
                description: >-
                  Answer for the question. Use a string for most questions, an
                  array of labels for dropdown and multiple choice questions,
                  and an object for full name (`prefix`, `first_name`,
                  `middle_name`, `last_name`), phone (`country` as ISO alpha-2
                  code, `number`), date (`date` as YYYY-MM-DD, `time` as HH:mm),
                  matrix, address and product list questions.
                oneOf:
                  - type: string
                  - type: array
                    items:
                      type: string
                  - type: object
                example: oliver@example.com
            required:
              - question_id
        discount_code:
          type: string
          description: >-
            Discount code to add to the link. It is changed to upper case. The
            form must have a published payment question and the code must be
            valid.
          example: SAVE10
      required:
        - answers
    prefilled_link_response:
      type: object
      properties:
        url:
          type: string
          description: Public link of the form with the answers in the query string.
          example: >-
            https://spinkart.neetoform.com/feedback?email=oliver%40example.com&discount_code=SAVE10
        query_params:
          type: object
          description: The query string parameters used in the link.
          additionalProperties: true
          example:
            email: oliver@example.com
            discount_code: SAVE10
    error_response:
      type: object
      properties:
        error:
          type: string

````

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