Skip to content

Update QR Code

Update an existing QR code. Only include the fields you want to change.

PUT /api/v1/qrcodes/:id

Path Parameters

ParameterTypeDescription
idstringUUID of the QR code

Request Body

All fields are optional. Only include what you want to update.

FieldTypeDescription
namestringNew display name (max 100 chars)
contentobjectNew content fields (validated against current type)
styleobjectNew styling options — replaces existing style entirely
folder_idstring|nullMove to a folder or remove from folder
is_dynamicbooleanUpgrade from static to dynamic (true only — cannot downgrade)

Important Restrictions

  • Type cannot be changed. Create a new QR code instead.
  • Dynamic cannot be downgraded to static. Once a short URL is created, it stays active.

Example: Update Content

bash
curl -X PUT "https://api.qbar-scanner.com/api/v1/qrcodes/550e8400-..." \
  -H "Content-Type: application/json" \
  -H "X-API-Key: qbar_your_key_here" \
  -d '{
    "content": {
      "url": "https://example.com/new-page"
    }
  }'

Example: Update Style

bash
curl -X PUT "https://api.qbar-scanner.com/api/v1/qrcodes/550e8400-..." \
  -H "Content-Type: application/json" \
  -H "X-API-Key: qbar_your_key_here" \
  -d '{
    "style": {
      "dotsOptions": {
        "type": "dots",
        "gradient": {
          "rotation": 45,
          "colorStops": [
            { "offset": 0, "color": "#667eea" },
            { "offset": 1, "color": "#764ba2" }
          ]
        }
      }
    }
  }'

Example: Upgrade to Dynamic

bash
curl -X PUT "https://api.qbar-scanner.com/api/v1/qrcodes/550e8400-..." \
  -H "Content-Type: application/json" \
  -H "X-API-Key: qbar_your_key_here" \
  -d '{
    "is_dynamic": true
  }'

Response 200 OK

json
{
  "message": "QR code updated successfully",
  "request_id": "..."
}

TIP

After updating, any cached QR images are automatically invalidated. The next call to the image endpoint will generate a fresh image.

Error Responses

StatusWhen
400Validation error or attempting to change type / downgrade dynamic
401Invalid API key
404QR code not found

QBar Scanner Developer API