# Update Product Allowlist

`PATCH https://api.suger.cloud/org/{orgId}/product/{productId}/targeting`

Replace the buyer AWS accounts allowlisted to view and subscribe to a Limited-visibility AWS SaaS listing. buyerAwsAccountIds is required and is the complete allowlist: accounts not in it are removed, and an explicit empty array clears every account the seller added. Supported for AWS SaaS listings only, and only while the listing is still Limited. AWS keeps no allowlist for professional services listings, and AMI, container and machine-learning listings are not supported yet. The change is applied asynchronously; the product is marked PENDING_UPDATE and the workflow writes the terminal status.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `orgId` | path | string | yes | Organization ID |
| `productId` | path | string | yes | Product ID |

## Request Body

Required.

Content-Type: `application/json` · Schema: `UpdateProductTargetingRequest`

**`UpdateProductTargetingRequest`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `buyerAwsAccountIds` | array<string> | yes | BuyerAwsAccountIds is the complete allowlist of 12-digit AWS account IDs that can view and subscribe to a Limited-visibility AWS listing. It is required, and it replaces the current list: accounts not in it are removed, and an explicit empty array clears every account the seller added (AWS keeps its own operations accounts). Omitting the field is an error rather than a request to clear the list. |

## Responses

### 200 — OK

Content-Type: `application/json` · Schema: `OperationExecutionDetails`

**`OperationExecutionDetails`** fields:

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `newWorkflowStarted` | boolean | no |  |
| `referralId` | string | no | ReferralID is the created referral's id, set by the SUGER co-sell create so the caller can chain follow-up calls (e.g. InviteCosellPartners) onto the new engagement without re-querying. Empty elsewhere. |
| `runID` | string | no |  |
| `slackMirrorWarning` | string | no | SlackMirrorWarning is a non-blocking advisory set when a SUGER co-sell console message was saved but could not be mirrored to the partner's Slack channel (no workspace connected, no channel mapped, bot not in the channel, or a transient post failure). Empty when the message mirrored or Slack is not involved. The console surfaces it as a warning toast; the message is always persisted regardless (best-effort mirror). |
| `status` | string | no |  |
| `workflowID` | string | no |  |

### 400 — Bad request error

Content-Type: `application/json`

### 409 — An update to this product is already in progress

Content-Type: `application/json`

### 500 — Internal server error

Content-Type: `application/json`

## Example

_Generated from this operation's schema. Values are placeholders — substitute your own ids, and set `SUGER_TOKEN` to a bearer token from the [OAuth client-credentials exchange](https://doc.suger.io/get-started/oauth-app/)._

### Request

```bash
curl -X PATCH 'https://api.suger.cloud/org/{orgId}/product/{productId}/targeting' \
  -H 'Authorization: Bearer $SUGER_TOKEN' \
  -H 'Content-Type: application/json' \
  -d '{
  "buyerAwsAccountIds": [
    "01H0000000000000000000"
  ]
}'
```

### Response — 200

```json
{
  "newWorkflowStarted": true,
  "referralId": "01H0000000000000000000",
  "runID": "01H0000000000000000000",
  "slackMirrorWarning": "string",
  "status": "string",
  "workflowID": "01H0000000000000000000"
}
```

### Error — 400

```json
"string"
```

---

Interactive API reference: https://doc.suger.io/api/
