Delete a QR Code

DELETE /api/v1/qr-code/:id

Common errors include:

  • "Bad Request" if body parameters are not passed
  • "DNS_CONFIGURATION_ERROR" if custom domain DNS is misconfigured.

The createQrCodeHandler creates a qr code for the input body and returns the reponse to users

Request

Method : DELETE
Content-Type : Application/json

URL Parameters Schema

id number
Required: Yes
The ID of the QR code to be deleted (passed as URL parameter)
LANGUAGE
REQUEST
 # cURL
 curl -X DELETE \
  'https://divsly-backend.vercel.app/api/v1/qr-code/123' \
  -H 'Authorization: Bearer YOUR_TOKEN_HERE'


API REQUEST
 // JavaScript Fetch
 const qrCodeId = '123';

 fetch(`https://divsly-backend.vercel.app/api/v1/qr-code/${qrCodeId}`, {
  method: 'DELETE',
  headers: {
	'Authorization': 'Bearer YOUR_TOKEN_HERE'
  }
 })
 .then(response => response.json())
 .then(data => console.log(data))
 .catch(error => console.error('Error:', error));

API REQUEST
 // Axios (Node.js)
 const axios = require('axios');

 const qrCodeId = '123';

 axios.delete(`https://divsly-backend.vercel.app/api/v1/qr-code/${qrCodeId}`, {
  headers: {
	'Authorization': 'Bearer YOUR_TOKEN_HERE'
  }
 })
 .then(response => console.log(response.data))
 .catch(error => console.error('Error:', error));


API REQUEST
 // PHP
    $qrCodeId = '123';

    $ch = curl_init("https://divsly-backend.vercel.app/api/v1/qr-code/{$qrCodeId}");
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array(
        'Authorization: Bearer YOUR_TOKEN_HERE'
    ));

    $response = curl_exec($ch);
    $result = json_decode($response, true);

    curl_close($ch);
    print_r($result);

API REQUEST
 # Python (requests)
 import requests

   qr_code_id = '123'

    headers = {
        'Authorization': 'Bearer YOUR_TOKEN_HERE'
    }

    response = requests.delete(
        f'https://divsly-backend.vercel.app/api/v1/qr-code/{qr_code_id}',
        headers=headers
    )

    print(response.json())

RESPONSE
  {
  "message": "QR Code Deleted successfully",
  "success": true,
  "result": {
	"id": 123,
	"type": "shortlink",
	"type2": null,
	"userId": 6,
	"clicks": 0,
	"lbClicks": 0,
	"scans": 0,
	"destinationUrl": "https://example.com",
	"faviconUrl": "",
	"title": "Updated QR Code",
	"titleLabel": "updated qr code",
	"btnLabel": null,
	"brandedDomain": "kut.lt",
	"slashTag": "i5qkc",
	"edit": 1,
	"utm_id": null,
	"utm_content": null,
	"utm_term": null,
	"utm_campaign": null,
	"utm_medium": null,
	"utm_source": null,
	"preset": null,
	"bgColor": null,
	"color": null,
	"pattern": null,
	"corner": null,
	"logo": null,
	"qr": null,
	"qrLogoId": null,
	"tags": "TestMultiplesites",
	"linkInBioId": null,
	"uniqueTagId": 126,
	"isActive": true,
	"isStarred": false,
	"expirationDate": "2025-06-25T06:21:29.854Z",
	"createdAt": "2025-01-24T10:11:26.423Z",
	"updatedAt": "2025-03-27T06:35:35.695Z",
	"fieldData": null,
	"frame": null,
	"isadminblocked": false,
	"isEdit": true,
	"password": null,
	"passwordProtectionEnabled": false,
	"primary": null,
	"qrType": null,
	"secondary": null,
	"text": null,
	"textColor": null
  }
}

        
  {
    "message": "Unauthorized!"
}


  { success: false, error: “Error deleting QR code }