Update QR Code
Update an existing QR code. Only include the fields you want to change.
PUT /api/v1/qrcodes/:idPath Parameters
| Parameter | Type | Description |
|---|---|---|
id | string | UUID of the QR code |
Request Body
All fields are optional. Only include what you want to update.
| Field | Type | Description |
|---|---|---|
name | string | New display name (max 100 chars) |
content | object | New content fields (validated against current type) |
style | object | New styling options — replaces existing style entirely |
folder_id | string|null | Move to a folder or remove from folder |
is_dynamic | boolean | Upgrade 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
| Status | When |
|---|---|
400 | Validation error or attempting to change type / downgrade dynamic |
401 | Invalid API key |
404 | QR code not found |