PUT
https://jmpy.me/api/v1
/
qr-codes
/
{id}
Update QR Code
curl --request PUT \
  --url https://jmpy.me/api/v1/qr-codes/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "content_data": {},
  "name": "<string>",
  "tracking_enabled": true,
  "password": "<string>",
  "is_password_protected": true,
  "expires_at": "<string>"
}
'
{
  "success": true,
  "data": {
    "qrCode": {}
  }
}
Update the properties of a QR code. For dynamic QR codes, you can update the destination content. For static QR codes, you can update metadata like name and tracking settings.
Visual settings cannot be changed after creation. To change the appearance of a QR code, you must generate a new one using the Generate QR Code endpoint.
Dynamic vs Static Updates
  • Dynamic QR codes: Can update content_data to change the destination URL
  • Static QR codes: Can only update metadata (name, tracking_enabled, password)

Path Parameters

id
string
required
The UUID of the QR code to update.

Body Parameters

content_data
object
New content data (for dynamic QR codes only).The structure depends on the content_type of the QR code. See Generate QR Code for content_data formats.Example for URL type:
{ "url": "https://example.com/new-destination" }
name
string
Update the friendly name for the QR code.
tracking_enabled
boolean
Enable or disable scan tracking for this QR code.
When updated, this also syncs to the associated short URL if one exists.
password
string
Set or update password protection.Requirements:
  • Minimum 8 characters
  • Must meet password complexity requirements
is_password_protected
boolean
Set to false to remove password protection.
expires_at
string
Update the expiration date (ISO 8601 format).

Response

success
boolean
Whether the request was successful.
data
object
Response containing the updated QR code.

Request Examples

# Update name and content
curl -X PUT "https://jmpy.me/api/v1/qr-codes/770e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "content_data": {
      "url": "https://example.com/new-destination"
    },
    "name": "Updated Campaign QR"
  }'

# Disable tracking
curl -X PUT "https://jmpy.me/api/v1/qr-codes/770e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"tracking_enabled": false}'

# Add password protection
curl -X PUT "https://jmpy.me/api/v1/qr-codes/770e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"password": "securePassword123"}'

Response Examples

{
  "success": true,
  "data": {
    "qrCode": {
      "id": "770e8400-e29b-41d4-a716-446655440000",
      "user_id": "user-uuid-here",
      "name": "Updated Campaign QR",
      "content_type": "url",
      "content_data": {
        "url": "https://example.com/new-destination"
      },
      "visual_settings": {
        "foregroundColor": "#1a1a1a",
        "backgroundColor": "#ffffff",
        "size": 400
      },
      "is_dynamic": true,
      "tracking_enabled": true,
      "short_url_id": "550e8400-e29b-41d4-a716-446655440000",
      "scan_count": 523,
      "is_password_protected": false,
      "created_at": "2024-01-15T10:30:00.000Z",
      "updated_at": "2024-01-21T09:15:00.000Z"
    }
  }
}

Use Cases

Change where a dynamic QR code redirects during a campaign.
async function updateCampaignDestination(qrCodeId, newUrl) {
  const response = await fetch(
    `https://jmpy.me/api/v1/qr-codes/${qrCodeId}`,
    {
      method: 'PUT',
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        content_data: { url: newUrl }
      })
    }
  );

  const data = await response.json();
  
  if (data.success) {
    console.log(`QR code now redirects to: ${newUrl}`);
    return data.data.qrCode;
  } else {
    throw new Error(data.error.message);
  }
}

// Usage: Switch from pre-launch to launch page
await updateCampaignDestination(
  'your-qr-id',
  'https://example.com/product-launch'
);
Protect sensitive content with a password.
import requests

def protect_qr_code(qr_code_id, password):
    response = requests.put(
        f'https://jmpy.me/api/v1/qr-codes/{qr_code_id}',
        headers={'Authorization': 'Bearer YOUR_API_KEY'},
        json={'password': password}
    )
    
    data = response.json()
    if data['success']:
        print(f"QR code is now password protected")
    else:
        print(f"Error: {data['error']['message']}")

# Add password
protect_qr_code('your-qr-id', 'securePassword123')
Remove password from a protected QR code.
curl -X PUT "https://jmpy.me/api/v1/qr-codes/770e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"is_password_protected": false}'
Enable or disable scan analytics.
async function toggleTracking(qrCodeId, enabled) {
  const response = await fetch(
    `https://jmpy.me/api/v1/qr-codes/${qrCodeId}`,
    {
      method: 'PUT',
      headers: {
        'Authorization': 'Bearer YOUR_API_KEY',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        tracking_enabled: enabled
      })
    }
  );

  const data = await response.json();
  console.log(`Tracking ${enabled ? 'enabled' : 'disabled'} for QR code`);
  return data;
}