Update a link's allowed origins
const url = 'https://apibase.ecomweb.app/api/v1/stores/example/themes/example/versions/example';const options = { method: 'PATCH', headers: {'x-api-key': '<x-api-key>', 'Content-Type': 'application/json'}, body: '{"allowed_origins":["example"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The theme ID.
The version ID of the link.
The store’s ref, as returned by GET /stores.
Request Bodyrequired
Section titled “Request Bodyrequired”object
The link’s allowed origins, replacing the current list. At most 20.
Example generated
{ "allowed_origins": [ "example" ]}Responses
Section titled “Responses”object
release: a catalog release. build: a deployment of your code. link: your own site.
When the version was added, as an ISO 8601 timestamp.
ID of the user who added it, or null.
Why the version cannot be used. Only when usable is false.
The catalog release. Only for a release.
object
The catalog theme ID.
The release version.
The build. Only for a build.
object
Why the build failed, or null.
When the build ended, as an ISO 8601 timestamp, or null.
How long the build took, in seconds, or null.
Deployment ID.
The deployment’s status.
source or prebuilt: what was uploaded.
The linked site. Only for a link.
object
Extra origins the site is served from.
The site address.
Deprecated: use build.status. Only for a build.
Deprecated: use build.error. Only for a build.
Deprecated: use usable. Only for a build.
Version ID.
A short name for the version.
Whether the theme uses this version.
Whether the store’s storefront serves this version now.
Whether the version can be used now. See unusable_reason when it cannot.
Example
{ "kind": "release", "unusable_reason": "build_failed"}The request is malformed or failed validation.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}The key is missing, invalid, revoked or expired.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
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.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}The resource does not exist in this store.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}The request conflicts with the resource’s current state.
object
The HTTP status code.
What went wrong; validation failures list one message per problem.
The HTTP status text, such as Bad Request.
object
A stable, machine-readable error code.
A human-readable explanation.
Extra context about the error, when there is any.
object
When the error happened, as an ISO 8601 timestamp.
Example generated
{ "statusCode": 1, "message": [ "example" ], "error": "example"}