Skip to content

Update allowed origins

PATCH
/teams/{teamId}/domains/{domainId}/origins
curl --request PATCH \
--url https://qinto-api.blotout.io/teams/7b8d1a52-6c1e-4b6f-9a30-2f8a54d1c3e9/domains/3f2a9c81-5d47-4e0b-8c66-91b2a7f04d15/origins \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "originCheck": true, "allowedOrigins": [ "https://shop.myshopify.com" ] }'

Turns the site’s origin check on or off, replaces the extra origins it allows, or both, with a single redeploy. List an origin such as a store’s myshopify.com address to let its pages use the snippet.

How it works

A field left out keeps its value, and the list is kept while the check is off. Origins are stored normalized and de-duplicated, and an invalid one stores nothing. deployed is false until the site serves every stored setting: deploy a site that has never deployed; a deployed one retries on its own.

Required permissions

  • domain:write on all domains, or on the addressed domain when its id is in the route
teamId
required

Unique id (UUID) of the team that owns the addressed resources, as shown in the team settings on the Blotout platform.

string format: uuid

Example

7b8d1a52-6c1e-4b6f-9a30-2f8a54d1c3e9

Unique id (UUID) of the team that owns the addressed resources, as shown in the team settings on the Blotout platform.

domainId
required

Unique id (UUID) of the site, as returned by the create and list operations.

string format: uuid

Example

3f2a9c81-5d47-4e0b-8c66-91b2a7f04d15

Unique id (UUID) of the site, as returned by the create and list operations.

The origin check, the origin list, or both.

Media typeapplication/json

The origin check, the origin list, or both. A field left out keeps its current value.

object
originCheck

Whether only pages on the site’s root domain, its subdomains and allowedOrigins may use the snippet and call the site’s apps. Off lets any origin.

boolean

Example

true
allowedOrigins

Replacement list of https://host origins, up to 20, kept while the check is off. An empty list allows none beyond the root domain.

Array<string>
<= 20 items

Example

[
"https://shop.myshopify.com"
]

The origin settings now stored, and whether the site already serves them.

Media typeapplication/json
object
originCheck
required

Whether only pages on the site’s root domain, its subdomains and allowedOrigins may use the snippet and call the site’s apps. Off lets any origin.

boolean
allowedOrigins
required

Extra https:// origins whose pages may use the snippet and call the site’s apps while originCheck is on.

Array<string>
deployed
required

Whether the site already serves every setting stored for it. False on a site that has never deployed — call deploy — and false while a change has not reached the site yet, which retries on its own.

boolean

Example

{
"originCheck": true,
"allowedOrigins": [
"https://shop.myshopify.com"
],
"deployed": true
}

invalid_params — A path parameter failed validation (for example a malformed UUID); details pinpoints the offending parameter. invalid_body — The JSON body is unparseable or failed schema validation; details pinpoints the offending fields when the body could be parsed. invalid_origins — An origin is not of the form https://host, or the list is too long, and nothing was stored. message states which.

Media typeapplication/json
object
error
required

Machine-readable error slug; switch on this value rather than on the HTTP status alone.

string
Allowed values: invalid_params invalid_body invalid_origins
details

Field-level validation errors: a tree keyed by input property, each node carrying an errors array of human-readable messages. Render it to help the caller correct the request.

object
key
additional properties

Example

{
"error": "invalid_params",
"details": {
"errors": [],
"properties": {
"teamId": {
"errors": [
"Invalid UUID"
]
}
}
}
}

unauthenticated — The Authorization: Bearer token is missing, malformed, or no longer valid. Generate a team API token or obtain a new OAuth access token.

Media typeapplication/json
object
error
required

Machine-readable error slug; switch on this value rather than on the HTTP status alone.

string
Allowed values: unauthenticated

Example

{
"error": "unauthenticated"
}

forbidden — The bearer credential lacks the required permission or belongs to another team, or its user lacks the organization role a developer operation needs. Update its policies, use a credential bound to the addressed team, or ask an organization owner for the role; message states the reason when one is known.

Media typeapplication/json
object
error
required

Machine-readable error slug; switch on this value rather than on the HTTP status alone.

string
Allowed values: forbidden
message

Human-readable reason for this specific failure, intended for display — do not parse it programmatically.

string

Example

{
"error": "forbidden",
"message": "The Cloudflare API token is invalid or expired."
}

not_found — The addressed resource does not exist within this team; check the id and retry.

Media typeapplication/json
object
error
required

Machine-readable error slug; switch on this value rather than on the HTTP status alone.

string
Allowed values: not_found

Example

{
"error": "not_found"
}

internal — Unexpected server error. Nothing is guaranteed to have been persisted; idempotent operations are safe to retry.

Media typeapplication/json
object
error
required

Machine-readable error slug; switch on this value rather than on the HTTP status alone.

string
Allowed values: internal

Example

{
"error": "internal"
}