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

# Detach Form from QR Code

## Overview

Detaches a form from a QR code. After detaching, users will access the QR code content directly without being prompted to fill out a form.

## Path Parameters

| Parameter | Type   | Required | Description | Example             |
| --------- | ------ | -------- | ----------- | ------------------- |
| `qrid`    | string | Yes      | QR code ID  | `Qc3ca09e1a5574caf` |

## Request Body

| Field  | Type | Required | Description                | Example |
| ------ | ---- | -------- | -------------------------- | ------- |
| `form` | null | Yes      | Set to null to detach form | `null`  |

## Examples

### Detach Form from QR Code

```bash theme={null}
curl -X PATCH "https://management.scanova.io/qr/Qc3ca09e1a5574caf/" \
  -H "Authorization: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "form": null
  }'
```

## Response

Returns the updated QR code object with the form information removed from the `dynamic_url_object`.

## Behavior After Detaching

When a form is detached from a QR code:

1. **User scans QR code**
2. **Direct access** to the original QR code content
3. **No form** is displayed
4. **No submission data** is collected
5. **Faster user experience** (no form to fill out)

## Important Notes

* **Immediate Effect**: Changes take effect immediately
* **No Data Loss**: Previously collected submissions remain in the form
* **Form Preserved**: The form itself is not deleted, only detached
* **Can Reattach**: You can attach the same or different form later

## Use Cases

* **Campaign End**: Stop collecting submissions when a campaign ends
* **A/B Testing**: Test QR codes with and without forms
* **User Experience**: Remove form for better user experience
* **Temporary Disable**: Temporarily disable submission capture without deleting data
* **Content Access**: Allow direct access to content without barriers

<Note>
  Detaching a form does not delete the form or any previously collected submissions. The form remains available and can be reattached to the same or different QR codes later.
</Note>

<Warning>
  Once detached, the QR code will no longer collect form submissions. If you need to resume collecting submissions, you'll need to reattach a form using the attach endpoint.
</Warning>


## OpenAPI

````yaml PATCH /qr/{qrid}/
openapi: 3.1.0
info:
  title: Scanova Form API
  description: Form management endpoints for creating, updating, and managing forms
  version: 1.0.0
servers:
  - url: https://management.scanova.io
    description: Production server
security:
  - apiKeyAuth: []
tags:
  - name: Form
    description: Form management operations
paths:
  /qr/{qrid}/:
    patch:
      tags:
        - Form
      summary: Attach/Detach Form to QR Code
      description: Attaches or detaches a form to/from a QR code. Requires authentication.
      parameters:
        - name: qrid
          in: path
          required: true
          description: QR code ID
          schema:
            type: string
          example: Qc3ca09e1a5574caf
      requestBody:
        required: true
        content:
          application/json:
            schema:
              oneOf:
                - $ref: '#/components/schemas/AttachFormRequest'
                - $ref: '#/components/schemas/DetachFormRequest'
            examples:
              attach_form:
                summary: Attach form to QR code
                value:
                  form: 301
              detach_form:
                summary: Detach form from QR code
                value:
                  form: null
      responses:
        '200':
          description: QR code updated successfully
          content:
            application/json:
              schema:
                type: object
                description: Updated QR code object with form information
        '400':
          description: Bad request - Invalid input
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ValidationErrorResponse'
        '401':
          description: Unauthorized - Invalid API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthenticationErrorResponse'
        '404':
          description: QR code or form not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
      security:
        - apiKeyAuth: []
components:
  schemas:
    AttachFormRequest:
      type: object
      required:
        - form
      properties:
        form:
          type: integer
          description: Form ID to attach to the QR code
          example: 301
    DetachFormRequest:
      type: object
      properties:
        form:
          type: 'null'
          description: Set to null to detach form from QR code
          example: null
    ValidationErrorResponse:
      type: object
      properties:
        field_name:
          type: array
          items:
            type: string
          description: Field-specific validation errors
          example:
            - This field is required.
            - Invalid value provided.
      additionalProperties:
        type: array
        items:
          type: string
        description: Additional field validation errors
    AuthenticationErrorResponse:
      type: object
      properties:
        detail:
          type: string
          description: Authentication error message
          example: Invalid token.
    ErrorResponse:
      type: object
      properties:
        detail:
          type: string
          description: Error message
          example: Not found.
  securitySchemes:
    apiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: >-
        API key authentication. Enter your API key directly in the Authorization
        header.

````