Skip to main content
PUT
/
scripts
/
{id}
Update a script
curl --request PUT \
  --url https://api.salesive.com/api/v1/scripts/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data @- <<EOF
{
  "code": "<script>console.log('updated');</script>",
  "enabled": false
}
EOF
{
  "status": 200,
  "success": true,
  "message": "Script updated",
  "data": {
    "_id": "66e1f0a3c2d4e5f6a7b8c9d0",
    "integration": "66e0aabbccddeeff00112233",
    "code": "<script>console.log('updated');</script>",
    "enabled": false,
    "shop": "6680aabbccddeeff00112200",
    "createdAt": "2026-06-21T10:30:00.000Z",
    "updatedAt": "2026-06-21T11:45:00.000Z"
  }
}
Updates the script’s code and/or enabled flag. The store is bound to your app token server-side — never send a shop id.

Authorizations

Authorization
string
header
required

Installed-app access token (prefix app_), issued by the OAuth install flow. The store is bound to the token server-side — never send a shop id.

Path Parameters

id
string
required

The script's id (Mongo ObjectId).

Body

application/json
code
string

The script/tracking code to inject into the storefront.

enabled
boolean

Whether the script is active.

Response

The updated script.

Standard Salesive response envelope. The operation-specific payload is carried in data.

status
integer
required

HTTP status code, echoed in the body.

success
boolean
required

Whether the request succeeded.

message
string
required

Human-readable result message.

data
object

A custom storefront script/tracking snippet belonging to the store.