Register Script - Inline

Register an inline script to a site. Inline scripts are limited to 2000 characters. <Note title="Script Registration"> To apply a script to a site or page, the script must first be registered to a site via the [Register Script](/data/reference/custom-code/custom-code/register-hosted) endpoints. Once registered, the script can be applied to a Site or Page using the appropriate endpoints. See the documentation on [working with Custom Code](/data/docs/custom-code) for more information. </Note> Required scope | `custom_code:write`

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

site_idstringRequiredformat: "objectid"
Unique identifier for a Site

Request

A registered inline (Webflow-hosted) script

sourceCodestringRequired

The code to be added to the site (to be hosted by Webflow).

versionstringRequired

A Semantic Version (SemVer) string, denoting the version of the script

displayNamestringRequired

User-facing name for the script. Must be between 1 and 50 alphanumeric characters

integrityHashstringOptionalformat: "hash"

Sub-Resource Integrity Hash. Only required for externally hosted scripts (passed via hostedLocation)

canCopybooleanOptionalDefaults to false
Define whether the script can be copied on site duplication and transfer

Response

Created
idstringRead-only

Human readable id, derived from the user-specified display name

canCopybooleanDefaults to false
Define whether the script can be copied on site duplication and transfer
displayNamestring

User-facing name for the script. Must be between 1 and 50 alphanumeric characters

hostedLocationstring
URI for an externally hosted script location
integrityHashstringformat: "hash"

Sub-Resource Integrity Hash. Only required for externally hosted scripts (passed via hostedLocation)

createdOnstringRead-onlyformat: "date-string"
Timestamp when the script version was created
lastUpdatedstringRead-onlyformat: "date-string"
Timestamp when the script version was last updated
versionstring

A Semantic Version (SemVer) string, denoting the version of the script

Errors

400
Bad Request Error
401
Unauthorized Error
404
Not Found Error
429
Too Many Requests Error
500
Internal Server Error