Skip to content

Update sending settings

API v2 is in public beta: endpoints and fields can change before general availability. See the changelog

PATCH/account/sending

Costs 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-Keystring

    A 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 (422 idempotency_key_reused); a retry while the first is still running gets 409 idempotency_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 of stoqklaviyoflow
  • sms_providerstring

    "stoq" (STOQ sends), "klaviyo" or "postscript" (the merchant's account sends).

    One of stoqklaviyopostscript
  • email_from_namestring

    Sender name customers see on emails.

  • use_custom_email_addressboolean

    True 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_addressstring

    The 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_enabledboolean

    Use the store domain in SMS purchase links.

  • klaviyo_skip_auto_subscribeboolean

    True stops subscribing signups to Klaviyo marketing; false subscribes them (the editor box ticked).

  • postscript_api_keystring

    Postscript 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_addressstring

    Deprecated name for sender_address.

Returns

  • email_providerstring
    Example: stoq
  • sms_providerstring
    Example: stoq
  • email_from_namestring, nullable
    Example: Stride Supply
  • use_custom_email_addressboolean
    Example: true
  • sender_addressstring, nullable
    Example: hello@stridesupply.com
  • sms_custom_domain_enabledboolean
    Example: false
  • klaviyo_skip_auto_subscribeboolean
    Example: false
  • email_from_addressstring, nullable
  • email_subdomainnull
  • email_dkim_verifiedboolean
    Example: false
  • sms_allowedboolean
    Example: true
  • email_allowedboolean
    Example: true
  • reply_to_addressstring
    Example: hello@stridesupply.com
  • sms_restricted_content_verifiedboolean
    Example: false
  • custom_address_statusstring
    Example: pending
  • sent_fromobject
    Show 4 child attributesHide child attributes
    • namestring, nullable
      Example: Stride Supply (STOQ)
    • back_in_stockstring
      Example: restock@stoqapp.com
    • preordersstring
      Example: preorders@stoqapp.com
    • yahoo_outlook_hotmail_recipientsstring
      Example: alerts@restockrocket.io
  • notificationsobject
    Show 2 child attributesHide child attributes
    • back_in_stockobject
      Show 3 child attributesHide child attributes
      • signup_thank_youobject
        Show 2 child attributesHide child attributes
        • emailobject
          Show 4 child attributesHide child attributes
          • senderstring
          • fallback_reasonnull
          • integrationnull
          • enabledboolean
        • smsobject
          Show 4 child attributesHide child attributes
          • senderstring
          • fallback_reasonnull
          • integrationnull
          • enabledboolean
      • restock_alertobject
        Show 2 child attributesHide child attributes
        • emailobject
          Show 4 child attributesHide child attributes
          • senderstring
            Example: stoq
          • fallback_reasonnull
          • integrationnull
          • enabledboolean
            Example: true
        • smsobject
          Show 4 child attributesHide child attributes
          • senderstring
            Example: stoq
          • fallback_reasonnull
          • integrationnull
          • enabledboolean
            Example: true
      • reminderobject
        Show 2 child attributesHide child attributes
        • emailobject
          Show 4 child attributesHide child attributes
          • senderstring
            Example: stoq
          • fallback_reasonnull
          • integrationnull
          • enabledboolean
            Example: true
        • smsobject
          Show 4 child attributesHide child attributes
          • senderstring
            Example: stoq
          • fallback_reasonnull
          • integrationnull
          • enabledboolean
            Example: true
    • preordersobject
      Show 3 child attributesHide child attributes
      • confirmationobject
        Show 2 child attributesHide child attributes
        • emailobject
          Show 4 child attributesHide child attributes
          • senderstring
            Example: stoq
          • fallback_reasonnull
          • integrationnull
          • enabledboolean
            Example: true
        • smsobject
          Show 4 child attributesHide child attributes
          • senderstring
            Example: stoq
          • fallback_reasonnull
          • integrationnull
          • enabledboolean
            Example: true
      • shipping_updateobject
        Show 1 child attributeHide child attributes
        • emailobject
          Show 4 child attributesHide child attributes
          • senderstring
            Example: stoq
          • fallback_reasonnull
          • integrationnull
          • enabledboolean
            Example: true
      • payment_failedobject
        Show 1 child attributeHide child attributes
        • emailobject
          Show 4 child attributesHide child attributes
          • senderstring
            Example: stoq
          • fallback_reasonnull
          • integrationnull
          • enabledboolean
            Example: true

Errors

404
not_found

The path is valid but nothing with that id exists in this store.

409
conflict

The request is well formed, but the resource's current state does not allow it.

409
idempotency_key_in_progress

An earlier request with the same Idempotency-Key is still running. Wait, then resend the same request with the same key.

422
invalid_option

An integration option, such as a Mailchimp list id, was rejected.

422
invalid_params

One or more fields failed the action's schema.

422
use_key_link

Through 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.

422
validation_failed

The action refused the request for a reason that is not a single bad field.

502
shopify_error

A Shopify call the operation needs failed after the operation had started.

503
upstream_unavailable

A 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.

PATCH/account/sending
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"
  }'
Response
{
  "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
        }
      }
    }
  }
}