---
title: "Update integrations"
description: "Update the shop's integrations: sync signups to Klaviyo, Omnisend, Mailchimp or Shopify customers (with the customer tag), the Omnisend and Mailchimp API keys and Mailchimp audience, the Meta Pixel, Shopify Flow triggers"
url: https://docs.stoqapp.com/v2-reference/account-integrations/update-integrations/
api: "API v2 reference"
method: PATCH
path: "/account/integrations"
---

# Update integrations

`PATCH https://app.stoqapp.com/api/v2/external/account/integrations`

Update the shop's integrations: sync signups to Klaviyo, Omnisend, Mailchimp or Shopify customers (with the customer tag), the Omnisend and Mailchimp API keys and Mailchimp audience, the Meta Pixel, Shopify Flow triggers and the SplitOrder app switch. API keys are write only; reads return connected flags.

**Note:** Deep partial: absent fields are unchanged. omnisend.api_key and mailchimp.api_key are never returned by any read; &quot;&quot; or null removes the saved key. A Mailchimp key is checked by fetching the account's audiences and is not saved when Mailchimp refuses it; mailchimp.list_id must be one of those audiences. Klaviyo connects with OAuth from the Integrations page; disconnect with [`POST /account/integrations/:provider/disconnect`](https://docs.stoqapp.com/v2-reference/account-integrations/disconnect-an-integration/). flow_triggers.triggers replaces the stored list. Over MCP or the in-app assistant an API key is refused with code use_key_link and key_url: the merchant enters it in STOQ.

## Headers

- `Idempotency-Key` (string): 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

- `klaviyo` (object): Klaviyo settings; sync_customers turns syncing signups to the connected Klaviyo account on or off.
  - `sync_customers` (boolean): Sync visitors who sign up to the connected Klaviyo account.
- `omnisend` (object): Omnisend settings, the API key and whether signups are synced to Omnisend.
  - `api_key` (string): Omnisend API key. Write only: reads return omnisend.connected. &quot;&quot; removes the key.
  - `sync_customers` (boolean): Sync visitors who sign up to Omnisend. Needs an Omnisend API key.
- `mailchimp` (object): Mailchimp settings, the API key, the audience signups go to and whether they are synced.
  - `api_key` (string): Mailchimp API key (ends in the data centre, e.g. &quot;-us21&quot;). Write only: reads return mailchimp.connected. Checked by fetching the account's audiences; a key Mailchimp refuses is not saved. &quot;&quot; removes the key.
  - `list_id` (string): Id of the Mailchimp audience signups go to. Must be an audience of the connected account. One of: ``.
  - `sync_customers` (boolean): Sync visitors who sign up to Mailchimp. Needs a key and an audience.
- `shopify` (object): Shopify customer sync settings.
  - `sync_customers` (boolean): Create or update a Shopify customer for each signup, with the tag below.
- `sync_customers_tag` (string): Tag put on synced customer profiles.
- `meta_pixel` (object): Meta Pixel settings, whether conversion events are sent and the pixel they go to.
  - `enabled` (boolean): Send conversion events to the merchant's Meta Pixel.
  - `pixel_id` (string): The Meta Pixel id events go to.
- `flow_triggers` (object): Shopify Flow settings, whether STOQ fires Flow triggers and which ones.
  - `enabled` (boolean): Fire Shopify Flow triggers for STOQ events.
  - `triggers` (array of strings): Which Shopify Flow triggers fire. REPLACES the stored list.
- `split_order_app` (object): SplitOrder app settings.
  - `enabled` (boolean): Hand preorders to the SplitOrder app.
- `postscript` (object): Postscript opt-in keyword settings.
  - `keyword` (string): The Postscript keyword subscribers text to opt in. One of GET /account/integrations/postscript/keywords.
  - `keyword_id` (string): Id of that Postscript keyword.

## Returns

- `klaviyo` (object)
  - `sync_customers` (boolean): e.g. `true`
  - `oauth_token_expires_at` (null): e.g. `2026-11-14T09:30:00Z`
  - `connected` (boolean): e.g. `true`
  - `connection_method` (null): e.g. `oauth`
  - `oauth_token_valid` (boolean): e.g. `true`
  - `oauth_needs_refresh` (boolean): e.g. `false`
  - `email_setup_verified` (boolean): e.g. `true`
  - `sms_setup_verified` (boolean): e.g. `false`
- `omnisend` (object)
  - `sync_customers` (boolean): e.g. `false`
  - `connected` (boolean): e.g. `false`
- `mailchimp` (object)
  - `list_id` (string, nullable)
  - `sync_customers` (boolean): e.g. `false`
  - `connected` (boolean): e.g. `false`
- `shopify` (object)
  - `sync_customers` (boolean): e.g. `true`
- `sync_customers_tag` (string): e.g. `restock-rocket`
- `meta_pixel` (object)
  - `enabled` (boolean): e.g. `true`
  - `pixel_id` (string, nullable): e.g. `1234567890123456`
- `flow_triggers` (object)
  - `enabled` (boolean): e.g. `true`
  - `triggers` (array of strings)
- `split_order_app` (object)
  - `enabled` (boolean): e.g. `false`
- `postscript` (object)
  - `keyword` (string, nullable)
  - `keyword_id` (string, nullable)
  - `connected` (boolean): e.g. `false`
  - `sms_setup_verified` (boolean): e.g. `false`
- `judgeme` (object)
  - `connected` (boolean): e.g. `true`
- `gorgias` (object)
  - `connected` (boolean): e.g. `false`
- `smile` (object)
  - `connected` (boolean): e.g. `false`

Rate limit: this call costs 2 points ([rate limits](https://docs.stoqapp.com/docs/rate-limits/)).

## Example request

```sh
curl -X PATCH "https://app.stoqapp.com/api/v2/external/account/integrations" \
  -H "X-Auth-Token: $STOQ_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "meta_pixel": {
      "enabled": true,
      "pixel_id": "1234567890123456"
    },
    "flow_triggers": {
      "enabled": true,
      "triggers": [
        "flow-customer-signed-up",
        "flow-customer-placed-preorder"
      ]
    }
  }'
```

## 202

Success: example response shown.

```json
{
  "klaviyo": {
    "sync_customers": true,
    "oauth_token_expires_at": "2026-11-14T09:30:00Z",
    "connected": true,
    "connection_method": "oauth",
    "oauth_token_valid": true,
    "oauth_needs_refresh": false,
    "email_setup_verified": true,
    "sms_setup_verified": false
  },
  "omnisend": {
    "sync_customers": false,
    "connected": false
  },
  "mailchimp": {
    "list_id": null,
    "sync_customers": false,
    "connected": false
  },
  "shopify": {
    "sync_customers": true
  },
  "sync_customers_tag": "restock-rocket",
  "meta_pixel": {
    "enabled": true,
    "pixel_id": "1234567890123456"
  },
  "flow_triggers": {
    "enabled": true,
    "triggers": [
      "flow-customer-signed-up",
      "flow-customer-placed-preorder"
    ]
  },
  "split_order_app": {
    "enabled": false
  },
  "postscript": {
    "keyword": null,
    "keyword_id": null,
    "connected": false,
    "sms_setup_verified": false
  },
  "judgeme": {
    "connected": true
  },
  "gorgias": {
    "connected": false
  },
  "smile": {
    "connected": false
  }
}
```

## 401

Missing or invalid `X-Auth-Token`.

```json
{
  "errors": [
    "Invalid API key"
  ],
  "code": "auth_invalid",
  "details": [
    {
      "code": "auth_invalid",
      "message": "Invalid API key",
      "path": null,
      "value": null,
      "expected": null
    }
  ]
}
```

## 409

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

```json
{
  "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
    }
  ]
}
```

## 422

The request failed validation.

```json
{
  "errors": [
    "name is required"
  ],
  "code": "validation_failed",
  "details": [
    {
      "code": "validation_failed",
      "message": "name is required",
      "path": null,
      "value": null,
      "expected": null
    }
  ]
}
```

## 429

Rate limited: cost-weighted per token (read 1, write 2; 360 points / 60s). Check `Retry-After`.

```json
{
  "errors": [
    "Rate limit exceeded"
  ],
  "code": "rate_limited",
  "details": [
    {
      "code": "rate_limited",
      "message": "Rate limit exceeded",
      "path": null,
      "value": null,
      "expected": null
    }
  ]
}
```

