---
title: "Create first JavaScript customization version for a block"
method: POST
path: "/studio-campaigns/{campaign_id}/js-customizations/{block_id}"
tags: ["Campaign Studio"]
---

# Create first JavaScript customization version for a block

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

## Request

- Base URL: `https://pro.gofundme.com/api/2.0`
- URL: `https://pro.gofundme.com/api/2.0/studio-campaigns/{campaign_id}/js-customizations/{block_id}`
- Auth: one of:
  - OAuth 2
    - Client credentials
    - Token URL: `/oauth2/auth`
  - OAuth 2
    - Password
    - Token URL: `/oauth2/auth`

Requires privateEndpoint auth and admin authorization. Organization must have 'custom-embedded-code' tag. Creates version 1 for the block and fails if the block already exists. 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.dev/gofundme/apis/gofundme-pro-api.md) - [All operations](https://skmtc.dev/gofundme/apis/gofundme-pro-api/llms.txt) - [OpenAPI document](https://skmtc.dev/gofundme/apis/gofundme-pro-api/revisions/094a1e510fe9?raw)
