---
title: "Update or create a new JavaScript customization version"
method: PUT
path: "/studio-campaigns/{campaign_id}/js-customizations/{block_id}"
tags: ["Campaign Studio"]
---

# Update or create a new JavaScript customization version

`PUT /studio-campaigns/{campaign_id}/js-customizations/{block_id}`

Requires privateEndpoint auth and admin authorization. Organization must have 'custom-embedded-code' tag. If latest is published, creates a new draft version; otherwise updates existing draft in place. Security scan is only triggered if scan=1 parameter is included.

## Path parameters

- `campaign_id` integer, required
- `block_id` string, required

## Query parameters

- `scan` '1'

## Request body

- JavaScriptCustomizationFillable
  - `html_content` string, required — Custom HTML/CSS/JS content as a string

## Response `200`

Success

- JavaScriptCustomization — Versioned custom HTML/CSS/JS snippet attached to a Campaign.
  - `_id` string — MongoDB identifier
  - `campaign_id` integer — Associated campaign ID
  - `block_id` string — Block identifier
  - `html_content` string — Custom HTML/CSS/JS content as a string
  - `status` 'draft' | 'published' | 'scanning' | 'failed' — Status of the customization
  - `version` integer — Version number per (campaign_id, block_id)
  - `published_at` string, date-time, nullable — Timestamp when promoted to published
  - `created_at` string, date-time
  - `updated_at` string, date-time

## Other responses

- `400` — Malformed payload provided
- `403` — Forbidden or feature not enabled
- `404` — Not found

---

[API](https://skmtc.net/gofundme/apis/gofundme-pro-api.md) · [All operations](https://skmtc.net/gofundme/apis/gofundme-pro-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gofundme/gofundme-pro-api/revisions/d22bb925eeed/schema)
