> ## 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.

# Update the public link

> Change the public link of a form, either to the given `public_link_id` or to a random new one. The old link stops working at once, including in shared emails and embeds.

> [!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 PATCH /forms/{form_id}/public_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}/public_link:
    patch:
      tags:
        - Share
      summary: Update the public link
      description: >-
        Change the public link of a form, either to the given `public_link_id`
        or to a random new one. The old link stops working at once, including in
        shared emails and embeds.
      parameters:
        - $ref: '#/components/parameters/api_key_header'
        - $ref: '#/components/parameters/form_id_param'
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                public_link_id:
                  type: string
                  description: >-
                    New public link ID. It can only contain letters, numbers,
                    hyphens and underscores, and it must be unique in the
                    workspace. When omitted, a random one is generated.
                  example: customer-feedback
      responses:
        '200':
          description: OK - Public link updated. Returns the new share details.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/share_details'
        '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 - The public link ID is not valid or is already
            taken
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/error_response'
              example:
                error: >-
                  Public link may only contain letters, numbers, hyphens, and
                  underscores.
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:
    share_details:
      type: object
      properties:
        id:
          type: string
          description: Unique ID of the form.
          example: 6f1c2a8e-4d1b-4f6e-9a57-2f0f3c1d9b10
        is_published:
          type: boolean
          description: >-
            Whether the form is published. Links and embeds only work on a
            published form.
          example: true
        public_link_id:
          type: string
          description: The last part of the public link of the form.
          example: feedback
        public_link:
          type: string
          description: Public link of the form.
          example: https://spinkart.neetoform.com/feedback
        custom_domain_links:
          type: array
          description: The same public link on each custom domain of the workspace.
          items:
            type: string
          example:
            - https://forms.spinkart.com/feedback
        embed_codes:
          $ref: '#/components/schemas/embed_codes'
    error_response:
      type: object
      properties:
        error:
          type: string
    embed_codes:
      type: object
      description: >-
        HTML snippets to embed the form in a website. Each snippet uses the
        default settings.
      properties:
        inline:
          type: string
          description: Code for an inline embed.
        floating_popup:
          type: string
          description: Code for a floating popup button that opens the form.
        element_popup:
          type: string
          description: Code for a popup that opens from an element on your page.
        iframe:
          type: string
          description: Code for an iframe embed.

````

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