Update a QR Code

POST /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 : POST
Content-Type : Application/json

Request Body Schema

destinationUrl string
Default: Current value
The URL where the QR code redirects to
title string
Default: Current value
Title of the QR code
isEdit boolean
Default: FALSE
Flag to increment edit counter
expirationDate string/date/null
Default: Current value
Expiration date for the QR code. Format: YYYY-MM-DDTHH:mm:ss.sssZ
titleLabel string
Default: Auto-generated
Lowercase version of title (auto-generated)
LANGUAGE
REQUEST
 # cURL
 curl -X POST \
  'https://divsly-backend.vercel.app/api/v1/qr-code' \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Bearer YOUR_TOKEN_HERE' \
  -d '{
	"firstName":"",
	"lastName":"",
	"videos":[],
	"imageList":[],
	"bio":"doe",
	"mobile":"",
	"phone":"",
	"fax":"",
	"email":"",
	"qrType":"website",
	"company":"",
	"job":"",
	"address":"",
	"website":"",
	"summary":"",
	"businessType":"",
	"facebook":"",
	"instagram":"",
	"google":"",
	"linkedin":"",
	"welcomeImage":"",
	"profilePic":"",
	"title":"Preview",
	"qr":"//api.qrcode-monkey.com/tmp/807f36b526d53242cbdb35e73b0f363f.png",
	"qrLogoId":"886d912a169c986ca5f98c3450da9edaf3cdf137.png",
	"destinationUrl":"https://divsly.com",
	"slashTag":"dye6y",
	"brandedDomain":"kut.lt",
	"preset":"#000000",
	"color":"#000000",
	"bgColor":"#ffffff",
	"isBgTransparent":false,
	"pattern":"classy",
	"corner":"square",
	"logo":"",
	"edit":0,
	"frame":"",
	"gradientColor":"",
	"primaryColor":"#f1416c",
	"audioPrimary":"#000000",
	"primary":"",
	"secondary":"",
	"textColor":"",
	"text":"Scan Me",
	"about":"",
	"aboutName":"",
	"aboutPhone":"",
	"aboutEmail":"",
	"aboutWebsite":"",
	"mondayOpen":"monday",
	"tuesdayOpen":"tuesday",
	"wednesdayOpen":"wednesday",
	"thursdayOpen":"thursday",
	"fridayOpen":"friday",
	"saturdayOpen":"saturday",
	"sundayOpen":"sunday",
	"mondayStart":"09:00",
	"tuesdayStart":"09:00",
	"wednesdayStart":"09:00",
	"thursdayStart":"09:00",
	"fridayStart":"09:00",
	"saturdayStart":"09:00",
	"sundayStart":"09:00",
	"mondayEnd":"20:00",
	"tuesdayEnd":"20:00",
	"wednesdayEnd":"20:00",
	"thursdayEnd":"20:00",
	"fridayEnd":"20:00",
	"saturdayEnd":"20:00",
	"sundayEnd":"20:00",
	"ctaColor":"#e9e7e7",
	"buttonText":"View",
	"buttonLink":"https://www.divsly.com",
	"audioTitle":"",
	"bannerImage":"",
	"pdfPassword":"",
	"password":"",
	"passwordProtectionEnabled":false,
	"fieldData":"{\"destinationUrl\":\"https://divsly.com\",\"title\":\"Preview\",\"metaDescription\":\"\",\"brandedDomain\":\"kut.lt\",\"contentWelcomeImage\":\"\",\"contentWelcomeTime\":2.5,\"password\":\"\",\"passwordProtectionEnabled\":false}",
	"expirationDate":"2025-06-25T06:21:29.854Z"
  }'

API REQUEST
 // JavaScript Fetch
 const qrCodeId = '123';
 const payload = {
  destinationUrl: "https://example.com",
  title: "Updated QR Code",
  isEdit: true,
  expirationDate: "2025-06-25T06:21:29.854Z"
 };

  fetch(`https://divsly-backend.vercel.app/api/v1/qr-code/${qrCodeId}`, {
  method: 'PUT',
  headers: {
	'Content-Type': 'application/json',
	'Authorization': 'Bearer YOUR_TOKEN_HERE'
  },
  body: JSON.stringify(payload)
  })
 .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';
 const payload = {
  destinationUrl: "https://example.com",
  title: "Updated QR Code",
  isEdit: true,
  expirationDate: "2025-06-25T06:21:29.854Z"
 };

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

API REQUEST
 // PHP
 $qrCodeId = '123';
 $payload = array(
	'destinationUrl' => 'https://example.com',
	'title' => 'Updated QR Code',
	'isEdit' => true,
	'expirationDate' => '2025-06-25T06:21:29.854Z'
 );

 $ch = curl_init("https://divsly-backend.vercel.app/api/v1/qr-code/{$qrCodeId}");
 curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
 curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
 curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
 curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($payload));
 curl_setopt($ch, CURLOPT_HTTPHEADER, array(
	'Content-Type: application/json',
	'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
 import json

 qr_code_id = '123'
 payload = {
	"destinationUrl": "https://example.com",
	"title": "Updated QR Code",
	"isEdit": True,
	"expirationDate": "2025-06-25T06:21:29.854Z"
 }

 headers = {
	'Content-Type': 'application/json',
	'Authorization': 'Bearer YOUR_TOKEN_HERE'
 }

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

 print(response.json())
RESPONSE
  {
  "message": "Qr Code Updated 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 message from caught exception"
}