Skip to content

Update a link's allowed origins

PATCH
/stores/{storeRef}/themes/{id}/versions/{versionId}
curl --request PATCH \
--url https://apibase.ecomweb.app/api/v1/stores/example/themes/example/versions/example \
--header 'Content-Type: application/json' \
--header 'x-api-key: <x-api-key>' \
--data '{ "allowed_origins": [ "example" ] }'

Replaces the allowed origins of a version that is a link to your own site. At most 20 origins, each checked and normalised. The route answers 409 when the version is not a link. Needs the write:settings scope.

Required scopes: write:settings

id
required
string

The theme ID.

versionId
required
string

The version ID of the link.

storeRef
required
string

The store’s ref, as returned by GET /stores.

Media typeapplication/json
object
allowed_origins
required

The link’s allowed origins, replacing the current list. At most 20.

Array<string>

Example generated

{
"allowed_origins": [
"example"
]
}
Media typeapplication/json
object
kind
required

release: a catalog release. build: a deployment of your code. link: your own site.

string
Allowed values: release build link
created_at
required

When the version was added, as an ISO 8601 timestamp.

string format: date-time
created_by
required

ID of the user who added it, or null.

string
nullable
unusable_reason

Why the version cannot be used. Only when usable is false.

string
Allowed values: build_failed build_in_progress build_pruned release_withdrawn hosting_not_in_plan
release

The catalog release. Only for a release.

object
theme_id
required

The catalog theme ID.

string
version
required

The release version.

string
build

The build. Only for a build.

object
error
required

Why the build failed, or null.

string
nullable
build_finished_at
required

When the build ended, as an ISO 8601 timestamp, or null.

string format: date-time
nullable
build_seconds
required

How long the build took, in seconds, or null.

number
nullable
deployment_id
required

Deployment ID.

string
status
required

The deployment’s status.

string
artifact
required

source or prebuilt: what was uploaded.

string
link

The linked site. Only for a link.

object
allowed_origins
required

Extra origins the site is served from.

Array<string>
url
required

The site address.

string
status

Deprecated: use build.status. Only for a build.

string
error

Deprecated: use build.error. Only for a build.

string
nullable
restorable

Deprecated: use usable. Only for a build.

boolean
id
required

Version ID.

string
label
required

A short name for the version.

string
current
required

Whether the theme uses this version.

boolean
serving
required

Whether the store’s storefront serves this version now.

boolean
usable
required

Whether the version can be used now. See unusable_reason when it cannot.

boolean

Example

{
"kind": "release",
"unusable_reason": "build_failed"
}

The request is malformed or failed validation.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key is missing, invalid, revoked or expired.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key may not do this: a missing scope, a readonly key, a publishable key on a Store API route, or a disallowed origin.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The resource does not exist in this store.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The request conflicts with the resource’s current state.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}