cancelStorefrontSectionGeneration
Requires permission storefront:storefront:update.
Stop a section-generation job (the editor's Stop button). Aborts the model call when this API instance runs the job and returns it CANCELLED; on another instance the job stops at its next model turn, so keep polling (if that instance is gone, the poll reads CANCELLED about a minute after the job's last update). A job that already ended is returned unchanged. Credits already charged stay charged (creditsUsedCents).
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation CancelStorefrontSectionGeneration($jobId: ID!) {
cancelStorefrontSectionGeneration(jobId: $jobId) {
status
costDisplay
creditsUsedCents
error
jobId
partial
writing {
name
codeTail
key
}
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation CancelStorefrontSectionGeneration($jobId: ID!) {\n cancelStorefrontSectionGeneration(jobId: $jobId) {\n status\n costDisplay\n creditsUsedCents\n error\n jobId\n partial\n writing {\n name\n codeTail\n key\n }\n }\n}",
"variables": {
"jobId": "id"
}
}
EOF
Variables:
{
"jobId": "id"
}
Response:
{
"data": {
"cancelStorefrontSectionGeneration": {
"status": "CANCELLED",
"costDisplay": "string",
"creditsUsedCents": 0,
"error": "string",
"jobId": "id",
"partial": "string",
"writing": {
"name": "string",
"codeTail": "string",
"key": "string"
}
}
}
}
cancelStorefrontSectionGeneration(
jobId: ID!
): StorefrontSectionJob!
Arguments
cancelStorefrontSectionGeneration.jobId ● ID! non-null scalar
The ID of the section generation job.
Type
StorefrontSectionJob object
A storefront section generation.