Update sending settings
API v2 is in public beta: endpoints and fields can change before general availability. See the changelog
/account/sendingCosts 2 rate-limit points · Rate limits
Update who sends the shop's customer notifications: email and SMS provider, sender name, the merchant's own sending address, store domain in SMS links, Klaviyo marketing consent and the Postscript API key (write only). The email font, text sizes and logo size are PATCH /account/templates/email_style.
Deep partial: absent fields are unchanged. Applies to back-in-stock and preorder notifications. use_custom_email_address true needs sender_address on a domain that is not a free mail provider, and DKIM set up for it (POST /account/sending/verify_domain) before mail goes out from it. postscript_api_key is never returned by any read; it is checked with Postscript before anything is saved, and nothing is saved when Postscript refuses it; "" removes it. email_reply_to_address is still accepted as a deprecated name for sender_address.
Also searched asswitch email providersend emails with klaviyosend emails from stoqswitch sms provideruse postscriptset postscript api keychange sender namesend from my own email addressuse store domain in sms linkschange preorder notification provider
Headers
Idempotency-KeystringA fresh unique key for every write (a new UUID, say); reuse it only to retry that write. Keys are remembered for 1 hour: the same key and the same request within that hour returns the first result, with
Idempotent-Replayed: true, without running again; the same key with a different method, path or body is refused (422idempotency_key_reused); a retry while the first is still running gets 409idempotency_key_in_progress. Keys are per store. Server errors and rate limits are not kept, so their retry runs.
Request body
email_providerstring"stoq" (STOQ sends), "klaviyo" (Klaviyo flows send) or "flow" (Shopify Flow sends).
One ofstoqklaviyoflowsms_providerstring"stoq" (STOQ sends), "klaviyo" or "postscript" (the merchant's account sends).
One ofstoqklaviyopostscriptemail_from_namestringSender name customers see on emails.
use_custom_email_addressbooleanTrue sends from the merchant's own address (sender_address), which needs DKIM set up for its domain; false sends from STOQ's default address and clears sender_address. Either way customer replies go to the merchant (reply_to_address on the read), never to STOQ.
sender_addressstringThe merchant's own address to send from, used while use_custom_email_address is on. The read returns null on STOQ's default address. Not a free mail domain (gmail.com and the like). email_reply_to_address is a deprecated name for it.
sms_custom_domain_enabledbooleanUse the store domain in SMS purchase links.
klaviyo_skip_auto_subscribebooleanTrue stops subscribing signups to Klaviyo marketing; false subscribes them (the editor box ticked).
postscript_api_keystringPostscript private API key; prefer POST /account/integrations/postscript/connect. Write only: GET /account/integrations/postscript shows connection.connected. Checked with Postscript before it is kept; a key Postscript refuses is not saved. "" removes the key. Refused over Quinn, ChatGPT or Claude (use_key_link).
email_reply_to_addressstringDeprecated name for sender_address.
Returns
email_providerstringExample:stoqsms_providerstringExample:stoqemail_from_namestring, nullableExample:Stride Supplyuse_custom_email_addressbooleanExample:truesender_addressstring, nullableExample:hello@stridesupply.comsms_custom_domain_enabledbooleanExample:falseklaviyo_skip_auto_subscribebooleanExample:falseemail_from_addressstring, nullableemail_subdomainnullemail_dkim_verifiedbooleanExample:falsesms_allowedbooleanExample:trueemail_allowedbooleanExample:truereply_to_addressstringExample:hello@stridesupply.comsms_restricted_content_verifiedbooleanExample:falsecustom_address_statusstringExample:pendingsent_fromobjectShow 4 child attributesHide child attributes
namestring, nullableExample:Stride Supply (STOQ)back_in_stockstringExample:restock@stoqapp.compreordersstringExample:preorders@stoqapp.comyahoo_outlook_hotmail_recipientsstringExample:alerts@restockrocket.io
notificationsobjectShow 2 child attributesHide child attributes
back_in_stockobjectShow 3 child attributesHide child attributes
signup_thank_youobjectShow 2 child attributesHide child attributes
emailobjectShow 4 child attributesHide child attributes
senderstringfallback_reasonnullintegrationnullenabledboolean
smsobjectShow 4 child attributesHide child attributes
senderstringfallback_reasonnullintegrationnullenabledboolean
restock_alertobjectShow 2 child attributesHide child attributes
emailobjectShow 4 child attributesHide child attributes
senderstringExample:stoqfallback_reasonnullintegrationnullenabledbooleanExample:true
smsobjectShow 4 child attributesHide child attributes
senderstringExample:stoqfallback_reasonnullintegrationnullenabledbooleanExample:true
reminderobjectShow 2 child attributesHide child attributes
emailobjectShow 4 child attributesHide child attributes
senderstringExample:stoqfallback_reasonnullintegrationnullenabledbooleanExample:true
smsobjectShow 4 child attributesHide child attributes
senderstringExample:stoqfallback_reasonnullintegrationnullenabledbooleanExample:true
preordersobjectShow 3 child attributesHide child attributes
confirmationobjectShow 2 child attributesHide child attributes
emailobjectShow 4 child attributesHide child attributes
senderstringExample:stoqfallback_reasonnullintegrationnullenabledbooleanExample:true
smsobjectShow 4 child attributesHide child attributes
senderstringExample:stoqfallback_reasonnullintegrationnullenabledbooleanExample:true
shipping_updateobjectShow 1 child attributeHide child attributes
emailobjectShow 4 child attributesHide child attributes
senderstringExample:stoqfallback_reasonnullintegrationnullenabledbooleanExample:true
payment_failedobjectShow 1 child attributeHide child attributes
emailobjectShow 4 child attributesHide child attributes
senderstringExample:stoqfallback_reasonnullintegrationnullenabledbooleanExample:true
Errors
not_foundThe path is valid but nothing with that id exists in this store.
conflictThe request is well formed, but the resource's current state does not allow it.
idempotency_key_in_progressAn earlier request with the same Idempotency-Key is still running. Wait, then resend the same request with the same key.
invalid_optionAn integration option, such as a Mailchimp list id, was rejected.
invalid_paramsOne or more fields failed the action's schema.
use_key_linkThrough an assistant or MCP, a third-party API key would pass through a model, so STOQ refuses it and returns the dashboard link where the merchant enters it.
validation_failedThe action refused the request for a reason that is not a single bad field.
shopify_errorA Shopify call the operation needs failed after the operation had started.
upstream_unavailableA service the answer depends on did not respond in time.
Any request can also fail with auth_invalid (401) or rate_limited (429).
Every error has the same shape: see Errors and the list of error codes.
curl -X PATCH "https://app.stoqapp.com/api/v2/external/account/sending" \
-H "X-Auth-Token: $STOQ_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"email_from_name": "Stride Supply",
"use_custom_email_address": true,
"sender_address": "hello@stridesupply.com"
}'const res = await fetch("https://app.stoqapp.com/api/v2/external/account/sending", {
method: "PATCH",
headers: {
"X-Auth-Token": process.env.STOQ_API_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
"email_from_name": "Stride Supply",
"use_custom_email_address": true,
"sender_address": "hello@stridesupply.com"
}),
});
const data = await res.json();import os
import requests
res = requests.patch(
"https://app.stoqapp.com/api/v2/external/account/sending",
headers={"X-Auth-Token": os.environ["STOQ_API_KEY"]},
json={
"email_from_name": "Stride Supply",
"use_custom_email_address": True,
"sender_address": "hello@stridesupply.com"
},
)
data = res.json()require "net/http"
require "json"
uri = URI("https://app.stoqapp.com/api/v2/external/account/sending")
req = Net::HTTP::Patch.new(uri, "X-Auth-Token" => ENV["STOQ_API_KEY"], "Content-Type" => "application/json")
req.body = {
email_from_name: "Stride Supply",
use_custom_email_address: true,
sender_address: "hello@stridesupply.com"
}.to_json
res = Net::HTTP.start(uri.host, uri.port, use_ssl: true) { |http| http.request(req) }
data = JSON.parse(res.body){
"email_provider": "stoq",
"sms_provider": "stoq",
"email_from_name": "Stride Supply",
"use_custom_email_address": true,
"sender_address": "hello@stridesupply.com",
"sms_custom_domain_enabled": false,
"klaviyo_skip_auto_subscribe": false,
"email_from_address": null,
"email_subdomain": null,
"email_dkim_verified": false,
"sms_allowed": true,
"email_allowed": true,
"reply_to_address": "hello@stridesupply.com",
"sms_restricted_content_verified": false,
"custom_address_status": "pending",
"sent_from": {
"name": "Stride Supply (STOQ)",
"back_in_stock": "restock@stoqapp.com",
"preorders": "preorders@stoqapp.com",
"yahoo_outlook_hotmail_recipients": "alerts@restockrocket.io"
},
"notifications": {
"back_in_stock": {
"restock_alert": {
"email": {
"sender": "stoq",
"fallback_reason": null,
"integration": null,
"enabled": true
},
"sms": {
"sender": "stoq",
"fallback_reason": null,
"integration": null,
"enabled": true
}
},
"reminder": {
"email": {
"sender": "stoq",
"fallback_reason": null,
"integration": null,
"enabled": true
},
"sms": {
"sender": "stoq",
"fallback_reason": null,
"integration": null,
"enabled": true
}
}
},
"preorders": {
"confirmation": {
"email": {
"sender": "stoq",
"fallback_reason": null,
"integration": null,
"enabled": true
},
"sms": {
"sender": "stoq",
"fallback_reason": null,
"integration": null,
"enabled": true
}
},
"shipping_update": {
"email": {
"sender": "stoq",
"fallback_reason": null,
"integration": null,
"enabled": true
}
},
"payment_failed": {
"email": {
"sender": "stoq",
"fallback_reason": null,
"integration": null,
"enabled": true
}
}
}
}
}{
"errors": [
"Invalid API key"
],
"code": "auth_invalid",
"details": [
{
"code": "auth_invalid",
"message": "Invalid API key",
"path": null,
"value": null,
"expected": null
}
]
}{
"errors": [
"A request with this Idempotency-Key is still running"
],
"code": "idempotency_key_in_progress",
"details": [
{
"code": "idempotency_key_in_progress",
"message": "A request with this Idempotency-Key is still running",
"path": null,
"value": null,
"expected": null
}
]
}{
"errors": [
"name is required"
],
"code": "validation_failed",
"details": [
{
"code": "validation_failed",
"message": "name is required",
"path": null,
"value": null,
"expected": null
}
]
}{
"errors": [
"Rate limit exceeded"
],
"code": "rate_limited",
"details": [
{
"code": "rate_limited",
"message": "Rate limit exceeded",
"path": null,
"value": null,
"expected": null
}
]
}