Update a script

patch
https://api.clakta.com/v1/projects/{idOrSlug}/scripts/{sourceId}

Update a tracking script. Requires an API key with `projects.write`. Send only the fields you want to change. Sending `domains: []` allows events from any domain.

Authentication

Send your API key as a bearer token in the Authorization header.

See Authentication for how to create and scope an API key.

Path parameters

idOrSlugstringrequired

The project ID (with the proj_ prefix) or slug.

sourceIdstringrequired

The script ID returned on creation.

Bodyapplication/json

namestringoptional
domainsstring[]optional
trackPageViewsbooleanoptional
trackClicksbooleanoptional
trackScrollsbooleanoptional
trackFormSubmissionsbooleanoptional

Response

The updated script

idstringrequired

The script's data-clakta-id.

namestringrequired
domainsstring[]required
typeenum<string>required

Allowed values:webiosandroid

trackPageViewsbooleanrequired
trackClicksbooleanrequired
trackScrollsbooleanrequired
trackFormSubmissionsbooleanrequired
lastEventAtdate-time | nullrequired
createdAtdate-timerequired
updatedAtdate-timerequired